gl-draw 0.2.5 → 0.2.8

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,13 +1,13 @@
1
- (function(){var K={666:function(b){var O=function(m){"use strict";var F=Object.prototype,D=F.hasOwnProperty,M,q=typeof Symbol=="function"?Symbol:{},A=q.iterator||"@@iterator",V=q.asyncIterator||"@@asyncIterator",I=q.toStringTag||"@@toStringTag";function W(r,t,o){return Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{W({},"")}catch(r){W=function(t,o,c){return t[o]=c}}function Y(r,t,o,c){var u=t&&t.prototype instanceof H?t:H,y=Object.create(u.prototype),j=new v(c||[]);return y._invoke=i(r,o,j),y}m.wrap=Y;function G(r,t,o){try{return{type:"normal",arg:r.call(t,o)}}catch(c){return{type:"throw",arg:c}}}var R="suspendedStart",J="suspendedYield",L="executing",N="completed",P={};function H(){}function T(){}function E(){}var U={};W(U,A,function(){return this});var p=Object.getPrototypeOf,f=p&&p(p(h([])));f&&f!==F&&D.call(f,A)&&(U=f);var a=E.prototype=H.prototype=Object.create(U);T.prototype=E,W(a,"constructor",E),W(E,"constructor",T),T.displayName=W(E,I,"GeneratorFunction");function n(r){["next","throw","return"].forEach(function(t){W(r,t,function(o){return this._invoke(t,o)})})}m.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===T||(t.displayName||t.name)==="GeneratorFunction":!1},m.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,E):(r.__proto__=E,W(r,I,"GeneratorFunction")),r.prototype=Object.create(a),r},m.awrap=function(r){return{__await:r}};function e(r,t){function o(y,j,x,g){var _=G(r[y],r,j);if(_.type==="throw")g(_.arg);else{var z=_.arg,C=z.value;return C&&typeof C=="object"&&D.call(C,"__await")?t.resolve(C.__await).then(function(k){o("next",k,x,g)},function(k){o("throw",k,x,g)}):t.resolve(C).then(function(k){z.value=k,x(z)},function(k){return o("throw",k,x,g)})}}var c;function u(y,j){function x(){return new t(function(g,_){o(y,j,g,_)})}return c=c?c.then(x,x):x()}this._invoke=u}n(e.prototype),W(e.prototype,V,function(){return this}),m.AsyncIterator=e,m.async=function(r,t,o,c,u){u===void 0&&(u=Promise);var y=new e(Y(r,t,o,c),u);return m.isGeneratorFunction(t)?y:y.next().then(function(j){return j.done?j.value:y.next()})};function i(r,t,o){var c=R;return function(y,j){if(c===L)throw new Error("Generator is already running");if(c===N){if(y==="throw")throw j;return w()}for(o.method=y,o.arg=j;;){var x=o.delegate;if(x){var g=d(x,o);if(g){if(g===P)continue;return g}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(c===R)throw c=N,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);c=L;var _=G(r,t,o);if(_.type==="normal"){if(c=o.done?N:J,_.arg===P)continue;return{value:_.arg,done:o.done}}else _.type==="throw"&&(c=N,o.method="throw",o.arg=_.arg)}}}function d(r,t){var o=r.iterator[t.method];if(o===M){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=M,d(r,t),t.method==="throw"))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var c=G(o,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,P;var u=c.arg;if(!u)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P;if(u.done)t[r.resultName]=u.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=M);else return u;return t.delegate=null,P}n(a),W(a,I,"Generator"),W(a,A,function(){return this}),W(a,"toString",function(){return"[object Generator]"});function s(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 l(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function v(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(s,this),this.reset(!0)}m.keys=function(r){var t=[];for(var o in r)t.push(o);return t.reverse(),function c(){for(;t.length;){var u=t.pop();if(u in r)return c.value=u,c.done=!1,c}return c.done=!0,c}};function h(r){if(r){var t=r[A];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var o=-1,c=function u(){for(;++o<r.length;)if(D.call(r,o))return u.value=r[o],u.done=!1,u;return u.value=M,u.done=!0,u};return c.next=c}}return{next:w}}m.values=h;function w(){return{value:M,done:!0}}return v.prototype={constructor:v,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=M,this.done=!1,this.delegate=null,this.method="next",this.arg=M,this.tryEntries.forEach(l),!r)for(var t in this)t.charAt(0)==="t"&&D.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=M)},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(g,_){return y.type="throw",y.arg=r,t.next=g,_&&(t.method="next",t.arg=M),!!_}for(var c=this.tryEntries.length-1;c>=0;--c){var u=this.tryEntries[c],y=u.completion;if(u.tryLoc==="root")return o("end");if(u.tryLoc<=this.prev){var j=D.call(u,"catchLoc"),x=D.call(u,"finallyLoc");if(j&&x){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(j){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else if(x){if(this.prev<u.finallyLoc)return o(u.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&&D.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var u=c;break}}u&&(r==="break"||r==="continue")&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var y=u?u.completion:{};return y.type=r,y.arg=t,u?(this.method="next",this.next=u.finallyLoc,P):this.complete(y)},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),P},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),l(o),P}},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 u=c.arg;l(o)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,o){return this.delegate={iterator:h(r),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=M),P}},m}(b.exports);try{regeneratorRuntime=O}catch(m){typeof globalThis=="object"?globalThis.regeneratorRuntime=O:Function("r","regeneratorRuntime = r")(O)}}},Q={};function S(b){var O=Q[b];if(O!==void 0)return O.exports;var m=Q[b]={exports:{}};return K[b](m,m.exports,S),m.exports}(function(){S.n=function(b){var O=b&&b.__esModule?function(){return b.default}:function(){return b};return S.d(O,{a:O}),O}})(),function(){S.d=function(b,O){for(var m in O)S.o(O,m)&&!S.o(b,m)&&Object.defineProperty(b,m,{enumerable:!0,get:O[m]})}}(),function(){S.o=function(b,O){return Object.prototype.hasOwnProperty.call(b,O)}}(),function(){S.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})}}();var $={};(function(){"use strict";S.r($),S.d($,{Bloom:function(){return I},Outline:function(){return W},SSR:function(){return Y},Scan:function(){return E},Scan2:function(){return U}});function b(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function O(p,f,a){return f in p?Object.defineProperty(p,f,{value:a,enumerable:!0,configurable:!0,writable:!0}):p[f]=a,p}function m(p){for(var f=1;f<arguments.length;f++){var a=arguments[f]!=null?arguments[f]:{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.forEach(function(e){O(p,e,a[e])})}return p}var F=function(){try{var p=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&p.getContext("webgl2"))}catch(f){return!1}},D=0,M=1,q=null,A=F()!==!1,V={},I=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;l.enable(),e.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||(h.layers.enable(M),V[h.uuid]=!0)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||(h.layers.disable(M),delete V[h.uuid])}),Object.keys(V).length===0&&(l.disable(),e.event.emit("passcheck","bloom"))}},p}(),W=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;l.enable(),e.event.emit("passcheck","outline"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","outline"))}},p}(),Y=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;l.enable(),e.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","ssr"))}},p}();function G(p,f,a,n,e,i,d){try{var s=p[i](d),l=s.value}catch(v){a(v);return}s.done?f(l):Promise.resolve(l).then(n,e)}function R(p){return function(){var f=this,a=arguments;return new Promise(function(n,e){var i=p.apply(f,a);function d(l){G(i,n,e,d,s,"next",l)}function s(l){G(i,n,e,d,s,"throw",l)}d(void 0)})}}var J=S(666),L=S.n(J),N=require("three"),P=require("popmotion");function H(p){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return p.then(function(a){return m({err:null,res:a},f)}).catch(function(a){return m({err:a,res:void 0},f)})}function T(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(n,e){a.resolve=n,a.reject=e}),p&&(a.promise=H(a.promise,f)),a}var E=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new N.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},n)}var f=p.prototype;return f.initMaterial=function(){var n=this,e=this.options,i=e.color,d=e.lineNum,s=e.lineWidth,l=e.lineHieght,v=e.fade,h=e.fadeType,w=e.radius,r=e.range,t=e.vertical,o=e.step,c=e.opacity,u=e.exclude,y={field:{value:new N.Vector4(0,0,0,0)},color:{value:new N.Color(i)},opacity:{value:c},lineNum:{value:d},lineWidth:{value:s},lineHieght:{value:l},sizeNum:{value:new N.Vector3(w,w,w)},objPos:{value:new N.Vector3(0,0,0)},fade:{value:v},fadeType:{value:h},range:{value:r},angle:{value:0},stepNum:{value:o}};if(!w){var j=this.object.getSize().size;y.sizeNum.value.copy(j)}this.uniforms=y,this.object.object3d.traverse(function(x){var g=x;!g.material||u&&u.includes(g)||(g.userData.materialO?g.material=g.userData.materialO.clone():g.userData.materialO=Array.isArray(g.material)?g.material.map(function(_){return _.clone()}):g.material.clone(),Array.isArray(g.material)?g.material.forEach(function(_){t?n.setVerticalMaterial(_):n.setMaterial(_)}):t?n.setVerticalMaterial(g.material):n.setMaterial(g.material))})},f.setMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(i){i.uniforms.field=e.field,i.uniforms.fieldColor=e.color,i.uniforms.fieldOpacity=e.opacity,i.uniforms.lineNum=e.lineNum,i.uniforms.lineWidth=e.lineWidth,i.uniforms.sizeNum=e.sizeNum,i.uniforms.fade=e.fade,i.uniforms.fadeType=e.fadeType,i.uniforms.range=e.range,i.uniforms.stepNum=e.stepNum,i.vertexShader=`
1
+ (function(){var ee={666:function(b){var O=function(m){"use strict";var F=Object.prototype,E=F.hasOwnProperty,M,q=typeof Symbol=="function"?Symbol:{},A=q.iterator||"@@iterator",V=q.asyncIterator||"@@asyncIterator",I=q.toStringTag||"@@toStringTag";function P(r,t,i){return Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{P({},"")}catch(r){P=function(t,i,c){return t[i]=c}}function Y(r,t,i,c){var f=t&&t.prototype instanceof U?t:U,y=Object.create(f.prototype),j=new p(c||[]);return y._invoke=o(r,i,j),y}m.wrap=Y;function G(r,t,i){try{return{type:"normal",arg:r.call(t,i)}}catch(c){return{type:"throw",arg:c}}}var R="suspendedStart",J="suspendedYield",L="executing",N="completed",W={};function U(){}function D(){}function z(){}var H={};P(H,A,function(){return this});var v=Object.getPrototypeOf,s=v&&v(v(h([])));s&&s!==F&&E.call(s,A)&&(H=s);var a=z.prototype=U.prototype=Object.create(H);D.prototype=z,P(a,"constructor",z),P(z,"constructor",D),D.displayName=P(z,I,"GeneratorFunction");function n(r){["next","throw","return"].forEach(function(t){P(r,t,function(i){return this._invoke(t,i)})})}m.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===D||(t.displayName||t.name)==="GeneratorFunction":!1},m.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,z):(r.__proto__=z,P(r,I,"GeneratorFunction")),r.prototype=Object.create(a),r},m.awrap=function(r){return{__await:r}};function e(r,t){function i(y,j,x,g){var _=G(r[y],r,j);if(_.type==="throw")g(_.arg);else{var T=_.arg,k=T.value;return k&&typeof k=="object"&&E.call(k,"__await")?t.resolve(k.__await).then(function(C){i("next",C,x,g)},function(C){i("throw",C,x,g)}):t.resolve(k).then(function(C){T.value=C,x(T)},function(C){return i("throw",C,x,g)})}}var c;function f(y,j){function x(){return new t(function(g,_){i(y,j,g,_)})}return c=c?c.then(x,x):x()}this._invoke=f}n(e.prototype),P(e.prototype,V,function(){return this}),m.AsyncIterator=e,m.async=function(r,t,i,c,f){f===void 0&&(f=Promise);var y=new e(Y(r,t,i,c),f);return m.isGeneratorFunction(t)?y:y.next().then(function(j){return j.done?j.value:y.next()})};function o(r,t,i){var c=R;return function(y,j){if(c===L)throw new Error("Generator is already running");if(c===N){if(y==="throw")throw j;return w()}for(i.method=y,i.arg=j;;){var x=i.delegate;if(x){var g=d(x,i);if(g){if(g===W)continue;return g}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(c===R)throw c=N,i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);c=L;var _=G(r,t,i);if(_.type==="normal"){if(c=i.done?N:J,_.arg===W)continue;return{value:_.arg,done:i.done}}else _.type==="throw"&&(c=N,i.method="throw",i.arg=_.arg)}}}function d(r,t){var i=r.iterator[t.method];if(i===M){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=M,d(r,t),t.method==="throw"))return W;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return W}var c=G(i,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,W;var f=c.arg;if(!f)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,W;if(f.done)t[r.resultName]=f.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=M);else return f;return t.delegate=null,W}n(a),P(a,I,"Generator"),P(a,A,function(){return this}),P(a,"toString",function(){return"[object Generator]"});function u(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 l(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function p(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(u,this),this.reset(!0)}m.keys=function(r){var t=[];for(var i in r)t.push(i);return t.reverse(),function c(){for(;t.length;){var f=t.pop();if(f in r)return c.value=f,c.done=!1,c}return c.done=!0,c}};function h(r){if(r){var t=r[A];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var i=-1,c=function f(){for(;++i<r.length;)if(E.call(r,i))return f.value=r[i],f.done=!1,f;return f.value=M,f.done=!0,f};return c.next=c}}return{next:w}}m.values=h;function w(){return{value:M,done:!0}}return p.prototype={constructor:p,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=M,this.done=!1,this.delegate=null,this.method="next",this.arg=M,this.tryEntries.forEach(l),!r)for(var t in this)t.charAt(0)==="t"&&E.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=M)},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(g,_){return y.type="throw",y.arg=r,t.next=g,_&&(t.method="next",t.arg=M),!!_}for(var c=this.tryEntries.length-1;c>=0;--c){var f=this.tryEntries[c],y=f.completion;if(f.tryLoc==="root")return i("end");if(f.tryLoc<=this.prev){var j=E.call(f,"catchLoc"),x=E.call(f,"finallyLoc");if(j&&x){if(this.prev<f.catchLoc)return i(f.catchLoc,!0);if(this.prev<f.finallyLoc)return i(f.finallyLoc)}else if(j){if(this.prev<f.catchLoc)return i(f.catchLoc,!0)}else if(x){if(this.prev<f.finallyLoc)return i(f.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 c=this.tryEntries[i];if(c.tryLoc<=this.prev&&E.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var f=c;break}}f&&(r==="break"||r==="continue")&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var y=f?f.completion:{};return y.type=r,y.arg=t,f?(this.method="next",this.next=f.finallyLoc,W):this.complete(y)},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),W},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),l(i),W}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===r){var c=i.completion;if(c.type==="throw"){var f=c.arg;l(i)}return f}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,i){return this.delegate={iterator:h(r),resultName:t,nextLoc:i},this.method==="next"&&(this.arg=M),W}},m}(b.exports);try{regeneratorRuntime=O}catch(m){typeof globalThis=="object"?globalThis.regeneratorRuntime=O:Function("r","regeneratorRuntime = r")(O)}}},X={};function S(b){var O=X[b];if(O!==void 0)return O.exports;var m=X[b]={exports:{}};return ee[b](m,m.exports,S),m.exports}(function(){S.n=function(b){var O=b&&b.__esModule?function(){return b.default}:function(){return b};return S.d(O,{a:O}),O}})(),function(){S.d=function(b,O){for(var m in O)S.o(O,m)&&!S.o(b,m)&&Object.defineProperty(b,m,{enumerable:!0,get:O[m]})}}(),function(){S.o=function(b,O){return Object.prototype.hasOwnProperty.call(b,O)}}(),function(){S.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})}}();var $={};(function(){"use strict";S.r($),S.d($,{Bloom:function(){return I},Outline:function(){return P},SSR:function(){return Y},Scan:function(){return z},Scan2:function(){return H}});function b(v,s){if(!(v instanceof s))throw new TypeError("Cannot call a class as a function")}function O(v,s,a){return s in v?Object.defineProperty(v,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):v[s]=a,v}function m(v){for(var s=1;s<arguments.length;s++){var a=arguments[s]!=null?arguments[s]:{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.forEach(function(e){O(v,e,a[e])})}return v}var F=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(a){return!1}},E=0,M=1,q=null,A=F()!==!1,V={},I=function(){"use strict";function v(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,v),this.object=a,this.options=m({},n)}var s=v.prototype;return s.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},s.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,o=this.options,d=o.exclude,u=o.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;l.enable(),e.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(p){var h=p;u&&!u.includes(h)||d&&d.includes(h)||(h.layers.enable(M),V[h.uuid]=!0)})}},s.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,o=this.options,d=o.exclude,u=o.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;this.object.object3d.traverse(function(p){var h=p;u&&!u.includes(h)||d&&d.includes(h)||(h.layers.disable(M),delete V[h.uuid])}),Object.keys(V).length===0&&(l.disable(),e.event.emit("passcheck","bloom"))}},v}(),P=function(){"use strict";function v(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,v),this.object=a,this.options=m({},n)}var s=v.prototype;return s.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},s.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,o=this.options,d=o.exclude,u=o.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;l.enable(),e.event.emit("passcheck","outline"),this.object.object3d.traverse(function(p){var h=p;u&&!u.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},s.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,o=this.options,d=o.exclude,u=o.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;this.object.object3d.traverse(function(p){var h=p;u&&!u.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","outline"))}},v}(),Y=function(){"use strict";function v(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,v),this.object=a,this.options=m({},n)}var s=v.prototype;return s.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},s.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,o=this.options,d=o.exclude,u=o.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;l.enable(),e.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(p){var h=p;u&&!u.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},s.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,o=this.options,d=o.exclude,u=o.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;this.object.object3d.traverse(function(p){var h=p;u&&!u.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","ssr"))}},v}();function G(v,s,a,n,e,o,d){try{var u=v[o](d),l=u.value}catch(p){a(p);return}u.done?s(l):Promise.resolve(l).then(n,e)}function R(v){return function(){var s=this,a=arguments;return new Promise(function(n,e){var o=v.apply(s,a);function d(l){G(o,n,e,d,u,"next",l)}function u(l){G(o,n,e,d,u,"throw",l)}d(void 0)})}}var J=S(666),L=S.n(J),N=require("three"),W=require("popmotion");function U(v){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v.then(function(a){return m({err:null,res:a},s)}).catch(function(a){return m({err:a,res:void 0},s)})}function D(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(n,e){a.resolve=n,a.reject=e}),v&&(a.promise=U(a.promise,s)),a}var z=function(){"use strict";function v(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,v),this.object=a,this.options=m({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new N.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},n)}var s=v.prototype;return s.initMaterial=function(){var n=this,e=this.options,o=e.color,d=e.lineNum,u=e.lineWidth,l=e.lineHieght,p=e.fade,h=e.fadeType,w=e.radius,r=e.range,t=e.vertical,i=e.step,c=e.opacity,f=e.exclude,y={field:{value:new N.Vector4(0,0,0,0)},color:{value:new N.Color(o)},opacity:{value:c},lineNum:{value:d},lineWidth:{value:u},lineHieght:{value:l},sizeNum:{value:new N.Vector3(w,w,w)},objPos:{value:new N.Vector3(0,0,0)},fade:{value:p},fadeType:{value:h},range:{value:r},angle:{value:0},stepNum:{value:i}};if(!w){var j=this.object.getSize().size;y.sizeNum.value.copy(j)}this.uniforms=y,this.object.object3d.traverse(function(x){var g=x;!g.material||f&&f.includes(g)||(g.userData.materialO?g.material=g.userData.materialO.clone():g.userData.materialO=Array.isArray(g.material)?g.material.map(function(_){return _.clone()}):g.material.clone(),Array.isArray(g.material)?g.material.forEach(function(_){t?n.setVerticalMaterial(_):n.setMaterial(_)}):t?n.setVerticalMaterial(g.material):n.setMaterial(g.material))})},s.setMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(o){o.uniforms.field=e.field,o.uniforms.fieldColor=e.color,o.uniforms.fieldOpacity=e.opacity,o.uniforms.lineNum=e.lineNum,o.uniforms.lineWidth=e.lineWidth,o.uniforms.sizeNum=e.sizeNum,o.uniforms.fade=e.fade,o.uniforms.fadeType=e.fadeType,o.uniforms.range=e.range,o.uniforms.stepNum=e.stepNum,o.vertexShader=`
2
2
  varying vec4 vWorldPos;
3
- `.concat(i.vertexShader,`
3
+ `.concat(o.vertexShader,`
4
4
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
5
5
  vWorldPos = vec4( transformed, 1.0 );
6
6
  #ifdef USE_INSTANCING
7
7
  vWorldPos = instanceMatrix * vWorldPos;
8
8
  #endif
9
9
  vWorldPos = modelMatrix * vWorldPos;
10
- `),i.fragmentShader=`
10
+ `),o.fragmentShader=`
11
11
  uniform vec4 field;
12
12
  uniform vec3 fieldColor;
13
13
  uniform float fieldOpacity;
@@ -19,7 +19,7 @@
19
19
  uniform vec2 range;
20
20
  uniform int stepNum;
21
21
  varying vec4 vWorldPos;
22
- `.concat(i.fragmentShader,`
22
+ `.concat(o.fragmentShader,`
23
23
  `).replace("#include <dithering_fragment>",`#include <dithering_fragment>
24
24
  float height = sizeNum.y;
25
25
  bool isTop = field.y > vWorldPos.y;
@@ -54,16 +54,16 @@
54
54
  }
