@urpflanze/js
Version:
A library for developers who want to approach to creative coding, artists who want to approach coding and for those who find it fun to play with math.
2 lines • 142 kB
JavaScript
/*! For license information please see urpflanze-light.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Urpflanze=e():t.Urpflanze=e()}(window,(function(){return(()=>{var t={1346:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.log=e.PI2=e.PHI=e.Vec2=e.distributePointsInBuffer=e.prepareBufferForInterpolation=e.interpolate=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.now=e.toRadians=e.toDegrees=e.relativeClamp=e.clamp=e.lerp=void 0,i(r(1378),e),i(r(541),e),i(r(2513),e),i(r(2648),e),i(r(3674),e),i(r(6951),e),i(r(7439),e),i(r(6448),e),i(r(8563),e),i(r(5382),e),i(r(6329),e),i(r(4233),e),i(r(5510),e),i(r(2982),e),i(r(7520),e),i(r(9667),e),i(r(894),e),i(r(5719),e),i(r(1451),e),i(r(3977),e),i(r(9958),e),i(r(9514),e);var a=r(313);Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return a.lerp}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return a.clamp}}),Object.defineProperty(e,"relativeClamp",{enumerable:!0,get:function(){return a.relativeClamp}}),Object.defineProperty(e,"toDegrees",{enumerable:!0,get:function(){return a.toDegrees}}),Object.defineProperty(e,"toRadians",{enumerable:!0,get:function(){return a.toRadians}}),Object.defineProperty(e,"now",{enumerable:!0,get:function(){return a.now}}),Object.defineProperty(e,"noise",{enumerable:!0,get:function(){return a.noise}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return a.random}}),Object.defineProperty(e,"angleFromRepetition",{enumerable:!0,get:function(){return a.angleFromRepetition}}),Object.defineProperty(e,"angle2FromRepetition",{enumerable:!0,get:function(){return a.angle2FromRepetition}}),Object.defineProperty(e,"distanceFromRepetition",{enumerable:!0,get:function(){return a.distanceFromRepetition}}),Object.defineProperty(e,"interpolate",{enumerable:!0,get:function(){return a.interpolate}}),Object.defineProperty(e,"prepareBufferForInterpolation",{enumerable:!0,get:function(){return a.prepareBufferForInterpolation}}),Object.defineProperty(e,"distributePointsInBuffer",{enumerable:!0,get:function(){return a.distributePointsInBuffer}});var o=r(795);Object.defineProperty(e,"Vec2",{enumerable:!0,get:function(){return o.default}});var s=r(3792);Object.defineProperty(e,"PHI",{enumerable:!0,get:function(){return s.PHI}}),Object.defineProperty(e,"PI2",{enumerable:!0,get:function(){return s.PI2}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return s.log}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return s.mod}})},5174:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(9367),e)},9367:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerCanvas=e.Animation=void 0,i(r(1346),e),e.Animation=r(7518);var a=r(2251);Object.defineProperty(e,"DrawerCanvas",{enumerable:!0,get:function(){return a.BrowserDrawerCanvas}})},2894:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UncontrolledLoop=e.Static=e.Loop=e.Compose=e.Simple=e.resolveSimpleAnimation=void 0;const n=r(4825),i=r(2765);function a(t){const e=i.createAnimation(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e.update(n),e.value}}e.resolveSimpleAnimation=a,e.Simple=a,e.Compose=function(t){const e=n.composeAnimations(t);if(e)return t=>{var r;const n="number"==typeof t?t:(null===(r=t.shape.scene)||void 0===r?void 0:r.currentTime)||0;return e(n)}},e.Loop=function(t){const e=t;return void 0===e.interpolator&&(e.interpolator="wave"),e.interpolator&&("string"==typeof e.interpolator?"wave"!==e.interpolator&&(e.direction="alternate"):"object"==typeof e.interpolator&&"wave"!==e.interpolator.type&&(e.direction="alternate")),e.loop=!0,a(e)},e.Static=function(t){const e=t;return e.direction="normal",e.loop=!1,a(e)},e.UncontrolledLoop=function(t){const e=t;return e.direction="normal",e.loop=!0,a(e)}},9727:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=void 0,e.Easings={linear:(t,e,r,n=1)=>r*t/n+e,quadraticIn:(t,e,r,n=1)=>r*(t/=n)*t+e,quadraticOut:(t,e,r,n=1)=>-r*(t/=n)*(t-2)+e,quadraticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e,cubicIn:(t,e,r,n=1)=>r*(t/=n)*t*t+e,cubicOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t+1)+e),cubicInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e,quarticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t+e,quarticOut:(t,e,r,n=1)=>(t/=n,-r*(--t*t*t*t-1)+e),quarticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e,quinticIn:(t,e,r,n=1)=>r*(t/=n)*t*t*t*t+e,quinticOut:(t,e,r,n=1)=>(t/=n,r*(--t*t*t*t*t+1)+e),quinticInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e,sinusoidalIn:(t,e,r,n=1)=>-r*Math.cos(t/n*(Math.PI/2))+r+e,sinusoidalOut:(t,e,r,n=1)=>r*Math.sin(t/n*(Math.PI/2))+e,sinusoidalInOut:(t,e,r,n=1)=>-r/2*(Math.cos(Math.PI*t/n)-1)+e,exponentialIn:(t,e,r,n=1)=>r*Math.pow(2,10*(t/n-1))+e,exponentialOut:(t,e,r,n=1)=>r*(1-Math.pow(2,-10*t/n))+e,exponentialInOut:(t,e,r,n=1)=>(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:(t--,r/2*(2-Math.pow(2,-10*t))+e),circularIn:(t,e,r,n=1)=>(t/=n,-r*(Math.sqrt(1-t*t)-1)+e),circularOut:(t,e,r,n=1)=>(t/=n,t--,r*Math.sqrt(1-t*t)+e),circularInOut:(t,e,r,n=1)=>(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,r/2*(Math.sqrt(1-t*t)+1)+e),elasticIn:(t,e,r,n=1,i=1,a=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)+e},elasticOut:(t,e,r,n=1,i=1,a=.5)=>{if(0===t)return e;if(1==(t/=n))return e+r;a*=n;let o=0;return i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),i*Math.pow(2,-10*t)*Math.sin((t*n-o)*(2*Math.PI)/a)+r+e},elasticInOut:(t,e,r,n=1,i=1,a=.5)=>{if(0===t)return e;if(2==(t/=n/2))return e+r;a*=n;let o=0;return i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)*-.5+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)*.5+r+e},backIn:(t,e,r,n=1,i=1.70158)=>r*(t/=n)*t*((i+1)*t-i)+e,backOut:(t,e,r,n=1,i=1.70158)=>r*((t=t/n-1)*t*((i+1)*t+i)+1)+e,backInOut:(t,e,r,n=1,i=1.70158)=>(t/=n/2)<1?r/2*(t*t*((1+(i*=1.525))*t-i))+e:r/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e,bounceIn:(t,r,n,i=1)=>n-e.Easings.bounceOut(i-t,0,n,i)+r,bounceOut:(t,e,r,n=1)=>(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e,bounceInOut:(t,r,n,i=1)=>t<i/2?.5*e.Easings.bounceIn(2*t,0,n,i)+r:.5*e.Easings.bounceOut(2*t-i,0,n,i)+.5*n+r}},4825:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.composeAnimations=void 0;const n=r(9968),i=r(2765),a=r(8782);function o(t,e,r=.5){const i=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[e],s=[];for(let t=0,e=i.length;t<e;t++){if(typeof i[t]!=typeof o[t])return void console.error("[@urpflanze/animation]: cannot interpolate");if("string"!=typeof i[t]){const e=i[t],n=o[t];s.push(e+r*(n-e))}else{const e=i[t],u=o[t],c=n.parseColorAndConvert(e),h=n.parseColorAndConvert(u);void 0!==c&&void 0!==h&&s.push(a.interpolateColorRGB(c,h,r))}}return 1===s.length?s[0]:s}e.composeAnimations=function(t){const e=t.map(i.createAnimation).filter((t=>void 0!==t)),r=e.length;if(r>0)return t=>{let n;for(let i=0;i<r;i++){const r=e[i];r.update(t),n=void 0===n?r.value:o(n,r.value)}return n}}},2765:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAnimation=void 0;const n=r(9298);e.createAnimation=function(t){const e=n.createInterpolationCallback(t);if(void 0===e)return;const r=t.delay||0,i=t.afterDelay||0,a=t.direction||"normal",o=t.duration||1e3,s="normal"===a||"reverse"===a?o+r:2*o+r+i,u={delay:r,afterDelay:i,direction:a,duration:o,totalDuration:s,loop:"number"==typeof t.loop?t.loop:!!t.loop},c=n.createInterpolator(t.interpolator),h={loop:0,offset:0,loopDuration:s,direction:"alternate"===a?"normal":a,started:!1,ended:!1,value:void 0};return h.update=function(t,e,r,n){const{loop:i,totalDuration:a,delay:o,afterDelay:s,direction:u,duration:c}=e;return h=>{if("number"==typeof i&&h>=a*i||!1===i&&h>=e.totalDuration)return t.started=!1,t.ended=!0,t.offset=r("normal"===u?c:0,c),void(t.value=n(t.offset));if(t.loop=Math.ceil(h/a),h%=a,(h-=o)<=0)return t.started=!1,t.offset=r(0,c),void(t.value=n(t.offset));if(t.started=!0,"alternate"===u)h<=c?(t.direction="normal",t.offset=r(h,c)):(t.direction="reverse",h-=c,(h-=s)>=0?t.offset=1-r(h>=c?c:h,c):t.offset=1);else{const e=r(h>=c?c:h,c);t.offset="normal"===u?e:1-e}t.value=n(t.offset)}}(h,u,c,e),h}},9298:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createInterpolator=e.createInterpolationCallback=void 0;const n=r(9968),i=r(3431),a=r(9727),o=r(8782);e.createInterpolationCallback=function(t){const e=Array.isArray(t.from)?t.from:[t.from],r=Array.isArray(t.to)?t.to:[t.to],i=t.round,a="hue"===t.colorTransitionMode?o.interpolateColorHSL:o.interpolateColorRGB;if(e.length!==r.length)return;const s=[];for(let t=0,o=e.length;t<o;t++){if(typeof e[t]!=typeof r[t])return void console.warn("[@urpflanze/animation]: `from` and `to` values mismatch");if("string"!=typeof e[t]){const n=e[t],a=r[t];s.push(void 0!==i?t=>1===t?a:0===t?n:Math.round((n+t*(a-n))*i)/i:t=>1===t?a:0===t?n:n+t*(a-n))}else{const i=e[t],o=r[t],u=n.parseColorAndConvert(i),c=n.parseColorAndConvert(o);void 0!==u&&void 0!==c&&s.push((t=>1===t?o:0===t?i:a(u,c,t)))}}return t=>{const e=s.map((e=>e(t)));return 1===e.length?e[0]:e}},e.createInterpolator=function(t){var e,r;switch(typeof t){case"function":return(e,r)=>t(e/r,e);case"string":if("wave"===t)return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+1.5*Math.PI);if(t in a.Easings){const e=a.Easings[t];return(t,r)=>e(t,0,1,r)}return(t,e)=>a.Easings.linear(t,0,1,e);case"object":switch(t.type){case"wave":{const r=1.5*Math.PI+((null===(e=t.params)||void 0===e?void 0:e.phase)||0);return(t,e)=>.5+.5*Math.sin(t*Math.PI*2/e+r)}case"elasticIn":case"elasticOut":case"elasticInOut":{const e=a.Easings[t.type],{amplitude:r,period:n}=t.params||{};return(t,i)=>e(t,0,1,i,r,n)}case"backIn":case"backOut":case"backInOut":{const e=a.Easings[t.type],n=(null===(r=t.params)||void 0===r?void 0:r.overshoot)||void 0;return(t,r)=>e(t,0,1,r,n)}case"cubicBezier":{const e=i.default(t.params[0],t.params[1],t.params[2],t.params[3]);return(t,r)=>e(t/r)}}}return(t,e)=>a.Easings.linear(t,0,1,e)}},7518:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5240),e),i(r(8782),e),i(r(2765),e),i(r(9298),e),i(r(9727),e),i(r(2894),e)},5240:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8782:(t,e)=>{"use strict";function r(t,e,r=!0,n="alternate",i=0,a=0){const o="normal"===n||"reverse"===n?e+i:2*e+i+a;return"number"==typeof r&&t>=o*r||!1===r&&t>=o?"normal"===n?e:0:(t%=o,(t-=i)<=0?0:"alternate"===n?t<=e?t:(t-=e,(t-=a)>=0?e-(t>=e?e:t):e):t>=e?e:t)}Object.defineProperty(e,"__esModule",{value:!0}),e.interpolateColorHSL=e.interpolateColorRGB=e.cosp=e.sinp=e.clockOffset=e.clock=void 0,e.clock=r,e.clockOffset=function(t,e,n=!0,i="alternate",a=0,o=0){return r(t,e,n,i,a,o)/e};const n=2*Math.PI;e.sinp=function(t,e,r=0,i=!1){const a=Math.sin(t*n/e+r);return i?.5+.5*a:a},e.cosp=function(t,e,r=0,i=!1){const a=Math.cos(t*n/e+r);return i?.5+.5*a:a},e.interpolateColorRGB=function(t,e,r){const n=t.r+r*(e.r-t.r),i=t.g+r*(e.g-t.g),a=t.b+r*(e.b-t.b),o=t.alpha+r*(e.alpha-t.alpha);return`rgba(${Math.floor(n)},${Math.floor(i)},${Math.floor(a)},${o})`},e.interpolateColorHSL=function(t,e,r){return`hsla(${t.h+r*(e.h-t.h)},${t.s+r*(e.s-t.s)}%,${t.l+r*(e.l-t.l)}%,${t.alpha+r*(e.alpha-t.alpha)})`}},9968:t=>{var e;window,e=function(){return(()=>{"use strict";var t=[function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(1),e),i(r(2),e),i(r(3),e)},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgbToHsl=e.hslToRgb=e.rgbToHex=void 0,e.rgbToHex=function(t,e,r){return`#${((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}`},e.hslToRgb=function(t,e,r){let n,i,a;if(t/=360,r/=100,0==(e/=100))n=i=a=r;else{const o=(t,e,r)=>(r+=r<0?1:r>1?-1:0)<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=o(u,s,t+1/3),i=o(u,s,t),a=o(u,s,t-1/3)}return[.5+255*n<<0,.5+255*i<<0,.5+255*a<<0]},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;const n=Math.max(t,e,r),i=Math.min(t,e,r),a=(n+i)/2;let o,s;if(n===i)o=s=0;else{const u=n-i;switch(s=a>.5?u/(2-n-i):u/(n+i),n){case t:o=(e-r)/u+(e<r?6:0);break;case e:o=(r-t)/u+2;break;case r:o=(t-e)/u+4}o/=6}return[.5+360*o<<0,.5+100*s<<0,.5+100*a<<0]}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.parseColorAndConvert=void 0;const n=r(4),i=r(2);function a(t){if("number"==typeof t)return t>16777215?{type:"rgb",a:t>>24&255,b:t>>16&255,c:t>>8&255,alpha:(255&t)/255}:{type:"rgb",a:t>>16&255,b:t>>8&255,c:255&t,alpha:1};t=t.replace(/\s/g,""),n.default[t]&&(t=n.default[t]);let e=/^#([0-9a-f]{3,8})$/i.exec(t);if(e){const t=e[1];return 3===t.length?{type:"rgb",a:parseInt(t[0]+t[0],16),b:parseInt(t[1]+t[1],16),c:parseInt(t[2]+t[2],16),alpha:1}:{type:"rgb",a:parseInt(t[0]+t[1],16),b:parseInt(t[2]+t[3],16),c:parseInt(t[4]+t[5],16),alpha:t.length>6?parseInt(t.substring(6),16)/255:1}}if(e=/^((hsl|rgb)a?)\((\d+),(\d+)%?,(\d+)%?,?(.+)?\)$/i.exec(t),e){const[,,t,r,n,i,a]=e;return{type:t,a:+r,b:+n,c:+i,alpha:a?+a:1}}}e.parseColorAndConvert=function(t){const e=a(t);if(e){if("hsl"===e.type){const[t,r,n]=i.hslToRgb(e.a,e.b,e.c);return{r:t,g:r,b:n,h:e.a,s:e.b,l:e.c,alpha:e.alpha}}{const[t,r,n]=i.rgbToHsl(e.a,e.b,e.c);return{h:t,s:r,l:n,r:e.a,g:e.b,b:e.c,alpha:e.alpha}}}},e.parseColor=a},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}],e={},r=function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}(0);return r})()},t.exports=e()},2513:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;const n=r(1378),i=r(541),a=r(2648),o=r(5511);class s extends i.SceneChild{constructor(t={}){t.type="Group",super(t),this.children=[],["id","name","data","order","type"].forEach((e=>{e in t&&delete t[e]})),this.props=t}isStatic(){const t=this.children;for(let e=0,r=t.length;e<r;e++)if(!t[e].isStatic())return!1;return!0}isStaticIndexed(){const t=this.children;for(let e=0,r=t.length;e<r;e++)if(!t[e].isStaticIndexed())return!1;return!0}add(...t){for(let e=0,r=t.length;e<r;e++){const r=t[e],i=r.getProps();Object.keys(this.props).forEach((t=>{void 0===i[t]&&r.setProp(t,this.props[t])})),r.order=void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,this.scene&&n.Scene.propagateToChilden(r,this.scene),this.children.push(r)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t))),this.clearBuffer(!0)}getChildren(){return this.children}find(t){if(this.id===t||this.name===t)return this;const e=this.getChildren();for(let r=0,n=e.length;r<n;r++){const n=e[r].find(t);if(null!==n)return n}return null}get(t){return t>=0&&t<this.children.length?this.children[t]:null}remove(t){if(t>=0&&t<this.children.length){const e=this.children.splice(t,1);return this.clearBuffer(!0),e}return!1}removeFromId(t){for(let e=0,r=this.children.length;e<r;e++)if(this.children[e].id==t)return this.children.splice(e,1),this.clearBuffer(!0)}generate(t,e=!1,r){this.generateId=t,this.children.forEach((n=>n.generate(t,e,r)))}getBounding(){const t=[],e=o.Bounding.empty();if(this.children.length>0){this.children.forEach((e=>t.push(e.getBounding())));for(let r=0,n=this.children.length;r<n;r++)e.x=e.x>t[r].x?t[r].x:e.x,e.y=e.y>t[r].y?t[r].y:e.y,e.width=e.width<t[r].width?t[r].width:e.width,e.height=e.height<t[r].height?t[r].height:e.height;e.cx=e.x+e.width/2,e.cy=e.y+e.height/2}return e}clearBuffer(t=!1,e=!0){if(this.children.forEach((e=>e.clearBuffer(t,!1))),this.scene&&e){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}setProp(t,e){"object"==typeof t?Object.keys(t).forEach((e=>this.props[e]=t[e])):this.props[t]=e,this.children.forEach((r=>r.setProp(t,e)))}setPropUnsafe(t,e){super.setPropUnsafe(t,e),this.children.forEach((r=>r.setPropUnsafe(t,e)))}getBufferLength(t){return this.children.map((e=>e.getBufferLength(t))).reduce(((t,e)=>t+e),0)}getBuffer(){const t=this.children.map((t=>t.getBuffer())).filter((t=>void 0!==t)),e=t.reduce(((t,e)=>t+e.length),0);if(e>0){const r=new Float32Array(e);r.set(t[0],0);for(let e=1,n=0,i=t.length;e<i;e++)n+=t[e-1].length,r.set(t[e],n);return r}return a.ShapeBase.EMPTY_BUFFER}getIndexedBuffer(){const t=this.children.map((t=>t.getIndexedBuffer())).filter((t=>void 0!==t));return[].concat.apply([],t)}stream(t){this.children.forEach((e=>e.stream(t)))}}e.Group=s},1378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scene=void 0;const n=r(541),i=r(2513),a=r(6448),o=r(313);class s{constructor(t={}){this.width=400,this.height=400,this.background="hsla(0, 0%, 0%, 1)",this.color="hsla(0, 0%, 100%, 1)",this.currentTime=0,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!==t.background&&(this.background=t.background),void 0!==t.color&&(this.color=t.color),this.children=[],this.anchorSettings=t.anchor,this.setSize(t.width||this.width,t.height||this.height,t.anchor)}setSize(t,e,r){this.width=t,this.height=e,this.center=[this.width/2,this.height/2],this.anchor=r&&Array.isArray(r)?["number"==typeof r[0]?(.5+.5*o.clamp(-1,1,r[0]))*this.width:"left"===r[0]?0:"right"===r[0]?this.width:this.center[0],"number"==typeof r[1]?(.5+.5*o.clamp(-1,1,r[1]))*this.height:"top"===r[1]?0:"bottom"===r[1]?this.height:this.center[1]]:[this.center[0],this.center[1]]}getWidth(t=100){return this.width*t/100}getHeight(t=100){return this.height*t/100}resize(t,e=t){this.setSize(t,e,this.anchorSettings),this.children.forEach((t=>t.clearBuffer(!0,!1)))}update(t=0){this.currentTime=t;for(let t=0,e=this.children.length;t<e;t++)this.children[t].generate(this.currentTime,!0)}stream(t){this.children.forEach((e=>e.stream(t)))}getChildren(){return this.children}add(...t){const e="number"==typeof t[t.length-1]?t[t.length-1]:void 0,r=t.length-(void 0===e?0:1);for(let n=0;n<r;n++){const r=t[n];r.order=void 0!==e?e+n:void 0!==r.order?r.order:this.children.length>0?Math.max.apply(this,this.children.map((t=>t.order||0)))+1:0,s.propagateToChilden(r,this),this.children.push(r),r.clearBuffer(!0,!1),r.generate(0,!0)}this.sortChildren()}sortChildren(){this.children.sort(((t,e)=>t.order-e.order)),this.children=this.children.map(((t,e)=>(t.order=e,t)))}find(t){const e=this.getChildren();for(let r=0,n=e.length;r<n;r++){const n=e[r].find(t);if(null!==n)return n}return null}get(t){return t>=0&&t<this.children.length?this.children[t]:null}remove(t){t>=0&&t<this.children.length&&this.children.splice(t,1)}removeChildren(){this.children=[]}removeFromId(t){for(let e=0,r=this.children.length;e<r;e++)if(this.children[e].id===t||this.children[e].name===t)return void this.children.splice(e,1)}isFirstLevelChild(t){for(let e=0,r=this.children.length;e<r;e++)if(this.children[e].id===t.id)return!0;const e=this.getParentsOfSceneChild(t);return 1===e.length&&e[0]instanceof i.Group}getParentsOfSceneChild(t){const e=s.getParentsOfSceneChild(this,t);return e?(e.splice(0,1),e):[]}static getParentsOfSceneChild(t,e,r=[]){let o;if(t instanceof n.SceneChild){if(t.id==e.id)return r;if(t instanceof a.Shape&&t.shape){const n=r.slice();if(n.push(t),o=s.getParentsOfSceneChild(t.shape,e,n))return o}}if(t instanceof s||t instanceof i.Group){const n=t.getChildren();r.push(t);for(let t=0,i=n.length;t<i;t++){const i=n[t];if(o=s.getParentsOfSceneChild(i,e,r))return o}r.pop()}return null}static walk(t,e){if(e instanceof n.SceneChild){if(!1===t(e))return!1;if(e instanceof a.Shape&&e.shape&&!1===s.walk(t,e.shape))return!1}if(e instanceof s||e instanceof i.Group){const r=e.getChildren();for(let e=0,n=r.length;e<n;e++){const n=r[e];if(!1===s.walk(t,n))return!1}}}static propagateToChilden(t,e){t.scene=e,t instanceof i.Group?t.getChildren().forEach((t=>{s.propagateToChilden(t,e)})):t instanceof a.Shape&&t.shape&&(t.shape.scene=e,s.propagateToChilden(t.shape,e))}}e.Scene=s},541:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SceneChild=void 0;let r=0;e.SceneChild=class{constructor(t){var e;this.generateId=-1,this.id=null!==(e=t.id)&&void 0!==e?e:++r,this.type=t.type||"SceneChild",this.name=t.name||this.type+"_"+this.id,this.data=t.data||{},this.props={}}find(t){return this.id===t||this.name===t?this:null}getProps(){return this.props}getProp(t,e,r){var n;return null!==(n=this.props[t])&&void 0!==n?n:r}hasProp(t){return void 0!==this.props[t]}setPropUnsafe(t,e){"string"==typeof t?this.props[t]=e:Object.keys(t).forEach((e=>this.props[e]=t[e]))}}},313:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interpolate=e.prepareBufferForInterpolation=e.distributePointsInBuffer=e.distanceFromRepetition=e.angle2FromRepetition=e.angleFromRepetition=e.random=e.noise=e.relativeClamp=e.clamp=e.lerp=e.toRadians=e.toDegrees=e.now=void 0;const n=r(21),i=r(2769),a=r(795),o="undefined"!=typeof performance?performance:Date;function s(t,e,r){return r<=t?t:r>=e?e:r}e.now=function(){return o.now()},e.toDegrees=function(t){return 180*t/Math.PI},e.toRadians=function(t){return t*Math.PI/180},e.lerp=function(t,e,r){return(1-r)*t+r*e},e.clamp=s,e.relativeClamp=function(t,e,r,n,i){return s(n,i,(r-t)/(e-t)*(i-n)+n)};const u={random:new n(Math.random)};e.noise=function(t="random",e=0,r=0,i=0,a=-1,o=1){void 0===u[t]&&(u[t]=new n(t));const s=u[t].noise3D(e,r,i);return-1!==a||1!==o?(.5+.5*s)*(o-a)+a:s};const c={};function h(t,e){const r=t.length,n=r/2,i=2*(n+e),a=n-1;if(a>1){const n=r-2,o=Math.floor(e/a);let s=(i-(r+o*n))/2;const u=Math.round(a/s),c=new Float32Array(i);for(let e=0,r=0,i=0;e<n;e+=2,r++,i+=2){const a=t[e],h=t[e+1],l=t[e+2],f=t[e+3];c[i]=a,c[i+1]=h;const d=s>0&&(r%u==0||e===n-2),p=o+(d?1:0),g=1/(p+1);for(let t=0;t<p;t++,i+=2){const e=g*(t+1);c[i+2]=(1-e)*a+e*l,c[i+3]=(1-e)*h+e*f}d&&s--}return c[i-2]=t[r-2],c[i-1]=t[r-1],c}const o=new Float32Array(i);for(let e=0;e<i;e+=2)o[e]=t[e%r],o[e+1]=t[(e+1)%r];return o}function l(t,e){const r=t.length,n=e.length;if(r===n)return[t,e];const i=Math.abs(r-n),a=r<n?e:t,o=h(r<n?t:e,Math.floor(i/2));return r>n?[a,o]:[o,a]}e.random=function(t,e=0,r=1,n){const i=t+"";if(void 0===c[i]){const t=function(t){let e=0,r=1779033703^t.length;for(;e<t.length;e++)r=Math.imul(r^t.charCodeAt(e),3432918353),r=r<<13|r>>>19;return function(){return r=Math.imul(r^r>>>16,2246822507),r=Math.imul(r^r>>>13,3266489909),(r^=r>>>16)>>>0}}(i);c[i]=(a=t(),o=t(),s=t(),u=t(),function(){let t=(a>>>=0)+(o>>>=0)|0;return a=o^o>>>9,o=(s>>>=0)+(s<<3)|0,t=t+(u=1+(u>>>=0)|0)|0,s=(s=s<<21|s>>>11)+t|0,(t>>>0)/4294967296})}var a,o,s,u;const h=e+c[i]()*(r-e);return void 0!==n?Math.round(h*10**n)/10**n:h},e.angleFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan(i/n)}return(t.angle-Math.PI)/2},e.angle2FromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[(t.col.count-1)/2,(t.row.count-1)/2];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=t.col.index-1-r[0],i=t.row.index-1-r[1];return 0===n?0:Math.atan2(i,n)}return t.angle-Math.PI},e.distanceFromRepetition=function(t,e=[0,0]){if(t.type===i.ERepetitionType.Matrix){const r=[.5,.5];r[0]+=r[0]*e[0],r[1]+=r[1]*e[1];const n=[t.col.offset,t.row.offset];return a.default.distance(n,r)}return 1},e.distributePointsInBuffer=h,e.prepareBufferForInterpolation=l,e.interpolate=function(t,e,r=.5){const[n,i]=l(t,e),a=Math.max(n.length,i.length),o="number"==typeof r?[r]:r,s=a/2;if(o.length!==s){const t=o.length;for(let e=0;e<s;e++)o[e]=o[e%t]}const u=new Float32Array(a);for(let t=0,e=0;t<a;t+=2,e++)u[t]=(1-o[e])*n[t]+o[e]*i[t],u[t+1]=(1-o[e])*n[t+1]+o[e]*i[t+1];return u}},795:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=new Array(4),n={from:(t=0,e)=>{const r=new Array(2);return"number"==typeof t?(r[0]=t,r[1]=null!=e?e:t):(r[0]=t[0],r[1]=t[1]),r},normalize:t=>{const e=n.length(t);return 0!==e?[t[0]/e,t[1]/e]:[0,0]},distance:(t,e)=>Math.hypot(t[0]-e[0],t[1]-e[1]),dot:(t,e)=>t[0]*e[0]+t[1]*e[1],length:t=>Math.hypot(t[0],t[1]),angle:(t,e)=>(t=n.normalize(t),e=n.normalize(e),Math.acos(n.dot(t,e))),skewX:(t,e)=>{t[0]+=Math.tan(e)*t[1]},skewY:(t,e)=>{t[1]+=Math.tan(e)*t[0]},squeezeX:(t,e)=>{t[1]+=t[1]*(t[0]*-e)},squeezeY:(t,e)=>{t[0]+=t[0]*(t[1]*e)},rotate:(t,e,r)=>{const n=t[0]-r[0],i=t[1]-r[1];t[0]=n*e[0]+i*e[1]+r[0],t[1]=n*e[2]+i*e[3]+r[1]},rotateX:(t,e,i)=>{r[0]=1,r[1]=0,r[2]=0,r[3]=Math.cos(i),n.rotate(t,r,e)},rotateY:(t,e,i)=>{r[0]=Math.cos(i),r[1]=0,r[2]=0,r[3]=1,n.rotate(t,r,e)},rotateZ:(t,e,i)=>{r[0]=Math.cos(i),r[1]=-Math.sin(i),r[2]=Math.sin(i),r[3]=Math.cos(i),n.rotate(t,r,e)},translate:(t,e)=>{t[0]+=e[0],t[1]+=e[1]},scale:(t,e)=>{t[0]*=e[0],t[1]*=e[1]},divide:(t,e)=>{t[0]/=e[0],t[1]/=e[1]},toString:t=>`x: ${t[0]}, y: ${t[1]}`,ZERO:Array.from([0,0]),ONE:Array.from([1,1])};e.default=n},8721:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toVec3=e.toVec2=e.fromSkew=e.VEC2_ONE=e.VEC2_ZERO=e.VEC3_ONE=e.VEC3_ZERO=void 0;const n=r(887);e.VEC3_ZERO=[0,0,0],e.VEC3_ONE=[1,1,1],e.VEC2_ZERO=[0,0],e.VEC2_ONE=[1,1],n.glMatrix.setMatrixArrayType(Array),e.fromSkew=function(t,e){return t[0]=1,t[1]=Math.tan(e[1]),t[2]=0,t[3]=0,t[4]=Math.tan(e[0]),t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.toVec2=function(t){return Array.isArray(t)?[t[0],t[1]]:[t,t]},e.toVec3=function(t,e=0){return Array.isArray(t)?[t[0],t[1],e]:[t,t,e]}},3792:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mod=e.PHI=e.PI2=e.log=void 0,e.log=(t,e)=>Math.log(t)/Math.log(e),e.PI2=2*Math.PI,e.PHI=(1+Math.sqrt(5))/2,e.mod=(t,e)=>{const r=t%e;return r<0?r+e:r}},5511:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Adapt=e.Bounding=e.EAdaptMode=void 0;const n=r(9958);var i;!function(t){t[t.None=0]="None",t[t.Scale=2]="Scale",t[t.Center=4]="Center",t[t.Fill=8]="Fill"}(i=e.EAdaptMode||(e.EAdaptMode={})),e.Bounding={empty:()=>({cx:0,cy:0,x:-1,y:-1,width:2,height:2}),clear:t=>{t[0]=void 0,t[1]=void 0,t[2]=void 0,t[3]=void 0},add:(t,e,r)=>{(void 0===t[0]||e<t[0])&&(t[0]=e),(void 0===t[2]||e>t[2])&&(t[2]=e),(void 0===t[1]||r<t[1])&&(t[1]=r),(void 0===t[3]||r>t[3])&&(t[3]=r)},sum:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?void 0===t[0]||void 0===t[1]||void 0===t[2]||void 0===t[3]?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):(t[0]<e[0]&&(t[0]=e[0]),t[2]>e[2]&&(t[2]=e[2]),t[1]<e[1]&&(t[1]=e[1]),t[3]>e[3]&&(t[3]=e[3])):console.warn("[Urplfanze:Bounding] cannot sum bounding")},bind:(t,e)=>{void 0!==e[0]&&void 0!==e[1]&&void 0!==e[2]&&void 0!==e[3]?(t.x=e[0],t.y=e[1],t.width=e[2]-e[0],t.height=e[3]-e[1],t.cx=t.x+t.width/2,t.cy=t.y+t.height/2):console.warn("[Urplfanze:Bounding] cannot bind bounding")}};class a extends n.Modifier{constructor(t){super(),this.mode=t.mode||i.Fill,this.rect=t.rect}apply(t,e){return a.adapt(t,this.mode,this.rect)}static adapt(t,e,r){if(e===i.None)return Float32Array.from(t);const n=new Float32Array(t.length);r||(r=a.getBounding(t));const o=r.width>=2||r.height>=2||e>=i.Fill&&(r.width<2||r.height<2)?2/Math.max(r.width,r.height):1,s=e>=i.Center?r.cx:0,u=e>=i.Center?r.cy:0;for(let e=0,r=t.length;e<r;e+=2)n[e]=(t[e]-s)*o,n[e+1]=(t[e+1]-u)*o;return n}static getBounding(t,r){void 0===r&&(r=e.Bounding.empty());const n=[void 0,void 0,void 0,void 0];for(let r=0,i=t.length;r<i;r+=2)e.Bounding.add(n,t[r],t[r+1]);return e.Bounding.bind(r,n),r}}e.Adapt=a,a.MODES=i},8301:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;const n=r(9958);class i extends n.Modifier{constructor(){super()}apply(t,e,r){return i.call(t)}static call(t){const e=t.length;if(i.isClosed(t))return t;const r=new Float32Array(e+2);return r.set(t,0),r[e]=r[0],r[e+1]=r[1],r}static isClosed(t){const e=t.length;return t[0]===t[e-2]&&t[1]===t[e-1]}}e.Close=i},1740:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mirror=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={x:!0,y:!0}){super(),this.x=!0===t.x,this.y=!0===t.y}apply(t,e){const r=t.length,n=new Float32Array(r*(this.x?2:1)*(this.y?2:1));if(this.x&&this.y){const e=r+r,i=e+r;for(let a=0;a<r;a+=2)n[a]=t[a]-1,n[a+1]=t[a+1]-1,n[r+a]=-1*t[r-2-a]+1,n[r+a+1]=t[r-2-a+1]-1,n[e+a]=-1*t[a]+1,n[e+a+1]=-1*t[a+1]+1,n[i+a]=t[r-2-a]-1,n[i+a+1]=-1*t[r-2-a+1]+1}else if(this.x)for(let e=0;e<r;e+=2)n[e]=t[e]-1,n[e+1]=t[e+1],n[r+e]=-1*t[r-2-e]+1,n[r+e+1]=t[r-2-e+1];else{if(!this.y)return t;for(let e=0;e<r;e+=2)n[e]=t[e],n[e+1]=t[e+1]-1,n[r+e]=t[r-2-e],n[r+e+1]=-1*t[r-2-e+1]+1}return n}}e.Mirror=i},9958:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifier=void 0,e.Modifier=class{}},3315:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Offset=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={from:0,to:void 0}){super(),this.from=t.from,this.to=t.to}apply(t,e){return t.subarray(this.from,this.to?this.to<0?t.length+this.to:this.to:void 0)}}e.Offset=i},4660:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Smooth=void 0;const n=r(313),i=r(8301),a=r(9958);class o extends a.Modifier{constructor(t={}){super(),this.level=t.level||1;const e=Array.isArray(t.tension)?t.tension:[t.tension];this.tension=new Array(this.level).fill(.5).map(((t,r)=>n.clamp(0,1,e[r]||t))),this.level=this.level<1?1:this.level,this.closed=!0===t.closed}apply(t,e){if(e&&!i.Close.isClosed(t)){const e=t.length,r=new Float32Array(e+2);r.set(t,0),r[e]=t[0],r[e+1]=t[1],t=r}let r=t;for(let t=0,n=this.level;t<n;t++)r=o.smooth(r,this.tension[t],e||this.closed);return r}static smooth(t,e=.5,r=!1){const n=t.length,i=new Float32Array(2*(t.length-(r?1:0)));r||(i[0]=t[0],i[1]=t[1]);const a=.05+.4*e,o=1-a;let s=r?0:2;for(let e=0,r=n-2;e<r;e+=2,s+=4)i[s]=o*t[e]+a*t[e+2],i[s+1]=o*t[e+1]+a*t[e+3],i[s+2]=a*t[e]+o*t[e+2],i[s+3]=a*t[e+1]+o*t[e+3];return r?(i[s]=i[0],i[s+1]=i[1]):(i[s]=t[n-2],i[s+1]=t[n-1]),i}}e.Smooth=o},5838:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solidify=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.closed=!0===t.closed,this.thickness=t.thickness||.2,this.error=t.error}apply(t,e){return i.solidify(t,this.thickness,this.closed,this.error)}static solidify(t,e,r=!1,n){const a=[],o=(e="number"==typeof e?[e]:e).length;let s,u,c=[[0,0],[0,0]],h=[[0,0],[0,0]];for(let r=0,l=0,f=t.length-2;r<f;r+=2,l++){s=0===r,u=r===f-2;const d={index:r+1,offset:r/f,count:f},p={index:r+2,offset:(r+1)/f,count:f},g="function"==typeof e?e(d):e[l%o],m="function"==typeof e?e(p):e[(l+1)%o],v=i.getOffsets(t[r],t[r+1],t[r+2],t[r+3],g),M=i.getOffsets(t[r],t[r+1],t[r+2],t[r+3],m),b=[t[r]+v[0],t[r+1]+v[1]],y=[t[r+2]+M[0],t[r+3]+M[1]],x=[t[r]-v[0],t[r+1]-v[1]],w=[t[r+2]-M[0],t[r+3]-M[1]];if(!s){const t=i.getIntersection(c[0],c[1],b,y,n);t&&(a.unshift(t[1]),a.unshift(t[0]));const e=i.getIntersection(h[0],h[1],x,w,n);e&&(a.push(e[0]),a.push(e[1]))}s&&(a.unshift(b[1]),a.unshift(b[0]),a.push(x[0]),a.push(x[1])),u&&(a.unshift(y[1]),a.unshift(y[0]),a.push(w[0]),a.push(w[1])),u||(c=[b,y],h=[x,w])}if(r){const e=t.length-2,r=a.length-2,n=.5*a[0]+.5*a[e],i=.5*a[1]+.5*a[e+1],o=.5*a[e+2]+.5*a[r],s=.5*a[e+3]+.5*a[r+1];a[0]=n,a[1]=i,a[e]=n,a[e+1]=i,a[e+2]=o,a[e+3]=s,a[r]=o,a[r+1]=s}return Float32Array.from(a)}static getOffsets(t,e,r,n,i){const a=r-t,o=n-e,s=i/(2*Math.sqrt(a*a+o*o));return[-s*o,s*a]}static getIntersection(t,e,r,n,i=1e-5){const a=(e[1]-t[1])/(e[0]-t[0]),o=(n[1]-r[1])/(n[0]-r[0]);if(Math.abs(a-o)<i)return;const s=t[1]-a*t[0],u=(s-(r[1]-o*r[0]))/(o-a);return[u,a*u+s]}}e.Solidify=i},5588:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Subdivide=void 0;const n=r(9958);class i extends n.Modifier{constructor(t={}){super(),this.level=t.level||1,this.level=this.level<1?1:this.level}apply(t,e){const r=this.level;let n=t;if(n&&n.length>0)for(let t=0;t<r;t++)n=i.subdivide(n,e);return n}static subdivide(t,e=!1){const r=t.length,n=new Float32Array(2*r-(e?0:2));for(let e=0;e<r;e+=2)if(0===e)n[0]=t[0],n[1]=t[1];else{const r=t[e-2],i=t[e-1],a=t[e],o=t[e+1],s=(a+r)/2,u=(o+i)/2;n[2*(e-1)]=s,n[2*(e-1)+1]=u,n[2*e]=a,n[2*e+1]=o}return e&&(n[2*(r-1)]=(t[0]+t[r-2])/2,n[2*(r-1)+1]=(t[1]+t[r-1])/2),n}}e.Subdivide=i},9514:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Modifiers=void 0;const n=r(5511),i=r(1740),a=r(4660),o=r(5838),s=r(5588),u=r(8301),c=r(3315),h={Adapt:n.Adapt,Mirror:i.Mirror,Smooth:a.Smooth,Solidify:o.Solidify,Subdivide:s.Subdivide,Close:u.Close,Offset:c.Offset};e.Modifiers=h},6448:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=void 0;const n=r(1378),i=r(541),a=r(2648);class o extends a.ShapeBase{constructor(t){t.type=t.type||"Shape",super(t),t.shape instanceof i.SceneChild?this.shape=t.shape:console.warn("[Urpflanze:Shape] requires the 'shape' property to be instance of SceneChild,\nYou passed:",t.shape),this.shapeUseParent=!!t.shapeUseParent,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return super.isStatic()&&(!this.shape||this.shape.isStatic())}isStaticIndexed(){return super.isStaticIndexed()&&(!this.shape||this.shape.isStaticIndexed())}find(t){return this.id===t||this.name===t?this:this.shape?this.shape.find(t):null}getBufferLength(t){return this.bStatic&&this.buffer&&this.buffer.length>0?this.buffer.length:(this.shape?this.shape.getBufferLength(t):0)*this.getRepetitionCount()}generateBuffer(t,e){return this.shape?((this.shapeUseParent||this.shape.generateId!==t)&&(this.shapeUseParent&&this.shape.clearBuffer(!0,!1),this.shape.generate(t,!1,e)),this.shape.getBuffer()):o.EMPTY_BUFFER}getShapeBounding(){return this.shape?this.shape.getBounding():this.bounding}addIndex(t,e,r){if(this.shape){const n=this.shape.getIndexedBuffer()||[],i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{index:e.row.index,count:e.row.count,offset:e.row.offset},col:{index:e.col.index,count:e.col.count,offset:e.col.offset}}};for(let t=0,e=n.length;t<e;t++){const e={...n[t]},r=e.parent?o.setIndexedParent(e.parent,i):i;this.indexedBuffer.push({...e,parent:r})}}}static setIndexedParent(t,e){const r={...t};return r.parent=t.parent?o.setIndexedParent(t.parent,e):e,r}setShape(t){void 0===t?(this.shape=void 0,this.clearBuffer(!0,!0)):(this.scene&&n.Scene.propagateToChilden(t,this.scene),this.shape=t,this.shape.clearBuffer(!0,!0))}}e.Shape=o},2648:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBase=void 0;const n=r(887),i=r(3757),a=r(8721),o=r(795),s=r(3792),u=r(5511),c=r(313),h=r(541),l=n.mat4.create(),f=n.mat4.create(),d=n.mat4.create(),p=n.mat4.create();class g extends h.SceneChild{constructor(t={}){super(t),this.bIndexed=!1,this.indexedBuffer=[],this.bounding={cx:0,cy:0,x:-1,y:-1,width:2,height:2},this.props={distance:t.distance,repetitions:t.repetitions,rotateX:t.rotateX,rotateY:t.rotateY,rotateZ:t.rotateZ,skewX:t.skewX,skewY:t.skewY,squeezeX:t.squeezeX,squeezeY:t.squeezeY,displace:t.displace,translate:t.translate,scale:t.scale,transformOrigin:t.transformOrigin,perspective:t.perspective,perspectiveOrigin:t.perspectiveOrigin},this.anchor=t.anchor&&Array.isArray(t.anchor)?["number"==typeof t.anchor[0]?-1*c.clamp(-1,1,t.anchor[0]):"left"===t.anchor[0]?1:"right"===t.anchor[0]?-1:0,"number"==typeof t.anchor[1]?-1*c.clamp(-1,1,t.anchor[1]):"top"===t.anchor[1]?1:"bottom"===t.anchor[1]?-1:0]:[0,0],this.boundingType="string"==typeof t.boundingType?"relative"===t.boundingType?i.EBoundingType.Relative:i.EBoundingType.Fixed:t.boundingType||i.EBoundingType.Fixed,this.vertexCallback=t.vertexCallback}isStatic(){const t=this.props;return"function"!=typeof t.repetitions&&"function"!=typeof t.distance&&"function"!=typeof t.displace&&"function"!=typeof t.scale&&"function"!=typeof t.translate&&"function"!=typeof t.skewX&&"function"!=typeof t.skewY&&"function"!=typeof t.squeezeX&&"function"!=typeof t.squeezeY&&"function"!=typeof t.rotateX&&"function"!=typeof t.rotateY&&"function"!=typeof t.rotateZ&&"function"!=typeof t.transformOrigin&&"function"!=typeof t.perspective&&"function"!=typeof t.perspectiveOrigin}isStaticIndexed(){return"function"!=typeof this.props.repetitions}getProp(t,e,r){let n=this.props[t];return"function"==typeof n&&(n=n(e)),void 0===n||Number.isNaN(n)?r:n}setProp(t,e,r=!1){"string"==typeof t?(r=r||"repetitions"==t,this.props[t]=e):(r=r||"repetitions"in t,Object.keys(t).forEach((e=>this.props[e]=t[e]))),this.clearBuffer(r,!0)}clearBuffer(t=!1,e=!0){if(this.buffer=void 0,t&&(this.bIndexed=!1,this.indexedBuffer=[]),this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),e&&this.scene&&!this.scene.isFirstLevelChild(this)){const r=this.scene.getParentsOfSceneChild(this);r.length>0&&r[r.length-1].clearBuffer(t,e)}}generate(t=0,e=!1,r){var h,m;if(this.buffer&&this.bStatic)return;this.generateId=t,this.bStaticIndexed&&this.bIndexed||(this.indexedBuffer=[]);const v=g.getEmptyPropArguments(this,r),M=v.repetition,b=this.getProp("repetitions",v,1),y=Array.isArray(b)?i.ERepetitionType.Matrix:i.ERepetitionType.Ring,x=Array.isArray(b)?b[0]*(null!==(h=b[1])&&void 0!==h?h:b[0]):b,w=Array.isArray(b)?b[0]:x,S=Array.isArray(b)?null!==(m=b[1])&&void 0!==m?m:b[0]:1,P=M.row;P.count=w;const _=M.col;_.count=S,M.count=x,M.col.count=S,M.row.count=w,M.type=y;let O=0;const I=[];let B=0;const A=n.vec2.fromValues((S-1)/2,(w-1)/2),C=this.scene?[this.scene.anchor[0],this.scene.anchor[1],0]:[0,0,0],E=[void 0,void 0,void 0,void 0],R=[void 0,void 0,void 0,void 0];for(let r=0;r<w;r++)for(let h=0;h<S;h++,B++){M.index=B+1,M.offset=x>1?B/(x-1):1,M.angle=y===i.ERepetitionType.Ring?s.PI2/x*B:0,_.index=h+1,_.offset=S>1?h/(S-1):1,P.index=r+1,P.offset=w>1?r/(w-1):1;const g=this.generateBuffer(t,v),m=g.length,b=this.getShapeBounding();I[B]=new Float32Array(m),O+=m;{const t=a.toVec2(this.getProp("distance",v,a.VEC2_ZERO)),s=this.getProp("displace",v,0),x=a.toVec3(this.getProp("scale",v,a.VEC2_ONE),1),w=a.toVec3(this.getProp("translate",v,a.VEC2_ZERO),0),S=this.getProp("skewX",v,0),P=this.getProp("skewY",v,0),_=this.getProp("squeezeX",v,0),O=this.getProp("squeezeY",v,0),F=this.getProp("rotateX",v,0),k=this.getProp("rotateY",v,0),q=this.getProp("rotateZ",v,0),L=c.clamp(0,1,this.getProp("perspective",v,0)),T=a.toVec3(this.getProp("perspectiveOrigin",v,a.VEC2_ZERO),0),j=a.toVec3(this.getProp("transformOrigin",v,a.VEC2_ZERO),0);let D;switch(y){case i.ERepetitionType.Ring:D=n.vec3.fromValues(t[0],0,0),n.vec3.rotateZ(D,D,a.VEC3_ZERO,M.angle+s);break;case i.ERepetitionType.Matrix:D=n.vec3.fromValues(t[1]*(h-A[0]),t[0]*(r-A[1]),0)}const z=L>0?Math.max(b.width,b.height)/2:1,V=L>0?z+10*z*(1-L):0,U=this.boundingType!==i.EBoundingType.Relative||0!==b.cx||0!==b.cy||0!==L||0!==j[0]||0!==j[1],Y=0!==T[0]||0!==T[1];U&&(this.boundingType===i.EBoundingType.Relative?(j[0]=j[0]*(b.width/2)+b.cx,j[1]=j[1]*(b.height/2)+b.cy):(j[0]*=b.width/2,j[1]*=b.height/2),j[2]=V);{n.mat4.identity(f),U&&n.mat4.translate(f,f,j),0===w[0]&&0===w[1]||n.mat4.translate(f,f,w),0===S&&0===P||(a.fromSkew(l,[S,P]),n.mat4.multiply(f,f,l)),0!==F&&n.mat4.rotateX(f,f,F),0!==k&&n.mat4.rotateY(f,f,k),0!==q&&n.mat4.rotateZ(f,f,q),1===x[0]&&1===x[1]||n.mat4.scale(f,f,x),U&&n.mat4.translate(f,f,n.vec3.scale(j,j,-1)),V>0&&(Y&&(this.boundingType===i.EBoundingType.Relative?(T[0]=T[0]*(b.width/2)+b.cx,T[1]=T[1]*(b.height/2)+b.cy):(T[0]*=b.width/2,T[1]*=b.height/2),T[2]=0),n.mat4.perspective(d,-Math.PI/2,1,0,1/0)),n.mat4.identity(p),n.mat4.translate(p,p,D),e&&n.mat4.translate(p,p,C);const t=[this.anchor[0]*(b.width/2),this.anchor[1]*(b.height/2),0];n.mat4.translate(p,p,t),y===i.ERepetitionType.Ring&&n.mat4.rotateZ(p,p,M.angle+s)}u.Bounding.clear(R);for(let t=0;t<m;t+=2){const e=[g[t],g[t+1],V];if(0!==_&&o.default.squeezeX(e,_),0!==O&&o.default.squeezeY(e,O),n.vec3.transformMat4(e,e,f),V>0&&(Y&&n.vec3.add(e,e,T),n.vec3.transformMat4(e,e,d),n.vec3.scale(e,e,V),Y&&n.vec3.sub(e,e,T)),n.vec3.transformMat4(e,e,p),void 0!==this.vertexCallback){const r=t/2,n=m/2,i={index:r+1,count:n,offset:n>1?r/(n-1):1};this.vertexCallback(e,i,v)}I[B][t]=e[0],I[B][t+1]=e[1],u.Bounding.add(R,e[0],e[1]),u.Bounding.add(E,e[0],e[1])}}const F={cx:0,cy:0,x:-1,y:-1,width:2,height:2};u.Bounding.bind(F,R),this.bStaticIndexed&&this.bIndexed||this.addIndex(m,M,F)}u.Bounding.bind(this.bounding,E),this.buffer=new Float32Array(O);for(let t=0,e=0,r=I.length;t<r;e+=I[t].length,t++)this.buffer.set(I[t],e);this.bIndexed=!0}getBounding(){return this.bounding}getRepetitionCount(){var t;const e=this.getProp("repetitions",void 0,1);return Array.isArray(e)?e[0]*(null!==(t=e[1])&&void 0!==t?t:e[0]):e}getBuffer(){return this.buffer}getIndexedBuffer(){return this.indexedBuffer}static getIndexParentLevel(t){if(void 0===t.parent)return 0;let e=t.parent,r=1;for(;void 0!==e.parent;)r++,e=e.parent;return r}stream(t){if(this.buffer&&this.indexedBuffer)for(let e=0,r=0,n=this.indexedBuffer.length;e<n;e++){const i=this.indexedBuffer[e];t({buffer:this.buffer,frameLength:i.frameLength,frameBufferIndex:r,currentIndexing:i,currentShapeIndex:e,totalShapes:n}),r+=i.frameLength}}static getEmptyPropArguments(t,e){return{repetition:{type:i.ERepetitionType.Ring,angle:0,index:1,offset:1,count:1,row:{index:1,offset:1,count:1},col:{index:1,offset:1,count:1}},shape:t,parent:e}}}e.ShapeBase=g,g.EMPTY_BUFFER=new Float32Array(0),g.getEmptySimpleRepetition=()=>({index:1,offset:1,count:1}),g.getEmptyRepetition=()=>({type:i.ERepetitionType.Ring,angle:0,...g.getEmptySimpleRepetition(),row:g.getEmptySimpleRepetition(),col:g.getEmptySimpleRepetition()})},7439:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeBuffer=void 0;const n=r(5511),i=r(3674);class a extends i.ShapePrimitive{constructor(t={}){var e,r;t.type=t.type||"ShapeBuffer",t.adaptMode=null!==(e=t.adaptMode)&&void 0!==e?e:n.EAdaptMode.Scale,super(t),this.adaptMode=null!==(r=t.adaptMode)&&void 0!==r?r:n.EAdaptMode.Fill,void 0===t.shape?(console.warn("[Urpflanze:ShapeBuffer] ShapeBuffer require a buffer passed from `shape` property"),this.shape=a.EMPTY_BUFFER):this.shape="function"!=typeof t.shape?n.Adapt.adapt(t.shape,this.adaptMode):t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed()}isStatic(){return"function"!=typeof this.shape&&super.isStatic()}isStaticIndexed(){return"function"!=typeof this.shape&&super.isStaticIndexed()}clearBuffer(t=!1,e=!0){super.clearBuffer(t,e),this.shapeBuffer=void 0}bindBuffer(t){const e=this.getRepetitionSideLength(t),r=this.applyModifiers(Float32Array.from("function"==typeof this.shape?this.shape(t):this.shape),t),i=[void 0,void 0,void 0,void 0];for(let t=0,a=r.length;t<a;t+=2)r[t]=r[t]*e[0],r[t+1]=r[t+1]*e[1],n.Bounding.add(i,r[t],r[t+1]);n.Bounding.bind(this.currentGenerationPrimitiveBounding,i),this.shapeBuffer=r}getBufferLength(){return this.buffer&&this.buffer.length>0?this.buffer.length:this.shape.length*this.getRepetitionCount()}generateBuffer(t,e){return void 0!==this.shapeBuffer&&"function"!=typeof this.props.sideLength&&"function"!=typeof this.shape||this.bindBuffer(e),this.shapeBuffer}setShape(t){this.shape=n.Adapt.adapt(t,this.adaptMode),this.clearBuffer(!0)}getAdaptMode(){return this.adaptMode}static getBuffer(t={}){const e=new this({...t,sideLength:t.sideLength||1});return e.generate(),e.getBuffer()||new Float32Array}}e.ShapeBuffer=a},5382:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeFollow=void 0;const n=r(6448);class i extends n.Shape{constructor(t){t.type=t.type||"ShapeFollow",super(t),this.follow=t.follow||t.shape,this.bStatic=this.isStatic(),this.bStaticIndexed=this.isStaticIndexed(),this.shapeUseFollow=!!t.shapeUseFollow}clearBuffer(t=!1,e=!0){t&&(this.shapeFollowBuffer=void 0),super.clearBuffer(t,e)}isStatic(){return(!this.follow||this.follow.isStatic())&&super.isStatic()}isStaticIndexed(){return(!this.follow||this.follow.isStaticIndexed())&&super.isStaticIndexed()}generateBuffer(t,e){return this.shape&&this.follow?((void 0===this.shapeFollowBuffer||this.shapeUseParent||this.shape.generateId!==t||this.follow.generateId!==t)&&this.bindBuffer(t,e),this.shapeFollowBuffer):n.Shape.EMPTY_BUFFER}bindBuffer(t,e){const r=this.follow;r.generate(t,!1,e);const n=r.getBuffer(),i={...e,follow:{index:1,offset:1,count:1}},a=this.shape;a.generate(t,!1,i);let o=a.getBuffer();const s=o.length,u=new Float32Array(s*(n.length/2)),c=n.length/2;for(let e=0;e<c;e++){const r={index:e+1,offset:c>1?e/(c-1):1,count:c};this.shapeUseFollow&&(i.follow=r,a.generate(t,!1,i),o=a.getBuffer());const h=e*s,l=2*e,f=n[l],d=n[l+1];for(let t=0,e=o.length;t<e;t+=2)u[h+t]=f+o[t],u[h+t+1]=d+o[t+1]}this.shapeFollowBuffer=u}addIndex(t,e,r){if(this.shape){const i={shape:this,frameLength:t,singleRepetitionBounding:r,repetition:{type:e.type,angle:e.angle,index:e.index,count:e.count,offset:e.offset,row:{in