55
55
  }
56
56
  }
57
- `)},n.needsUpdate=!0},f.setVerticalMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(i){i.uniforms.field=e.field,i.uniforms.fieldColor=e.color,i.uniforms.fieldOpacity=e.opacity,i.uniforms.lineNum=e.lineNum,i.uniforms.lineWidth=e.lineWidth,i.uniforms.lineHieght=e.lineHieght,i.uniforms.sizeNum=e.sizeNum,i.uniforms.fade=e.fade,i.uniforms.range=e.range,i.uniforms.angle=e.angle,i.uniforms.objPos=e.objPos,i.vertexShader=`
57
+ `)},n.needsUpdate=!0},s.setVerticalMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(o){o.uniforms.field=e.field,o.uniforms.fieldColor=e.color,o.uniforms.fieldOpacity=e.opacity,o.uniforms.lineNum=e.lineNum,o.uniforms.lineWidth=e.lineWidth,o.uniforms.lineHieght=e.lineHieght,o.uniforms.sizeNum=e.sizeNum,o.uniforms.fade=e.fade,o.uniforms.range=e.range,o.uniforms.angle=e.angle,o.uniforms.objPos=e.objPos,o.vertexShader=`
58
58
  varying vec4 vWorldPos;
59
- `.concat(i.vertexShader,`
59
+ `.concat(o.vertexShader,`
60
60
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
61
61
  vWorldPos = vec4( transformed, 1.0 );
62
62
  #ifdef USE_INSTANCING
63
63
  vWorldPos = instanceMatrix * vWorldPos;
64
64
  #endif
65
65
  vWorldPos = modelMatrix * vWorldPos;
66
- `),i.fragmentShader=`
66
+ `),o.fragmentShader=`
67
67
  uniform vec4 field;
68
68
  uniform vec3 fieldColor;
69
69
  uniform float fieldOpacity;
@@ -81,7 +81,7 @@
81
81
  return(x - objPos.x)*cos(a) - (z - objPos.z)*sin(a) + objPos.x ;
82
82
  }
83
83
 
84
- `.concat(i.fragmentShader,`
84
+ `.concat(o.fragmentShader,`
85
85
  `).replace("#include <dithering_fragment>",`#include <dithering_fragment>
86
86
 
87
87
  float worldDist = distance(field.y, vWorldPos.y);
@@ -125,23 +125,23 @@
125
125
  }
126
126
  }
127
127
 
128
- `)},n.needsUpdate=!0},f.resetMaterial=function(){this.object.object3d.traverse(function(n){var e=n;e.material&&e.userData.materialO&&(e.material=e.userData.materialO.clone(),e.userData.materialO=void 0)})},f.play=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;this.stop();var i=T(!0),d=this,s=d.object,l=d.uniforms,v=m({},this.options,n),h=v.lineNum,w=v.step,r=v.lineWidth,t=v.pos,o=v.duration,c=s.getSize(),u=c.min,y=c.max,j=c.size,x=h,g=r;w>0&&(x=1,g=j.y/w);var _=l.sizeNum.value.y*(x>1?2:1);return this.tween=(0,P.animate)({from:0,to:1,duration:o,onPlay:function(){var z,C=new N.Vector3;t==="bottom"?C.set(u.x-.001,u.y-.001,u.z-.001):t==="top"&&C.set(y.x+.001,y.y+.001,y.z+.001);var k=((z=s.pencil.control)===null||z===void 0?void 0:z.getAzimuthalAngle())||0,B=e.object.object3d.position.clone();if(k){var X=Math.sqrt(Math.pow(j.x,2)+Math.pow(j.z,2))/2;C.x=B.x+X,C.z=B.z+X;var Z=new N.Vector3().subVectors(C,B),ee=new N.Vector3(0,1,0);Z.applyAxisAngle(ee,k),C.addVectors(B,Z)}l.objPos.value.copy(B),l.field.value.set(C.x,C.y,C.z,0),l.angle.value=k,l.lineNum.value=x,l.lineWidth.value=g},onUpdate:function(z){w>0?l.field.value.w=Math.floor(z*w)/w*_:l.field.value.w=z*_},onStop:function(){l.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},f.checkRepeat=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;return R(L().mark(function i(){var d,s,l,v,h,w;return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return d=m({},e.options,n),s=d.yoyo,l=d.repeat,v=d.pos,l===e.options.repeat&&e.initMaterial(),t.next=4,e.play(n);case 4:if(h=t.sent.err,!h){t.next=8;break}return e.resetMaterial(),t.abrupt("return");case 8:if(!l){t.next=15;break}return w=v,s&&(w=w==="bottom"?"top":"bottom"),t.next=13,e.checkRepeat({pos:w,repeat:l===1/0?-1:l-1});case 13:t.next=16;break;case 15:e.resetMaterial();case 16:case"end":return t.stop()}},i)}))()},f.start=function(){return this.checkRepeat()},f.stop=function(){this.tween&&this.tween.stop()},p}(),U=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new N.Vector3(0,0,0),duration:5e3,repeat:0},n)}var f=p.prototype;return f.initMaterial=function(){var n=this,e=this.options.exclude,i={field:{value:new N.Vector4(0,0,0,1e-4)},color:{value:new N.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(d){var s=d;!s.material||e&&e.includes(s)||(s.userData.materialO?s.material=s.userData.materialO:s.userData.materialO=Array.isArray(s.material)?s.material.map(function(l){return l.clone()}):s.material.clone(),Array.isArray(s.material)?s.material.forEach(function(l){n.setMaterial(l)}):n.setMaterial(s.material))})},f.setMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(i){i.uniforms.field=e.field,i.uniforms.fieldColor=e.color,i.uniforms.fieldOpacity=e.opacity,i.uniforms.lineWidth=e.lineWidth,i.vertexShader=`
128
+ `)},n.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(n){var e=n;e.material&&e.userData.materialO&&(e.material=e.userData.materialO.clone(),e.userData.materialO=void 0)})},s.play=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;this.stop();var o=D(!0),d=this,u=d.object,l=d.uniforms,p=m({},this.options,n),h=p.lineNum,w=p.step,r=p.lineWidth,t=p.pos,i=p.duration,c=u.getSize(),f=c.min,y=c.max,j=c.size,x=h,g=r;w>0&&(x=1,g=j.y/w);var _=l.sizeNum.value.y*(x>1?2:1);return this.tween=(0,W.animate)({from:0,to:1,duration:i,onPlay:function(){var k,C=new N.Vector3;t==="bottom"?C.set(f.x-.001,f.y-.001,f.z-.001):t==="top"&&C.set(y.x+.001,y.y+.001,y.z+.001);var Q=((k=u.pencil.control)===null||k===void 0?void 0:k.getAzimuthalAngle())||0,B=e.object.object3d.position.clone();if(Q){var Z=Math.sqrt(Math.pow(j.x,2)+Math.pow(j.z,2))/2;C.x=B.x+Z,C.z=B.z+Z;var K=new N.Vector3().subVectors(C,B),te=new N.Vector3(0,1,0);K.applyAxisAngle(te,Q),C.addVectors(B,K)}l.objPos.value.copy(B),l.field.value.set(C.x,C.y,C.z,0),l.angle.value=Q,l.lineNum.value=x,l.lineWidth.value=g},onUpdate:function(k){w>0?l.field.value.w=Math.floor(k*w)/w*_:l.field.value.w=k*_},onStop:function(){l.field.value.w=0,o.reject("stop")},onComplete:function(){o.resolve()}}),o.promise},s.checkRepeat=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;return R(L().mark(function o(){var d,u,l,p,h,w;return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return d=m({},e.options,n),u=d.yoyo,l=d.repeat,p=d.pos,l===e.options.repeat&&e.initMaterial(),t.next=4,e.play(n);case 4:if(h=t.sent.err,!h){t.next=8;break}return e.resetMaterial(),t.abrupt("return");case 8:if(!l){t.next=15;break}return w=p,u&&(w=w==="bottom"?"top":"bottom"),t.next=13,e.checkRepeat({pos:w,repeat:l===1/0?-1:l-1});case 13:t.next=16;break;case 15:e.resetMaterial();case 16:case"end":return t.stop()}},o)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},v}(),H=function(){"use strict";function v(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,v),this.object=a,this.options=m({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new N.Vector3(0,0,0),duration:5e3,repeat:0},n)}var s=v.prototype;return s.initMaterial=function(){var n=this,e=this.options.exclude,o={field:{value:new N.Vector4(0,0,0,1e-4)},color:{value:new N.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=o,this.object.object3d.traverse(function(d){var u=d;!u.material||e&&e.includes(u)||(u.userData.materialO?u.material=u.userData.materialO:u.userData.materialO=Array.isArray(u.material)?u.material.map(function(l){return l.clone()}):u.material.clone(),Array.isArray(u.material)?u.material.forEach(function(l){n.setMaterial(l)}):n.setMaterial(u.material))})},s.setMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(o){o.uniforms.field=e.field,o.uniforms.fieldColor=e.color,o.uniforms.fieldOpacity=e.opacity,o.uniforms.lineWidth=e.lineWidth,o.vertexShader=`
129
129
  varying vec4 vWorldPos;
130
- `.concat(i.vertexShader,`
130
+ `.concat(o.vertexShader,`
131
131
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
132
132
  vWorldPos = vec4( transformed, 1.0 );
133
133
  #ifdef USE_INSTANCING
134
134
  vWorldPos = instanceMatrix * vWorldPos;
135
135
  #endif
136
136
  vWorldPos = modelMatrix * vWorldPos;
137
- `),i.fragmentShader=`
137
+ `),o.fragmentShader=`
138
138
  uniform vec4 field;
139
139
  uniform vec3 fieldColor;
140
140
  uniform float fieldOpacity;
141
141
  uniform float lineWidth;
142
142
 
143
143
  varying vec4 vWorldPos;
144
- `.concat(i.fragmentShader,`
144
+ `.concat(o.fragmentShader,`
145
145
  `).replace("#include <dithering_fragment>",`#include <dithering_fragment>
146
146
 
147
147
  float worldDist = distance(field.xyz, vWorldPos.xyz);
@@ -157,4 +157,4 @@
157
157
  }
158
158
  gl_FragColor.rgb = mix(gl_FragColor.rgb, fieldColor, fadeout);
159
159
 
160
- `)},n.needsUpdate=!0},f.resetMaterial=function(){this.object.object3d.traverse(function(n){var e=n;e.material&&e.userData.materialO&&(e.material=e.userData.materialO.clone(),e.userData.materialO=void 0)})},f.play=function(){var n=this;this.stop();var e=T(!0),i=this,d=i.object,s=i.uniforms,l=this.options,v=l.position,h=l.duration,w=this.options.radius;if(!w){var r=d.getSize().size;w=Math.max(r.x,r.y,r.z)}return this.tween=(0,P.animate)({from:1e-4,to:1,duration:h,onPlay:function(){s.field.value.set(v.x,v.y,v.z,1e-4),n.options.fade&&(s.opacity.value=n.options.opacity)},onUpdate:function(t){s.field.value.w=t*w,n.options.fade&&(s.opacity.value=(1-t)*n.options.opacity)},onStop:function(){s.field.value.w=0,e.reject("stop")},onComplete:function(){e.resolve()}}),e.promise},f.checkRepeat=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;return R(L().mark(function i(){var d,s;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return d=m({},e.options,n).repeat,d===e.options.repeat&&e.initMaterial(),v.next=4,e.play();case 4:if(s=v.sent.err,!s){v.next=8;break}return e.resetMaterial(),v.abrupt("return");case 8:if(!d){v.next=13;break}return v.next=11,e.checkRepeat({repeat:d===1/0?-1:d-1});case 11:v.next=14;break;case 13:e.resetMaterial();case 14:case"end":return v.stop()}},i)}))()},f.start=function(){return this.checkRepeat()},f.stop=function(){this.tween&&this.tween.stop()},p}()})(),module.exports=$})();
160
+ `)},n.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(n){var e=n;e.material&&e.userData.materialO&&(e.material=e.userData.materialO.clone(),e.userData.materialO=void 0)})},s.play=function(){var n=this;this.stop();var e=D(!0),o=this,d=o.object,u=o.uniforms,l=this.options,p=l.position,h=l.duration,w=this.options.radius;if(!w){var r=d.getSize().size;w=Math.max(r.x,r.y,r.z)}return this.tween=(0,W.animate)({from:1e-4,to:1,duration:h,onPlay:function(){u.field.value.set(p.x,p.y,p.z,1e-4),n.options.fade&&(u.opacity.value=n.options.opacity)},onUpdate:function(i){u.field.value.w=i*w,n.options.fade&&(u.opacity.value=(1-i)*n.options.opacity)},onStop:function(){u.field.value.w=0,e.reject("stop")},onComplete:function(){e.resolve()}}),e.promise},s.checkRepeat=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this;return R(L().mark(function o(){var d,u;return L().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return d=m({},e.options,n).repeat,d===e.options.repeat&&e.initMaterial(),p.next=4,e.play();case 4:if(u=p.sent.err,!u){p.next=8;break}return e.resetMaterial(),p.abrupt("return");case 8:if(!d){p.next=13;break}return p.next=11,e.checkRepeat({repeat:d===1/0?-1:d-1});case 11:p.next=14;break;case 13:e.resetMaterial();case 14:case"end":return p.stop()}},o)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},v}()})(),module.exports=$})();
@@ -1,4 +1,4 @@
1
- import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var w=function(v){"use strict";var $=Object.prototype,S=$.hasOwnProperty,C,X=typeof Symbol=="function"?Symbol:{},U=X.iterator||"@@iterator",B=X.asyncIterator||"@@asyncIterator",F=X.toStringTag||"@@toStringTag";function j(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{j({},"")}catch(e){j=function(t,n,a){return t[n]=a}}function J(e,t,n,a){var u=t&&t.prototype instanceof x?t:x,p=Object.create(u.prototype),_=new i(a||[]);return p._invoke=s(e,n,_),p}v.wrap=J;function T(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(a){return{type:"throw",arg:a}}}var H="suspendedStart",Z="suspendedYield",z="executing",A="completed",O={};function x(){}function G(){}function k(){}var V={};j(V,U,function(){return this});var q=Object.getPrototypeOf,L=q&&q(q(d([])));L&&L!==$&&S.call(L,U)&&(V=L);var E=k.prototype=x.prototype=Object.create(V);G.prototype=k,j(E,"constructor",k),j(k,"constructor",G),G.displayName=j(k,F,"GeneratorFunction");function K(e){["next","throw","return"].forEach(function(t){j(e,t,function(n){return this._invoke(t,n)})})}v.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===G||(t.displayName||t.name)==="GeneratorFunction":!1},v.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,j(e,F,"GeneratorFunction")),e.prototype=Object.create(E),e},v.awrap=function(e){return{__await:e}};function c(e,t){function n(p,_,y,b){var g=T(e[p],e,_);if(g.type==="throw")b(g.arg);else{var P=g.arg,N=P.value;return N&&typeof N=="object"&&S.call(N,"__await")?t.resolve(N.__await).then(function(h){n("next",h,y,b)},function(h){n("throw",h,y,b)}):t.resolve(N).then(function(h){P.value=h,y(P)},function(h){return n("throw",h,y,b)})}}var a;function u(p,_){function y(){return new t(function(b,g){n(p,_,b,g)})}return a=a?a.then(y,y):y()}this._invoke=u}K(c.prototype),j(c.prototype,B,function(){return this}),v.AsyncIterator=c,v.async=function(e,t,n,a,u){u===void 0&&(u=Promise);var p=new c(J(e,t,n,a),u);return v.isGeneratorFunction(t)?p:p.next().then(function(_){return _.done?_.value:p.next()})};function s(e,t,n){var a=H;return function(p,_){if(a===z)throw new Error("Generator is already running");if(a===A){if(p==="throw")throw _;return f()}for(n.method=p,n.arg=_;;){var y=n.delegate;if(y){var b=l(y,n);if(b){if(b===O)continue;return b}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(a===H)throw a=A,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);a=z;var g=T(e,t,n);if(g.type==="normal"){if(a=n.done?A:Z,g.arg===O)continue;return{value:g.arg,done:n.done}}else g.type==="throw"&&(a=A,n.method="throw",n.arg=g.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===C){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=C,l(e,t),t.method==="throw"))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var a=T(n,e.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,O;var u=a.arg;if(!u)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O;if(u.done)t[e.resultName]=u.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=C);else return u;return t.delegate=null,O}K(E),j(E,F,"Generator"),j(E,U,function(){return this}),j(E,"toString",function(){return"[object Generator]"});function o(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function r(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function i(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(o,this),this.reset(!0)}v.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function a(){for(;t.length;){var u=t.pop();if(u in e)return a.value=u,a.done=!1,a}return a.done=!0,a}};function d(e){if(e){var t=e[U];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,a=function u(){for(;++n<e.length;)if(S.call(e,n))return u.value=e[n],u.done=!1,u;return u.value=C,u.done=!0,u};return a.next=a}}return{next:f}}v.values=d;function f(){return{value:C,done:!0}}return i.prototype={constructor:i,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(r),!e)for(var t in this)t.charAt(0)==="t"&&S.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=C)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(b,g){return p.type="throw",p.arg=e,t.next=b,g&&(t.method="next",t.arg=C),!!g}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],p=u.completion;if(u.tryLoc==="root")return n("end");if(u.tryLoc<=this.prev){var _=S.call(u,"catchLoc"),y=S.call(u,"finallyLoc");if(_&&y){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(_){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else if(y){if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&S.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var u=a;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var p=u?u.completion:{};return p.type=e,p.arg=t,u?(this.method="next",this.next=u.finallyLoc,O):this.complete(p)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),r(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if(a.type==="throw"){var u=a.arg;r(n)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=C),O}},v}(m.exports);try{regeneratorRuntime=w}catch(v){typeof globalThis=="object"?globalThis.regeneratorRuntime=w:Function("r","regeneratorRuntime = r")(w)}}},ne={};function W(m){var w=ne[m];if(w!==void 0)return w.exports;var v=ne[m]={exports:{}};return ae[m](v,v.exports,W),v.exports}(function(){W.n=function(m){var w=m&&m.__esModule?function(){return m.default}:function(){return m};return W.d(w,{a:w}),w}})(),function(){W.d=function(m,w){for(var v in w)W.o(w,v)&&!W.o(m,v)&&Object.defineProperty(m,v,{enumerable:!0,get:w[v]})}}(),function(){W.o=function(m,w){return Object.prototype.hasOwnProperty.call(m,w)}}();var I={};(function(){W.d(I,{dp:function(){return F},bw:function(){return j},F7:function(){return J},hC:function(){return E},WU:function(){return K}});function m(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}function w(c,s,l){return s in c?Object.defineProperty(c,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):c[s]=l,c}function v(c){for(var s=1;s<arguments.length;s++){var l=arguments[s]!=null?arguments[s]:{},o=Object.keys(l);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(l).filter(function(r){return Object.getOwnPropertyDescriptor(l,r).enumerable}))),o.forEach(function(r){w(c,r,l[r])})}return c}var $=function(){try{var c=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&c.getContext("webgl2"))}catch(s){return!1}},S=0,C=1,X=null,U=$()!==!1,B={},F=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;e.enable(),r.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||(n.layers.enable(C),B[n.uuid]=!0)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||(n.layers.disable(C),delete B[n.uuid])}),Object.keys(B).length===0&&(e.disable(),r.event.emit("passcheck","bloom"))}},c}(),j=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;e.enable(),r.event.emit("passcheck","outline"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","outline"))}},c}(),J=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;e.enable(),r.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","ssr"))}},c}();function T(c,s,l,o,r,i,d){try{var f=c[i](d),e=f.value}catch(t){l(t);return}f.done?s(e):Promise.resolve(e).then(o,r)}function H(c){return function(){var s=this,l=arguments;return new Promise(function(o,r){var i=c.apply(s,l);function d(e){T(i,o,r,d,f,"next",e)}function f(e){T(i,o,r,d,f,"throw",e)}d(void 0)})}}var Z=W(666),z=W.n(Z),A=c=>{var s={};return W.d(s,c),s},O=c=>()=>c,x=A({Color:()=>Q.Color,Vector2:()=>Q.Vector2,Vector3:()=>Q.Vector3,Vector4:()=>Q.Vector4}),G=c=>{var s={};return W.d(s,c),s},k=c=>()=>c,V=G({animate:()=>ie.animate});function q(c){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return c.then(function(l){return v({err:null,res:l},s)}).catch(function(l){return v({err:l,res:void 0},s)})}function L(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l={};return l.promise=new Promise(function(o,r){l.resolve=o,l.reject=r}),c&&(l.promise=q(l.promise,s)),l}var E=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new x.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},o)}var s=c.prototype;return s.initMaterial=function(){var o=this,r=this.options,i=r.color,d=r.lineNum,f=r.lineWidth,e=r.lineHieght,t=r.fade,n=r.fadeType,a=r.radius,u=r.range,p=r.vertical,_=r.step,y=r.opacity,b=r.exclude,g={field:{value:new x.Vector4(0,0,0,0)},color:{value:new x.Color(i)},opacity:{value:y},lineNum:{value:d},lineWidth:{value:f},lineHieght:{value:e},sizeNum:{value:new x.Vector3(a,a,a)},objPos:{value:new x.Vector3(0,0,0)},fade:{value:t},fadeType:{value:n},range:{value:u},angle:{value:0},stepNum:{value:_}};if(!a){var P=this.object.getSize().size;g.sizeNum.value.copy(P)}this.uniforms=g,this.object.object3d.traverse(function(N){var h=N;!h.material||b&&b.includes(h)||(h.userData.materialO?h.material=h.userData.materialO.clone():h.userData.materialO=Array.isArray(h.material)?h.material.map(function(D){return D.clone()}):h.material.clone(),Array.isArray(h.material)?h.material.forEach(function(D){p?o.setVerticalMaterial(D):o.setMaterial(D)}):p?o.setVerticalMaterial(h.material):o.setMaterial(h.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineNum=r.lineNum,i.uniforms.lineWidth=r.lineWidth,i.uniforms.sizeNum=r.sizeNum,i.uniforms.fade=r.fade,i.uniforms.fadeType=r.fadeType,i.uniforms.range=r.range,i.uniforms.stepNum=r.stepNum,i.vertexShader=`
1
+ import*as Q from"three";import*as ae from"popmotion";var le={666:function(m){var _=function(v){"use strict";var $=Object.prototype,S=$.hasOwnProperty,C,X=typeof Symbol=="function"?Symbol:{},U=X.iterator||"@@iterator",B=X.asyncIterator||"@@asyncIterator",F=X.toStringTag||"@@toStringTag";function j(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{j({},"")}catch(e){j=function(t,n,a){return t[n]=a}}function J(e,t,n,a){var u=t&&t.prototype instanceof x?t:x,d=Object.create(u.prototype),g=new i(a||[]);return d._invoke=s(e,n,g),d}v.wrap=J;function T(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(a){return{type:"throw",arg:a}}}var H="suspendedStart",Z="suspendedYield",z="executing",A="completed",O={};function x(){}function G(){}function k(){}var V={};j(V,U,function(){return this});var q=Object.getPrototypeOf,L=q&&q(q(p([])));L&&L!==$&&S.call(L,U)&&(V=L);var E=k.prototype=x.prototype=Object.create(V);G.prototype=k,j(E,"constructor",k),j(k,"constructor",G),G.displayName=j(k,F,"GeneratorFunction");function K(e){["next","throw","return"].forEach(function(t){j(e,t,function(n){return this._invoke(t,n)})})}v.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===G||(t.displayName||t.name)==="GeneratorFunction":!1},v.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,j(e,F,"GeneratorFunction")),e.prototype=Object.create(E),e},v.awrap=function(e){return{__await:e}};function c(e,t){function n(d,g,b,w){var y=T(e[d],e,g);if(y.type==="throw")w(y.arg);else{var P=y.arg,N=P.value;return N&&typeof N=="object"&&S.call(N,"__await")?t.resolve(N.__await).then(function(h){n("next",h,b,w)},function(h){n("throw",h,b,w)}):t.resolve(N).then(function(h){P.value=h,b(P)},function(h){return n("throw",h,b,w)})}}var a;function u(d,g){function b(){return new t(function(w,y){n(d,g,w,y)})}return a=a?a.then(b,b):b()}this._invoke=u}K(c.prototype),j(c.prototype,B,function(){return this}),v.AsyncIterator=c,v.async=function(e,t,n,a,u){u===void 0&&(u=Promise);var d=new c(J(e,t,n,a),u);return v.isGeneratorFunction(t)?d:d.next().then(function(g){return g.done?g.value:d.next()})};function s(e,t,n){var a=H;return function(d,g){if(a===z)throw new Error("Generator is already running");if(a===A){if(d==="throw")throw g;return f()}for(n.method=d,n.arg=g;;){var b=n.delegate;if(b){var w=l(b,n);if(w){if(w===O)continue;return w}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(a===H)throw a=A,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);a=z;var y=T(e,t,n);if(y.type==="normal"){if(a=n.done?A:Z,y.arg===O)continue;return{value:y.arg,done:n.done}}else y.type==="throw"&&(a=A,n.method="throw",n.arg=y.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===C){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=C,l(e,t),t.method==="throw"))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var a=T(n,e.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,O;var u=a.arg;if(!u)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O;if(u.done)t[e.resultName]=u.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=C);else return u;return t.delegate=null,O}K(E),j(E,F,"Generator"),j(E,U,function(){return this}),j(E,"toString",function(){return"[object Generator]"});function o(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function r(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function i(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(o,this),this.reset(!0)}v.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function a(){for(;t.length;){var u=t.pop();if(u in e)return a.value=u,a.done=!1,a}return a.done=!0,a}};function p(e){if(e){var t=e[U];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,a=function u(){for(;++n<e.length;)if(S.call(e,n))return u.value=e[n],u.done=!1,u;return u.value=C,u.done=!0,u};return a.next=a}}return{next:f}}v.values=p;function f(){return{value:C,done:!0}}return i.prototype={constructor:i,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(r),!e)for(var t in this)t.charAt(0)==="t"&&S.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=C)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(w,y){return d.type="throw",d.arg=e,t.next=w,y&&(t.method="next",t.arg=C),!!y}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],d=u.completion;if(u.tryLoc==="root")return n("end");if(u.tryLoc<=this.prev){var g=S.call(u,"catchLoc"),b=S.call(u,"finallyLoc");if(g&&b){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(g){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else if(b){if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&S.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var u=a;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var d=u?u.completion:{};return d.type=e,d.arg=t,u?(this.method="next",this.next=u.finallyLoc,O):this.complete(d)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),r(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if(a.type==="throw"){var u=a.arg;r(n)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:p(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=C),O}},v}(m.exports);try{regeneratorRuntime=_}catch(v){typeof globalThis=="object"?globalThis.regeneratorRuntime=_:Function("r","regeneratorRuntime = r")(_)}}},oe={};function W(m){var _=oe[m];if(_!==void 0)return _.exports;var v=oe[m]={exports:{}};return le[m](v,v.exports,W),v.exports}(function(){W.n=function(m){var _=m&&m.__esModule?function(){return m.default}:function(){return m};return W.d(_,{a:_}),_}})(),function(){W.d=function(m,_){for(var v in _)W.o(_,v)&&!W.o(m,v)&&Object.defineProperty(m,v,{enumerable:!0,get:_[v]})}}(),function(){W.o=function(m,_){return Object.prototype.hasOwnProperty.call(m,_)}}();var I={};(function(){W.d(I,{dp:function(){return F},bw:function(){return j},F7:function(){return J},hC:function(){return E},WU:function(){return K}});function m(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}function _(c,s,l){return s in c?Object.defineProperty(c,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):c[s]=l,c}function v(c){for(var s=1;s<arguments.length;s++){var l=arguments[s]!=null?arguments[s]:{},o=Object.keys(l);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(l).filter(function(r){return Object.getOwnPropertyDescriptor(l,r).enumerable}))),o.forEach(function(r){_(c,r,l[r])})}return c}var $=function(){try{var s=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&s.getContext("webgl2"))}catch(l){return!1}},S=0,C=1,X=null,U=$()!==!1,B={},F=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,p=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;e.enable(),r.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||p&&p.includes(n)||(n.layers.enable(C),B[n.uuid]=!0)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,p=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||p&&p.includes(n)||(n.layers.disable(C),delete B[n.uuid])}),Object.keys(B).length===0&&(e.disable(),r.event.emit("passcheck","bloom"))}},c}(),j=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,p=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;e.enable(),r.event.emit("passcheck","outline"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||p&&p.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,p=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||p&&p.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","outline"))}},c}(),J=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,p=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;e.enable(),r.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||p&&p.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,p=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||p&&p.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","ssr"))}},c}();function T(c,s,l,o,r,i,p){try{var f=c[i](p),e=f.value}catch(t){l(t);return}f.done?s(e):Promise.resolve(e).then(o,r)}function H(c){return function(){var s=this,l=arguments;return new Promise(function(o,r){var i=c.apply(s,l);function p(e){T(i,o,r,p,f,"next",e)}function f(e){T(i,o,r,p,f,"throw",e)}p(void 0)})}}var Z=W(666),z=W.n(Z),A=c=>{var s={};return W.d(s,c),s},O=c=>()=>c,x=A({Color:()=>Q.Color,Vector2:()=>Q.Vector2,Vector3:()=>Q.Vector3,Vector4:()=>Q.Vector4}),G=c=>{var s={};return W.d(s,c),s},k=c=>()=>c,V=G({animate:()=>ae.animate});function q(c){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return c.then(function(l){return v({err:null,res:l},s)}).catch(function(l){return v({err:l,res:void 0},s)})}function L(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l={};return l.promise=new Promise(function(o,r){l.resolve=o,l.reject=r}),c&&(l.promise=q(l.promise,s)),l}var E=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new x.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},o)}var s=c.prototype;return s.initMaterial=function(){var o=this,r=this.options,i=r.color,p=r.lineNum,f=r.lineWidth,e=r.lineHieght,t=r.fade,n=r.fadeType,a=r.radius,u=r.range,d=r.vertical,g=r.step,b=r.opacity,w=r.exclude,y={field:{value:new x.Vector4(0,0,0,0)},color:{value:new x.Color(i)},opacity:{value:b},lineNum:{value:p},lineWidth:{value:f},lineHieght:{value:e},sizeNum:{value:new x.Vector3(a,a,a)},objPos:{value:new x.Vector3(0,0,0)},fade:{value:t},fadeType:{value:n},range:{value:u},angle:{value:0},stepNum:{value:g}};if(!a){var P=this.object.getSize().size;y.sizeNum.value.copy(P)}this.uniforms=y,this.object.object3d.traverse(function(N){var h=N;!h.material||w&&w.includes(h)||(h.userData.materialO?h.material=h.userData.materialO.clone():h.userData.materialO=Array.isArray(h.material)?h.material.map(function(D){return D.clone()}):h.material.clone(),Array.isArray(h.material)?h.material.forEach(function(D){d?o.setVerticalMaterial(D):o.setMaterial(D)}):d?o.setVerticalMaterial(h.material):o.setMaterial(h.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineNum=r.lineNum,i.uniforms.lineWidth=r.lineWidth,i.uniforms.sizeNum=r.sizeNum,i.uniforms.fade=r.fade,i.uniforms.fadeType=r.fadeType,i.uniforms.range=r.range,i.uniforms.stepNum=r.stepNum,i.vertexShader=`
2
2
  varying vec4 vWorldPos;
3
3
  `.concat(i.vertexShader,`
4
4
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -125,7 +125,7 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
125
125
  }
126
126
  }
127
127
 
128
- `)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;this.stop();var i=L(!0),d=this,f=d.object,e=d.uniforms,t=v({},this.options,o),n=t.lineNum,a=t.step,u=t.lineWidth,p=t.pos,_=t.duration,y=f.getSize(),b=y.min,g=y.max,P=y.size,N=n,h=u;a>0&&(N=1,h=P.y/a);var D=e.sizeNum.value.y*(N>1?2:1);return this.tween=(0,V.animate)({from:0,to:1,duration:_,onPlay:function(){var R,M=new x.Vector3;p==="bottom"?M.set(b.x-.001,b.y-.001,b.z-.001):p==="top"&&M.set(g.x+.001,g.y+.001,g.z+.001);var ee=((R=f.pencil.control)===null||R===void 0?void 0:R.getAzimuthalAngle())||0,Y=r.object.object3d.position.clone();if(ee){var te=Math.sqrt(Math.pow(P.x,2)+Math.pow(P.z,2))/2;M.x=Y.x+te,M.z=Y.z+te;var re=new x.Vector3().subVectors(M,Y),oe=new x.Vector3(0,1,0);re.applyAxisAngle(oe,ee),M.addVectors(Y,re)}e.objPos.value.copy(Y),e.field.value.set(M.x,M.y,M.z,0),e.angle.value=ee,e.lineNum.value=N,e.lineWidth.value=h},onUpdate:function(R){a>0?e.field.value.w=Math.floor(R*a)/a*D:e.field.value.w=R*D},onStop:function(){e.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return H(z().mark(function i(){var d,f,e,t,n,a;return z().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return d=v({},r.options,o),f=d.yoyo,e=d.repeat,t=d.pos,e===r.options.repeat&&r.initMaterial(),p.next=4,r.play(o);case 4:if(n=p.sent.err,!n){p.next=8;break}return r.resetMaterial(),p.abrupt("return");case 8:if(!e){p.next=15;break}return a=t,f&&(a=a==="bottom"?"top":"bottom"),p.next=13,r.checkRepeat({pos:a,repeat:e===1/0?-1:e-1});case 13:p.next=16;break;case 15:r.resetMaterial();case 16:case"end":return p.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}(),K=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new x.Vector3(0,0,0),duration:5e3,repeat:0},o)}var s=c.prototype;return s.initMaterial=function(){var o=this,r=this.options.exclude,i={field:{value:new x.Vector4(0,0,0,1e-4)},color:{value:new x.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(d){var f=d;!f.material||r&&r.includes(f)||(f.userData.materialO?f.material=f.userData.materialO:f.userData.materialO=Array.isArray(f.material)?f.material.map(function(e){return e.clone()}):f.material.clone(),Array.isArray(f.material)?f.material.forEach(function(e){o.setMaterial(e)}):o.setMaterial(f.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineWidth=r.lineWidth,i.vertexShader=`
128
+ `)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;this.stop();var i=L(!0),p=this,f=p.object,e=p.uniforms,t=v({},this.options,o),n=t.lineNum,a=t.step,u=t.lineWidth,d=t.pos,g=t.duration,b=f.getSize(),w=b.min,y=b.max,P=b.size,N=n,h=u;a>0&&(N=1,h=P.y/a);var D=e.sizeNum.value.y*(N>1?2:1);return this.tween=(0,V.animate)({from:0,to:1,duration:g,onPlay:function(){var R,M=new x.Vector3;d==="bottom"?M.set(w.x-.001,w.y-.001,w.z-.001):d==="top"&&M.set(y.x+.001,y.y+.001,y.z+.001);var te=((R=f.pencil.control)===null||R===void 0?void 0:R.getAzimuthalAngle())||0,Y=r.object.object3d.position.clone();if(te){var re=Math.sqrt(Math.pow(P.x,2)+Math.pow(P.z,2))/2;M.x=Y.x+re,M.z=Y.z+re;var ne=new x.Vector3().subVectors(M,Y),ie=new x.Vector3(0,1,0);ne.applyAxisAngle(ie,te),M.addVectors(Y,ne)}e.objPos.value.copy(Y),e.field.value.set(M.x,M.y,M.z,0),e.angle.value=te,e.lineNum.value=N,e.lineWidth.value=h},onUpdate:function(R){a>0?e.field.value.w=Math.floor(R*a)/a*D:e.field.value.w=R*D},onStop:function(){e.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return H(z().mark(function i(){var p,f,e,t,n,a;return z().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return p=v({},r.options,o),f=p.yoyo,e=p.repeat,t=p.pos,e===r.options.repeat&&r.initMaterial(),d.next=4,r.play(o);case 4:if(n=d.sent.err,!n){d.next=8;break}return r.resetMaterial(),d.abrupt("return");case 8:if(!e){d.next=15;break}return a=t,f&&(a=a==="bottom"?"top":"bottom"),d.next=13,r.checkRepeat({pos:a,repeat:e===1/0?-1:e-1});case 13:d.next=16;break;case 15:r.resetMaterial();case 16:case"end":return d.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}(),K=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new x.Vector3(0,0,0),duration:5e3,repeat:0},o)}var s=c.prototype;return s.initMaterial=function(){var o=this,r=this.options.exclude,i={field:{value:new x.Vector4(0,0,0,1e-4)},color:{value:new x.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(p){var f=p;!f.material||r&&r.includes(f)||(f.userData.materialO?f.material=f.userData.materialO:f.userData.materialO=Array.isArray(f.material)?f.material.map(function(e){return e.clone()}):f.material.clone(),Array.isArray(f.material)?f.material.forEach(function(e){o.setMaterial(e)}):o.setMaterial(f.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineWidth=r.lineWidth,i.vertexShader=`
129
129
  varying vec4 vWorldPos;
130
130
  `.concat(i.vertexShader,`
131
131
  `).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
@@ -157,4 +157,4 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
157
157
  }
158
158
  gl_FragColor.rgb = mix(gl_FragColor.rgb, fieldColor, fadeout);
159
159
 
160
- `)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=this;this.stop();var r=L(!0),i=this,d=i.object,f=i.uniforms,e=this.options,t=e.position,n=e.duration,a=this.options.radius;if(!a){var u=d.getSize().size;a=Math.max(u.x,u.y,u.z)}return this.tween=(0,V.animate)({from:1e-4,to:1,duration:n,onPlay:function(){f.field.value.set(t.x,t.y,t.z,1e-4),o.options.fade&&(f.opacity.value=o.options.opacity)},onUpdate:function(p){f.field.value.w=p*a,o.options.fade&&(f.opacity.value=(1-p)*o.options.opacity)},onStop:function(){f.field.value.w=0,r.reject("stop")},onComplete:function(){r.resolve()}}),r.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return H(z().mark(function i(){var d,f;return z().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return d=v({},r.options,o).repeat,d===r.options.repeat&&r.initMaterial(),t.next=4,r.play();case 4:if(f=t.sent.err,!f){t.next=8;break}return r.resetMaterial(),t.abrupt("return");case 8:if(!d){t.next=13;break}return t.next=11,r.checkRepeat({repeat:d===1/0?-1:d-1});case 11:t.next=14;break;case 13:r.resetMaterial();case 14:case"end":return t.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}()})();var le=I.dp,se=I.bw,ue=I.F7,fe=I.hC,ce=I.WU;export{le as Bloom,se as Outline,ue as SSR,fe as Scan,ce as Scan2};
160
+ `)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=this;this.stop();var r=L(!0),i=this,p=i.object,f=i.uniforms,e=this.options,t=e.position,n=e.duration,a=this.options.radius;if(!a){var u=p.getSize().size;a=Math.max(u.x,u.y,u.z)}return this.tween=(0,V.animate)({from:1e-4,to:1,duration:n,onPlay:function(){f.field.value.set(t.x,t.y,t.z,1e-4),o.options.fade&&(f.opacity.value=o.options.opacity)},onUpdate:function(g){f.field.value.w=g*a,o.options.fade&&(f.opacity.value=(1-g)*o.options.opacity)},onStop:function(){f.field.value.w=0,r.reject("stop")},onComplete:function(){r.resolve()}}),r.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return H(z().mark(function i(){var p,f;return z().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return p=v({},r.options,o).repeat,p===r.options.repeat&&r.initMaterial(),t.next=4,r.play();case 4:if(f=t.sent.err,!f){t.next=8;break}return r.resetMaterial(),t.abrupt("return");case 8:if(!p){t.next=13;break}return t.next=11,r.checkRepeat({repeat:p===1/0?-1:p-1});case 11:t.next=14;break;case 13:r.resetMaterial();case 14:case"end":return t.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}()})();var se=I.dp,ue=I.bw,fe=I.F7,ce=I.hC,pe=I.WU;export{se as Bloom,ue as Outline,fe as SSR,ce as Scan,pe as Scan2};