wonder-image 1.5.1 → 1.5.2

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,2 +1,2 @@
1
- .swiper-slicer .swiper-slide,.swiper-slicer swiper-slide{overflow:hidden}.swiper-slicer-image,.swiper-slicer-image-clone,.swiper-slicer-image-clones{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.swiper-slicer-image{display:none;object-fit:cover;object-position:center}.swiper-slicer-image-clone{overflow:hidden;transition-timing-function:cubic-bezier(1,0,.5,1)}.swiper-slicer-image-clone .swiper-slicer-image{display:block}.swiper-gl{margin:0 auto;max-width:100%;overflow:hidden}.swiper-gl,.swiper-gl .swiper-slide,.swiper-gl swiper-slide{position:relative}.swiper-gl .swiper-gl-image{display:none}.swiper-gl-image,.swiper-gl>canvas{height:100%;left:0;position:absolute;top:0;width:100%}.swiper-gl-image{object-fit:cover;object-position:center}.swiper-shutters .swiper-slide,.swiper-shutters swiper-slide{overflow:hidden}.swiper-shutters-image,.swiper-shutters-image-clone,.swiper-shutters-image-clones{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.swiper-shutters-image{object-fit:cover;object-position:center}.swiper-shutters-image-clone{overflow:hidden}.swiper-carousel{margin:0 auto;max-width:100%;overflow:hidden}.swiper-carousel,.swiper-carousel .swiper-slide,.swiper-carousel swiper-slide{position:relative}
1
+ .swiper-slicer .swiper-slide,.swiper-slicer swiper-slide{overflow:hidden}.swiper-slicer-image,.swiper-slicer-image-clone,.swiper-slicer-image-clones{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.swiper-slicer-image{display:none;object-fit:cover;object-position:center}.swiper-slicer-image-clone{overflow:hidden;transition-timing-function:cubic-bezier(1,0,.5,1)}.swiper-slicer-image-clone .swiper-slicer-image{display:block}.swiper-gl{margin:0 auto;max-width:100%;overflow:hidden}.swiper-gl,.swiper-gl .swiper-slide,.swiper-gl swiper-slide{position:relative}.swiper-gl .swiper-gl-image{display:none}.swiper-gl-image,.swiper-gl>canvas{height:100%;left:0;position:absolute;top:0;width:100%}.swiper-gl-image{object-fit:cover;object-position:center}.swiper-shutters .swiper-slide,.swiper-shutters swiper-slide{overflow:hidden}.swiper-shutters-image,.swiper-shutters-image-clone,.swiper-shutters-image-clones{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.swiper-shutters-image{object-fit:cover;object-position:center}.swiper-shutters-image-clone{overflow:hidden}.swiper-carousel{margin:0 auto;max-width:100%;overflow:hidden}.swiper-carousel,.swiper-carousel .swiper-slide,.swiper-carousel swiper-slide{position:relative}:root{--swiper-material-scale:1;--swiper-material-slide-size:100%;--swiper-material-slide-border-radius:32px}.swiper-material-wrapper{border-radius:var(--swiper-material-slide-border-radius);box-sizing:border-box;height:100%;left:0;overflow:hidden;pointer-events:auto;position:absolute;top:0;width:100%}.swiper-material-content{align-items:center;display:flex;font-size:18px;justify-content:center;position:absolute;transform:translateZ(0)}.swiper-horizontal .swiper-material-content{height:100%;left:calc(50% - var(--swiper-material-slide-size)/2);top:0;width:var(--swiper-material-slide-size)}.swiper-vertical .swiper-material-content{height:var(--swiper-material-slide-size);left:0;top:calc(50% - var(--swiper-material-slide-size)/2);width:100%}
2
2
  /*# sourceMappingURL=swiper-plugin.css.map*/
@@ -1 +1 @@
1
- {"version":3,"file":"lib/swiperjs/swiper-plugin.css","mappings":"AAeA,yDAEE,eACF,CACA,4EAKE,WAAY,CAHZ,MAAO,CAIP,mBAAoB,CALpB,iBAAkB,CAElB,KAAM,CACN,UAGF,CACA,qBACE,YAAa,CACb,gBAAiB,CACjB,sBACF,CACA,2BACE,eAAgB,CAChB,iDACF,CACA,gDACE,aACF,CCxBA,WAEE,aAAc,CACd,cAAe,CACf,eACF,CACA,4DALE,iBAQF,CACA,4BACE,YACF,CASA,mCAHE,WAAY,CAHZ,MAAO,CADP,iBAAkB,CAElB,KAAM,CACN,UAYF,CARA,iBAGE,gBAAiB,CACjB,sBAIF,CC7BA,6DAEE,eACF,CACA,kFAKE,WAAY,CAHZ,MAAO,CAIP,mBAAoB,CALpB,iBAAkB,CAElB,KAAM,CACN,UAGF,CACA,uBACE,gBAAiB,CACjB,sBACF,CACA,6BACE,eACF,CClBA,iBAEE,aAAc,CACd,cAAe,CACf,eACF,CACA,8EALE,iBAQF","sources":["webpack://wonder/./src/build/lib/swiperjs/effect-slicer.css","webpack://wonder/./src/build/lib/swiperjs/swiper-gl.css","webpack://wonder/./src/build/lib/swiperjs/effect-shutters.css","webpack://wonder/./src/build/lib/swiperjs/effect-carousel.css"],"sourcesContent":["/**\n * UI Initiative Slicer Slider\n *\n * Images slicer slider\n *\n * https://uiinitiative.com\n *\n * Copyright 2023 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * October 25, 2023\n *\n */\n\n.swiper-slicer .swiper-slide,\n.swiper-slicer swiper-slide {\n overflow: hidden;\n}\n.swiper-slicer-image, .swiper-slicer-image-clones, .swiper-slicer-image-clone {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.swiper-slicer-image {\n display: none;\n object-fit: cover;\n object-position: center;\n}\n.swiper-slicer-image-clone {\n overflow: hidden;\n transition-timing-function: cubic-bezier(1, 0, 0.5, 1);\n}\n.swiper-slicer-image-clone .swiper-slicer-image {\n display: block;\n}","/**\n * UI Initiative Swiper GL\n *\n * Stunning WebGL image transitions\n *\n * https://uiinitiative.com\n *\n * Copyright 2024 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * April 25, 2024\n */\n\n.swiper-gl {\n position: relative;\n margin: 0 auto;\n max-width: 100%;\n overflow: hidden;\n}\n.swiper-gl .swiper-slide,\n.swiper-gl swiper-slide {\n position: relative;\n}\n.swiper-gl .swiper-gl-image {\n display: none;\n}\n.swiper-gl > canvas {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n\n.swiper-gl-image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n position: absolute;\n left: 0;\n top: 0;\n}","/**\n * UI Initiative Shutters Slider\n *\n * Infinite 3D carousel slider\n *\n * https://uiinitiative.com\n *\n * Copyright 2023 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * October 25, 2023\n */\n\n.swiper-shutters .swiper-slide,\n.swiper-shutters swiper-slide {\n overflow: hidden;\n}\n.swiper-shutters-image, .swiper-shutters-image-clones, .swiper-shutters-image-clone {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.swiper-shutters-image {\n object-fit: cover;\n object-position: center;\n}\n.swiper-shutters-image-clone {\n overflow: hidden;\n}","/**\n * UI Initiative Carousel Slider\n *\n * Infinite 3D carousel slider\n *\n * https://uiinitiative.com\n *\n * Copyright 2023 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * December 27, 2023\n */\n\n.swiper-carousel {\n position: relative;\n margin: 0 auto;\n max-width: 100%;\n overflow: hidden;\n}\n.swiper-carousel .swiper-slide,\n.swiper-carousel swiper-slide {\n position: relative;\n}"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"lib/swiperjs/swiper-plugin.css","mappings":"AAeA,yDAEE,eACF,CACA,4EAKE,WAAY,CAHZ,MAAO,CAIP,mBAAoB,CALpB,iBAAkB,CAElB,KAAM,CACN,UAGF,CACA,qBACE,YAAa,CACb,gBAAiB,CACjB,sBACF,CACA,2BACE,eAAgB,CAChB,iDACF,CACA,gDACE,aACF,CCxBA,WAEE,aAAc,CACd,cAAe,CACf,eACF,CACA,4DALE,iBAQF,CACA,4BACE,YACF,CASA,mCAHE,WAAY,CAHZ,MAAO,CADP,iBAAkB,CAElB,KAAM,CACN,UAYF,CARA,iBAGE,gBAAiB,CACjB,sBAIF,CC7BA,6DAEE,eACF,CACA,kFAKE,WAAY,CAHZ,MAAO,CAIP,mBAAoB,CALpB,iBAAkB,CAElB,KAAM,CACN,UAGF,CACA,uBACE,gBAAiB,CACjB,sBACF,CACA,6BACE,eACF,CClBA,iBAEE,aAAc,CACd,cAAe,CACf,eACF,CACA,8EALE,iBAQF,CCTA,MACE,yBAA0B,CAC1B,iCAAkC,CAClC,0CACF,CAEA,yBACE,wDAAyD,CAOzD,qBAAsB,CAHtB,WAAY,CACZ,MAAO,CAJP,eAAgB,CAOhB,mBAAoB,CANpB,iBAAkB,CAIlB,KAAM,CAHN,UAMF,CAEA,yBAME,kBAAmB,CAFnB,YAAa,CADb,cAAe,CAEf,sBAAuB,CAJvB,iBAAkB,CAClB,uBAKF,CAEA,4CACE,WAAY,CAEZ,oDAAuD,CACvD,KAAM,CAFN,uCAGF,CAEA,0CAEE,wCAAyC,CAEzC,MAAO,CADP,mDAAsD,CAFtD,UAIF","sources":["webpack://wonder/./src/build/lib/swiperjs/effect-slicer.css","webpack://wonder/./src/build/lib/swiperjs/swiper-gl.css","webpack://wonder/./src/build/lib/swiperjs/effect-shutters.css","webpack://wonder/./src/build/lib/swiperjs/effect-carousel.css","webpack://wonder/./src/build/lib/swiperjs/effect-material.css"],"sourcesContent":["/**\n * UI Initiative Slicer Slider\n *\n * Images slicer slider\n *\n * https://uiinitiative.com\n *\n * Copyright 2023 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * October 25, 2023\n *\n */\n\n.swiper-slicer .swiper-slide,\n.swiper-slicer swiper-slide {\n overflow: hidden;\n}\n.swiper-slicer-image, .swiper-slicer-image-clones, .swiper-slicer-image-clone {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.swiper-slicer-image {\n display: none;\n object-fit: cover;\n object-position: center;\n}\n.swiper-slicer-image-clone {\n overflow: hidden;\n transition-timing-function: cubic-bezier(1, 0, 0.5, 1);\n}\n.swiper-slicer-image-clone .swiper-slicer-image {\n display: block;\n}","/**\n * UI Initiative Swiper GL\n *\n * Stunning WebGL image transitions\n *\n * https://uiinitiative.com\n *\n * Copyright 2024 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * April 25, 2024\n */\n\n.swiper-gl {\n position: relative;\n margin: 0 auto;\n max-width: 100%;\n overflow: hidden;\n}\n.swiper-gl .swiper-slide,\n.swiper-gl swiper-slide {\n position: relative;\n}\n.swiper-gl .swiper-gl-image {\n display: none;\n}\n.swiper-gl > canvas {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n\n.swiper-gl-image {\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center;\n position: absolute;\n left: 0;\n top: 0;\n}","/**\n * UI Initiative Shutters Slider\n *\n * Infinite 3D carousel slider\n *\n * https://uiinitiative.com\n *\n * Copyright 2023 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * October 25, 2023\n */\n\n.swiper-shutters .swiper-slide,\n.swiper-shutters swiper-slide {\n overflow: hidden;\n}\n.swiper-shutters-image, .swiper-shutters-image-clones, .swiper-shutters-image-clone {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.swiper-shutters-image {\n object-fit: cover;\n object-position: center;\n}\n.swiper-shutters-image-clone {\n overflow: hidden;\n}","/**\n * UI Initiative Carousel Slider\n *\n * Infinite 3D carousel slider\n *\n * https://uiinitiative.com\n *\n * Copyright 2023 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * December 27, 2023\n */\n\n.swiper-carousel {\n position: relative;\n margin: 0 auto;\n max-width: 100%;\n overflow: hidden;\n}\n.swiper-carousel .swiper-slide,\n.swiper-carousel swiper-slide {\n position: relative;\n}","/**\n * UI Initiative Material You Slider\n *\n * Material You Carousel made with Swiper\n *\n * https://uiinitiative.com\n *\n * Copyright 2024 UI Initiative\n *\n * Released under the UI Initiative Regular License\n *\n * April 29, 2024\n */\n\n:root {\n --swiper-material-scale: 1;\n --swiper-material-slide-size: 100%;\n --swiper-material-slide-border-radius: 32px;\n}\n\n.swiper-material-wrapper {\n border-radius: var(--swiper-material-slide-border-radius);\n overflow: hidden;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n box-sizing: border-box;\n pointer-events: auto;\n}\n\n.swiper-material-content {\n position: absolute;\n transform: translate3d(0, 0, 0);\n font-size: 18px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.swiper-horizontal .swiper-material-content {\n height: 100%;\n width: var(--swiper-material-slide-size);\n left: calc(50% - var(--swiper-material-slide-size) / 2);\n top: 0;\n}\n\n.swiper-vertical .swiper-material-content {\n width: 100%;\n height: var(--swiper-material-slide-size);\n top: calc(50% - var(--swiper-material-slide-size) / 2);\n left: 0;\n}"],"names":[],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see swiper-plugin.js.LICENSE.txt */
2
- (()=>{"use strict";var t={r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){let e=t[0],i=t[1],s=t[2];return Math.sqrt(e*e+i*i+s*s)}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function r(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function n(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function a(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function o(t){let e=t[0],i=t[1],s=t[2];return e*e+i*i+s*s}function h(t,e){let i=e[0],s=e[1],r=e[2],n=i*i+s*s+r*r;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function l(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function c(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[0],o=i[1],h=i[2];return t[0]=r*h-n*o,t[1]=n*a-s*h,t[2]=s*o-r*a,t}t.r(e),"undefined"!=typeof window&&window.SwiperElementRegisterParams&&window.SwiperElementRegisterParams(["slicerEffect"]);const u=function(){const t=[0,0,0],e=[0,0,0];return function(i,r){s(t,i),s(e,r),h(t,t),h(e,e);let n=l(t,e);return n>1?0:n<-1?Math.PI:Math.acos(n)}}();class m extends Array{constructor(t=0,e=t,i=t){return super(t,e,i),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,e=t,i=t){return t.length?this.copy(t):(function(t,e,i,s){t[0]=e,t[1]=i,t[2]=s}(this,t,e,i),this)}copy(t){return s(this,t),this}add(t,e){return e?r(this,t,e):r(this,this,t),this}sub(t,e){return e?n(this,t,e):n(this,this,t),this}multiply(t){var e,i,s;return t.length?(i=this,s=t,(e=this)[0]=i[0]*s[0],e[1]=i[1]*s[1],e[2]=i[2]*s[2]):a(this,this,t),this}divide(t){var e,i,s;return t.length?(i=this,s=t,(e=this)[0]=i[0]/s[0],e[1]=i[1]/s[1],e[2]=i[2]/s[2]):a(this,this,1/t),this}inverse(t=this){var e,i;return i=t,(e=this)[0]=1/i[0],e[1]=1/i[1],e[2]=1/i[2],this}len(){return i(this)}distance(t){return t?function(t,e){let i=e[0]-t[0],s=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(i*i+s*s+r*r)}(this,t):i(this)}squaredLen(){return o(this)}squaredDistance(t){return t?function(t,e){let i=e[0]-t[0],s=e[1]-t[1],r=e[2]-t[2];return i*i+s*s+r*r}(this,t):o(this)}negate(t=this){var e,i;return i=t,(e=this)[0]=-i[0],e[1]=-i[1],e[2]=-i[2],this}cross(t,e){return e?c(this,t,e):c(this,this,t),this}scale(t){return a(this,this,t),this}normalize(){return h(this,this),this}dot(t){return l(this,t)}equals(t){return i=t,(e=this)[0]===i[0]&&e[1]===i[1]&&e[2]===i[2];var e,i}applyMatrix3(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2];t[0]=s*i[0]+r*i[3]+n*i[6],t[1]=s*i[1]+r*i[4]+n*i[7],t[2]=s*i[2]+r*i[5]+n*i[8]}(this,this,t),this}applyMatrix4(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[3]*s+i[7]*r+i[11]*n+i[15];a=a||1,t[0]=(i[0]*s+i[4]*r+i[8]*n+i[12])/a,t[1]=(i[1]*s+i[5]*r+i[9]*n+i[13])/a,t[2]=(i[2]*s+i[6]*r+i[10]*n+i[14])/a}(this,this,t),this}scaleRotateMatrix4(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[3]*s+i[7]*r+i[11]*n+i[15];a=a||1,t[0]=(i[0]*s+i[4]*r+i[8]*n)/a,t[1]=(i[1]*s+i[5]*r+i[9]*n)/a,t[2]=(i[2]*s+i[6]*r+i[10]*n)/a}(this,this,t),this}applyQuaternion(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[0],o=i[1],h=i[2],l=o*n-h*r,c=h*s-a*n,u=a*r-o*s,m=o*u-h*c,d=h*l-a*u,g=a*c-o*l,p=2*i[3];l*=p,c*=p,u*=p,m*=2,d*=2,g*=2,t[0]=s+l+m,t[1]=r+c+d,t[2]=n+u+g}(this,this,t),this}angle(t){return u(this,t)}lerp(t,e){return function(t,e,i,s){let r=e[0],n=e[1],a=e[2];t[0]=r+s*(i[0]-r),t[1]=n+s*(i[1]-n),t[2]=a+s*(i[2]-a)}(this,this,t,e),this}clone(){return new m(this[0],this[1],this[2])}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}transformDirection(t){const e=this[0],i=this[1],s=this[2];return this[0]=t[0]*e+t[4]*i+t[8]*s,this[1]=t[1]*e+t[5]*i+t[9]*s,this[2]=t[2]*e+t[6]*i+t[10]*s,this.normalize()}}const d=new m;let g=1,p=1,f=!1;class x{constructor(t,e={}){t.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=t,this.attributes=e,this.id=g++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let t in e)this.addAttribute(t,e[t])}addAttribute(t,e){if(this.attributes[t]=e,e.id=p++,e.size=e.size||1,e.type=e.type||(e.data.constructor===Float32Array?this.gl.FLOAT:e.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),e.target="index"===t?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,e.normalized=e.normalized||!1,e.stride=e.stride||0,e.offset=e.offset||0,e.count=e.count||(e.stride?e.data.byteLength/e.stride:e.data.length/e.size),e.divisor=e.instanced||0,e.needsUpdate=!1,e.usage=e.usage||this.gl.STATIC_DRAW,e.buffer||this.updateAttribute(e),e.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==e.count*e.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,e.count*e.divisor);this.instancedCount=e.count*e.divisor}else"index"===t?this.drawRange.count=e.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,e.count))}updateAttribute(t){const e=!t.buffer;e&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),e?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach(((t,{name:e,type:i})=>{if(!this.attributes[e])return void console.warn(`active attribute ${e} not being supplied`);const s=this.attributes[e];this.gl.bindBuffer(s.target,s.buffer),this.glState.boundBuffer=s.buffer;let r=1;35674===i&&(r=2),35675===i&&(r=3),35676===i&&(r=4);const n=s.size/r,a=1===r?0:r*r*r,o=1===r?0:r*r;for(let e=0;e<r;e++)this.gl.vertexAttribPointer(t+e,n,s.type,s.normalized,s.stride+a,s.offset+e*o),this.gl.enableVertexAttribArray(t+e),this.gl.renderer.vertexAttribDivisor(t+e,s.divisor)})),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:e=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach(((t,{name:e})=>{const i=this.attributes[e];i.needsUpdate&&this.updateAttribute(i)})),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+2*this.drawRange.start,this.instancedCount):this.gl.renderer.drawArraysInstanced(e,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+2*this.drawRange.start):this.gl.drawArrays(e,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;return t.data?t:f?void 0:(console.warn("No position buffer data found to compute bounds"),f=!0)}computeBoundingBox(t){t||(t=this.getPosition());const e=t.data,i=t.stride?t.stride/e.BYTES_PER_ELEMENT:t.size;this.bounds||(this.bounds={min:new m,max:new m,center:new m,scale:new m,radius:1/0});const s=this.bounds.min,r=this.bounds.max,n=this.bounds.center,a=this.bounds.scale;s.set(1/0),r.set(-1/0);for(let t=0,n=e.length;t<n;t+=i){const i=e[t],n=e[t+1],a=e[t+2];s.x=Math.min(i,s.x),s.y=Math.min(n,s.y),s.z=Math.min(a,s.z),r.x=Math.max(i,r.x),r.y=Math.max(n,r.y),r.z=Math.max(a,r.z)}a.sub(r,s),n.add(s,r).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const e=t.data,i=t.stride?t.stride/e.BYTES_PER_ELEMENT:t.size;this.bounds||this.computeBoundingBox(t);let s=0;for(let t=0,r=e.length;t<r;t+=i)d.fromArray(e,t),s=Math.max(s,this.bounds.center.squaredDistance(d));this.bounds.radius=Math.sqrt(s)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let A=1;const v={};class w{constructor(t,{vertex:e,fragment:i,uniforms:s={},transparent:r=!1,cullFace:n=t.BACK,frontFace:a=t.CCW,depthTest:o=!0,depthWrite:h=!0,depthFunc:l=t.LESS}={}){t.canvas||console.error("gl not passed as fist argument to Program"),this.gl=t,this.uniforms=s,this.id=A++,e||console.warn("vertex shader not supplied"),i||console.warn("fragment shader not supplied"),this.transparent=r,this.cullFace=n,this.frontFace=a,this.depthTest=o,this.depthWrite=h,this.depthFunc=l,this.blendFunc={},this.blendEquation={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA));const c=t.createShader(t.VERTEX_SHADER);t.shaderSource(c,e),t.compileShader(c),""!==t.getShaderInfoLog(c)&&console.warn(`${t.getShaderInfoLog(c)}\nVertex Shader\n${y(e)}`);const u=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(u,i),t.compileShader(u),""!==t.getShaderInfoLog(u)&&console.warn(`${t.getShaderInfoLog(u)}\nFragment Shader\n${y(i)}`),this.program=t.createProgram(),t.attachShader(this.program,c),t.attachShader(this.program,u),t.linkProgram(this.program),!t.getProgramParameter(this.program,t.LINK_STATUS))return console.warn(t.getProgramInfoLog(this.program));t.deleteShader(c),t.deleteShader(u),this.uniformLocations=new Map;let m=t.getProgramParameter(this.program,t.ACTIVE_UNIFORMS);for(let e=0;e<m;e++){let i=t.getActiveUniform(this.program,e);this.uniformLocations.set(i,t.getUniformLocation(this.program,i.name));const s=i.name.match(/(\w+)/g);i.uniformName=s[0],3===s.length?(i.isStructArray=!0,i.structIndex=Number(s[1]),i.structProperty=s[2]):2===s.length&&isNaN(Number(s[1]))&&(i.isStruct=!0,i.structProperty=s[1])}this.attributeLocations=new Map;const d=[],g=t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);for(let e=0;e<g;e++){const i=t.getActiveAttrib(this.program,e),s=t.getAttribLocation(this.program,i.name);-1!==s&&(d[s]=i.name,this.attributeLocations.set(i,s))}this.attributeOrder=d.join("")}setBlendFunc(t,e,i,s){this.blendFunc.src=t,this.blendFunc.dst=e,this.blendFunc.srcAlpha=i,this.blendFunc.dstAlpha=s,t&&(this.transparent=!0)}setBlendEquation(t,e){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=e}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha)}use({flipFaces:t=!1}={}){let e=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach(((t,i)=>{let s=i.uniformName,r=this.uniforms[s];if(i.isStruct&&(r=r[i.structProperty],s+=`.${i.structProperty}`),i.isStructArray&&(r=r[i.structIndex][i.structProperty],s+=`[${i.structIndex}].${i.structProperty}`),!r)return U(`Active uniform ${s} has not been supplied`);if(r&&void 0===r.value)return U(`${s} uniform is missing a value parameter`);if(r.value.texture)return e+=1,r.value.update(e),M(this.gl,i.type,t,e);if(r.value.length&&r.value[0].texture){const s=[];return r.value.forEach((t=>{e+=1,t.update(e),s.push(e)})),M(this.gl,i.type,t,s)}M(this.gl,i.type,t,r.value)})),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function M(t,e,i,s){s=s.length?function(t){const e=t.length,i=t[0].length;if(void 0===i)return t;const s=e*i;let r=v[s];r||(v[s]=r=new Float32Array(s));for(let s=0;s<e;s++)r.set(t[s],s*i);return r}(s):s;const r=t.renderer.state.uniformLocations.get(i);if(s.length)if(void 0===r||r.length!==s.length)t.renderer.state.uniformLocations.set(i,s.slice(0));else{if(function(t,e){if(t.length!==e.length)return!1;for(let i=0,s=t.length;i<s;i++)if(t[i]!==e[i])return!1;return!0}(r,s))return;r.set?r.set(s):function(t,e){for(let i=0,s=t.length;i<s;i++)t[i]=e[i]}(r,s),t.renderer.state.uniformLocations.set(i,r)}else{if(r===s)return;t.renderer.state.uniformLocations.set(i,s)}switch(e){case 5126:return s.length?t.uniform1fv(i,s):t.uniform1f(i,s);case 35664:return t.uniform2fv(i,s);case 35665:return t.uniform3fv(i,s);case 35666:return t.uniform4fv(i,s);case 35670:case 5124:case 35678:case 35680:return s.length?t.uniform1iv(i,s):t.uniform1i(i,s);case 35671:case 35667:return t.uniform2iv(i,s);case 35672:case 35668:return t.uniform3iv(i,s);case 35673:case 35669:return t.uniform4iv(i,s);case 35674:return t.uniformMatrix2fv(i,!1,s);case 35675:return t.uniformMatrix3fv(i,!1,s);case 35676:return t.uniformMatrix4fv(i,!1,s)}}function y(t){let e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}let E=0;function U(t){E>100||(console.warn(t),E++,E>100&&console.warn("More than 100 program warnings - stopping logs."))}const F=new m;let b=1;class C{constructor({canvas:t=document.createElement("canvas"),width:e=300,height:i=150,dpr:s=1,alpha:r=!1,depth:n=!0,stencil:a=!1,antialias:o=!1,premultipliedAlpha:h=!1,preserveDrawingBuffer:l=!1,powerPreference:c="default",autoClear:u=!0,webgl:m=2}={}){const d={alpha:r,depth:n,stencil:a,antialias:o,premultipliedAlpha:h,preserveDrawingBuffer:l,powerPreference:c};this.dpr=s,this.alpha=r,this.color=!0,this.depth=n,this.stencil=a,this.premultipliedAlpha=h,this.autoClear=u,this.id=b++,2===m&&(this.gl=t.getContext("webgl2",d)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",d)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(e,i),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=null,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LESS,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,e){this.width=t,this.height=e,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=e*this.dpr,Object.assign(this.gl.canvas.style,{width:t+"px",height:e+"px"})}setViewport(t,e,i=0,s=0){this.state.viewport.width===t&&this.state.viewport.height===e||(this.state.viewport.width=t,this.state.viewport.height=e,this.state.viewport.x=i,this.state.viewport.y=s,this.gl.viewport(i,s,t,e))}setScissor(t,e,i=0,s=0){this.gl.scissor(i,s,t,e)}enable(t){!0!==this.state[t]&&(this.gl.enable(t),this.state[t]=!0)}disable(t){!1!==this.state[t]&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,e,i,s){this.state.blendFunc.src===t&&this.state.blendFunc.dst===e&&this.state.blendFunc.srcAlpha===i&&this.state.blendFunc.dstAlpha===s||(this.state.blendFunc.src=t,this.state.blendFunc.dst=e,this.state.blendFunc.srcAlpha=i,this.state.blendFunc.dstAlpha=s,void 0!==i?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e))}setBlendEquation(t,e){t=t||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===e||(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=e,void 0!==e?this.gl.blendEquationSeparate(t,e):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:e=null}={}){this.state.framebuffer!==e&&(this.state.framebuffer=e,this.gl.bindFramebuffer(t,e))}getExtension(t,e,i){return e&&this.gl[e]?this.gl[e].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),e?this.extensions[t]?this.extensions[t][i].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:t.zDepth!==e.zDepth?t.zDepth-e.zDepth:e.id-t.id}sortTransparent(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.zDepth!==e.zDepth?e.zDepth-t.zDepth:e.id-t.id}sortUI(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:e.id-t.id}getRenderList({scene:t,camera:e,frustumCull:i,sort:s}){let r=[];if(e&&i&&e.updateFrustum(),t.traverse((t=>{if(!t.visible)return!0;t.draw&&(i&&t.frustumCulled&&e&&!e.frustumIntersectsMesh(t)||r.push(t))})),s){const t=[],i=[],s=[];r.forEach((r=>{r.program.transparent?r.program.depthTest?i.push(r):s.push(r):t.push(r),r.zDepth=0,0===r.renderOrder&&r.program.depthTest&&e&&(r.worldMatrix.getTranslation(F),F.applyMatrix4(e.projectionViewMatrix),r.zDepth=F.z)})),t.sort(this.sortOpaque),i.sort(this.sortTransparent),s.sort(this.sortUI),r=t.concat(i,s)}return r}render({scene:t,camera:e,target:i=null,update:s=!0,sort:r=!0,frustumCull:n=!0,clear:a}){null===i?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(i),this.setViewport(i.width,i.height)),(a||this.autoClear&&!1!==a)&&(!this.depth||i&&!i.depth||(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),s&&t.updateMatrixWorld(),e&&e.updateMatrixWorld();this.getRenderList({scene:t,camera:e,frustumCull:n,sort:r}).forEach((t=>{t.draw({camera:e})}))}}function R(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function T(t,e,i,s,r){return t[0]=e,t[1]=i,t[2]=s,t[3]=r,t}function S(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i*i+s*s+r*r+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=i*a,t[1]=s*a,t[2]=r*a,t[3]=n*a,t}function I(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function G(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=i[0],h=i[1],l=i[2],c=i[3];return t[0]=s*c+a*o+r*l-n*h,t[1]=r*c+a*h+n*o-s*l,t[2]=n*c+a*l+s*h-r*o,t[3]=a*c-s*o-r*h-n*l,t}const Y=R,B=T,D=I,K=S;class k extends Array{constructor(t=0,e=0,i=0,s=1){return super(t,e,i,s),this.onChange=()=>{},this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this[0]=t,this.onChange()}set y(t){this[1]=t,this.onChange()}set z(t){this[2]=t,this.onChange()}set w(t){this[3]=t,this.onChange()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.onChange(),this}set(t,e,i,s){return t.length?this.copy(t):(B(this,t,e,i,s),this.onChange(),this)}rotateX(t){return function(t,e,i){i*=.5;let s=e[0],r=e[1],n=e[2],a=e[3],o=Math.sin(i),h=Math.cos(i);t[0]=s*h+a*o,t[1]=r*h+n*o,t[2]=n*h-r*o,t[3]=a*h-s*o}(this,this,t),this.onChange(),this}rotateY(t){return function(t,e,i){i*=.5;let s=e[0],r=e[1],n=e[2],a=e[3],o=Math.sin(i),h=Math.cos(i);t[0]=s*h-n*o,t[1]=r*h+a*o,t[2]=n*h+s*o,t[3]=a*h-r*o}(this,this,t),this.onChange(),this}rotateZ(t){return function(t,e,i){i*=.5;let s=e[0],r=e[1],n=e[2],a=e[3],o=Math.sin(i),h=Math.cos(i);t[0]=s*h+r*o,t[1]=r*h-s*o,t[2]=n*h+a*o,t[3]=a*h-n*o}(this,this,t),this.onChange(),this}inverse(t=this){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i*i+s*s+r*r+n*n,o=a?1/a:0;t[0]=-i*o,t[1]=-s*o,t[2]=-r*o,t[3]=n*o}(this,t),this.onChange(),this}conjugate(t=this){var e,i;return i=t,(e=this)[0]=-i[0],e[1]=-i[1],e[2]=-i[2],e[3]=i[3],this.onChange(),this}copy(t){return Y(this,t),this.onChange(),this}normalize(t=this){return K(this,t),this.onChange(),this}multiply(t,e){return e?G(this,t,e):G(this,this,t),this.onChange(),this}dot(t){return D(this,t)}fromMatrix3(t){return function(t,e){let i,s=e[0]+e[4]+e[8];if(s>0)i=Math.sqrt(s+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{let s=0;e[4]>e[0]&&(s=1),e[8]>e[3*s+s]&&(s=2);let r=(s+1)%3,n=(s+2)%3;i=Math.sqrt(e[3*s+s]-e[3*r+r]-e[3*n+n]+1),t[s]=.5*i,i=.5/i,t[3]=(e[3*r+n]-e[3*n+r])*i,t[r]=(e[3*r+s]+e[3*s+r])*i,t[n]=(e[3*n+s]+e[3*s+n])*i}}(this,t),this.onChange(),this}fromEuler(t){return function(t,e,i="YXZ"){let s=Math.sin(.5*e[0]),r=Math.cos(.5*e[0]),n=Math.sin(.5*e[1]),a=Math.cos(.5*e[1]),o=Math.sin(.5*e[2]),h=Math.cos(.5*e[2]);"XYZ"===i?(t[0]=s*a*h+r*n*o,t[1]=r*n*h-s*a*o,t[2]=r*a*o+s*n*h,t[3]=r*a*h-s*n*o):"YXZ"===i?(t[0]=s*a*h+r*n*o,t[1]=r*n*h-s*a*o,t[2]=r*a*o-s*n*h,t[3]=r*a*h+s*n*o):"ZXY"===i?(t[0]=s*a*h-r*n*o,t[1]=r*n*h+s*a*o,t[2]=r*a*o+s*n*h,t[3]=r*a*h-s*n*o):"ZYX"===i?(t[0]=s*a*h-r*n*o,t[1]=r*n*h+s*a*o,t[2]=r*a*o-s*n*h,t[3]=r*a*h+s*n*o):"YZX"===i?(t[0]=s*a*h+r*n*o,t[1]=r*n*h+s*a*o,t[2]=r*a*o-s*n*h,t[3]=r*a*h-s*n*o):"XZY"===i&&(t[0]=s*a*h-r*n*o,t[1]=r*n*h-s*a*o,t[2]=r*a*o+s*n*h,t[3]=r*a*h+s*n*o)}(this,t,t.order),this}fromAxisAngle(t,e){return function(t,e,i){i*=.5;let s=Math.sin(i);t[0]=s*e[0],t[1]=s*e[1],t[2]=s*e[2],t[3]=Math.cos(i)}(this,t,e),this}slerp(t,e){return function(t,e,i,s){let r,n,a,o,h,l=e[0],c=e[1],u=e[2],m=e[3],d=i[0],g=i[1],p=i[2],f=i[3];n=l*d+c*g+u*p+m*f,n<0&&(n=-n,d=-d,g=-g,p=-p,f=-f),1-n>1e-6?(r=Math.acos(n),a=Math.sin(r),o=Math.sin((1-s)*r)/a,h=Math.sin(s*r)/a):(o=1-s,h=s),t[0]=o*l+h*d,t[1]=o*c+h*g,t[2]=o*u+h*p,t[3]=o*m+h*f}(this,this,t,e),this}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}}function P(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],m=e[9],d=e[10],g=e[11],p=e[12],f=e[13],x=e[14],A=e[15],v=i[0],w=i[1],M=i[2],y=i[3];return t[0]=v*s+w*o+M*u+y*p,t[1]=v*r+w*h+M*m+y*f,t[2]=v*n+w*l+M*d+y*x,t[3]=v*a+w*c+M*g+y*A,v=i[4],w=i[5],M=i[6],y=i[7],t[4]=v*s+w*o+M*u+y*p,t[5]=v*r+w*h+M*m+y*f,t[6]=v*n+w*l+M*d+y*x,t[7]=v*a+w*c+M*g+y*A,v=i[8],w=i[9],M=i[10],y=i[11],t[8]=v*s+w*o+M*u+y*p,t[9]=v*r+w*h+M*m+y*f,t[10]=v*n+w*l+M*d+y*x,t[11]=v*a+w*c+M*g+y*A,v=i[12],w=i[13],M=i[14],y=i[15],t[12]=v*s+w*o+M*u+y*p,t[13]=v*r+w*h+M*m+y*f,t[14]=v*n+w*l+M*d+y*x,t[15]=v*a+w*c+M*g+y*A,t}function N(t,e){let i=e[0],s=e[1],r=e[2],n=e[4],a=e[5],o=e[6],h=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(i,s,r),t[1]=Math.hypot(n,a,o),t[2]=Math.hypot(h,l,c),t}const Q=function(){const t=[0,0,0];return function(e,i){let s=t;N(s,i);let r=1/s[0],n=1/s[1],a=1/s[2],o=i[0]*r,h=i[1]*n,l=i[2]*a,c=i[4]*r,u=i[5]*n,m=i[6]*a,d=i[8]*r,g=i[9]*n,p=i[10]*a,f=o+u+p,x=0;return f>0?(x=2*Math.sqrt(f+1),e[3]=.25*x,e[0]=(m-g)/x,e[1]=(d-l)/x,e[2]=(h-c)/x):o>u&&o>p?(x=2*Math.sqrt(1+o-u-p),e[3]=(m-g)/x,e[0]=.25*x,e[1]=(h+c)/x,e[2]=(d+l)/x):u>p?(x=2*Math.sqrt(1+u-o-p),e[3]=(d-l)/x,e[0]=(h+c)/x,e[1]=.25*x,e[2]=(m+g)/x):(x=2*Math.sqrt(1+p-o-u),e[3]=(h-c)/x,e[0]=(d+l)/x,e[1]=(m+g)/x,e[2]=.25*x),e}}();class j extends Array{constructor(t=1,e=0,i=0,s=0,r=0,n=1,a=0,o=0,h=0,l=0,c=1,u=0,m=0,d=0,g=0,p=1){return super(t,e,i,s,r,n,a,o,h,l,c,u,m,d,g,p),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,e,i,s,r,n,a,o,h,l,c,u,m,d,g,p){return t.length?this.copy(t):(function(t,e,i,s,r,n,a,o,h,l,c,u,m,d,g,p,f){t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=n,t[5]=a,t[6]=o,t[7]=h,t[8]=l,t[9]=c,t[10]=u,t[11]=m,t[12]=d,t[13]=g,t[14]=p,t[15]=f}(this,t,e,i,s,r,n,a,o,h,l,c,u,m,d,g,p),this)}translate(t,e=this){return function(t,e,i){let s,r,n,a,o,h,l,c,u,m,d,g,p=i[0],f=i[1],x=i[2];e===t?(t[12]=e[0]*p+e[4]*f+e[8]*x+e[12],t[13]=e[1]*p+e[5]*f+e[9]*x+e[13],t[14]=e[2]*p+e[6]*f+e[10]*x+e[14],t[15]=e[3]*p+e[7]*f+e[11]*x+e[15]):(s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],m=e[9],d=e[10],g=e[11],t[0]=s,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=h,t[6]=l,t[7]=c,t[8]=u,t[9]=m,t[10]=d,t[11]=g,t[12]=s*p+o*f+u*x+e[12],t[13]=r*p+h*f+m*x+e[13],t[14]=n*p+l*f+d*x+e[14],t[15]=a*p+c*f+g*x+e[15])}(this,e,t),this}rotate(t,e,i=this){return function(t,e,i,s){let r,n,a,o,h,l,c,u,m,d,g,p,f,x,A,v,w,M,y,E,U,F,b,C,R=s[0],T=s[1],S=s[2],I=Math.hypot(R,T,S);Math.abs(I)<1e-6||(I=1/I,R*=I,T*=I,S*=I,r=Math.sin(i),n=Math.cos(i),a=1-n,o=e[0],h=e[1],l=e[2],c=e[3],u=e[4],m=e[5],d=e[6],g=e[7],p=e[8],f=e[9],x=e[10],A=e[11],v=R*R*a+n,w=T*R*a+S*r,M=S*R*a-T*r,y=R*T*a-S*r,E=T*T*a+n,U=S*T*a+R*r,F=R*S*a+T*r,b=T*S*a-R*r,C=S*S*a+n,t[0]=o*v+u*w+p*M,t[1]=h*v+m*w+f*M,t[2]=l*v+d*w+x*M,t[3]=c*v+g*w+A*M,t[4]=o*y+u*E+p*U,t[5]=h*y+m*E+f*U,t[6]=l*y+d*E+x*U,t[7]=c*y+g*E+A*U,t[8]=o*F+u*b+p*C,t[9]=h*F+m*b+f*C,t[10]=l*F+d*b+x*C,t[11]=c*F+g*b+A*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,i,t,e),this}scale(t,e=this){return function(t,e,i){let s=i[0],r=i[1],n=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(this,e,"number"==typeof t?[t,t,t]:t),this}multiply(t,e){return e?P(this,t,e):P(this,this,t),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=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,this}copy(t){var e,i;return i=t,(e=this)[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}fromPerspective({fov:t,aspect:e,near:i,far:s}={}){return function(t,e,i,s,r){let n=1/Math.tan(e/2),a=1/(s-r);t[0]=n/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+s)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*s*a,t[15]=0}(this,t,e,i,s),this}fromOrthogonal({left:t,right:e,bottom:i,top:s,near:r,far:n}){return function(t,e,i,s,r,n,a){let o=1/(e-i),h=1/(s-r),l=1/(n-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*o,t[13]=(r+s)*h,t[14]=(a+n)*l,t[15]=1}(this,t,e,i,s,r,n),this}fromQuaternion(t){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i+i,o=s+s,h=r+r,l=i*a,c=s*a,u=s*o,m=r*a,d=r*o,g=r*h,p=n*a,f=n*o,x=n*h;t[0]=1-u-g,t[1]=c+x,t[2]=m-f,t[3]=0,t[4]=c-x,t[5]=1-l-g,t[6]=d+p,t[7]=0,t[8]=m+f,t[9]=d-p,t[10]=1-l-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],m=e[10],d=e[11],g=e[12],p=e[13],f=e[14],x=e[15],A=i*o-s*a,v=i*h-r*a,w=i*l-n*a,M=s*h-r*o,y=s*l-n*o,E=r*l-n*h,U=c*p-u*g,F=c*f-m*g,b=c*x-d*g,C=u*f-m*p,R=u*x-d*p,T=m*x-d*f,S=A*T-v*R+w*C+M*b-y*F+E*U;S&&(S=1/S,t[0]=(o*T-h*R+l*C)*S,t[1]=(r*R-s*T-n*C)*S,t[2]=(p*E-f*y+x*M)*S,t[3]=(m*y-u*E-d*M)*S,t[4]=(h*b-a*T-l*F)*S,t[5]=(i*T-r*b+n*F)*S,t[6]=(f*w-g*E-x*v)*S,t[7]=(c*E-m*w+d*v)*S,t[8]=(a*R-o*b+l*U)*S,t[9]=(s*b-i*R-n*U)*S,t[10]=(g*y-p*w+x*A)*S,t[11]=(u*w-c*y-d*A)*S,t[12]=(o*F-a*C-h*U)*S,t[13]=(i*C-s*F+r*U)*S,t[14]=(p*v-g*M-f*A)*S,t[15]=(c*M-u*v+m*A)*S)}(this,t),this}compose(t,e,i){return function(t,e,i,s){let r=e[0],n=e[1],a=e[2],o=e[3],h=r+r,l=n+n,c=a+a,u=r*h,m=r*l,d=r*c,g=n*l,p=n*c,f=a*c,x=o*h,A=o*l,v=o*c,w=s[0],M=s[1],y=s[2];t[0]=(1-(g+f))*w,t[1]=(m+v)*w,t[2]=(d-A)*w,t[3]=0,t[4]=(m-v)*M,t[5]=(1-(u+f))*M,t[6]=(p+x)*M,t[7]=0,t[8]=(d+A)*y,t[9]=(p-x)*y,t[10]=(1-(u+g))*y,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1}(this,t,e,i),this}getRotation(t){return Q(t,this),this}getTranslation(t){var e,i;return i=this,(e=t)[0]=i[12],e[1]=i[13],e[2]=i[14],this}getScaling(t){return N(t,this),this}getMaxScaleOnAxis(){return function(t){let e=t[0],i=t[1],s=t[2],r=t[4],n=t[5],a=t[6],o=t[8],h=t[9],l=t[10];const c=e*e+i*i+s*s,u=r*r+n*n+a*a,m=o*o+h*h+l*l;return Math.sqrt(Math.max(c,u,m))}(this)}lookAt(t,e,i){return function(t,e,i,s){let r=e[0],n=e[1],a=e[2],o=s[0],h=s[1],l=s[2],c=r-i[0],u=n-i[1],m=a-i[2],d=c*c+u*u+m*m;0===d?m=1:(d=1/Math.sqrt(d),c*=d,u*=d,m*=d);let g=h*m-l*u,p=l*c-o*m,f=o*u-h*c;d=g*g+p*p+f*f,0===d&&(l?o+=1e-6:h?l+=1e-6:h+=1e-6,g=h*m-l*u,p=l*c-o*m,f=o*u-h*c,d=g*g+p*p+f*f),d=1/Math.sqrt(d),g*=d,p*=d,f*=d,t[0]=g,t[1]=p,t[2]=f,t[3]=0,t[4]=u*f-m*p,t[5]=m*g-c*f,t[6]=c*p-u*g,t[7]=0,t[8]=c,t[9]=u,t[10]=m,t[11]=0,t[12]=r,t[13]=n,t[14]=a,t[15]=1}(this,t,e,i),this}determinant(){return function(t){let e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],m=t[11],d=t[12],g=t[13],p=t[14],f=t[15];return(e*a-i*n)*(u*f-m*p)-(e*o-s*n)*(c*f-m*g)+(e*h-r*n)*(c*p-u*g)+(i*o-s*a)*(l*f-m*d)-(i*h-r*a)*(l*p-u*d)+(s*h-r*o)*(l*g-c*d)}(this)}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this[4]=t[e+4],this[5]=t[e+5],this[6]=t[e+6],this[7]=t[e+7],this[8]=t[e+8],this[9]=t[e+9],this[10]=t[e+10],this[11]=t[e+11],this[12]=t[e+12],this[13]=t[e+13],this[14]=t[e+14],this[15]=t[e+15],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t[e+4]=this[4],t[e+5]=this[5],t[e+6]=this[6],t[e+7]=this[7],t[e+8]=this[8],t[e+9]=this[9],t[e+10]=this[10],t[e+11]=this[11],t[e+12]=this[12],t[e+13]=this[13],t[e+14]=this[14],t[e+15]=this[15],t}}const O=new j;class z extends Array{constructor(t=0,e=t,i=t,s="YXZ"){return super(t,e,i),this.order=s,this.onChange=()=>{},this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t,this.onChange()}set y(t){this[1]=t,this.onChange()}set z(t){this[2]=t,this.onChange()}set(t,e=t,i=t){return t.length?this.copy(t):(this[0]=t,this[1]=e,this[2]=i,this.onChange(),this)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.onChange(),this}reorder(t){return this.order=t,this.onChange(),this}fromRotationMatrix(t,e=this.order){return function(t,e,i="YXZ"){"XYZ"===i?(t[1]=Math.asin(Math.min(Math.max(e[8],-1),1)),Math.abs(e[8])<.99999?(t[0]=Math.atan2(-e[9],e[10]),t[2]=Math.atan2(-e[4],e[0])):(t[0]=Math.atan2(e[6],e[5]),t[2]=0)):"YXZ"===i?(t[0]=Math.asin(-Math.min(Math.max(e[9],-1),1)),Math.abs(e[9])<.99999?(t[1]=Math.atan2(e[8],e[10]),t[2]=Math.atan2(e[1],e[5])):(t[1]=Math.atan2(-e[2],e[0]),t[2]=0)):"ZXY"===i?(t[0]=Math.asin(Math.min(Math.max(e[6],-1),1)),Math.abs(e[6])<.99999?(t[1]=Math.atan2(-e[2],e[10]),t[2]=Math.atan2(-e[4],e[5])):(t[1]=0,t[2]=Math.atan2(e[1],e[0]))):"ZYX"===i?(t[1]=Math.asin(-Math.min(Math.max(e[2],-1),1)),Math.abs(e[2])<.99999?(t[0]=Math.atan2(e[6],e[10]),t[2]=Math.atan2(e[1],e[0])):(t[0]=0,t[2]=Math.atan2(-e[4],e[5]))):"YZX"===i?(t[2]=Math.asin(Math.min(Math.max(e[1],-1),1)),Math.abs(e[1])<.99999?(t[0]=Math.atan2(-e[9],e[5]),t[1]=Math.atan2(-e[2],e[0])):(t[0]=0,t[1]=Math.atan2(e[8],e[10]))):"XZY"===i&&(t[2]=Math.asin(-Math.min(Math.max(e[4],-1),1)),Math.abs(e[4])<.99999?(t[0]=Math.atan2(e[6],e[5]),t[1]=Math.atan2(e[8],e[0])):(t[0]=Math.atan2(-e[9],e[10]),t[1]=0))}(this,t,e),this}fromQuaternion(t,e=this.order){return O.fromQuaternion(t),this.fromRotationMatrix(O,e)}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}}class V{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new j,this.worldMatrix=new j,this.matrixAutoUpdate=!0,this.position=new m,this.quaternion=new k,this.scale=new m(1),this.rotation=new z,this.up=new m(0,1,0),this.rotation.onChange=()=>this.quaternion.fromEuler(this.rotation),this.quaternion.onChange=()=>this.rotation.fromQuaternion(this.quaternion)}setParent(t,e=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,e&&t&&t.addChild(this,!1)}addChild(t,e=!0){~this.children.indexOf(t)||this.children.push(t),e&&t.setParent(this,!1)}removeChild(t,e=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),e&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(null===this.parent?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let e=0,i=this.children.length;e<i;e++)this.children[e].traverse(t)}decompose(){this.matrix.getTranslation(this.position),this.matrix.getRotation(this.quaternion),this.matrix.getScaling(this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,e=!1){e?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion),this.rotation.fromQuaternion(this.quaternion)}}const Z=new j,J=new m,L=new m;class H extends V{constructor(t,{near:e=.1,far:i=100,fov:s=45,aspect:r=1,left:n,right:a,bottom:o,top:h,zoom:l=1}={}){super(),Object.assign(this,{near:e,far:i,fov:s,aspect:r,left:n,right:a,bottom:o,top:h,zoom:l}),this.projectionMatrix=new j,this.viewMatrix=new j,this.projectionViewMatrix=new j,this.worldPosition=new m,this.type=n||a?"orthographic":"perspective","orthographic"===this.type?this.orthographic():this.perspective()}perspective({near:t=this.near,far:e=this.far,fov:i=this.fov,aspect:s=this.aspect}={}){return Object.assign(this,{near:t,far:e,fov:i,aspect:s}),this.projectionMatrix.fromPerspective({fov:i*(Math.PI/180),aspect:s,near:t,far:e}),this.type="perspective",this}orthographic({near:t=this.near,far:e=this.far,left:i=this.left,right:s=this.right,bottom:r=this.bottom,top:n=this.top,zoom:a=this.zoom}={}){return Object.assign(this,{near:t,far:e,left:i,right:s,bottom:r,top:n,zoom:a}),i/=a,s/=a,r/=a,n/=a,this.projectionMatrix.fromOrthogonal({left:i,right:s,bottom:r,top:n,near:t,far:e}),this.type="orthographic",this}updateMatrixWorld(){return super.updateMatrixWorld(),this.viewMatrix.inverse(this.worldMatrix),this.worldMatrix.getTranslation(this.worldPosition),this.projectionViewMatrix.multiply(this.projectionMatrix,this.viewMatrix),this}lookAt(t){return super.lookAt(t,!0),this}project(t){return t.applyMatrix4(this.viewMatrix),t.applyMatrix4(this.projectionMatrix),this}unproject(t){return t.applyMatrix4(Z.inverse(this.projectionMatrix)),t.applyMatrix4(this.worldMatrix),this}updateFrustum(){this.frustum||(this.frustum=[new m,new m,new m,new m,new m,new m]);const t=this.projectionViewMatrix;this.frustum[0].set(t[3]-t[0],t[7]-t[4],t[11]-t[8]).constant=t[15]-t[12],this.frustum[1].set(t[3]+t[0],t[7]+t[4],t[11]+t[8]).constant=t[15]+t[12],this.frustum[2].set(t[3]+t[1],t[7]+t[5],t[11]+t[9]).constant=t[15]+t[13],this.frustum[3].set(t[3]-t[1],t[7]-t[5],t[11]-t[9]).constant=t[15]-t[13],this.frustum[4].set(t[3]-t[2],t[7]-t[6],t[11]-t[10]).constant=t[15]-t[14],this.frustum[5].set(t[3]+t[2],t[7]+t[6],t[11]+t[10]).constant=t[15]+t[14];for(let t=0;t<6;t++){const e=1/this.frustum[t].distance();this.frustum[t].multiply(e),this.frustum[t].constant*=e}}frustumIntersectsMesh(t){if(!t.geometry.attributes.position)return!0;if(t.geometry.bounds&&t.geometry.bounds.radius!==1/0||t.geometry.computeBoundingSphere(),!t.geometry.bounds)return!0;const e=J;e.copy(t.geometry.bounds.center),e.applyMatrix4(t.worldMatrix);const i=t.geometry.bounds.radius*t.worldMatrix.getMaxScaleOnAxis();return this.frustumIntersectsSphere(e,i)}frustumIntersectsSphere(t,e){const i=L;for(let s=0;s<6;s++){const r=this.frustum[s];if(i.copy(r).dot(t)+r.constant<-e)return!1}return!0}}function W(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],m=i[0],d=i[1],g=i[2],p=i[3],f=i[4],x=i[5],A=i[6],v=i[7],w=i[8];return t[0]=m*s+d*a+g*l,t[1]=m*r+d*o+g*c,t[2]=m*n+d*h+g*u,t[3]=p*s+f*a+x*l,t[4]=p*r+f*o+x*c,t[5]=p*n+f*h+x*u,t[6]=A*s+v*a+w*l,t[7]=A*r+v*o+w*c,t[8]=A*n+v*h+w*u,t}class q extends Array{constructor(t=1,e=0,i=0,s=0,r=1,n=0,a=0,o=0,h=1){return super(t,e,i,s,r,n,a,o,h),this}set(t,e,i,s,r,n,a,o,h){return t.length?this.copy(t):(function(t,e,i,s,r,n,a,o,h,l){t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=n,t[5]=a,t[6]=o,t[7]=h,t[8]=l}(this,t,e,i,s,r,n,a,o,h),this)}translate(t,e=this){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],m=i[0],d=i[1];t[0]=s,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=h,t[6]=m*s+d*a+l,t[7]=m*r+d*o+c,t[8]=m*n+d*h+u}(this,e,t),this}rotate(t,e=this){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],m=Math.sin(i),d=Math.cos(i);t[0]=d*s+m*a,t[1]=d*r+m*o,t[2]=d*n+m*h,t[3]=d*a-m*s,t[4]=d*o-m*r,t[5]=d*h-m*n,t[6]=l,t[7]=c,t[8]=u}(this,e,t),this}scale(t,e=this){return function(t,e,i){let s=i[0],r=i[1];t[0]=s*e[0],t[1]=s*e[1],t[2]=s*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}(this,e,t),this}multiply(t,e){return e?W(this,t,e):W(this,this,t),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this}copy(t){var e,i;return i=t,(e=this)[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}fromMatrix4(t){var e,i;return i=t,(e=this)[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[4],e[4]=i[5],e[5]=i[6],e[6]=i[8],e[7]=i[9],e[8]=i[10],this}fromQuaternion(t){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i+i,o=s+s,h=r+r,l=i*a,c=s*a,u=s*o,m=r*a,d=r*o,g=r*h,p=n*a,f=n*o,x=n*h;t[0]=1-u-g,t[3]=c-x,t[6]=m+f,t[1]=c+x,t[4]=1-l-g,t[7]=d-p,t[2]=m-f,t[5]=d+p,t[8]=1-l-u}(this,t),this}fromBasis(t,e,i){return this.set(t[0],t[1],t[2],e[0],e[1],e[2],i[0],i[1],i[2]),this}inverse(t=this){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=c*a-o*l,m=-c*n+o*h,d=l*n-a*h,g=i*u+s*m+r*d;g&&(g=1/g,t[0]=u*g,t[1]=(-c*s+r*l)*g,t[2]=(o*s-r*a)*g,t[3]=m*g,t[4]=(c*i-r*h)*g,t[5]=(-o*i+r*n)*g,t[6]=d*g,t[7]=(-l*i+s*h)*g,t[8]=(a*i-s*n)*g)}(this,t),this}getNormalMatrix(t){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],m=e[10],d=e[11],g=e[12],p=e[13],f=e[14],x=e[15],A=i*o-s*a,v=i*h-r*a,w=i*l-n*a,M=s*h-r*o,y=s*l-n*o,E=r*l-n*h,U=c*p-u*g,F=c*f-m*g,b=c*x-d*g,C=u*f-m*p,R=u*x-d*p,T=m*x-d*f,S=A*T-v*R+w*C+M*b-y*F+E*U;S&&(S=1/S,t[0]=(o*T-h*R+l*C)*S,t[1]=(h*b-a*T-l*F)*S,t[2]=(a*R-o*b+l*U)*S,t[3]=(r*R-s*T-n*C)*S,t[4]=(i*T-r*b+n*F)*S,t[5]=(s*b-i*R-n*U)*S,t[6]=(p*E-f*y+x*M)*S,t[7]=(f*w-g*E-x*v)*S,t[8]=(g*y-p*w+x*A)*S)}(this,t),this}}let X=0;class _ extends V{constructor(t,{geometry:e,program:i,mode:s=t.TRIANGLES,frustumCulled:r=!0,renderOrder:n=0}={}){super(),t.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=t,this.id=X++,this.geometry=e,this.program=i,this.mode=s,this.frustumCulled=r,this.renderOrder=n,this.modelViewMatrix=new j,this.normalMatrix=new q,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){this.beforeRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t}))),t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix);let e=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:e}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t})))}}const $=new Uint8Array(4);function tt(t){return!(t&t-1)}let et=1;class it{constructor(t,{image:e,target:i=t.TEXTURE_2D,type:s=t.UNSIGNED_BYTE,format:r=t.RGBA,internalFormat:n=r,wrapS:a=t.CLAMP_TO_EDGE,wrapT:o=t.CLAMP_TO_EDGE,generateMipmaps:h=!0,minFilter:l=(h?t.NEAREST_MIPMAP_LINEAR:t.LINEAR),magFilter:c=t.LINEAR,premultiplyAlpha:u=!1,unpackAlignment:m=4,flipY:d=i==t.TEXTURE_2D,anisotropy:g=0,level:p=0,width:f,height:x=f}={}){this.gl=t,this.id=et++,this.image=e,this.target=i,this.type=s,this.format=r,this.internalFormat=n,this.minFilter=l,this.magFilter=c,this.wrapS=a,this.wrapT=o,this.generateMipmaps=h,this.premultiplyAlpha=u,this.unpackAlignment=m,this.flipY=d,this.anisotropy=Math.min(g,this.gl.renderer.parameters.maxAnisotropy),this.level=p,this.width=f,this.height=x,this.texture=this.gl.createTexture(),this.store={image:null},this.glState=this.gl.renderer.state,this.state={},this.state.minFilter=this.gl.NEAREST_MIPMAP_LINEAR,this.state.magFilter=this.gl.LINEAR,this.state.wrapS=this.gl.REPEAT,this.state.wrapT=this.gl.REPEAT,this.state.anisotropy=0}bind(){this.glState.textureUnits[this.glState.activeTextureUnit]!==this.id&&(this.gl.bindTexture(this.target,this.texture),this.glState.textureUnits[this.glState.activeTextureUnit]=this.id)}update(t=0){const e=!(this.image===this.store.image&&!this.needsUpdate);if((e||this.glState.textureUnits[t]!==this.id)&&(this.gl.renderer.activeTexture(t),this.bind()),e){if(this.needsUpdate=!1,this.flipY!==this.glState.flipY&&(this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,this.flipY),this.glState.flipY=this.flipY),this.premultiplyAlpha!==this.glState.premultiplyAlpha&&(this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),this.glState.premultiplyAlpha=this.premultiplyAlpha),this.unpackAlignment!==this.glState.unpackAlignment&&(this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,this.unpackAlignment),this.glState.unpackAlignment=this.unpackAlignment),this.minFilter!==this.state.minFilter&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.minFilter),this.state.minFilter=this.minFilter),this.magFilter!==this.state.magFilter&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.magFilter),this.state.magFilter=this.magFilter),this.wrapS!==this.state.wrapS&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.wrapS),this.state.wrapS=this.wrapS),this.wrapT!==this.state.wrapT&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.wrapT),this.state.wrapT=this.wrapT),this.anisotropy&&this.anisotropy!==this.state.anisotropy&&(this.gl.texParameterf(this.target,this.gl.renderer.getExtension("EXT_texture_filter_anisotropic").TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy),this.state.anisotropy=this.anisotropy),this.image){if(this.image.width&&(this.width=this.image.width,this.height=this.image.height),this.target===this.gl.TEXTURE_CUBE_MAP)for(let t=0;t<6;t++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+t,this.level,this.internalFormat,this.format,this.type,this.image[t]);else if(ArrayBuffer.isView(this.image))this.gl.texImage2D(this.target,this.level,this.internalFormat,this.width,this.height,0,this.format,this.type,this.image);else if(this.image.isCompressedTexture)for(let t=0;t<this.image.length;t++)this.gl.compressedTexImage2D(this.target,t,this.internalFormat,this.image[t].width,this.image[t].height,0,this.image[t].data);else this.gl.texImage2D(this.target,this.level,this.internalFormat,this.format,this.type,this.image);this.generateMipmaps&&(this.gl.renderer.isWebgl2||tt(this.image.width)&&tt(this.image.height)?this.gl.generateMipmap(this.target):(this.generateMipmaps=!1,this.wrapS=this.wrapT=this.gl.CLAMP_TO_EDGE,this.minFilter=this.gl.LINEAR)),this.onUpdate&&this.onUpdate()}else if(this.target===this.gl.TEXTURE_CUBE_MAP)for(let t=0;t<6;t++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this.gl.RGBA,1,1,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,$);else this.width?this.gl.texImage2D(this.target,this.level,this.internalFormat,this.width,this.height,0,this.format,this.type,null):this.gl.texImage2D(this.target,0,this.gl.RGBA,1,1,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,$);this.store.image=this.image}}}class st extends Array{constructor(t=0,e=t,i=t,s=t){return super(t,e,i,s),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set w(t){this[3]=t}set(t,e,i,s){return t.length?this.copy(t):(T(this,t,e,i,s),this)}copy(t){return R(this,t),this}normalize(){return S(this,this),this}multiply(t){var e,i,s;return i=this,s=t,(e=this)[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=i[3]*s,this}dot(t){return I(this,t)}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}}class rt extends x{constructor(t,{width:e=1,height:i=1,widthSegments:s=1,heightSegments:r=1,attributes:n={}}={}){const a=s,o=r,h=(a+1)*(o+1),l=a*o*6,c=new Float32Array(3*h),u=new Float32Array(3*h),m=new Float32Array(2*h),d=l>65536?new Uint32Array(l):new Uint16Array(l);rt.buildPlane(c,u,m,d,e,i,0,a,o),Object.assign(n,{position:{size:3,data:c},normal:{size:3,data:u},uv:{size:2,data:m},index:{data:d}}),super(t,n)}static buildPlane(t,e,i,s,r,n,a,o,h,l=0,c=1,u=2,m=1,d=-1,g=0,p=0){const f=g,x=r/o,A=n/h;for(let v=0;v<=h;v++){let w=v*A-n/2;for(let n=0;n<=o;n++,g++){let A=n*x-r/2;if(t[3*g+l]=A*m,t[3*g+c]=w*d,t[3*g+u]=a/2,e[3*g+l]=0,e[3*g+c]=0,e[3*g+u]=a>=0?1:-1,i[2*g]=n/o,i[2*g+1]=1-v/h,v===h||n===o)continue;let M=f+n+v*(o+1),y=f+n+(v+1)*(o+1),E=f+n+(v+1)*(o+1)+1,U=f+n+v*(o+1)+1;s[6*p]=M,s[6*p+1]=y,s[6*p+2]=U,s[6*p+3]=y,s[6*p+4]=E,s[6*p+5]=U,p++}}}}const nt="data:image/jpeg;base64,/9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ixzfWjzRYuRnmy5Ci0KUEa11kmVY5uhwkYFjZfWMRVTFIiJ7PMXKKBZQqFxxNmI+QzR6XowbdGExyYzBGUusIEpjghzMh2NIckVO6EkUJIxkXITSE0fyNIsxRcRxHscOvQykUSikZoqx2zMUdifTzMTISVdrEoyGxwZ6MwY5GBIsbLNCiKSaKKlRihyVDMBzMEWNsUImchRIiVn9mSMYscmyWZoaHKJaEJCxGkxysxuiTkOBnopWYFC5UUmUKSN6NbFHrFDyP6FZiNjstCZiOUhQMjIUWeguM1fVlpmMhlDn1h1YmrLEpmtdWmU+skZiiYGbRgj//xAAUEQEAAAAAAAAAAAAAAAAAAADA/9oACAECAQE/AAAH/8QAFBEBAAAAAAAAAAAAAAAAAAAAwP/aAAgBAwEBPwAAB//Z",at=.5*(Math.sqrt(3)-1),ot=(3-Math.sqrt(3))/6,ht=t=>0|Math.floor(t),lt=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]);function ct(t){return t*(.5-Math.random())}function ut(t,e){return t+Math.random()*(e-t)}const mt=function(t=Math.random){const e=function(t){const e=512,i=new Uint8Array(e);for(let t=0;t<e/2;t++)i[t]=t;for(let s=0;s<e/2-1;s++){const e=s+~~(t()*(256-s)),r=i[s];i[s]=i[e],i[e]=r}for(let t=256;t<e;t++)i[t]=i[t-256];return i}(t),i=new Float64Array(e).map((t=>lt[t%12*2])),s=new Float64Array(e).map((t=>lt[t%12*2+1]));return function(t,r){let n=0,a=0,o=0;const h=(t+r)*at,l=ht(t+h),c=ht(r+h),u=(l+c)*ot,m=t-(l-u),d=r-(c-u);let g,p;m>d?(g=1,p=0):(g=0,p=1);const f=m-g+ot,x=d-p+ot,A=m-1+2*ot,v=d-1+2*ot,w=255&l,M=255&c;let y=.5-m*m-d*d;if(y>=0){const t=w+e[M];y*=y,n=y*y*(i[t]*m+s[t]*d)}let E=.5-f*f-x*x;if(E>=0){const t=w+g+e[M+p];E*=E,a=E*E*(i[t]*f+s[t]*x)}let U=.5-A*A-v*v;if(U>=0){const t=w+1+e[M+1];U*=U,o=U*U*(i[t]*A+s[t]*v)}return 70*(n+a+o)}}(Math.random);function dt(t){return Math.max(0,Math.min(1,t))}const gt="float PI = 3.141592653589793238;",pt="\nprecision highp float;\n\nuniform float time;\nuniform float progress;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform vec4 resolution;\nvarying vec2 vUv;\n",ft="\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute float offset;\nattribute vec3 bary;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float progress;\nuniform vec4 resolution;\n\nvarying vec2 vUv;\nvarying float vProgress;\nvarying float vProgress1;\nvarying vec3 vBary;\n",xt="\nmat4 rotationMatrix(vec3 axis, float angle) {\n axis = normalize(axis);\n float s = sin(angle);\n float c = cos(angle);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\nvec3 rotate(vec3 v, vec3 axis, float angle) {\n mat4 m = rotationMatrix(axis, angle);\n return (m * vec4(v, 1.0)).xyz;\n}\n",At={dots:{uniforms:{},fragment:`\n ${pt}\n const float SQRT_2 = 1.414213562373;\n const vec2 center = vec2(0, 0);// = vec2(0, 0);\n const float dots = 20.0;// = 20.0;\n\n vec4 getFromColor(vec2 p) {\n return texture2D(texture1, p);\n }\n\n vec4 getToColor(vec2 p) {\n return texture2D(texture2, p);\n }\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n bool nextImage = distance(fract(newUV * dots), vec2(0.5, 0.5)) < ( progress / distance(newUV, center));\n gl_FragColor = nextImage ? getToColor(newUV) : getFromColor(newUV);\n }\n\n `},flyeye:{uniforms:{},fragment:`\n ${pt}\n const float size = 0.04; // = 0.04\n const float zoom = 100.0; // = 50.0\n const float colorSeparation = 0.3; // = 0.3\n\n vec4 getFromColor(vec2 p) {\n return texture2D(texture1, p);\n }\n\n vec4 getToColor(vec2 p) {\n return texture2D(texture2, p);\n }\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float inv = 1. - progress;\n vec2 disp = size*vec2(cos(zoom*newUV.x), sin(zoom*newUV.y));\n vec4 texTo = getToColor(newUV + inv*disp);\n vec4 texFrom = vec4(\n getFromColor(newUV + progress*disp*(1.0 - colorSeparation)).r,\n getFromColor(newUV + progress*disp).g,\n getFromColor(newUV + progress*disp*(1.0 + colorSeparation)).b,\n 1.0);\n gl_FragColor = texTo*progress + texFrom*inv;\n }\n\n `},"morph-x":{uniforms:{intensity:{value:1,type:"f",min:0,max:3}},fragment:`\n ${pt}\n uniform float intensity;\n uniform sampler2D displacement;\n mat2 getRotM(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n return mat2(c, -s, s, c);\n }\n const float PI = 3.1415;\n const float angle1 = PI *0.25;\n const float angle2 = -PI *0.75;\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec4 disp = texture2D(displacement, newUV);\n vec2 dispVec = vec2(disp.r, disp.g);\n vec2 distortedPosition1 = newUV + getRotM(angle1) * dispVec * intensity * progress;\n vec4 t1 = texture2D(texture1, distortedPosition1);\n vec2 distortedPosition2 = newUV + getRotM(angle2) * dispVec * intensity * (1.0 - progress);\n vec4 t2 = texture2D(texture2, distortedPosition2);\n gl_FragColor = mix(t1, t2, progress);\n }\n`},"morph-y":{uniforms:{intensity:{value:.3,type:"f",min:0,max:2}},fragment:`\n ${pt}\n uniform float intensity;\n uniform sampler2D displacement;\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec4 d1 = texture2D(texture1, newUV);\n vec4 d2 = texture2D(texture2, newUV);\n float displace1 = (d1.r + d1.g + d1.b)*0.33;\n float displace2 = (d2.r + d2.g + d2.b)*0.33;\n\n vec4 t1 = texture2D(texture1, vec2(newUV.x, newUV.y + progress * (displace2 * intensity)));\n vec4 t2 = texture2D(texture2, vec2(newUV.x, newUV.y + (1.0 - progress) * (displace1 * intensity)));\n gl_FragColor = mix(t1, t2, progress);\n }\n`},"page-curl":{uniforms:{},fragment:`\n ${pt}\n const float MIN_AMOUNT = -0.16;\n const float MAX_AMOUNT = 1.5;\n\n const float PI = 3.141592653589793;\n\n const float scale = 512.0;\n const float sharpness = 3.0;\n\n const float cylinderRadius = 1.0 / PI / 2.0;\n\n vec4 getFromColor(vec2 p) {\n return texture2D(texture1, p);\n }\n\n vec4 getToColor(vec2 p) {\n return texture2D(texture2, p);\n }\n\n vec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation) {\n float hitPoint = hitAngle / (2.0 * PI);\n point.y = hitPoint;\n return rrotation * point;\n }\n\n vec4 antiAlias(vec4 color1, vec4 color2, float distanc) {\n distanc *= scale;\n if(distanc < 0.0)\n return color2;\n if(distanc > 2.0)\n return color1;\n float dd = pow(1.0 - distanc / 2.0, sharpness);\n return ((color2 - color1) * dd) + color1;\n }\n\n float distanceToEdge(vec3 point) {\n float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x);\n float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y);\n if(point.x < 0.0)\n dx = -point.x;\n if(point.x > 1.0)\n dx = point.x - 1.0;\n if(point.y < 0.0)\n dy = -point.y;\n if(point.y > 1.0)\n dy = point.y - 1.0;\n if((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0))\n return sqrt(dx * dx + dy * dy);\n return min(dx, dy);\n }\n\n vec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation, float cylinderAngle) {\n float hitAngle = PI - (acos(yc / cylinderRadius) - cylinderAngle);\n vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation);\n if(yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0)) {\n return getToColor(p);\n }\n\n if(yc > 0.0)\n return getFromColor(p);\n\n vec4 color = getFromColor(point.xy);\n vec4 tcolor = vec4(0.0);\n\n return antiAlias(color, tcolor, distanceToEdge(point));\n }\n\n vec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation, float cylinderAngle, float amount) {\n float shadow = distanceToEdge(point) * 30.0;\n shadow = (1.0 - shadow) / 3.0;\n\n if(shadow < 0.0)\n shadow = 0.0;\n else\n shadow *= amount;\n\n vec4 shadowColor = seeThrough(yc, p, rotation, rrotation, cylinderAngle);\n shadowColor.r -= shadow;\n shadowColor.g -= shadow;\n shadowColor.b -= shadow;\n\n return shadowColor;\n }\n\n vec4 backside(float yc, vec3 point) {\n vec4 color = getFromColor(point.xy);\n float gray = (color.r + color.b + color.g) / 15.0;\n gray += (8.0 / 10.0) * (pow(1.0 - abs(yc / cylinderRadius), 2.0 / 10.0) / 2.0 + (5.0 / 10.0));\n color.rgb = vec3(gray);\n return color;\n }\n\n vec4 behindSurface(vec2 p, float yc, vec3 point, mat3 rrotation, float cylinderAngle, float amount) {\n float shado = (1.0 - ((-cylinderRadius - yc) / amount * 7.0)) / 6.0;\n shado *= 1.0 - abs(point.x - 0.5);\n\n yc = (-cylinderRadius - cylinderRadius - yc);\n\n float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI;\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if(yc < 0.0 && point.x >= 0.0 && point.y >= 0.0 && point.x <= 1.0 && point.y <= 1.0 && (hitAngle < PI || amount > 0.5)) {\n shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / (71.0 / 100.0));\n shado *= pow(-yc / cylinderRadius, 3.0);\n shado *= 0.5;\n } else {\n shado = 0.0;\n }\n return vec4(getToColor(p).rgb - shado, 1.0);\n }\n\n void main() {\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n\n float amount = progress * (MAX_AMOUNT - MIN_AMOUNT) + MIN_AMOUNT;\n float cylinderCenter = amount;\n // 360 degrees * amount\n float cylinderAngle = 2.0 * PI * amount;\n\n const float angle = 100.0 * PI / 180.0;\n float c = cos(-angle);\n float s = sin(-angle);\n\n mat3 rotation = mat3(c, s, 0, -s, c, 0, -0.801, 0.8900, 1);\n c = cos(angle);\n s = sin(angle);\n\n mat3 rrotation = mat3(c, s, 0, -s, c, 0, 0.98500, 0.985, 1);\n\n vec3 point = rotation * vec3(newUV, 1.0);\n\n float yc = point.y - cylinderCenter;\n\n if(yc < -cylinderRadius) {\n // Behind surface\n gl_FragColor = behindSurface(newUV, yc, point, rrotation, cylinderAngle, amount);\n return;\n }\n\n if(yc > cylinderRadius) {\n // Flat surface\n gl_FragColor = getFromColor(newUV);\n return;\n }\n\n float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI;\n\n float hitAngleMod = mod(hitAngle, 2.0 * PI);\n if((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI / 2.0 && amount < 0.0)) {\n gl_FragColor = seeThrough(yc, newUV, rotation, rrotation, cylinderAngle);\n return;\n }\n\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if(point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0) {\n gl_FragColor = seeThroughWithShadow(yc, newUV, point, rotation, rrotation, cylinderAngle, amount);\n return;\n }\n\n vec4 color = backside(yc, point);\n\n vec4 otherColor;\n if(yc < 0.0) {\n float shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / 0.71);\n shado *= pow(-yc / cylinderRadius, 3.0);\n shado *= 0.5;\n otherColor = vec4(0.0, 0.0, 0.0, shado);\n } else {\n otherColor = getFromColor(newUV);\n }\n\n color = antiAlias(color, otherColor, cylinderRadius - abs(yc));\n\n vec4 cl = seeThroughWithShadow(yc, newUV, point, rotation, rrotation, cylinderAngle, amount);\n float dist = distanceToEdge(point);\n\n gl_FragColor = antiAlias(color, cl, dist);\n }\n `},"peel-x":{uniforms:{},fragment:`\n ${pt}\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec2 p = newUV;\n float x = progress;\n x = smoothstep(.0,1.0,(x*2.0+p.x-1.0));\n vec4 f = mix(\n texture2D(texture1, (p-.5)*(1.-x)+.5),\n texture2D(texture2, (p-.5)*x+.5),\n x);\n gl_FragColor = f;\n }\n `},"peel-y":{uniforms:{},fragment:`\n ${pt}\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec2 p = newUV;\n float x = progress;\n x = smoothstep(.0,1.0,(x*2.0+p.y-1.0));\n vec4 f = mix(\n texture2D(texture1, (p-.5)*(1.-x)+.5),\n texture2D(texture2, (p-.5)*x+.5),\n x);\n gl_FragColor = f;\n }\n `},"polygons-fall":{uniforms:{},detail:12,offsetTop:0,vertex:`\n ${ft}\n attribute vec3 centroid1;\n\n ${xt}\n\n void main() {\n ${gt}\n vUv = uv;\n vBary = bary;\n\n vec3 newpos = position;\n\n float o = 1. - offset;\n float pr = (progress - 0.5) * (0. + resolution.y / resolution.x) + 0.5;\n pr = progress;\n float prog = clamp((pr - o * 0.9) / 0.1, 0., 1.);\n vProgress = prog;\n vProgress1 = clamp((pr - clamp(o - 0.1, 0., 1.) * 0.9) / 0.1, 0., 1.);\n newpos = rotate((newpos - centroid1), vec3(1., 0., 0.), -prog * PI) + centroid1 + vec3(0., -1., 0.) * prog * 0.;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newpos, 1.0);\n }\n `,fragment:`\n ${pt}\n varying float vProgress;\n varying float vProgress1;\n ${gt}\n varying vec3 vBary;\n\n void main()\t{\n float width = 2.5 * vProgress1;\n vec3 d;\n #ifdef GL_OES_standard_derivatives\n d = fwidth(vBary);\n #endif\n vec3 s = smoothstep(d * (width + 0.5), d * (width - 0.5), vBary);\n float alpha = max(max(s.x, s.y), s.z);\n vec3 color = vec3(alpha);\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n vec4 t = texture2D(texture1, newUV);\n float opa = smoothstep(1., 0.5, vProgress);\n opa = 1. - vProgress;\n gl_FragColor = vec4(vUv, 0.0, opa);\n gl_FragColor = vec4(t.rgb + .5 * color * vProgress1, opa);\n }\n `},"polygons-morph":{uniforms:{},detail:20,offsetTop:.4,vertex:`\n ${ft}\n ${xt}\n\n void main() {\n ${gt}\n vUv = uv;\n vBary = bary;\n\n vec3 newpos = position;\n\n float o = 1. - offset;\n float prog = clamp((progress - o * 0.6) / 0.4, 0., 1.);\n vProgress = prog;\n vProgress1 = clamp((progress - clamp(o - 0.1, -0., 1.) * 0.9) / 0.1, 0., 1.);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newpos, 1.0);\n }\n `,fragment:`\n ${pt}\n varying float vProgress;\n varying float vProgress1;\n ${gt}\n varying vec3 vBary;\n void main()\t{\n float width = 2.5 * vProgress1;\n vec3 d;\n #ifdef GL_OES_standard_derivatives\n d = fwidth(vBary);\n #endif\n vec3 s = smoothstep(d * (width + 0.5), d * (width - 0.5), vBary);\n float alpha = max(max(s.x, s.y), s.z);\n vec3 color = vec3(alpha);\n\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n vec4 t = texture2D(texture1, newUV);\n float opa = smoothstep(1., 0.5, vProgress);\n opa = 1. - vProgress;\n gl_FragColor = vec4(t.rgb + 1. * color * vProgress1, opa);\n }\n `},"polygons-wind":{uniforms:{},detail:40,offsetTop:1,vertex:`\n ${ft}\n attribute vec3 control0;\n attribute vec3 control1;\n\n ${xt}\n\n float easeOut(float t){\n return t * t * t;\n }\n\n vec3 bezier4(vec3 a, vec3 b, vec3 c, vec3 d, float t) {\n return mix(mix(mix(a, b, t), mix(b, c, t), t), mix(mix(b, c, t), mix(c, d, t), t), t);\n }\n\n void main() {\n ${gt}\n vUv = uv;\n vBary = bary;\n\n vec3 newpos = position;\n\n float o = 1. - offset;\n float prog = clamp((progress - o * 0.6) / 0.4, 0., 1.);\n vProgress = prog;\n vProgress1 = clamp((progress - clamp(o - 0.2, -0., 1.) * 0.6) / 0.4, 0., 1.);\n newpos = bezier4(newpos, control0, control1, newpos, easeOut(prog));\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newpos, 1.0);\n }\n `,fragment:`\n ${pt}\n varying float vProgress;\n varying float vProgress1;\n ${gt}\n varying vec3 vBary;\n void main()\t{\n float width = 2.5 * vProgress1;\n vec3 d;\n #ifdef GL_OES_standard_derivatives\n d = fwidth(vBary);\n #endif\n vec3 s = smoothstep(d * (width + 0.5), d * (width - 0.5), vBary);\n float alpha = max(max(s.x, s.y), s.z);\n vec3 color = vec3(alpha);\n\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n vec4 t = texture2D(texture1, newUV);\n float opa = smoothstep(1., 0.5, vProgress);\n opa = 1. - vProgress;\n gl_FragColor = vec4(vUv, 0.0, opa);\n opa = smoothstep(0.5, 1., opa);\n gl_FragColor = vec4(t.rgb + 1. * color * vProgress1, opa);\n }\n `},pixelize:{uniforms:{},fragment:`\n ${pt}\n ivec2 squaresMin = ivec2(50);\n int steps = 20;\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float d = min(progress, 1.0 - progress);\n float dist = steps>0 ? ceil(d * float(steps)) / float(steps) : d;\n vec2 squareSize = 2.0 * dist / vec2(squaresMin);\n\n vec2 p = dist>0.0 ? (floor(newUV / squareSize) + 0.5) * squareSize : newUV;\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,p);\n vec4 t2 = texture2D(texture2,p);\n\n gl_FragColor = mix(t1, t2, progress);\n }\n `},ripple:{uniforms:{radius:{value:.9,type:"f",min:.1,max:2},width:{value:.35,type:"f",min:0,max:1}},fragment:`\n ${pt}\n uniform float width;\n uniform float radius;\n uniform sampler2D displacement;\n float parabola( float x, float k ) {\n return pow( 4. * x * ( 1. - x ), k );\n }\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec2 p = newUV;\n vec2 start = vec2(0.5,0.5);\n vec2 aspect = resolution.wz;\n vec2 uv = newUV;\n float dt = parabola(progress, 1.);\n vec4 noise = texture2D(displacement, fract(vUv+time*0.04));\n float prog = progress*0.66 + noise.g * 0.04;\n float circ = 1. - smoothstep(-width, 0.0, radius * distance(start*aspect, uv*aspect) - prog*(1.+width));\n float intpl = pow(abs(circ), 1.);\n vec4 t1 = texture2D( texture1, (uv - 0.5) * (1.0 - intpl) + 0.5 ) ;\n vec4 t2 = texture2D( texture2, (uv - 0.5) * intpl + 0.5 );\n gl_FragColor = mix( t1, t2, intpl );\n }\n `},shutters:{uniforms:{intensity:{value:50,type:"f",min:1,max:100}},fragment:`\n ${pt}\n uniform float intensity;\n mat2 rotate(float a) {\n float s = sin(a);\n float c = cos(a);\n return mat2(c, -s, s, c);\n }\n const float PI = 3.1415;\n const float angle1 = PI *0.25;\n const float angle2 = PI *0.25;\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n vec2 uvDivided = fract(newUV*vec2(intensity,1.));\n\n vec2 uvDisplaced1 = newUV + rotate(angle1)*uvDivided*progress*0.1;\n vec2 uvDisplaced2 = newUV + rotate(angle2)*uvDivided*(1. - progress)*0.1;\n\n vec4 t1 = texture2D(texture1,uvDisplaced1);\n vec4 t2 = texture2D(texture2,uvDisplaced2);\n\n gl_FragColor = mix(t1, t2, progress);\n }\n\n `},slices:{uniforms:{size:{value:.25,type:"f",min:.1,max:1}},fragment:`\n ${pt}\n uniform float size; // = 0.2\n float count = 20.; // = 10.0\n float smoothness = .5; // = 0.5\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float pr = smoothstep(-smoothness, 0.0, newUV.x - progress * (1.0 + smoothness));\n float s = step(pr, fract(count * newUV.x));\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,uv1);\n vec4 t2 = texture2D(texture2,uv2);\n gl_FragColor = mix(t1, t2, s);\n\n }\n `},squares:{uniforms:{},fragment:`\n ${pt}\n ivec2 squares = ivec2(10,10);\n vec2 direction = vec2(1.0, -0.5);\n float smoothness = 1.6;\n\n const vec2 center = vec2(0.5, 0.5);\n void main() {\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float offset = smoothness;\n float pr = smoothstep(-offset, 0.0, v.x * newUV.x + v.y * newUV.y - (d-0.5+progress*(1.+offset)));\n vec2 squarep = fract(newUV*vec2(squares));\n vec2 squaremin = vec2(pr/2.0);\n vec2 squaremax = vec2(1.0 - pr/2.0);\n float a = (1.0 - step(progress, 0.0)) * step(squaremin.x, squarep.x) * step(squaremin.y, squarep.y) * step(squarep.x, squaremax.x) * step(squarep.y, squaremax.y);\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,newUV);\n vec4 t2 = texture2D(texture2,newUV);\n\n gl_FragColor = mix(t1, t2, a);\n }\n `},stretch:{uniforms:{intensity:{value:50,type:"f",min:1,max:100}},fragment:`\n ${pt}\n uniform float intensity;\n mat2 rotate(float a) {\n float s = sin(a);\n float c = cos(a);\n return mat2(c, -s, s, c);\n }\n const float PI = 3.1415;\n const float angle1 = PI *0.25;\n const float angle2 = -PI *0.75;\n const float noiseSeed = 2.;\n float random() {\n return fract(sin(noiseSeed + dot(gl_FragCoord.xy / resolution.xy / 10.0, vec2(12.9898, 4.1414))) * 43758.5453);\n }\n float hash(float n) { return fract(sin(n) * 1e4); }\n float hash(vec2 p) { return fract(1e4 * sin(17.0 * p.x + p.y * 0.1) * (0.1 + abs(sin(p.y * 13.0 + p.x)))); }\n float hnoise(vec2 x) {\n vec2 i = floor(x);\n vec2 f = fract(x);\n float a = hash(i);\n float b = hash(i + vec2(1.0, 0.0));\n float c = hash(i + vec2(0.0, 1.0));\n float d = hash(i + vec2(1.0, 1.0));\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;\n }\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float hn = hnoise(newUV.xy * resolution.xy / 100.0);\n vec2 d = vec2(0.,normalize(vec2(0.5,0.5) - newUV.xy).y);\n vec2 uv1 = newUV + d * progress / 5.0 * (1.0 + hn / 2.0);\n vec2 uv2 = newUV - d * (1.0 - progress) / 5.0 * (1.0 + hn / 2.0);\n vec4 t1 = texture2D(texture1,uv1);\n vec4 t2 = texture2D(texture2,uv2);\n gl_FragColor = mix(t1, t2, progress);\n }\n `},"wave-x":{uniforms:{},fragment:`\n ${pt}\n uniform sampler2D displacement;\n vec2 mirrored(vec2 v) {\n vec2 m = mod(v,2.);\n return mix(m,2.0 - m, step(1.0 ,m));\n }\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec4 noise = texture2D(displacement, mirrored(newUV+time*0.04));\n float prog = (1.0 - progress)*0.8 -0.05 + noise.g * 0.06;\n float intpl = pow(abs(smoothstep(0., 1., (prog*2. - vUv.x + 0.5))), 10.);\n\n vec4 t1 = texture2D( texture2, (newUV - 0.5) * (1.0 - intpl) + 0.5 ) ;\n vec4 t2 = texture2D( texture1, (newUV - 0.5) * intpl + 0.5 );\n gl_FragColor = mix( t1, t2, intpl );\n }\n `},wind:{uniforms:{},fragment:`\n ${pt}\n float size = 0.2;\n\n float rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n }\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float r = rand(vec2(0, newUV.y));\n float m = smoothstep(0.0, -size, newUV.x*(1.0-size) + size*r - ((progress) * (1.0 + size)));\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,uv1);\n vec4 t2 = texture2D(texture2,uv2);\n gl_FragColor = mix(t1, t2, m);\n\n }\n `}},vt="\nattribute vec2 uv;\nattribute vec3 position;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",wt=(t,e)=>{const{shaderPerSlide:i,swiper:s}=e,r=s.params.loop?s.realIndex:s.activeIndex;let n=At;if(Array.isArray(t)&&t.length){if(i)return void 0===t[r]?At[t[0]]:At[t[r]];n={},Object.keys(At).forEach((e=>{t.includes(e)&&(n[e]=At[e])}))}const a=Math.floor(Math.random()*Object.keys(n).length);return n[Object.keys(n)[a]]};class Mt{constructor(t){const e="random"===t.shader||Array.isArray(t.shader)?wt(t.shader,t):At[t.shader];this.shader=e,this.displacement=t.displacementMap||nt,this.scene=new V,this.swiper=t.swiper,this.vertex=e.vertex||vt,this.fragment=e.fragment,this.uniforms=e.uniforms||{},this.renderer=new C({dpr:2,webgl:2,alpha:!0}),this.gl=this.renderer.gl,this.width=window.innerWidth,this.height=window.innerHeight,this.renderer.setSize(this.width,this.height),this.gl.clearColor(1,1,1,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.opts=t,this.container=this.swiper.el,this.displacementTexture=null,this.width=this.swiper.width,this.height=this.swiper.height,this.swiper.isElement&&this.gl.canvas.setAttribute("slot","container-start"),this.container.prepend(this.gl.canvas),this.camera=new H(this.gl,{fov:45}),this.camera.perspective({aspect:this.gl.canvas.width/this.gl.canvas.height}),this.camera.position.set(0,0,2),this.time=0,this.current=0,this.init((()=>{this.addObjects(),this.resize(),this.render()}))}animateUniform(t,e,i){const s=t.value;let r,n=null;window.cancelAnimationFrame(this.animateUniformFrame);const a=e>t.value?"next":"prev",o=(t,e)=>"next"===a&&t>=e||"prev"===a&&t<=e,h=()=>{if(this.destroyed)return;r=(new Date).getTime(),null===n&&(n=r);const a=Math.max(Math.min((r-n)/this.swiper.params.speed,1),0),l=.5-Math.cos(a*Math.PI)/2;let c=s+l*(e-s);if(o(c,e)&&(c=e),t.value=c,o(c,e))return cancelAnimationFrame(this.animateUniformFrame),void(i&&i());this.animateUniformFrame=requestAnimationFrame(h)};h()}loadTextures(){const t=[],e=this;return this.images=[],this.textures=[],this.container.querySelectorAll(".swiper-gl-image").forEach((t=>{this.images.push(t.src)})),this.images.forEach(((i,s)=>{const r=new Promise((t=>{const r=new Image;r.crossOrigin="anonymous";const n=new it(this.gl);r.onload=()=>{n.image=r,e.textures[s]=n,t()},r.src=i}));t.push(r)})),t.push(new Promise((t=>{const i=new Image;i.crossOrigin="anonymous";const s=new it(this.gl);i.onload=()=>{s.image=i,e.displacementTexture=s,t()},i.src=nt}))),Promise.all(t)}init(t){this.loadTextures().then((()=>{this.initialized=!0,this.onInit&&this.onInit(),t()}))}resize(){if(!this.initialized||this.destroyed)return;const{width:t,height:e}=this.swiper;this.width=t,this.height=e,this.renderer.setSize(t,e);const i=this.camera.position.z;if(this.camera.perspective({aspect:t/e,fov:180/Math.PI*2*Math.atan(1/(2*i))}),!this.textures[0].image)return;const s=this.textures[0].image.height/this.textures[0].image.width;let r,n;e/t>s?(r=t/e*s,n=1):(r=1,n=e/t/s),this.material.uniforms.resolution.value.x=t,this.material.uniforms.resolution.value.y=e,this.material.uniforms.resolution.value.z=r,this.material.uniforms.resolution.value.w=n,this.shader.vertex&&this.vertexMaterial&&(this.vertexMaterial.uniforms.resolution.value.x=t,this.vertexMaterial.uniforms.resolution.value.y=e,this.vertexMaterial.uniforms.resolution.value.z=r,this.vertexMaterial.uniforms.resolution.value.w=n),this.shader.vertex?(this.nextMesh.scale.set(this.camera.aspect/2,.5,.5),this.currentMesh.scale.set(this.camera.aspect/2,.5,.5)):(this.plane.scale.x=this.camera.aspect,this.plane.scale.y=1)}createMaterial(){return new w(this.gl,{extensions:{derivatives:"#extension GL_OES_standard_derivatives : enable"},uniforms:{time:{type:"f",value:0},progress:{type:"f",value:0},intensity:{type:"f",value:0},width:{type:"f",value:0},radius:{type:"f",value:0},size:{type:"f",value:0},texture1:{type:"f",value:this.textures[0]},texture2:{type:"f",value:this.textures[1]},displacement:{type:"f",value:this.displacementTexture},resolution:{type:"v4",value:new st}},vertex:this.shader.vertex||vt,fragment:this.shader.fragment,...this.shader.vertex?{transparent:!0,depthWrite:!1}:{}})}addObjects(){if(this.scene.children.forEach((t=>{this.scene.removeChild(t)})),this.scene.children.forEach((t=>{this.scene.removeChild(t)})),this.material=this.createMaterial(),this.shader.vertex){const t=function(t,e,i){i=i||0;const s=e,r=2/s,n=r*Math.sqrt(3)/2,a=2/n,o=[],h=[],l=[],c=[],u=[],m=[],d=[];let g=0;const p=[];let f=0;for(let t=0;t<a;t+=1){f=t*n,g=t%2==1?-r/2:0;for(let x=0;x<=s;x+=1){const s=Math.sign(x*r+g-1);h.push(x*r+g-1,f-1,0),d.push((x*r+g)/2,f/2),h.push(x*r+r/2+g-1,n+f-1,0),d.push((x*r+r/2+g)/2,(n+f)/2),h.push(x*r-r/2+g-1,n+f-1,0),d.push((x*r-r/2+g)/2,(n+f)/2);let A=mt(x/a,t/a)+Math.random();const v=dt(f/2+2*A/e);let w=Math.random();o.push(v,dt(v+.1*i),dt(v+.1*i)),m.push(w,w,w);const M=[x*r+g-1,f-1,0];l.push(...M,...M,...M);const y=[2*s*ut(-.3,.3),-2*ut(-.3,.3)*1.5,-ct(.5)],E=[2*s*ut(.3,.6),-2*ut(.3,.6)*1.5,-ct(.5)];c.push(...y,...y,...y),u.push(...E,...E,...E),p.push(0,0,1,0,1,0,1,0,0),h.push(x*r+g-1,f-1,0),d.push((x*r+g)/2,f/2),h.push(x*r+r+g-1,f-1,0),d.push((x*r+r+g)/2,f/2),h.push(x*r+r/2+g-1,n+f-1,0),d.push((x*r+r/2+g)/2,(n+f)/2),A=mt((x+1)/a,t/a)+Math.random();const U=dt(f/2+2*A/e);w=Math.random(),o.push(U,U,dt(U+.1*i)),m.push(w,w,w);const F=[x*r+g-1,f-1,0];c.push(...y,...y,...y),u.push(...E,...E,...E),l.push(...F,...F,...F),p.push(0,0,1,0,1,0,1,0,0)}}const A=new x(t);return A.addAttribute("position",{size:3,data:new Float32Array(h)}),A.addAttribute("bary",{size:3,data:new Float32Array(p)}),A.addAttribute("uv",{size:2,data:new Float32Array(d)}),A.addAttribute("offset",{size:1,data:new Float32Array(o)}),A.addAttribute("centroid1",{size:3,data:new Float32Array(l)}),A.addAttribute("control0",{size:3,data:new Float32Array(c)}),A.addAttribute("control1",{size:3,data:new Float32Array(u)}),A.addAttribute("random",{size:1,data:new Float32Array(m)}),A}(this.gl,this.shader.detail,this.shader.offsetTop),e=this.textures[1];this.vertexMaterial=this.createMaterial(),this.vertexMaterial.uniforms.texture1.value=e,this.currentMesh=new _(this.gl,{geometry:t,program:this.material}),this.nextMesh=new _(this.gl,{geometry:t,program:this.vertexMaterial}),this.nextMesh.position.z=-1e-4,this.currentMesh.setParent(this.scene),this.nextMesh.setParent(this.scene)}else{const t=new rt(this.gl,{width:1,height:1,widthSegments:2,heightSegments:2});this.plane=new _(this.gl,{geometry:t,program:this.material}),this.plane.setParent(this.scene)}}replaceShader(t){let e,i;this.shader.vertex?(e=this.material.uniforms.texture1.value,i=this.vertexMaterial.uniforms.texture1.value):(e=this.material.uniforms.texture1.value,i=this.material.uniforms.texture2.value);const s="random"===t||Array.isArray(t)?wt(t,this.opts):At[t],{fragment:r,uniforms:n,vertex:a}=s;this.shader=s,this.vertex=a||vt,this.fragment=r||"",this.uniforms=n||{},this.addObjects(),this.shader.vertex?(this.material.uniforms.texture1.value=i,this.vertexMaterial.uniforms.texture1.value=i):(this.material.uniforms.texture1.value=e,this.material.uniforms.texture2.value=i,this.material.uniforms.progress.value=1),this.resize(),this.swiper.params.gl.shader=t}replaceRandomShader(){const t=wt(this.opts.shader,this.opts),{fragment:e,uniforms:i,vertex:s}=t;this.shader=t,this.fragment=e||"",this.uniforms=i||{},this.vertex=s||vt,this.addObjects(),this.resize()}setProgress(t,e,i,s,r){if(this.destroyed||this.swiper.glDestroyed)return;if(!this.initialized)return void(this.onInit=()=>{requestAnimationFrame((()=>{this.setProgress(t,e,i,s)}))});this.swiper.params.loop&&this.swiper.slides[t]&&this.swiper.slides[e]&&(t=parseInt(this.swiper.slides[t].getAttribute("data-swiper-slide-index"),10),e=parseInt(this.swiper.slides[e].getAttribute("data-swiper-slide-index"),10));const n=this.textures[e],a=this.textures[t];if(this.material.uniforms.texture1.value=a,this.shader.vertex?this.vertexMaterial.uniforms.texture1.value=n:this.material.uniforms.texture2.value=n,r){if(this.preventShaderReplace)return void(this.material.uniforms.progress.value=Math.abs(i));this.preventShaderReplace=!0,requestAnimationFrame((()=>{this.preventShaderReplace=!1})),"random"===this.swiper.params.gl.shader||Array.isArray(this.swiper.params.gl.shader)?(this.replaceRandomShader(),this.material.uniforms.texture1.value=a,this.material.uniforms.texture2.value=n,this.material.uniforms.progress.value=Math.abs(i)):this.material.uniforms.progress.value=Math.abs(i)}else s?(0===i&&0===this.material.uniforms.progress.value&&(this.material.uniforms.progress.value=1),1===i&&1===this.material.uniforms.progress.value&&(this.material.uniforms.progress.value=0),this.animateUniform(this.material.uniforms.progress,i,(()=>{("random"===this.swiper.params.gl.shader||Array.isArray(this.swiper.params.gl.shader))&&(this.replaceRandomShader(),this.material.uniforms.texture1.value=a,this.material.uniforms.texture2.value=n,this.material.uniforms.progress.value=i),1===i&&(this.material.uniforms.texture1.value=n),this.material.uniforms.progress.value=0}))):this.material.uniforms.progress.value=Math.abs(i)}render(){this.swiper.destroyed||this.destroyed||(this.time+=.05,this.material.uniforms.time.value=this.time,Object.keys(this.uniforms).forEach((t=>{this.material.uniforms[t].value=this.uniforms[t].value})),requestAnimationFrame(this.render.bind(this)),this.renderer.render({scene:this.scene,camera:this.camera}))}destroy(){this.initialized=!1,this.destroyed=!0,this.gl&&this.gl.canvas&&this.container.removeChild(this.gl.canvas)}}"undefined"!=typeof window&&window.SwiperElementRegisterParams&&window.SwiperElementRegisterParams(["gl"]),"undefined"!=typeof window&&window.SwiperElementRegisterParams&&window.SwiperElementRegisterParams(["shuttersEffect"]),window.EffectSlicer=function({swiper:t,extendParams:e,on:i,emit:s}){e({slicerEffect:{split:5}});const r=()=>{t.slides.forEach((e=>{if(e.querySelector(".swiper-slicer-image-clones"))return;const i=e.querySelector(".swiper-slicer-image");if(!i)return;const s=i.nextElementSibling,r=document.createElement("div");r.classList.add("swiper-slicer-image-clones");for(let e=0;e<t.params.slicerEffect.split;e+=1){const t=document.createElement("div");t.classList.add("swiper-slicer-image-clone"),t.appendChild(i.cloneNode()),r.appendChild(t)}s?i.parentNode.insertBefore(r,s):i.parentNode.appendChild(r)}))},n=()=>{t.slides.forEach((e=>e.querySelectorAll(".swiper-slicer-image").forEach((e=>{e.style.width=`${t.width}px`,e.style.height=`${t.height}px`})))),t.slides.forEach((e=>{e.querySelectorAll(".swiper-slicer-image-clone").forEach(((e,i)=>{const s=e.querySelector(".swiper-slicer-image");"horizontal"===t.params.direction?(e.style.height=100/t.params.slicerEffect.split+"%",e.style.top=100/t.params.slicerEffect.split*i+"%",s.style.top=`-${100*i}%`):(e.style.width=100/t.params.slicerEffect.split+"%",e.style.left=100/t.params.slicerEffect.split*i+"%",s.style.left=`-${100*i}%`)}))}))},a=e=>{t.slides.forEach((i=>{const s=i.querySelectorAll(".swiper-slicer-image-clone"),r=i.querySelector(".swiper-slide-content");r&&(r.style.transitionDuration=`${e}ms`),s.forEach(((i,r)=>{0===e?(i.style.transitionTimingFunction="ease-out",i.style.transitionDuration=`${t.params.speed+t.params.speed/(s.length-1)*(s.length-r-1)}ms`):(i.style.transitionTimingFunction="",i.style.transitionDuration=`${e+e/(s.length-1)*(s.length-r-1)}ms`)}))})),function({duration:e}){const{slides:i,activeIndex:s}=t;if(0!==e){let e=!1;const r=i[s].querySelector(".swiper-slicer-image-clone:nth-child(1)");if(!r)return;const n=i=>{if(i.target!==r)return;if(r.removeEventListener("transitionend",n),e)return;if(!t||t.destroyed)return;e=!0,t.animating=!1;const s=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(s)};r.addEventListener("transitionend",n)}}({duration:e})};i("setTranslate",(()=>{"slicer"===t.params.effect&&(()=>{const e="vertical"===t.params.direction?"Y":"X";t.slides.forEach(((i,s)=>{i.style.transform=`translate${e}(-${100*s}%)`;const r=i.progress,n=i.querySelector(".swiper-slide-content");n&&(n.style.transform=`translate${e}(${t.size*-r*1.2}px)`),i.querySelectorAll(".swiper-slicer-image-clone").forEach((t=>{const i=-r;t.style.transform=`translate${e}(${100*i}%)`}))}))})()})),i("setTransition",((e,i)=>{"slicer"===t.params.effect&&a(i)})),i("slidesLengthChange",(()=>{r(),n()})),i("beforeInit",(()=>{if("slicer"!==t.params.effect)return;t.classNames.push("swiper-slicer");const e={slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),i("init",(()=>{"slicer"===t.params.effect&&(r(),s("setTranslate",t,t.translate))})),i("resize init",(()=>{"slicer"===t.params.effect&&n()}))},window.SwiperGL=function({swiper:t,on:e,extendParams:i}){t.gl=null;let s=!1;i({gl:{shader:"random",shaderPerSlide:!1,displacementMap:void 0}});const r=()=>{t.gl=new Mt({swiper:t,shader:t.params.gl.shader,shaderPerSlide:t.params.gl.shaderPerSlide})};let n,a;e("beforeInit",(()=>{if("gl"!==t.params.effect)return;if(!function(){try{const t=document.createElement("canvas");return!!window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(t){return!1}}())return void(s=!0);t.classNames.push(`${t.params.containerModifierClass}gl`);const e={watchSlidesProgress:!0};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),e("init",(()=>{"gl"!==t.params.effect||s||t.glDestroyed||t.gl||r()})),e("resize",(()=>{"gl"!==t.params.effect||s||t.glDestroyed||t.gl.resize()})),e("setTranslate",(()=>{if("gl"!==t.params.effect||s||t.glDestroyed)return;let e,i,o;t.gl||r();let h,l=!1;if(t.slides.forEach(((s,r)=>{const n=s.progress;t.params.cssMode&&0===Math.round(100*n)&&(l=!0),(n>0&&n<1||0===n&&t.progress<a)&&(e=r,i=r+1,o=n,h=e),(n<0&&n>-1||0===n&&t.progress>a)&&(e=r-1,i=r,o=1+n,h=i)})),a=t.progress||0,void 0===e&&void 0===i)return;l=l&&Math.round(o)===o;const c=Math.min(h,t.activeIndex),u=Math.max(h,t.activeIndex);t.params.loop||u===c||(e=c,i=u),t.gl.setProgress(e,i,o,n,l)})),e("setTransition",((e,i)=>{"gl"!==t.params.effect||s||t.glDestroyed||(n=i>0&&!t.params.cssMode)})),e("slidesGridLengthChange",(()=>{"gl"!==t.params.effect||s||!t.initialized||t.glDestroyed||t.gl&&t.gl.loadTextures&&t.gl.loadTextures()})),e("beforeDestroy",(()=>{"gl"!==t.params.effect||s||t.gl&&(t.glDestroyed=!0,t.gl.destroy(),t.gl=null)}))},window.EffectShutters=function({swiper:t,extendParams:e,on:i}){e({shuttersEffect:{split:5}}),i("beforeInit",(()=>{if("shutters"!==t.params.effect)return;t.classNames.push("swiper-shutters");const e={watchSlidesProgress:!0,parallax:{enabled:!0}};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),i("init",(()=>{"shutters"===t.params.effect&&t.slides.forEach((e=>{const i=e.querySelector(".swiper-shutters-image");if(!i)return;const s=i.nextElementSibling,r=document.createElement("div");r.classList.add("swiper-shutters-image-clones");for(let e=0;e<t.params.shuttersEffect.split;e+=1){const t=document.createElement("div");t.classList.add("swiper-shutters-image-clone"),t.appendChild(i.cloneNode()),r.appendChild(t)}s?i.parentNode.insertBefore(r,s):i.parentNode.appendChild(r)}))})),i("resize init",(()=>{"shutters"===t.params.effect&&(t.el.querySelectorAll(".swiper-shutters-image").forEach((e=>{e.style.width=`${t.width}px`,e.style.height=`${t.height}px`})),t.el.querySelectorAll(".swiper-slide, swiper-slide").forEach((e=>{e.querySelectorAll(".swiper-shutters-image-clone").forEach(((e,i)=>{const s=100/t.params.shuttersEffect.split,r=e.querySelector(".swiper-shutters-image");"vertical"===t.params.direction?(e.style.height=100/t.params.shuttersEffect.split+"%",e.style.top=100/t.params.shuttersEffect.split*i+"%",r.style.top=`-${100*i}%`):(e.style.width=100/t.params.shuttersEffect.split+"%",e.style.left=100/t.params.shuttersEffect.split*i+"%",r.style.left=`-${100*i}%`),r.setAttribute("data-swiper-parallax","10%"),e.setAttribute("data-swiper-parallax",s*(i+1)*(i%2==0?.5:-1)+"%")}))})))}))},window.EffectCarousel=function({swiper:t,on:e,extendParams:i}){i({carouselEffect:{opacityStep:.33,scaleStep:.2,sideSlides:2}}),e("beforeInit",(()=>{if("carousel"!==t.params.effect)return;t.classNames.push(`${t.params.containerModifierClass}carousel`);const e={watchSlidesProgress:!0,centeredSlides:!0};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),e("progress",(()=>{if("carousel"!==t.params.effect)return;const{scaleStep:e,opacityStep:i}=t.params.carouselEffect,s=Math.max(Math.min(t.params.carouselEffect.sideSlides,3),1),r={1:2,2:1,3:.2}[s],n={1:50,2:50,3:67}[s],a=t.slides.length;for(let o=0;o<t.slides.length;o+=1){const h=t.slides[o],l=t.slides[o].progress,c=Math.abs(l);let u=1;c>1&&(u=.3*(c-1)*r+1);const m=h.querySelectorAll(".swiper-carousel-animate-opacity"),d=l*u*n*(t.rtlTranslate?-1:1)+"%",g=1-c*e,p=a-Math.abs(Math.round(l));h.style.transform=`translateX(${d}) scale(${g})`,h.style.zIndex=p,h.style.opacity=c>s+1?0:1,m.forEach((t=>{t.style.opacity=1-c*i}))}})),e("setTransition",((e,i)=>{if("carousel"===t.params.effect)for(let e=0;e<t.slides.length;e+=1){const s=t.slides[e],r=s.querySelectorAll(".swiper-carousel-animate-opacity");s.style.transitionDuration=`${i}ms`,r.forEach((t=>{t.style.transitionDuration=`${i}ms`}))}}))},window.wonder=e})();
2
+ (()=>{"use strict";var t={r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){let e=t[0],i=t[1],s=t[2];return Math.sqrt(e*e+i*i+s*s)}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function r(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function n(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function a(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function o(t){let e=t[0],i=t[1],s=t[2];return e*e+i*i+s*s}function h(t,e){let i=e[0],s=e[1],r=e[2],n=i*i+s*s+r*r;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function l(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function c(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[0],o=i[1],h=i[2];return t[0]=r*h-n*o,t[1]=n*a-s*h,t[2]=s*o-r*a,t}t.r(e),"undefined"!=typeof window&&window.SwiperElementRegisterParams&&window.SwiperElementRegisterParams(["slicerEffect"]);const u=function(){const t=[0,0,0],e=[0,0,0];return function(i,r){s(t,i),s(e,r),h(t,t),h(e,e);let n=l(t,e);return n>1?0:n<-1?Math.PI:Math.acos(n)}}();class d extends Array{constructor(t=0,e=t,i=t){return super(t,e,i),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,e=t,i=t){return t.length?this.copy(t):(function(t,e,i,s){t[0]=e,t[1]=i,t[2]=s}(this,t,e,i),this)}copy(t){return s(this,t),this}add(t,e){return e?r(this,t,e):r(this,this,t),this}sub(t,e){return e?n(this,t,e):n(this,this,t),this}multiply(t){var e,i,s;return t.length?(i=this,s=t,(e=this)[0]=i[0]*s[0],e[1]=i[1]*s[1],e[2]=i[2]*s[2]):a(this,this,t),this}divide(t){var e,i,s;return t.length?(i=this,s=t,(e=this)[0]=i[0]/s[0],e[1]=i[1]/s[1],e[2]=i[2]/s[2]):a(this,this,1/t),this}inverse(t=this){var e,i;return i=t,(e=this)[0]=1/i[0],e[1]=1/i[1],e[2]=1/i[2],this}len(){return i(this)}distance(t){return t?function(t,e){let i=e[0]-t[0],s=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(i*i+s*s+r*r)}(this,t):i(this)}squaredLen(){return o(this)}squaredDistance(t){return t?function(t,e){let i=e[0]-t[0],s=e[1]-t[1],r=e[2]-t[2];return i*i+s*s+r*r}(this,t):o(this)}negate(t=this){var e,i;return i=t,(e=this)[0]=-i[0],e[1]=-i[1],e[2]=-i[2],this}cross(t,e){return e?c(this,t,e):c(this,this,t),this}scale(t){return a(this,this,t),this}normalize(){return h(this,this),this}dot(t){return l(this,t)}equals(t){return i=t,(e=this)[0]===i[0]&&e[1]===i[1]&&e[2]===i[2];var e,i}applyMatrix3(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2];t[0]=s*i[0]+r*i[3]+n*i[6],t[1]=s*i[1]+r*i[4]+n*i[7],t[2]=s*i[2]+r*i[5]+n*i[8]}(this,this,t),this}applyMatrix4(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[3]*s+i[7]*r+i[11]*n+i[15];a=a||1,t[0]=(i[0]*s+i[4]*r+i[8]*n+i[12])/a,t[1]=(i[1]*s+i[5]*r+i[9]*n+i[13])/a,t[2]=(i[2]*s+i[6]*r+i[10]*n+i[14])/a}(this,this,t),this}scaleRotateMatrix4(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[3]*s+i[7]*r+i[11]*n+i[15];a=a||1,t[0]=(i[0]*s+i[4]*r+i[8]*n)/a,t[1]=(i[1]*s+i[5]*r+i[9]*n)/a,t[2]=(i[2]*s+i[6]*r+i[10]*n)/a}(this,this,t),this}applyQuaternion(t){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=i[0],o=i[1],h=i[2],l=o*n-h*r,c=h*s-a*n,u=a*r-o*s,d=o*u-h*c,m=h*l-a*u,p=a*c-o*l,g=2*i[3];l*=g,c*=g,u*=g,d*=2,m*=2,p*=2,t[0]=s+l+d,t[1]=r+c+m,t[2]=n+u+p}(this,this,t),this}angle(t){return u(this,t)}lerp(t,e){return function(t,e,i,s){let r=e[0],n=e[1],a=e[2];t[0]=r+s*(i[0]-r),t[1]=n+s*(i[1]-n),t[2]=a+s*(i[2]-a)}(this,this,t,e),this}clone(){return new d(this[0],this[1],this[2])}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}transformDirection(t){const e=this[0],i=this[1],s=this[2];return this[0]=t[0]*e+t[4]*i+t[8]*s,this[1]=t[1]*e+t[5]*i+t[9]*s,this[2]=t[2]*e+t[6]*i+t[10]*s,this.normalize()}}const m=new d;let p=1,g=1,f=!1;class x{constructor(t,e={}){t.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=t,this.attributes=e,this.id=p++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let t in e)this.addAttribute(t,e[t])}addAttribute(t,e){if(this.attributes[t]=e,e.id=g++,e.size=e.size||1,e.type=e.type||(e.data.constructor===Float32Array?this.gl.FLOAT:e.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),e.target="index"===t?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,e.normalized=e.normalized||!1,e.stride=e.stride||0,e.offset=e.offset||0,e.count=e.count||(e.stride?e.data.byteLength/e.stride:e.data.length/e.size),e.divisor=e.instanced||0,e.needsUpdate=!1,e.usage=e.usage||this.gl.STATIC_DRAW,e.buffer||this.updateAttribute(e),e.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==e.count*e.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,e.count*e.divisor);this.instancedCount=e.count*e.divisor}else"index"===t?this.drawRange.count=e.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,e.count))}updateAttribute(t){const e=!t.buffer;e&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),e?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach(((t,{name:e,type:i})=>{if(!this.attributes[e])return void console.warn(`active attribute ${e} not being supplied`);const s=this.attributes[e];this.gl.bindBuffer(s.target,s.buffer),this.glState.boundBuffer=s.buffer;let r=1;35674===i&&(r=2),35675===i&&(r=3),35676===i&&(r=4);const n=s.size/r,a=1===r?0:r*r*r,o=1===r?0:r*r;for(let e=0;e<r;e++)this.gl.vertexAttribPointer(t+e,n,s.type,s.normalized,s.stride+a,s.offset+e*o),this.gl.enableVertexAttribArray(t+e),this.gl.renderer.vertexAttribDivisor(t+e,s.divisor)})),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:e=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach(((t,{name:e})=>{const i=this.attributes[e];i.needsUpdate&&this.updateAttribute(i)})),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+2*this.drawRange.start,this.instancedCount):this.gl.renderer.drawArraysInstanced(e,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+2*this.drawRange.start):this.gl.drawArrays(e,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;return t.data?t:f?void 0:(console.warn("No position buffer data found to compute bounds"),f=!0)}computeBoundingBox(t){t||(t=this.getPosition());const e=t.data,i=t.stride?t.stride/e.BYTES_PER_ELEMENT:t.size;this.bounds||(this.bounds={min:new d,max:new d,center:new d,scale:new d,radius:1/0});const s=this.bounds.min,r=this.bounds.max,n=this.bounds.center,a=this.bounds.scale;s.set(1/0),r.set(-1/0);for(let t=0,n=e.length;t<n;t+=i){const i=e[t],n=e[t+1],a=e[t+2];s.x=Math.min(i,s.x),s.y=Math.min(n,s.y),s.z=Math.min(a,s.z),r.x=Math.max(i,r.x),r.y=Math.max(n,r.y),r.z=Math.max(a,r.z)}a.sub(r,s),n.add(s,r).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const e=t.data,i=t.stride?t.stride/e.BYTES_PER_ELEMENT:t.size;this.bounds||this.computeBoundingBox(t);let s=0;for(let t=0,r=e.length;t<r;t+=i)m.fromArray(e,t),s=Math.max(s,this.bounds.center.squaredDistance(m));this.bounds.radius=Math.sqrt(s)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let w=1;const v={};class A{constructor(t,{vertex:e,fragment:i,uniforms:s={},transparent:r=!1,cullFace:n=t.BACK,frontFace:a=t.CCW,depthTest:o=!0,depthWrite:h=!0,depthFunc:l=t.LESS}={}){t.canvas||console.error("gl not passed as fist argument to Program"),this.gl=t,this.uniforms=s,this.id=w++,e||console.warn("vertex shader not supplied"),i||console.warn("fragment shader not supplied"),this.transparent=r,this.cullFace=n,this.frontFace=a,this.depthTest=o,this.depthWrite=h,this.depthFunc=l,this.blendFunc={},this.blendEquation={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA));const c=t.createShader(t.VERTEX_SHADER);t.shaderSource(c,e),t.compileShader(c),""!==t.getShaderInfoLog(c)&&console.warn(`${t.getShaderInfoLog(c)}\nVertex Shader\n${y(e)}`);const u=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(u,i),t.compileShader(u),""!==t.getShaderInfoLog(u)&&console.warn(`${t.getShaderInfoLog(u)}\nFragment Shader\n${y(i)}`),this.program=t.createProgram(),t.attachShader(this.program,c),t.attachShader(this.program,u),t.linkProgram(this.program),!t.getProgramParameter(this.program,t.LINK_STATUS))return console.warn(t.getProgramInfoLog(this.program));t.deleteShader(c),t.deleteShader(u),this.uniformLocations=new Map;let d=t.getProgramParameter(this.program,t.ACTIVE_UNIFORMS);for(let e=0;e<d;e++){let i=t.getActiveUniform(this.program,e);this.uniformLocations.set(i,t.getUniformLocation(this.program,i.name));const s=i.name.match(/(\w+)/g);i.uniformName=s[0],3===s.length?(i.isStructArray=!0,i.structIndex=Number(s[1]),i.structProperty=s[2]):2===s.length&&isNaN(Number(s[1]))&&(i.isStruct=!0,i.structProperty=s[1])}this.attributeLocations=new Map;const m=[],p=t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);for(let e=0;e<p;e++){const i=t.getActiveAttrib(this.program,e),s=t.getAttribLocation(this.program,i.name);-1!==s&&(m[s]=i.name,this.attributeLocations.set(i,s))}this.attributeOrder=m.join("")}setBlendFunc(t,e,i,s){this.blendFunc.src=t,this.blendFunc.dst=e,this.blendFunc.srcAlpha=i,this.blendFunc.dstAlpha=s,t&&(this.transparent=!0)}setBlendEquation(t,e){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=e}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha)}use({flipFaces:t=!1}={}){let e=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach(((t,i)=>{let s=i.uniformName,r=this.uniforms[s];if(i.isStruct&&(r=r[i.structProperty],s+=`.${i.structProperty}`),i.isStructArray&&(r=r[i.structIndex][i.structProperty],s+=`[${i.structIndex}].${i.structProperty}`),!r)return U(`Active uniform ${s} has not been supplied`);if(r&&void 0===r.value)return U(`${s} uniform is missing a value parameter`);if(r.value.texture)return e+=1,r.value.update(e),M(this.gl,i.type,t,e);if(r.value.length&&r.value[0].texture){const s=[];return r.value.forEach((t=>{e+=1,t.update(e),s.push(e)})),M(this.gl,i.type,t,s)}M(this.gl,i.type,t,r.value)})),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function M(t,e,i,s){s=s.length?function(t){const e=t.length,i=t[0].length;if(void 0===i)return t;const s=e*i;let r=v[s];r||(v[s]=r=new Float32Array(s));for(let s=0;s<e;s++)r.set(t[s],s*i);return r}(s):s;const r=t.renderer.state.uniformLocations.get(i);if(s.length)if(void 0===r||r.length!==s.length)t.renderer.state.uniformLocations.set(i,s.slice(0));else{if(function(t,e){if(t.length!==e.length)return!1;for(let i=0,s=t.length;i<s;i++)if(t[i]!==e[i])return!1;return!0}(r,s))return;r.set?r.set(s):function(t,e){for(let i=0,s=t.length;i<s;i++)t[i]=e[i]}(r,s),t.renderer.state.uniformLocations.set(i,r)}else{if(r===s)return;t.renderer.state.uniformLocations.set(i,s)}switch(e){case 5126:return s.length?t.uniform1fv(i,s):t.uniform1f(i,s);case 35664:return t.uniform2fv(i,s);case 35665:return t.uniform3fv(i,s);case 35666:return t.uniform4fv(i,s);case 35670:case 5124:case 35678:case 35680:return s.length?t.uniform1iv(i,s):t.uniform1i(i,s);case 35671:case 35667:return t.uniform2iv(i,s);case 35672:case 35668:return t.uniform3iv(i,s);case 35673:case 35669:return t.uniform4iv(i,s);case 35674:return t.uniformMatrix2fv(i,!1,s);case 35675:return t.uniformMatrix3fv(i,!1,s);case 35676:return t.uniformMatrix4fv(i,!1,s)}}function y(t){let e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}let E=0;function U(t){E>100||(console.warn(t),E++,E>100&&console.warn("More than 100 program warnings - stopping logs."))}const F=new d;let b=1;class S{constructor({canvas:t=document.createElement("canvas"),width:e=300,height:i=150,dpr:s=1,alpha:r=!1,depth:n=!0,stencil:a=!1,antialias:o=!1,premultipliedAlpha:h=!1,preserveDrawingBuffer:l=!1,powerPreference:c="default",autoClear:u=!0,webgl:d=2}={}){const m={alpha:r,depth:n,stencil:a,antialias:o,premultipliedAlpha:h,preserveDrawingBuffer:l,powerPreference:c};this.dpr=s,this.alpha=r,this.color=!0,this.depth=n,this.stencil=a,this.premultipliedAlpha=h,this.autoClear=u,this.id=b++,2===d&&(this.gl=t.getContext("webgl2",m)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",m)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(e,i),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=null,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LESS,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,e){this.width=t,this.height=e,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=e*this.dpr,Object.assign(this.gl.canvas.style,{width:t+"px",height:e+"px"})}setViewport(t,e,i=0,s=0){this.state.viewport.width===t&&this.state.viewport.height===e||(this.state.viewport.width=t,this.state.viewport.height=e,this.state.viewport.x=i,this.state.viewport.y=s,this.gl.viewport(i,s,t,e))}setScissor(t,e,i=0,s=0){this.gl.scissor(i,s,t,e)}enable(t){!0!==this.state[t]&&(this.gl.enable(t),this.state[t]=!0)}disable(t){!1!==this.state[t]&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,e,i,s){this.state.blendFunc.src===t&&this.state.blendFunc.dst===e&&this.state.blendFunc.srcAlpha===i&&this.state.blendFunc.dstAlpha===s||(this.state.blendFunc.src=t,this.state.blendFunc.dst=e,this.state.blendFunc.srcAlpha=i,this.state.blendFunc.dstAlpha=s,void 0!==i?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e))}setBlendEquation(t,e){t=t||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===e||(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=e,void 0!==e?this.gl.blendEquationSeparate(t,e):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:e=null}={}){this.state.framebuffer!==e&&(this.state.framebuffer=e,this.gl.bindFramebuffer(t,e))}getExtension(t,e,i){return e&&this.gl[e]?this.gl[e].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),e?this.extensions[t]?this.extensions[t][i].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:t.zDepth!==e.zDepth?t.zDepth-e.zDepth:e.id-t.id}sortTransparent(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.zDepth!==e.zDepth?e.zDepth-t.zDepth:e.id-t.id}sortUI(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:e.id-t.id}getRenderList({scene:t,camera:e,frustumCull:i,sort:s}){let r=[];if(e&&i&&e.updateFrustum(),t.traverse((t=>{if(!t.visible)return!0;t.draw&&(i&&t.frustumCulled&&e&&!e.frustumIntersectsMesh(t)||r.push(t))})),s){const t=[],i=[],s=[];r.forEach((r=>{r.program.transparent?r.program.depthTest?i.push(r):s.push(r):t.push(r),r.zDepth=0,0===r.renderOrder&&r.program.depthTest&&e&&(r.worldMatrix.getTranslation(F),F.applyMatrix4(e.projectionViewMatrix),r.zDepth=F.z)})),t.sort(this.sortOpaque),i.sort(this.sortTransparent),s.sort(this.sortUI),r=t.concat(i,s)}return r}render({scene:t,camera:e,target:i=null,update:s=!0,sort:r=!0,frustumCull:n=!0,clear:a}){null===i?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(i),this.setViewport(i.width,i.height)),(a||this.autoClear&&!1!==a)&&(!this.depth||i&&!i.depth||(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),s&&t.updateMatrixWorld(),e&&e.updateMatrixWorld();this.getRenderList({scene:t,camera:e,frustumCull:n,sort:r}).forEach((t=>{t.draw({camera:e})}))}}function R(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function C(t,e,i,s,r){return t[0]=e,t[1]=i,t[2]=s,t[3]=r,t}function T(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i*i+s*s+r*r+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=i*a,t[1]=s*a,t[2]=r*a,t[3]=n*a,t}function G(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function I(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=i[0],h=i[1],l=i[2],c=i[3];return t[0]=s*c+a*o+r*l-n*h,t[1]=r*c+a*h+n*o-s*l,t[2]=n*c+a*l+s*h-r*o,t[3]=a*c-s*o-r*h-n*l,t}const Y=R,B=C,D=G,K=T;class P extends Array{constructor(t=0,e=0,i=0,s=1){return super(t,e,i,s),this.onChange=()=>{},this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this[0]=t,this.onChange()}set y(t){this[1]=t,this.onChange()}set z(t){this[2]=t,this.onChange()}set w(t){this[3]=t,this.onChange()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.onChange(),this}set(t,e,i,s){return t.length?this.copy(t):(B(this,t,e,i,s),this.onChange(),this)}rotateX(t){return function(t,e,i){i*=.5;let s=e[0],r=e[1],n=e[2],a=e[3],o=Math.sin(i),h=Math.cos(i);t[0]=s*h+a*o,t[1]=r*h+n*o,t[2]=n*h-r*o,t[3]=a*h-s*o}(this,this,t),this.onChange(),this}rotateY(t){return function(t,e,i){i*=.5;let s=e[0],r=e[1],n=e[2],a=e[3],o=Math.sin(i),h=Math.cos(i);t[0]=s*h-n*o,t[1]=r*h+a*o,t[2]=n*h+s*o,t[3]=a*h-r*o}(this,this,t),this.onChange(),this}rotateZ(t){return function(t,e,i){i*=.5;let s=e[0],r=e[1],n=e[2],a=e[3],o=Math.sin(i),h=Math.cos(i);t[0]=s*h+r*o,t[1]=r*h-s*o,t[2]=n*h+a*o,t[3]=a*h-n*o}(this,this,t),this.onChange(),this}inverse(t=this){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i*i+s*s+r*r+n*n,o=a?1/a:0;t[0]=-i*o,t[1]=-s*o,t[2]=-r*o,t[3]=n*o}(this,t),this.onChange(),this}conjugate(t=this){var e,i;return i=t,(e=this)[0]=-i[0],e[1]=-i[1],e[2]=-i[2],e[3]=i[3],this.onChange(),this}copy(t){return Y(this,t),this.onChange(),this}normalize(t=this){return K(this,t),this.onChange(),this}multiply(t,e){return e?I(this,t,e):I(this,this,t),this.onChange(),this}dot(t){return D(this,t)}fromMatrix3(t){return function(t,e){let i,s=e[0]+e[4]+e[8];if(s>0)i=Math.sqrt(s+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{let s=0;e[4]>e[0]&&(s=1),e[8]>e[3*s+s]&&(s=2);let r=(s+1)%3,n=(s+2)%3;i=Math.sqrt(e[3*s+s]-e[3*r+r]-e[3*n+n]+1),t[s]=.5*i,i=.5/i,t[3]=(e[3*r+n]-e[3*n+r])*i,t[r]=(e[3*r+s]+e[3*s+r])*i,t[n]=(e[3*n+s]+e[3*s+n])*i}}(this,t),this.onChange(),this}fromEuler(t){return function(t,e,i="YXZ"){let s=Math.sin(.5*e[0]),r=Math.cos(.5*e[0]),n=Math.sin(.5*e[1]),a=Math.cos(.5*e[1]),o=Math.sin(.5*e[2]),h=Math.cos(.5*e[2]);"XYZ"===i?(t[0]=s*a*h+r*n*o,t[1]=r*n*h-s*a*o,t[2]=r*a*o+s*n*h,t[3]=r*a*h-s*n*o):"YXZ"===i?(t[0]=s*a*h+r*n*o,t[1]=r*n*h-s*a*o,t[2]=r*a*o-s*n*h,t[3]=r*a*h+s*n*o):"ZXY"===i?(t[0]=s*a*h-r*n*o,t[1]=r*n*h+s*a*o,t[2]=r*a*o+s*n*h,t[3]=r*a*h-s*n*o):"ZYX"===i?(t[0]=s*a*h-r*n*o,t[1]=r*n*h+s*a*o,t[2]=r*a*o-s*n*h,t[3]=r*a*h+s*n*o):"YZX"===i?(t[0]=s*a*h+r*n*o,t[1]=r*n*h+s*a*o,t[2]=r*a*o-s*n*h,t[3]=r*a*h-s*n*o):"XZY"===i&&(t[0]=s*a*h-r*n*o,t[1]=r*n*h-s*a*o,t[2]=r*a*o+s*n*h,t[3]=r*a*h+s*n*o)}(this,t,t.order),this}fromAxisAngle(t,e){return function(t,e,i){i*=.5;let s=Math.sin(i);t[0]=s*e[0],t[1]=s*e[1],t[2]=s*e[2],t[3]=Math.cos(i)}(this,t,e),this}slerp(t,e){return function(t,e,i,s){let r,n,a,o,h,l=e[0],c=e[1],u=e[2],d=e[3],m=i[0],p=i[1],g=i[2],f=i[3];n=l*m+c*p+u*g+d*f,n<0&&(n=-n,m=-m,p=-p,g=-g,f=-f),1-n>1e-6?(r=Math.acos(n),a=Math.sin(r),o=Math.sin((1-s)*r)/a,h=Math.sin(s*r)/a):(o=1-s,h=s),t[0]=o*l+h*m,t[1]=o*c+h*p,t[2]=o*u+h*g,t[3]=o*d+h*f}(this,this,t,e),this}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}}function k(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],m=e[10],p=e[11],g=e[12],f=e[13],x=e[14],w=e[15],v=i[0],A=i[1],M=i[2],y=i[3];return t[0]=v*s+A*o+M*u+y*g,t[1]=v*r+A*h+M*d+y*f,t[2]=v*n+A*l+M*m+y*x,t[3]=v*a+A*c+M*p+y*w,v=i[4],A=i[5],M=i[6],y=i[7],t[4]=v*s+A*o+M*u+y*g,t[5]=v*r+A*h+M*d+y*f,t[6]=v*n+A*l+M*m+y*x,t[7]=v*a+A*c+M*p+y*w,v=i[8],A=i[9],M=i[10],y=i[11],t[8]=v*s+A*o+M*u+y*g,t[9]=v*r+A*h+M*d+y*f,t[10]=v*n+A*l+M*m+y*x,t[11]=v*a+A*c+M*p+y*w,v=i[12],A=i[13],M=i[14],y=i[15],t[12]=v*s+A*o+M*u+y*g,t[13]=v*r+A*h+M*d+y*f,t[14]=v*n+A*l+M*m+y*x,t[15]=v*a+A*c+M*p+y*w,t}function N(t,e){let i=e[0],s=e[1],r=e[2],n=e[4],a=e[5],o=e[6],h=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(i,s,r),t[1]=Math.hypot(n,a,o),t[2]=Math.hypot(h,l,c),t}const j=function(){const t=[0,0,0];return function(e,i){let s=t;N(s,i);let r=1/s[0],n=1/s[1],a=1/s[2],o=i[0]*r,h=i[1]*n,l=i[2]*a,c=i[4]*r,u=i[5]*n,d=i[6]*a,m=i[8]*r,p=i[9]*n,g=i[10]*a,f=o+u+g,x=0;return f>0?(x=2*Math.sqrt(f+1),e[3]=.25*x,e[0]=(d-p)/x,e[1]=(m-l)/x,e[2]=(h-c)/x):o>u&&o>g?(x=2*Math.sqrt(1+o-u-g),e[3]=(d-p)/x,e[0]=.25*x,e[1]=(h+c)/x,e[2]=(m+l)/x):u>g?(x=2*Math.sqrt(1+u-o-g),e[3]=(m-l)/x,e[0]=(h+c)/x,e[1]=.25*x,e[2]=(d+p)/x):(x=2*Math.sqrt(1+g-o-u),e[3]=(h-c)/x,e[0]=(m+l)/x,e[1]=(d+p)/x,e[2]=.25*x),e}}();class O extends Array{constructor(t=1,e=0,i=0,s=0,r=0,n=1,a=0,o=0,h=0,l=0,c=1,u=0,d=0,m=0,p=0,g=1){return super(t,e,i,s,r,n,a,o,h,l,c,u,d,m,p,g),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,e,i,s,r,n,a,o,h,l,c,u,d,m,p,g){return t.length?this.copy(t):(function(t,e,i,s,r,n,a,o,h,l,c,u,d,m,p,g,f){t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=n,t[5]=a,t[6]=o,t[7]=h,t[8]=l,t[9]=c,t[10]=u,t[11]=d,t[12]=m,t[13]=p,t[14]=g,t[15]=f}(this,t,e,i,s,r,n,a,o,h,l,c,u,d,m,p,g),this)}translate(t,e=this){return function(t,e,i){let s,r,n,a,o,h,l,c,u,d,m,p,g=i[0],f=i[1],x=i[2];e===t?(t[12]=e[0]*g+e[4]*f+e[8]*x+e[12],t[13]=e[1]*g+e[5]*f+e[9]*x+e[13],t[14]=e[2]*g+e[6]*f+e[10]*x+e[14],t[15]=e[3]*g+e[7]*f+e[11]*x+e[15]):(s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],m=e[10],p=e[11],t[0]=s,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=h,t[6]=l,t[7]=c,t[8]=u,t[9]=d,t[10]=m,t[11]=p,t[12]=s*g+o*f+u*x+e[12],t[13]=r*g+h*f+d*x+e[13],t[14]=n*g+l*f+m*x+e[14],t[15]=a*g+c*f+p*x+e[15])}(this,e,t),this}rotate(t,e,i=this){return function(t,e,i,s){let r,n,a,o,h,l,c,u,d,m,p,g,f,x,w,v,A,M,y,E,U,F,b,S,R=s[0],C=s[1],T=s[2],G=Math.hypot(R,C,T);Math.abs(G)<1e-6||(G=1/G,R*=G,C*=G,T*=G,r=Math.sin(i),n=Math.cos(i),a=1-n,o=e[0],h=e[1],l=e[2],c=e[3],u=e[4],d=e[5],m=e[6],p=e[7],g=e[8],f=e[9],x=e[10],w=e[11],v=R*R*a+n,A=C*R*a+T*r,M=T*R*a-C*r,y=R*C*a-T*r,E=C*C*a+n,U=T*C*a+R*r,F=R*T*a+C*r,b=C*T*a-R*r,S=T*T*a+n,t[0]=o*v+u*A+g*M,t[1]=h*v+d*A+f*M,t[2]=l*v+m*A+x*M,t[3]=c*v+p*A+w*M,t[4]=o*y+u*E+g*U,t[5]=h*y+d*E+f*U,t[6]=l*y+m*E+x*U,t[7]=c*y+p*E+w*U,t[8]=o*F+u*b+g*S,t[9]=h*F+d*b+f*S,t[10]=l*F+m*b+x*S,t[11]=c*F+p*b+w*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,i,t,e),this}scale(t,e=this){return function(t,e,i){let s=i[0],r=i[1],n=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(this,e,"number"==typeof t?[t,t,t]:t),this}multiply(t,e){return e?k(this,t,e):k(this,this,t),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=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,this}copy(t){var e,i;return i=t,(e=this)[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}fromPerspective({fov:t,aspect:e,near:i,far:s}={}){return function(t,e,i,s,r){let n=1/Math.tan(e/2),a=1/(s-r);t[0]=n/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+s)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*s*a,t[15]=0}(this,t,e,i,s),this}fromOrthogonal({left:t,right:e,bottom:i,top:s,near:r,far:n}){return function(t,e,i,s,r,n,a){let o=1/(e-i),h=1/(s-r),l=1/(n-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*o,t[13]=(r+s)*h,t[14]=(a+n)*l,t[15]=1}(this,t,e,i,s,r,n),this}fromQuaternion(t){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i+i,o=s+s,h=r+r,l=i*a,c=s*a,u=s*o,d=r*a,m=r*o,p=r*h,g=n*a,f=n*o,x=n*h;t[0]=1-u-p,t[1]=c+x,t[2]=d-f,t[3]=0,t[4]=c-x,t[5]=1-l-p,t[6]=m+g,t[7]=0,t[8]=d+f,t[9]=m-g,t[10]=1-l-u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],m=e[11],p=e[12],g=e[13],f=e[14],x=e[15],w=i*o-s*a,v=i*h-r*a,A=i*l-n*a,M=s*h-r*o,y=s*l-n*o,E=r*l-n*h,U=c*g-u*p,F=c*f-d*p,b=c*x-m*p,S=u*f-d*g,R=u*x-m*g,C=d*x-m*f,T=w*C-v*R+A*S+M*b-y*F+E*U;T&&(T=1/T,t[0]=(o*C-h*R+l*S)*T,t[1]=(r*R-s*C-n*S)*T,t[2]=(g*E-f*y+x*M)*T,t[3]=(d*y-u*E-m*M)*T,t[4]=(h*b-a*C-l*F)*T,t[5]=(i*C-r*b+n*F)*T,t[6]=(f*A-p*E-x*v)*T,t[7]=(c*E-d*A+m*v)*T,t[8]=(a*R-o*b+l*U)*T,t[9]=(s*b-i*R-n*U)*T,t[10]=(p*y-g*A+x*w)*T,t[11]=(u*A-c*y-m*w)*T,t[12]=(o*F-a*S-h*U)*T,t[13]=(i*S-s*F+r*U)*T,t[14]=(g*v-p*M-f*w)*T,t[15]=(c*M-u*v+d*w)*T)}(this,t),this}compose(t,e,i){return function(t,e,i,s){let r=e[0],n=e[1],a=e[2],o=e[3],h=r+r,l=n+n,c=a+a,u=r*h,d=r*l,m=r*c,p=n*l,g=n*c,f=a*c,x=o*h,w=o*l,v=o*c,A=s[0],M=s[1],y=s[2];t[0]=(1-(p+f))*A,t[1]=(d+v)*A,t[2]=(m-w)*A,t[3]=0,t[4]=(d-v)*M,t[5]=(1-(u+f))*M,t[6]=(g+x)*M,t[7]=0,t[8]=(m+w)*y,t[9]=(g-x)*y,t[10]=(1-(u+p))*y,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1}(this,t,e,i),this}getRotation(t){return j(t,this),this}getTranslation(t){var e,i;return i=this,(e=t)[0]=i[12],e[1]=i[13],e[2]=i[14],this}getScaling(t){return N(t,this),this}getMaxScaleOnAxis(){return function(t){let e=t[0],i=t[1],s=t[2],r=t[4],n=t[5],a=t[6],o=t[8],h=t[9],l=t[10];const c=e*e+i*i+s*s,u=r*r+n*n+a*a,d=o*o+h*h+l*l;return Math.sqrt(Math.max(c,u,d))}(this)}lookAt(t,e,i){return function(t,e,i,s){let r=e[0],n=e[1],a=e[2],o=s[0],h=s[1],l=s[2],c=r-i[0],u=n-i[1],d=a-i[2],m=c*c+u*u+d*d;0===m?d=1:(m=1/Math.sqrt(m),c*=m,u*=m,d*=m);let p=h*d-l*u,g=l*c-o*d,f=o*u-h*c;m=p*p+g*g+f*f,0===m&&(l?o+=1e-6:h?l+=1e-6:h+=1e-6,p=h*d-l*u,g=l*c-o*d,f=o*u-h*c,m=p*p+g*g+f*f),m=1/Math.sqrt(m),p*=m,g*=m,f*=m,t[0]=p,t[1]=g,t[2]=f,t[3]=0,t[4]=u*f-d*g,t[5]=d*p-c*f,t[6]=c*g-u*p,t[7]=0,t[8]=c,t[9]=u,t[10]=d,t[11]=0,t[12]=r,t[13]=n,t[14]=a,t[15]=1}(this,t,e,i),this}determinant(){return function(t){let e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],m=t[12],p=t[13],g=t[14],f=t[15];return(e*a-i*n)*(u*f-d*g)-(e*o-s*n)*(c*f-d*p)+(e*h-r*n)*(c*g-u*p)+(i*o-s*a)*(l*f-d*m)-(i*h-r*a)*(l*g-u*m)+(s*h-r*o)*(l*p-c*m)}(this)}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this[4]=t[e+4],this[5]=t[e+5],this[6]=t[e+6],this[7]=t[e+7],this[8]=t[e+8],this[9]=t[e+9],this[10]=t[e+10],this[11]=t[e+11],this[12]=t[e+12],this[13]=t[e+13],this[14]=t[e+14],this[15]=t[e+15],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t[e+4]=this[4],t[e+5]=this[5],t[e+6]=this[6],t[e+7]=this[7],t[e+8]=this[8],t[e+9]=this[9],t[e+10]=this[10],t[e+11]=this[11],t[e+12]=this[12],t[e+13]=this[13],t[e+14]=this[14],t[e+15]=this[15],t}}const Q=new O;class z extends Array{constructor(t=0,e=t,i=t,s="YXZ"){return super(t,e,i),this.order=s,this.onChange=()=>{},this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t,this.onChange()}set y(t){this[1]=t,this.onChange()}set z(t){this[2]=t,this.onChange()}set(t,e=t,i=t){return t.length?this.copy(t):(this[0]=t,this[1]=e,this[2]=i,this.onChange(),this)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.onChange(),this}reorder(t){return this.order=t,this.onChange(),this}fromRotationMatrix(t,e=this.order){return function(t,e,i="YXZ"){"XYZ"===i?(t[1]=Math.asin(Math.min(Math.max(e[8],-1),1)),Math.abs(e[8])<.99999?(t[0]=Math.atan2(-e[9],e[10]),t[2]=Math.atan2(-e[4],e[0])):(t[0]=Math.atan2(e[6],e[5]),t[2]=0)):"YXZ"===i?(t[0]=Math.asin(-Math.min(Math.max(e[9],-1),1)),Math.abs(e[9])<.99999?(t[1]=Math.atan2(e[8],e[10]),t[2]=Math.atan2(e[1],e[5])):(t[1]=Math.atan2(-e[2],e[0]),t[2]=0)):"ZXY"===i?(t[0]=Math.asin(Math.min(Math.max(e[6],-1),1)),Math.abs(e[6])<.99999?(t[1]=Math.atan2(-e[2],e[10]),t[2]=Math.atan2(-e[4],e[5])):(t[1]=0,t[2]=Math.atan2(e[1],e[0]))):"ZYX"===i?(t[1]=Math.asin(-Math.min(Math.max(e[2],-1),1)),Math.abs(e[2])<.99999?(t[0]=Math.atan2(e[6],e[10]),t[2]=Math.atan2(e[1],e[0])):(t[0]=0,t[2]=Math.atan2(-e[4],e[5]))):"YZX"===i?(t[2]=Math.asin(Math.min(Math.max(e[1],-1),1)),Math.abs(e[1])<.99999?(t[0]=Math.atan2(-e[9],e[5]),t[1]=Math.atan2(-e[2],e[0])):(t[0]=0,t[1]=Math.atan2(e[8],e[10]))):"XZY"===i&&(t[2]=Math.asin(-Math.min(Math.max(e[4],-1),1)),Math.abs(e[4])<.99999?(t[0]=Math.atan2(e[6],e[5]),t[1]=Math.atan2(e[8],e[0])):(t[0]=Math.atan2(-e[9],e[10]),t[1]=0))}(this,t,e),this}fromQuaternion(t,e=this.order){return Q.fromQuaternion(t),this.fromRotationMatrix(Q,e)}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}}class V{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new O,this.worldMatrix=new O,this.matrixAutoUpdate=!0,this.position=new d,this.quaternion=new P,this.scale=new d(1),this.rotation=new z,this.up=new d(0,1,0),this.rotation.onChange=()=>this.quaternion.fromEuler(this.rotation),this.quaternion.onChange=()=>this.rotation.fromQuaternion(this.quaternion)}setParent(t,e=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,e&&t&&t.addChild(this,!1)}addChild(t,e=!0){~this.children.indexOf(t)||this.children.push(t),e&&t.setParent(this,!1)}removeChild(t,e=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),e&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(null===this.parent?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let e=0,i=this.children.length;e<i;e++)this.children[e].traverse(t)}decompose(){this.matrix.getTranslation(this.position),this.matrix.getRotation(this.quaternion),this.matrix.getScaling(this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,e=!1){e?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion),this.rotation.fromQuaternion(this.quaternion)}}const Z=new O,J=new d,L=new d;class H extends V{constructor(t,{near:e=.1,far:i=100,fov:s=45,aspect:r=1,left:n,right:a,bottom:o,top:h,zoom:l=1}={}){super(),Object.assign(this,{near:e,far:i,fov:s,aspect:r,left:n,right:a,bottom:o,top:h,zoom:l}),this.projectionMatrix=new O,this.viewMatrix=new O,this.projectionViewMatrix=new O,this.worldPosition=new d,this.type=n||a?"orthographic":"perspective","orthographic"===this.type?this.orthographic():this.perspective()}perspective({near:t=this.near,far:e=this.far,fov:i=this.fov,aspect:s=this.aspect}={}){return Object.assign(this,{near:t,far:e,fov:i,aspect:s}),this.projectionMatrix.fromPerspective({fov:i*(Math.PI/180),aspect:s,near:t,far:e}),this.type="perspective",this}orthographic({near:t=this.near,far:e=this.far,left:i=this.left,right:s=this.right,bottom:r=this.bottom,top:n=this.top,zoom:a=this.zoom}={}){return Object.assign(this,{near:t,far:e,left:i,right:s,bottom:r,top:n,zoom:a}),i/=a,s/=a,r/=a,n/=a,this.projectionMatrix.fromOrthogonal({left:i,right:s,bottom:r,top:n,near:t,far:e}),this.type="orthographic",this}updateMatrixWorld(){return super.updateMatrixWorld(),this.viewMatrix.inverse(this.worldMatrix),this.worldMatrix.getTranslation(this.worldPosition),this.projectionViewMatrix.multiply(this.projectionMatrix,this.viewMatrix),this}lookAt(t){return super.lookAt(t,!0),this}project(t){return t.applyMatrix4(this.viewMatrix),t.applyMatrix4(this.projectionMatrix),this}unproject(t){return t.applyMatrix4(Z.inverse(this.projectionMatrix)),t.applyMatrix4(this.worldMatrix),this}updateFrustum(){this.frustum||(this.frustum=[new d,new d,new d,new d,new d,new d]);const t=this.projectionViewMatrix;this.frustum[0].set(t[3]-t[0],t[7]-t[4],t[11]-t[8]).constant=t[15]-t[12],this.frustum[1].set(t[3]+t[0],t[7]+t[4],t[11]+t[8]).constant=t[15]+t[12],this.frustum[2].set(t[3]+t[1],t[7]+t[5],t[11]+t[9]).constant=t[15]+t[13],this.frustum[3].set(t[3]-t[1],t[7]-t[5],t[11]-t[9]).constant=t[15]-t[13],this.frustum[4].set(t[3]-t[2],t[7]-t[6],t[11]-t[10]).constant=t[15]-t[14],this.frustum[5].set(t[3]+t[2],t[7]+t[6],t[11]+t[10]).constant=t[15]+t[14];for(let t=0;t<6;t++){const e=1/this.frustum[t].distance();this.frustum[t].multiply(e),this.frustum[t].constant*=e}}frustumIntersectsMesh(t){if(!t.geometry.attributes.position)return!0;if(t.geometry.bounds&&t.geometry.bounds.radius!==1/0||t.geometry.computeBoundingSphere(),!t.geometry.bounds)return!0;const e=J;e.copy(t.geometry.bounds.center),e.applyMatrix4(t.worldMatrix);const i=t.geometry.bounds.radius*t.worldMatrix.getMaxScaleOnAxis();return this.frustumIntersectsSphere(e,i)}frustumIntersectsSphere(t,e){const i=L;for(let s=0;s<6;s++){const r=this.frustum[s];if(i.copy(r).dot(t)+r.constant<-e)return!1}return!0}}function W(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=i[0],m=i[1],p=i[2],g=i[3],f=i[4],x=i[5],w=i[6],v=i[7],A=i[8];return t[0]=d*s+m*a+p*l,t[1]=d*r+m*o+p*c,t[2]=d*n+m*h+p*u,t[3]=g*s+f*a+x*l,t[4]=g*r+f*o+x*c,t[5]=g*n+f*h+x*u,t[6]=w*s+v*a+A*l,t[7]=w*r+v*o+A*c,t[8]=w*n+v*h+A*u,t}class q extends Array{constructor(t=1,e=0,i=0,s=0,r=1,n=0,a=0,o=0,h=1){return super(t,e,i,s,r,n,a,o,h),this}set(t,e,i,s,r,n,a,o,h){return t.length?this.copy(t):(function(t,e,i,s,r,n,a,o,h,l){t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=n,t[5]=a,t[6]=o,t[7]=h,t[8]=l}(this,t,e,i,s,r,n,a,o,h),this)}translate(t,e=this){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=i[0],m=i[1];t[0]=s,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=h,t[6]=d*s+m*a+l,t[7]=d*r+m*o+c,t[8]=d*n+m*h+u}(this,e,t),this}rotate(t,e=this){return function(t,e,i){let s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=Math.sin(i),m=Math.cos(i);t[0]=m*s+d*a,t[1]=m*r+d*o,t[2]=m*n+d*h,t[3]=m*a-d*s,t[4]=m*o-d*r,t[5]=m*h-d*n,t[6]=l,t[7]=c,t[8]=u}(this,e,t),this}scale(t,e=this){return function(t,e,i){let s=i[0],r=i[1];t[0]=s*e[0],t[1]=s*e[1],t[2]=s*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}(this,e,t),this}multiply(t,e){return e?W(this,t,e):W(this,this,t),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this}copy(t){var e,i;return i=t,(e=this)[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}fromMatrix4(t){var e,i;return i=t,(e=this)[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[4],e[4]=i[5],e[5]=i[6],e[6]=i[8],e[7]=i[9],e[8]=i[10],this}fromQuaternion(t){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=i+i,o=s+s,h=r+r,l=i*a,c=s*a,u=s*o,d=r*a,m=r*o,p=r*h,g=n*a,f=n*o,x=n*h;t[0]=1-u-p,t[3]=c-x,t[6]=d+f,t[1]=c+x,t[4]=1-l-p,t[7]=m-g,t[2]=d-f,t[5]=m+g,t[8]=1-l-u}(this,t),this}fromBasis(t,e,i){return this.set(t[0],t[1],t[2],e[0],e[1],e[2],i[0],i[1],i[2]),this}inverse(t=this){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=c*a-o*l,d=-c*n+o*h,m=l*n-a*h,p=i*u+s*d+r*m;p&&(p=1/p,t[0]=u*p,t[1]=(-c*s+r*l)*p,t[2]=(o*s-r*a)*p,t[3]=d*p,t[4]=(c*i-r*h)*p,t[5]=(-o*i+r*n)*p,t[6]=m*p,t[7]=(-l*i+s*h)*p,t[8]=(a*i-s*n)*p)}(this,t),this}getNormalMatrix(t){return function(t,e){let i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],m=e[11],p=e[12],g=e[13],f=e[14],x=e[15],w=i*o-s*a,v=i*h-r*a,A=i*l-n*a,M=s*h-r*o,y=s*l-n*o,E=r*l-n*h,U=c*g-u*p,F=c*f-d*p,b=c*x-m*p,S=u*f-d*g,R=u*x-m*g,C=d*x-m*f,T=w*C-v*R+A*S+M*b-y*F+E*U;T&&(T=1/T,t[0]=(o*C-h*R+l*S)*T,t[1]=(h*b-a*C-l*F)*T,t[2]=(a*R-o*b+l*U)*T,t[3]=(r*R-s*C-n*S)*T,t[4]=(i*C-r*b+n*F)*T,t[5]=(s*b-i*R-n*U)*T,t[6]=(g*E-f*y+x*M)*T,t[7]=(f*A-p*E-x*v)*T,t[8]=(p*y-g*A+x*w)*T)}(this,t),this}}let X=0;class _ extends V{constructor(t,{geometry:e,program:i,mode:s=t.TRIANGLES,frustumCulled:r=!0,renderOrder:n=0}={}){super(),t.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=t,this.id=X++,this.geometry=e,this.program=i,this.mode=s,this.frustumCulled=r,this.renderOrder=n,this.modelViewMatrix=new O,this.normalMatrix=new q,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){this.beforeRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t}))),t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix);let e=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:e}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach((e=>e&&e({mesh:this,camera:t})))}}const $=new Uint8Array(4);function tt(t){return!(t&t-1)}let et=1;class it{constructor(t,{image:e,target:i=t.TEXTURE_2D,type:s=t.UNSIGNED_BYTE,format:r=t.RGBA,internalFormat:n=r,wrapS:a=t.CLAMP_TO_EDGE,wrapT:o=t.CLAMP_TO_EDGE,generateMipmaps:h=!0,minFilter:l=(h?t.NEAREST_MIPMAP_LINEAR:t.LINEAR),magFilter:c=t.LINEAR,premultiplyAlpha:u=!1,unpackAlignment:d=4,flipY:m=i==t.TEXTURE_2D,anisotropy:p=0,level:g=0,width:f,height:x=f}={}){this.gl=t,this.id=et++,this.image=e,this.target=i,this.type=s,this.format=r,this.internalFormat=n,this.minFilter=l,this.magFilter=c,this.wrapS=a,this.wrapT=o,this.generateMipmaps=h,this.premultiplyAlpha=u,this.unpackAlignment=d,this.flipY=m,this.anisotropy=Math.min(p,this.gl.renderer.parameters.maxAnisotropy),this.level=g,this.width=f,this.height=x,this.texture=this.gl.createTexture(),this.store={image:null},this.glState=this.gl.renderer.state,this.state={},this.state.minFilter=this.gl.NEAREST_MIPMAP_LINEAR,this.state.magFilter=this.gl.LINEAR,this.state.wrapS=this.gl.REPEAT,this.state.wrapT=this.gl.REPEAT,this.state.anisotropy=0}bind(){this.glState.textureUnits[this.glState.activeTextureUnit]!==this.id&&(this.gl.bindTexture(this.target,this.texture),this.glState.textureUnits[this.glState.activeTextureUnit]=this.id)}update(t=0){const e=!(this.image===this.store.image&&!this.needsUpdate);if((e||this.glState.textureUnits[t]!==this.id)&&(this.gl.renderer.activeTexture(t),this.bind()),e){if(this.needsUpdate=!1,this.flipY!==this.glState.flipY&&(this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,this.flipY),this.glState.flipY=this.flipY),this.premultiplyAlpha!==this.glState.premultiplyAlpha&&(this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),this.glState.premultiplyAlpha=this.premultiplyAlpha),this.unpackAlignment!==this.glState.unpackAlignment&&(this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,this.unpackAlignment),this.glState.unpackAlignment=this.unpackAlignment),this.minFilter!==this.state.minFilter&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_MIN_FILTER,this.minFilter),this.state.minFilter=this.minFilter),this.magFilter!==this.state.magFilter&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_MAG_FILTER,this.magFilter),this.state.magFilter=this.magFilter),this.wrapS!==this.state.wrapS&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_S,this.wrapS),this.state.wrapS=this.wrapS),this.wrapT!==this.state.wrapT&&(this.gl.texParameteri(this.target,this.gl.TEXTURE_WRAP_T,this.wrapT),this.state.wrapT=this.wrapT),this.anisotropy&&this.anisotropy!==this.state.anisotropy&&(this.gl.texParameterf(this.target,this.gl.renderer.getExtension("EXT_texture_filter_anisotropic").TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy),this.state.anisotropy=this.anisotropy),this.image){if(this.image.width&&(this.width=this.image.width,this.height=this.image.height),this.target===this.gl.TEXTURE_CUBE_MAP)for(let t=0;t<6;t++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+t,this.level,this.internalFormat,this.format,this.type,this.image[t]);else if(ArrayBuffer.isView(this.image))this.gl.texImage2D(this.target,this.level,this.internalFormat,this.width,this.height,0,this.format,this.type,this.image);else if(this.image.isCompressedTexture)for(let t=0;t<this.image.length;t++)this.gl.compressedTexImage2D(this.target,t,this.internalFormat,this.image[t].width,this.image[t].height,0,this.image[t].data);else this.gl.texImage2D(this.target,this.level,this.internalFormat,this.format,this.type,this.image);this.generateMipmaps&&(this.gl.renderer.isWebgl2||tt(this.image.width)&&tt(this.image.height)?this.gl.generateMipmap(this.target):(this.generateMipmaps=!1,this.wrapS=this.wrapT=this.gl.CLAMP_TO_EDGE,this.minFilter=this.gl.LINEAR)),this.onUpdate&&this.onUpdate()}else if(this.target===this.gl.TEXTURE_CUBE_MAP)for(let t=0;t<6;t++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this.gl.RGBA,1,1,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,$);else this.width?this.gl.texImage2D(this.target,this.level,this.internalFormat,this.width,this.height,0,this.format,this.type,null):this.gl.texImage2D(this.target,0,this.gl.RGBA,1,1,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,$);this.store.image=this.image}}}class st extends Array{constructor(t=0,e=t,i=t,s=t){return super(t,e,i,s),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set w(t){this[3]=t}set(t,e,i,s){return t.length?this.copy(t):(C(this,t,e,i,s),this)}copy(t){return R(this,t),this}normalize(){return T(this,this),this}multiply(t){var e,i,s;return i=this,s=t,(e=this)[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=i[3]*s,this}dot(t){return G(this,t)}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}}class rt extends x{constructor(t,{width:e=1,height:i=1,widthSegments:s=1,heightSegments:r=1,attributes:n={}}={}){const a=s,o=r,h=(a+1)*(o+1),l=a*o*6,c=new Float32Array(3*h),u=new Float32Array(3*h),d=new Float32Array(2*h),m=l>65536?new Uint32Array(l):new Uint16Array(l);rt.buildPlane(c,u,d,m,e,i,0,a,o),Object.assign(n,{position:{size:3,data:c},normal:{size:3,data:u},uv:{size:2,data:d},index:{data:m}}),super(t,n)}static buildPlane(t,e,i,s,r,n,a,o,h,l=0,c=1,u=2,d=1,m=-1,p=0,g=0){const f=p,x=r/o,w=n/h;for(let v=0;v<=h;v++){let A=v*w-n/2;for(let n=0;n<=o;n++,p++){let w=n*x-r/2;if(t[3*p+l]=w*d,t[3*p+c]=A*m,t[3*p+u]=a/2,e[3*p+l]=0,e[3*p+c]=0,e[3*p+u]=a>=0?1:-1,i[2*p]=n/o,i[2*p+1]=1-v/h,v===h||n===o)continue;let M=f+n+v*(o+1),y=f+n+(v+1)*(o+1),E=f+n+(v+1)*(o+1)+1,U=f+n+v*(o+1)+1;s[6*g]=M,s[6*g+1]=y,s[6*g+2]=U,s[6*g+3]=y,s[6*g+4]=E,s[6*g+5]=U,g++}}}}const nt="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwkHBgoJCAkLCwoMDxkQDw4ODx4WFxIZJCAmJSMgIyIoLTkwKCo2KyIjMkQyNjs9QEBAJjBGS0U+Sjk/QD3/2wBDAQsLCw8NDx0QEB09KSMpPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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NsUImchRIiVn9mSMYscmyWZoaHKJaEJCxGkxysxuiTkOBnopWYFC5UUmUKSN6NbFHrFDyP6FZiNjstCZiOUhQMjIUWeguM1fVlpmMhlDn1h1YmrLEpmtdWmU+skZiiYGbRgj//xAAUEQEAAAAAAAAAAAAAAAAAAADA/9oACAECAQE/AAAH/8QAFBEBAAAAAAAAAAAAAAAAAAAAwP/aAAgBAwEBPwAAB//Z",at=.5*(Math.sqrt(3)-1),ot=(3-Math.sqrt(3))/6,ht=t=>0|Math.floor(t),lt=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]);function ct(t){return t*(.5-Math.random())}function ut(t,e){return t+Math.random()*(e-t)}const dt=function(t=Math.random){const e=function(t){const e=512,i=new Uint8Array(e);for(let t=0;t<e/2;t++)i[t]=t;for(let s=0;s<e/2-1;s++){const e=s+~~(t()*(256-s)),r=i[s];i[s]=i[e],i[e]=r}for(let t=256;t<e;t++)i[t]=i[t-256];return i}(t),i=new Float64Array(e).map((t=>lt[t%12*2])),s=new Float64Array(e).map((t=>lt[t%12*2+1]));return function(t,r){let n=0,a=0,o=0;const h=(t+r)*at,l=ht(t+h),c=ht(r+h),u=(l+c)*ot,d=t-(l-u),m=r-(c-u);let p,g;d>m?(p=1,g=0):(p=0,g=1);const f=d-p+ot,x=m-g+ot,w=d-1+2*ot,v=m-1+2*ot,A=255&l,M=255&c;let y=.5-d*d-m*m;if(y>=0){const t=A+e[M];y*=y,n=y*y*(i[t]*d+s[t]*m)}let E=.5-f*f-x*x;if(E>=0){const t=A+p+e[M+g];E*=E,a=E*E*(i[t]*f+s[t]*x)}let U=.5-w*w-v*v;if(U>=0){const t=A+1+e[M+1];U*=U,o=U*U*(i[t]*w+s[t]*v)}return 70*(n+a+o)}}(Math.random);function mt(t){return Math.max(0,Math.min(1,t))}const pt="float PI = 3.141592653589793238;",gt="\nprecision highp float;\n\nuniform float time;\nuniform float progress;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform vec4 resolution;\nvarying vec2 vUv;\n",ft="\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute float offset;\nattribute vec3 bary;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float progress;\nuniform vec4 resolution;\n\nvarying vec2 vUv;\nvarying float vProgress;\nvarying float vProgress1;\nvarying vec3 vBary;\n",xt="\nmat4 rotationMatrix(vec3 axis, float angle) {\n axis = normalize(axis);\n float s = sin(angle);\n float c = cos(angle);\n float oc = 1.0 - c;\n\n return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n 0.0, 0.0, 0.0, 1.0);\n}\nvec3 rotate(vec3 v, vec3 axis, float angle) {\n mat4 m = rotationMatrix(axis, angle);\n return (m * vec4(v, 1.0)).xyz;\n}\n",wt={dots:{uniforms:{},fragment:`\n ${gt}\n const float SQRT_2 = 1.414213562373;\n const vec2 center = vec2(0, 0);// = vec2(0, 0);\n const float dots = 20.0;// = 20.0;\n\n vec4 getFromColor(vec2 p) {\n return texture2D(texture1, p);\n }\n\n vec4 getToColor(vec2 p) {\n return texture2D(texture2, p);\n }\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n bool nextImage = distance(fract(newUV * dots), vec2(0.5, 0.5)) < ( progress / distance(newUV, center));\n gl_FragColor = nextImage ? getToColor(newUV) : getFromColor(newUV);\n }\n\n `},flyeye:{uniforms:{},fragment:`\n ${gt}\n const float size = 0.04; // = 0.04\n const float zoom = 100.0; // = 50.0\n const float colorSeparation = 0.3; // = 0.3\n\n vec4 getFromColor(vec2 p) {\n return texture2D(texture1, p);\n }\n\n vec4 getToColor(vec2 p) {\n return texture2D(texture2, p);\n }\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float inv = 1. - progress;\n vec2 disp = size*vec2(cos(zoom*newUV.x), sin(zoom*newUV.y));\n vec4 texTo = getToColor(newUV + inv*disp);\n vec4 texFrom = vec4(\n getFromColor(newUV + progress*disp*(1.0 - colorSeparation)).r,\n getFromColor(newUV + progress*disp).g,\n getFromColor(newUV + progress*disp*(1.0 + colorSeparation)).b,\n 1.0);\n gl_FragColor = texTo*progress + texFrom*inv;\n }\n\n `},"morph-x":{uniforms:{intensity:{value:1,type:"f",min:0,max:3}},fragment:`\n ${gt}\n uniform float intensity;\n uniform sampler2D displacement;\n mat2 getRotM(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n return mat2(c, -s, s, c);\n }\n const float PI = 3.1415;\n const float angle1 = PI *0.25;\n const float angle2 = -PI *0.75;\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec4 disp = texture2D(displacement, newUV);\n vec2 dispVec = vec2(disp.r, disp.g);\n vec2 distortedPosition1 = newUV + getRotM(angle1) * dispVec * intensity * progress;\n vec4 t1 = texture2D(texture1, distortedPosition1);\n vec2 distortedPosition2 = newUV + getRotM(angle2) * dispVec * intensity * (1.0 - progress);\n vec4 t2 = texture2D(texture2, distortedPosition2);\n gl_FragColor = mix(t1, t2, progress);\n }\n`},"morph-y":{uniforms:{intensity:{value:.3,type:"f",min:0,max:2}},fragment:`\n ${gt}\n uniform float intensity;\n uniform sampler2D displacement;\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec4 d1 = texture2D(texture1, newUV);\n vec4 d2 = texture2D(texture2, newUV);\n float displace1 = (d1.r + d1.g + d1.b)*0.33;\n float displace2 = (d2.r + d2.g + d2.b)*0.33;\n\n vec4 t1 = texture2D(texture1, vec2(newUV.x, newUV.y + progress * (displace2 * intensity)));\n vec4 t2 = texture2D(texture2, vec2(newUV.x, newUV.y + (1.0 - progress) * (displace1 * intensity)));\n gl_FragColor = mix(t1, t2, progress);\n }\n`},"page-curl":{uniforms:{},fragment:`\n ${gt}\n const float MIN_AMOUNT = -0.16;\n const float MAX_AMOUNT = 1.5;\n\n const float PI = 3.141592653589793;\n\n const float scale = 512.0;\n const float sharpness = 3.0;\n\n const float cylinderRadius = 1.0 / PI / 2.0;\n\n vec4 getFromColor(vec2 p) {\n return texture2D(texture1, p);\n }\n\n vec4 getToColor(vec2 p) {\n return texture2D(texture2, p);\n }\n\n vec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation) {\n float hitPoint = hitAngle / (2.0 * PI);\n point.y = hitPoint;\n return rrotation * point;\n }\n\n vec4 antiAlias(vec4 color1, vec4 color2, float distanc) {\n distanc *= scale;\n if(distanc < 0.0)\n return color2;\n if(distanc > 2.0)\n return color1;\n float dd = pow(1.0 - distanc / 2.0, sharpness);\n return ((color2 - color1) * dd) + color1;\n }\n\n float distanceToEdge(vec3 point) {\n float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x);\n float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y);\n if(point.x < 0.0)\n dx = -point.x;\n if(point.x > 1.0)\n dx = point.x - 1.0;\n if(point.y < 0.0)\n dy = -point.y;\n if(point.y > 1.0)\n dy = point.y - 1.0;\n if((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0))\n return sqrt(dx * dx + dy * dy);\n return min(dx, dy);\n }\n\n vec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation, float cylinderAngle) {\n float hitAngle = PI - (acos(yc / cylinderRadius) - cylinderAngle);\n vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation);\n if(yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0)) {\n return getToColor(p);\n }\n\n if(yc > 0.0)\n return getFromColor(p);\n\n vec4 color = getFromColor(point.xy);\n vec4 tcolor = vec4(0.0);\n\n return antiAlias(color, tcolor, distanceToEdge(point));\n }\n\n vec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation, float cylinderAngle, float amount) {\n float shadow = distanceToEdge(point) * 30.0;\n shadow = (1.0 - shadow) / 3.0;\n\n if(shadow < 0.0)\n shadow = 0.0;\n else\n shadow *= amount;\n\n vec4 shadowColor = seeThrough(yc, p, rotation, rrotation, cylinderAngle);\n shadowColor.r -= shadow;\n shadowColor.g -= shadow;\n shadowColor.b -= shadow;\n\n return shadowColor;\n }\n\n vec4 backside(float yc, vec3 point) {\n vec4 color = getFromColor(point.xy);\n float gray = (color.r + color.b + color.g) / 15.0;\n gray += (8.0 / 10.0) * (pow(1.0 - abs(yc / cylinderRadius), 2.0 / 10.0) / 2.0 + (5.0 / 10.0));\n color.rgb = vec3(gray);\n return color;\n }\n\n vec4 behindSurface(vec2 p, float yc, vec3 point, mat3 rrotation, float cylinderAngle, float amount) {\n float shado = (1.0 - ((-cylinderRadius - yc) / amount * 7.0)) / 6.0;\n shado *= 1.0 - abs(point.x - 0.5);\n\n yc = (-cylinderRadius - cylinderRadius - yc);\n\n float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI;\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if(yc < 0.0 && point.x >= 0.0 && point.y >= 0.0 && point.x <= 1.0 && point.y <= 1.0 && (hitAngle < PI || amount > 0.5)) {\n shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / (71.0 / 100.0));\n shado *= pow(-yc / cylinderRadius, 3.0);\n shado *= 0.5;\n } else {\n shado = 0.0;\n }\n return vec4(getToColor(p).rgb - shado, 1.0);\n }\n\n void main() {\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n\n float amount = progress * (MAX_AMOUNT - MIN_AMOUNT) + MIN_AMOUNT;\n float cylinderCenter = amount;\n // 360 degrees * amount\n float cylinderAngle = 2.0 * PI * amount;\n\n const float angle = 100.0 * PI / 180.0;\n float c = cos(-angle);\n float s = sin(-angle);\n\n mat3 rotation = mat3(c, s, 0, -s, c, 0, -0.801, 0.8900, 1);\n c = cos(angle);\n s = sin(angle);\n\n mat3 rrotation = mat3(c, s, 0, -s, c, 0, 0.98500, 0.985, 1);\n\n vec3 point = rotation * vec3(newUV, 1.0);\n\n float yc = point.y - cylinderCenter;\n\n if(yc < -cylinderRadius) {\n // Behind surface\n gl_FragColor = behindSurface(newUV, yc, point, rrotation, cylinderAngle, amount);\n return;\n }\n\n if(yc > cylinderRadius) {\n // Flat surface\n gl_FragColor = getFromColor(newUV);\n return;\n }\n\n float hitAngle = (acos(yc / cylinderRadius) + cylinderAngle) - PI;\n\n float hitAngleMod = mod(hitAngle, 2.0 * PI);\n if((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI / 2.0 && amount < 0.0)) {\n gl_FragColor = seeThrough(yc, newUV, rotation, rrotation, cylinderAngle);\n return;\n }\n\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if(point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0) {\n gl_FragColor = seeThroughWithShadow(yc, newUV, point, rotation, rrotation, cylinderAngle, amount);\n return;\n }\n\n vec4 color = backside(yc, point);\n\n vec4 otherColor;\n if(yc < 0.0) {\n float shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / 0.71);\n shado *= pow(-yc / cylinderRadius, 3.0);\n shado *= 0.5;\n otherColor = vec4(0.0, 0.0, 0.0, shado);\n } else {\n otherColor = getFromColor(newUV);\n }\n\n color = antiAlias(color, otherColor, cylinderRadius - abs(yc));\n\n vec4 cl = seeThroughWithShadow(yc, newUV, point, rotation, rrotation, cylinderAngle, amount);\n float dist = distanceToEdge(point);\n\n gl_FragColor = antiAlias(color, cl, dist);\n }\n `},"peel-x":{uniforms:{},fragment:`\n ${gt}\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec2 p = newUV;\n float x = progress;\n x = smoothstep(.0,1.0,(x*2.0+p.x-1.0));\n vec4 f = mix(\n texture2D(texture1, (p-.5)*(1.-x)+.5),\n texture2D(texture2, (p-.5)*x+.5),\n x);\n gl_FragColor = f;\n }\n `},"peel-y":{uniforms:{},fragment:`\n ${gt}\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec2 p = newUV;\n float x = progress;\n x = smoothstep(.0,1.0,(x*2.0+p.y-1.0));\n vec4 f = mix(\n texture2D(texture1, (p-.5)*(1.-x)+.5),\n texture2D(texture2, (p-.5)*x+.5),\n x);\n gl_FragColor = f;\n }\n `},"polygons-fall":{uniforms:{},detail:12,offsetTop:0,vertex:`\n ${ft}\n attribute vec3 centroid1;\n\n ${xt}\n\n void main() {\n ${pt}\n vUv = uv;\n vBary = bary;\n\n vec3 newpos = position;\n\n float o = 1. - offset;\n float pr = (progress - 0.5) * (0. + resolution.y / resolution.x) + 0.5;\n pr = progress;\n float prog = clamp((pr - o * 0.9) / 0.1, 0., 1.);\n vProgress = prog;\n vProgress1 = clamp((pr - clamp(o - 0.1, 0., 1.) * 0.9) / 0.1, 0., 1.);\n newpos = rotate((newpos - centroid1), vec3(1., 0., 0.), -prog * PI) + centroid1 + vec3(0., -1., 0.) * prog * 0.;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newpos, 1.0);\n }\n `,fragment:`\n ${gt}\n varying float vProgress;\n varying float vProgress1;\n ${pt}\n varying vec3 vBary;\n\n void main()\t{\n float width = 2.5 * vProgress1;\n vec3 d;\n #ifdef GL_OES_standard_derivatives\n d = fwidth(vBary);\n #endif\n vec3 s = smoothstep(d * (width + 0.5), d * (width - 0.5), vBary);\n float alpha = max(max(s.x, s.y), s.z);\n vec3 color = vec3(alpha);\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n vec4 t = texture2D(texture1, newUV);\n float opa = smoothstep(1., 0.5, vProgress);\n opa = 1. - vProgress;\n gl_FragColor = vec4(vUv, 0.0, opa);\n gl_FragColor = vec4(t.rgb + .5 * color * vProgress1, opa);\n }\n `},"polygons-morph":{uniforms:{},detail:20,offsetTop:.4,vertex:`\n ${ft}\n ${xt}\n\n void main() {\n ${pt}\n vUv = uv;\n vBary = bary;\n\n vec3 newpos = position;\n\n float o = 1. - offset;\n float prog = clamp((progress - o * 0.6) / 0.4, 0., 1.);\n vProgress = prog;\n vProgress1 = clamp((progress - clamp(o - 0.1, -0., 1.) * 0.9) / 0.1, 0., 1.);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newpos, 1.0);\n }\n `,fragment:`\n ${gt}\n varying float vProgress;\n varying float vProgress1;\n ${pt}\n varying vec3 vBary;\n void main()\t{\n float width = 2.5 * vProgress1;\n vec3 d;\n #ifdef GL_OES_standard_derivatives\n d = fwidth(vBary);\n #endif\n vec3 s = smoothstep(d * (width + 0.5), d * (width - 0.5), vBary);\n float alpha = max(max(s.x, s.y), s.z);\n vec3 color = vec3(alpha);\n\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n vec4 t = texture2D(texture1, newUV);\n float opa = smoothstep(1., 0.5, vProgress);\n opa = 1. - vProgress;\n gl_FragColor = vec4(t.rgb + 1. * color * vProgress1, opa);\n }\n `},"polygons-wind":{uniforms:{},detail:40,offsetTop:1,vertex:`\n ${ft}\n attribute vec3 control0;\n attribute vec3 control1;\n\n ${xt}\n\n float easeOut(float t){\n return t * t * t;\n }\n\n vec3 bezier4(vec3 a, vec3 b, vec3 c, vec3 d, float t) {\n return mix(mix(mix(a, b, t), mix(b, c, t), t), mix(mix(b, c, t), mix(c, d, t), t), t);\n }\n\n void main() {\n ${pt}\n vUv = uv;\n vBary = bary;\n\n vec3 newpos = position;\n\n float o = 1. - offset;\n float prog = clamp((progress - o * 0.6) / 0.4, 0., 1.);\n vProgress = prog;\n vProgress1 = clamp((progress - clamp(o - 0.2, -0., 1.) * 0.6) / 0.4, 0., 1.);\n newpos = bezier4(newpos, control0, control1, newpos, easeOut(prog));\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newpos, 1.0);\n }\n `,fragment:`\n ${gt}\n varying float vProgress;\n varying float vProgress1;\n ${pt}\n varying vec3 vBary;\n void main()\t{\n float width = 2.5 * vProgress1;\n vec3 d;\n #ifdef GL_OES_standard_derivatives\n d = fwidth(vBary);\n #endif\n vec3 s = smoothstep(d * (width + 0.5), d * (width - 0.5), vBary);\n float alpha = max(max(s.x, s.y), s.z);\n vec3 color = vec3(alpha);\n\n vec2 newUV = (vUv - vec2(0.5)) * resolution.zw + vec2(0.5);\n vec4 t = texture2D(texture1, newUV);\n float opa = smoothstep(1., 0.5, vProgress);\n opa = 1. - vProgress;\n gl_FragColor = vec4(vUv, 0.0, opa);\n opa = smoothstep(0.5, 1., opa);\n gl_FragColor = vec4(t.rgb + 1. * color * vProgress1, opa);\n }\n `},pixelize:{uniforms:{},fragment:`\n ${gt}\n ivec2 squaresMin = ivec2(50);\n int steps = 20;\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float d = min(progress, 1.0 - progress);\n float dist = steps>0 ? ceil(d * float(steps)) / float(steps) : d;\n vec2 squareSize = 2.0 * dist / vec2(squaresMin);\n\n vec2 p = dist>0.0 ? (floor(newUV / squareSize) + 0.5) * squareSize : newUV;\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,p);\n vec4 t2 = texture2D(texture2,p);\n\n gl_FragColor = mix(t1, t2, progress);\n }\n `},ripple:{uniforms:{radius:{value:.9,type:"f",min:.1,max:2},width:{value:.35,type:"f",min:0,max:1}},fragment:`\n ${gt}\n uniform float width;\n uniform float radius;\n uniform sampler2D displacement;\n float parabola( float x, float k ) {\n return pow( 4. * x * ( 1. - x ), k );\n }\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec2 p = newUV;\n vec2 start = vec2(0.5,0.5);\n vec2 aspect = resolution.wz;\n vec2 uv = newUV;\n float dt = parabola(progress, 1.);\n vec4 noise = texture2D(displacement, fract(vUv+time*0.04));\n float prog = progress*0.66 + noise.g * 0.04;\n float circ = 1. - smoothstep(-width, 0.0, radius * distance(start*aspect, uv*aspect) - prog*(1.+width));\n float intpl = pow(abs(circ), 1.);\n vec4 t1 = texture2D( texture1, (uv - 0.5) * (1.0 - intpl) + 0.5 ) ;\n vec4 t2 = texture2D( texture2, (uv - 0.5) * intpl + 0.5 );\n gl_FragColor = mix( t1, t2, intpl );\n }\n `},shutters:{uniforms:{intensity:{value:50,type:"f",min:1,max:100}},fragment:`\n ${gt}\n uniform float intensity;\n mat2 rotate(float a) {\n float s = sin(a);\n float c = cos(a);\n return mat2(c, -s, s, c);\n }\n const float PI = 3.1415;\n const float angle1 = PI *0.25;\n const float angle2 = PI *0.25;\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n vec2 uvDivided = fract(newUV*vec2(intensity,1.));\n\n vec2 uvDisplaced1 = newUV + rotate(angle1)*uvDivided*progress*0.1;\n vec2 uvDisplaced2 = newUV + rotate(angle2)*uvDivided*(1. - progress)*0.1;\n\n vec4 t1 = texture2D(texture1,uvDisplaced1);\n vec4 t2 = texture2D(texture2,uvDisplaced2);\n\n gl_FragColor = mix(t1, t2, progress);\n }\n\n `},slices:{uniforms:{size:{value:.25,type:"f",min:.1,max:1}},fragment:`\n ${gt}\n uniform float size; // = 0.2\n float count = 20.; // = 10.0\n float smoothness = .5; // = 0.5\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float pr = smoothstep(-smoothness, 0.0, newUV.x - progress * (1.0 + smoothness));\n float s = step(pr, fract(count * newUV.x));\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,uv1);\n vec4 t2 = texture2D(texture2,uv2);\n gl_FragColor = mix(t1, t2, s);\n\n }\n `},squares:{uniforms:{},fragment:`\n ${gt}\n ivec2 squares = ivec2(10,10);\n vec2 direction = vec2(1.0, -0.5);\n float smoothness = 1.6;\n\n const vec2 center = vec2(0.5, 0.5);\n void main() {\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float offset = smoothness;\n float pr = smoothstep(-offset, 0.0, v.x * newUV.x + v.y * newUV.y - (d-0.5+progress*(1.+offset)));\n vec2 squarep = fract(newUV*vec2(squares));\n vec2 squaremin = vec2(pr/2.0);\n vec2 squaremax = vec2(1.0 - pr/2.0);\n float a = (1.0 - step(progress, 0.0)) * step(squaremin.x, squarep.x) * step(squaremin.y, squarep.y) * step(squarep.x, squaremax.x) * step(squarep.y, squaremax.y);\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,newUV);\n vec4 t2 = texture2D(texture2,newUV);\n\n gl_FragColor = mix(t1, t2, a);\n }\n `},stretch:{uniforms:{intensity:{value:50,type:"f",min:1,max:100}},fragment:`\n ${gt}\n uniform float intensity;\n mat2 rotate(float a) {\n float s = sin(a);\n float c = cos(a);\n return mat2(c, -s, s, c);\n }\n const float PI = 3.1415;\n const float angle1 = PI *0.25;\n const float angle2 = -PI *0.75;\n const float noiseSeed = 2.;\n float random() {\n return fract(sin(noiseSeed + dot(gl_FragCoord.xy / resolution.xy / 10.0, vec2(12.9898, 4.1414))) * 43758.5453);\n }\n float hash(float n) { return fract(sin(n) * 1e4); }\n float hash(vec2 p) { return fract(1e4 * sin(17.0 * p.x + p.y * 0.1) * (0.1 + abs(sin(p.y * 13.0 + p.x)))); }\n float hnoise(vec2 x) {\n vec2 i = floor(x);\n vec2 f = fract(x);\n float a = hash(i);\n float b = hash(i + vec2(1.0, 0.0));\n float c = hash(i + vec2(0.0, 1.0));\n float d = hash(i + vec2(1.0, 1.0));\n vec2 u = f * f * (3.0 - 2.0 * f);\n return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;\n }\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float hn = hnoise(newUV.xy * resolution.xy / 100.0);\n vec2 d = vec2(0.,normalize(vec2(0.5,0.5) - newUV.xy).y);\n vec2 uv1 = newUV + d * progress / 5.0 * (1.0 + hn / 2.0);\n vec2 uv2 = newUV - d * (1.0 - progress) / 5.0 * (1.0 + hn / 2.0);\n vec4 t1 = texture2D(texture1,uv1);\n vec4 t2 = texture2D(texture2,uv2);\n gl_FragColor = mix(t1, t2, progress);\n }\n `},"wave-x":{uniforms:{},fragment:`\n ${gt}\n uniform sampler2D displacement;\n vec2 mirrored(vec2 v) {\n vec2 m = mod(v,2.);\n return mix(m,2.0 - m, step(1.0 ,m));\n }\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n vec4 noise = texture2D(displacement, mirrored(newUV+time*0.04));\n float prog = (1.0 - progress)*0.8 -0.05 + noise.g * 0.06;\n float intpl = pow(abs(smoothstep(0., 1., (prog*2. - vUv.x + 0.5))), 10.);\n\n vec4 t1 = texture2D( texture2, (newUV - 0.5) * (1.0 - intpl) + 0.5 ) ;\n vec4 t2 = texture2D( texture1, (newUV - 0.5) * intpl + 0.5 );\n gl_FragColor = mix( t1, t2, intpl );\n }\n `},wind:{uniforms:{},fragment:`\n ${gt}\n float size = 0.2;\n\n float rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n }\n\n void main()\t{\n vec2 newUV = (vUv - vec2(0.5))*resolution.zw + vec2(0.5);\n\n float r = rand(vec2(0, newUV.y));\n float m = smoothstep(0.0, -size, newUV.x*(1.0-size) + size*r - ((progress) * (1.0 + size)));\n\n vec2 uv1 = newUV;\n vec2 uv2 = newUV;\n\n vec4 t1 = texture2D(texture1,uv1);\n vec4 t2 = texture2D(texture2,uv2);\n gl_FragColor = mix(t1, t2, m);\n\n }\n `}},vt="\nattribute vec2 uv;\nattribute vec3 position;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",At=(t,e)=>{const{shaderPerSlide:i,swiper:s}=e,r=s.params.loop?s.realIndex:s.activeIndex;let n=wt;if(Array.isArray(t)&&t.length){if(i)return void 0===t[r]?wt[t[0]]:wt[t[r]];n={},Object.keys(wt).forEach((e=>{t.includes(e)&&(n[e]=wt[e])}))}const a=Math.floor(Math.random()*Object.keys(n).length);return n[Object.keys(n)[a]]};class Mt{constructor(t){const e="random"===t.shader||Array.isArray(t.shader)?At(t.shader,t):wt[t.shader];this.shader=e,this.displacement=t.displacementMap||nt,this.scene=new V,this.swiper=t.swiper,this.vertex=e.vertex||vt,this.fragment=e.fragment,this.uniforms=e.uniforms||{},this.renderer=new S({dpr:2,webgl:2,alpha:!0}),this.gl=this.renderer.gl,this.width=window.innerWidth,this.height=window.innerHeight,this.renderer.setSize(this.width,this.height),this.gl.clearColor(1,1,1,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.opts=t,this.container=this.swiper.el,this.displacementTexture=null,this.width=this.swiper.width,this.height=this.swiper.height,this.swiper.isElement&&this.gl.canvas.setAttribute("slot","container-start"),this.container.prepend(this.gl.canvas),this.camera=new H(this.gl,{fov:45}),this.camera.perspective({aspect:this.gl.canvas.width/this.gl.canvas.height}),this.camera.position.set(0,0,2),this.time=0,this.current=0,this.init((()=>{this.addObjects(),this.resize(),this.render()}))}animateUniform(t,e,i){const s=t.value;let r,n=null;window.cancelAnimationFrame(this.animateUniformFrame);const a=e>t.value?"next":"prev",o=(t,e)=>"next"===a&&t>=e||"prev"===a&&t<=e,h=()=>{if(this.destroyed)return;r=(new Date).getTime(),null===n&&(n=r);const a=Math.max(Math.min((r-n)/this.swiper.params.speed,1),0),l=.5-Math.cos(a*Math.PI)/2;let c=s+l*(e-s);if(o(c,e)&&(c=e),t.value=c,o(c,e))return cancelAnimationFrame(this.animateUniformFrame),void(i&&i());this.animateUniformFrame=requestAnimationFrame(h)};h()}loadTextures(){const t=[],e=this;return this.images=[],this.textures=[],this.container.querySelectorAll(".swiper-gl-image").forEach((t=>{this.images.push(t.src)})),this.images.forEach(((i,s)=>{const r=new Promise((t=>{const r=new Image;r.crossOrigin="anonymous";const n=new it(this.gl);r.onload=()=>{n.image=r,e.textures[s]=n,t()},r.src=i}));t.push(r)})),t.push(new Promise((t=>{const i=new Image;i.crossOrigin="anonymous";const s=new it(this.gl);i.onload=()=>{s.image=i,e.displacementTexture=s,t()},i.src=nt}))),Promise.all(t)}init(t){this.loadTextures().then((()=>{this.initialized=!0,this.onInit&&this.onInit(),t()}))}resize(){if(!this.initialized||this.destroyed)return;const{width:t,height:e}=this.swiper;this.width=t,this.height=e,this.renderer.setSize(t,e);const i=this.camera.position.z;if(this.camera.perspective({aspect:t/e,fov:180/Math.PI*2*Math.atan(1/(2*i))}),!this.textures[0].image)return;const s=this.textures[0].image.height/this.textures[0].image.width;let r,n;e/t>s?(r=t/e*s,n=1):(r=1,n=e/t/s),this.material.uniforms.resolution.value.x=t,this.material.uniforms.resolution.value.y=e,this.material.uniforms.resolution.value.z=r,this.material.uniforms.resolution.value.w=n,this.shader.vertex&&this.vertexMaterial&&(this.vertexMaterial.uniforms.resolution.value.x=t,this.vertexMaterial.uniforms.resolution.value.y=e,this.vertexMaterial.uniforms.resolution.value.z=r,this.vertexMaterial.uniforms.resolution.value.w=n),this.shader.vertex?(this.nextMesh.scale.set(this.camera.aspect/2,.5,.5),this.currentMesh.scale.set(this.camera.aspect/2,.5,.5)):(this.plane.scale.x=this.camera.aspect,this.plane.scale.y=1)}createMaterial(){return new A(this.gl,{extensions:{derivatives:"#extension GL_OES_standard_derivatives : enable"},uniforms:{time:{type:"f",value:0},progress:{type:"f",value:0},intensity:{type:"f",value:0},width:{type:"f",value:0},radius:{type:"f",value:0},size:{type:"f",value:0},texture1:{type:"f",value:this.textures[0]},texture2:{type:"f",value:this.textures[1]},displacement:{type:"f",value:this.displacementTexture},resolution:{type:"v4",value:new st}},vertex:this.shader.vertex||vt,fragment:this.shader.fragment,...this.shader.vertex?{transparent:!0,depthWrite:!1}:{}})}addObjects(){if(this.scene.children.forEach((t=>{this.scene.removeChild(t)})),this.scene.children.forEach((t=>{this.scene.removeChild(t)})),this.material=this.createMaterial(),this.shader.vertex){const t=function(t,e,i){i=i||0;const s=e,r=2/s,n=r*Math.sqrt(3)/2,a=2/n,o=[],h=[],l=[],c=[],u=[],d=[],m=[];let p=0;const g=[];let f=0;for(let t=0;t<a;t+=1){f=t*n,p=t%2==1?-r/2:0;for(let x=0;x<=s;x+=1){const s=Math.sign(x*r+p-1);h.push(x*r+p-1,f-1,0),m.push((x*r+p)/2,f/2),h.push(x*r+r/2+p-1,n+f-1,0),m.push((x*r+r/2+p)/2,(n+f)/2),h.push(x*r-r/2+p-1,n+f-1,0),m.push((x*r-r/2+p)/2,(n+f)/2);let w=dt(x/a,t/a)+Math.random();const v=mt(f/2+2*w/e);let A=Math.random();o.push(v,mt(v+.1*i),mt(v+.1*i)),d.push(A,A,A);const M=[x*r+p-1,f-1,0];l.push(...M,...M,...M);const y=[2*s*ut(-.3,.3),-2*ut(-.3,.3)*1.5,-ct(.5)],E=[2*s*ut(.3,.6),-2*ut(.3,.6)*1.5,-ct(.5)];c.push(...y,...y,...y),u.push(...E,...E,...E),g.push(0,0,1,0,1,0,1,0,0),h.push(x*r+p-1,f-1,0),m.push((x*r+p)/2,f/2),h.push(x*r+r+p-1,f-1,0),m.push((x*r+r+p)/2,f/2),h.push(x*r+r/2+p-1,n+f-1,0),m.push((x*r+r/2+p)/2,(n+f)/2),w=dt((x+1)/a,t/a)+Math.random();const U=mt(f/2+2*w/e);A=Math.random(),o.push(U,U,mt(U+.1*i)),d.push(A,A,A);const F=[x*r+p-1,f-1,0];c.push(...y,...y,...y),u.push(...E,...E,...E),l.push(...F,...F,...F),g.push(0,0,1,0,1,0,1,0,0)}}const w=new x(t);return w.addAttribute("position",{size:3,data:new Float32Array(h)}),w.addAttribute("bary",{size:3,data:new Float32Array(g)}),w.addAttribute("uv",{size:2,data:new Float32Array(m)}),w.addAttribute("offset",{size:1,data:new Float32Array(o)}),w.addAttribute("centroid1",{size:3,data:new Float32Array(l)}),w.addAttribute("control0",{size:3,data:new Float32Array(c)}),w.addAttribute("control1",{size:3,data:new Float32Array(u)}),w.addAttribute("random",{size:1,data:new Float32Array(d)}),w}(this.gl,this.shader.detail,this.shader.offsetTop),e=this.textures[1];this.vertexMaterial=this.createMaterial(),this.vertexMaterial.uniforms.texture1.value=e,this.currentMesh=new _(this.gl,{geometry:t,program:this.material}),this.nextMesh=new _(this.gl,{geometry:t,program:this.vertexMaterial}),this.nextMesh.position.z=-1e-4,this.currentMesh.setParent(this.scene),this.nextMesh.setParent(this.scene)}else{const t=new rt(this.gl,{width:1,height:1,widthSegments:2,heightSegments:2});this.plane=new _(this.gl,{geometry:t,program:this.material}),this.plane.setParent(this.scene)}}replaceShader(t){let e,i;this.shader.vertex?(e=this.material.uniforms.texture1.value,i=this.vertexMaterial.uniforms.texture1.value):(e=this.material.uniforms.texture1.value,i=this.material.uniforms.texture2.value);const s="random"===t||Array.isArray(t)?At(t,this.opts):wt[t],{fragment:r,uniforms:n,vertex:a}=s;this.shader=s,this.vertex=a||vt,this.fragment=r||"",this.uniforms=n||{},this.addObjects(),this.shader.vertex?(this.material.uniforms.texture1.value=i,this.vertexMaterial.uniforms.texture1.value=i):(this.material.uniforms.texture1.value=e,this.material.uniforms.texture2.value=i,this.material.uniforms.progress.value=1),this.resize(),this.swiper.params.gl.shader=t}replaceRandomShader(){const t=At(this.opts.shader,this.opts),{fragment:e,uniforms:i,vertex:s}=t;this.shader=t,this.fragment=e||"",this.uniforms=i||{},this.vertex=s||vt,this.addObjects(),this.resize()}setProgress(t,e,i,s,r){if(this.destroyed||this.swiper.glDestroyed)return;if(!this.initialized)return void(this.onInit=()=>{requestAnimationFrame((()=>{this.setProgress(t,e,i,s)}))});this.swiper.params.loop&&this.swiper.slides[t]&&this.swiper.slides[e]&&(t=parseInt(this.swiper.slides[t].getAttribute("data-swiper-slide-index"),10),e=parseInt(this.swiper.slides[e].getAttribute("data-swiper-slide-index"),10));const n=this.textures[e],a=this.textures[t];if(this.material.uniforms.texture1.value=a,this.shader.vertex?this.vertexMaterial.uniforms.texture1.value=n:this.material.uniforms.texture2.value=n,r){if(this.preventShaderReplace)return void(this.material.uniforms.progress.value=Math.abs(i));this.preventShaderReplace=!0,requestAnimationFrame((()=>{this.preventShaderReplace=!1})),"random"===this.swiper.params.gl.shader||Array.isArray(this.swiper.params.gl.shader)?(this.replaceRandomShader(),this.material.uniforms.texture1.value=a,this.material.uniforms.texture2.value=n,this.material.uniforms.progress.value=Math.abs(i)):this.material.uniforms.progress.value=Math.abs(i)}else s?(0===i&&0===this.material.uniforms.progress.value&&(this.material.uniforms.progress.value=1),1===i&&1===this.material.uniforms.progress.value&&(this.material.uniforms.progress.value=0),this.animateUniform(this.material.uniforms.progress,i,(()=>{("random"===this.swiper.params.gl.shader||Array.isArray(this.swiper.params.gl.shader))&&(this.replaceRandomShader(),this.material.uniforms.texture1.value=a,this.material.uniforms.texture2.value=n,this.material.uniforms.progress.value=i),1===i&&(this.material.uniforms.texture1.value=n),this.material.uniforms.progress.value=0}))):this.material.uniforms.progress.value=Math.abs(i)}render(){this.swiper.destroyed||this.destroyed||(this.time+=.05,this.material.uniforms.time.value=this.time,Object.keys(this.uniforms).forEach((t=>{this.material.uniforms[t].value=this.uniforms[t].value})),requestAnimationFrame(this.render.bind(this)),this.renderer.render({scene:this.scene,camera:this.camera}))}destroy(){this.initialized=!1,this.destroyed=!0,this.gl&&this.gl.canvas&&this.container.removeChild(this.gl.canvas)}}function yt({swiper:t,duration:e,transformElements:i,allSlides:s}){const{activeIndex:r}=t;if(t.params.virtualTranslate&&0!==e){let e,n=!1;e=s?i:i.filter((e=>{const i=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter((t=>t.shadowRoot&&t.shadowRoot===e.parentNode))[0];return e.parentElement})(e):e;return t.getSlideIndex(i)===r})),e.forEach((e=>{!function(t,e){e&&t.addEventListener("transitionend",(function i(s){s.target===t&&(e.call(t,s),t.removeEventListener("transitionend",i))}))}(e,(()=>{if(n)return;if(!t||t.destroyed)return;n=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)}))}))}}"undefined"!=typeof window&&window.SwiperElementRegisterParams&&window.SwiperElementRegisterParams(["gl"]),"undefined"!=typeof window&&window.SwiperElementRegisterParams&&window.SwiperElementRegisterParams(["shuttersEffect"]),"undefined"!=typeof window&&window.SwiperElementRegisterParams&&window.SwiperElementRegisterParams(["materialEffect"]),window.EffectSlicer=function({swiper:t,extendParams:e,on:i,emit:s}){e({slicerEffect:{split:5}});const r=()=>{t.slides.forEach((e=>{if(e.querySelector(".swiper-slicer-image-clones"))return;const i=e.querySelector(".swiper-slicer-image");if(!i)return;const s=i.nextElementSibling,r=document.createElement("div");r.classList.add("swiper-slicer-image-clones");for(let e=0;e<t.params.slicerEffect.split;e+=1){const t=document.createElement("div");t.classList.add("swiper-slicer-image-clone"),t.appendChild(i.cloneNode()),r.appendChild(t)}s?i.parentNode.insertBefore(r,s):i.parentNode.appendChild(r)}))},n=()=>{t.slides.forEach((e=>e.querySelectorAll(".swiper-slicer-image").forEach((e=>{e.style.width=`${t.width}px`,e.style.height=`${t.height}px`})))),t.slides.forEach((e=>{e.querySelectorAll(".swiper-slicer-image-clone").forEach(((e,i)=>{const s=e.querySelector(".swiper-slicer-image");"horizontal"===t.params.direction?(e.style.height=100/t.params.slicerEffect.split+"%",e.style.top=100/t.params.slicerEffect.split*i+"%",s.style.top=`-${100*i}%`):(e.style.width=100/t.params.slicerEffect.split+"%",e.style.left=100/t.params.slicerEffect.split*i+"%",s.style.left=`-${100*i}%`)}))}))},a=e=>{t.slides.forEach((i=>{const s=i.querySelectorAll(".swiper-slicer-image-clone"),r=i.querySelector(".swiper-slide-content");r&&(r.style.transitionDuration=`${e}ms`),s.forEach(((i,r)=>{0===e?(i.style.transitionTimingFunction="ease-out",i.style.transitionDuration=`${t.params.speed+t.params.speed/(s.length-1)*(s.length-r-1)}ms`):(i.style.transitionTimingFunction="",i.style.transitionDuration=`${e+e/(s.length-1)*(s.length-r-1)}ms`)}))})),function({duration:e}){const{slides:i,activeIndex:s}=t;if(0!==e){let e=!1;const r=i[s].querySelector(".swiper-slicer-image-clone:nth-child(1)");if(!r)return;const n=i=>{if(i.target!==r)return;if(r.removeEventListener("transitionend",n),e)return;if(!t||t.destroyed)return;e=!0,t.animating=!1;const s=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(s)};r.addEventListener("transitionend",n)}}({duration:e})};i("setTranslate",(()=>{"slicer"===t.params.effect&&(()=>{const e="vertical"===t.params.direction?"Y":"X";t.slides.forEach(((i,s)=>{i.style.transform=`translate${e}(-${100*s}%)`;const r=i.progress,n=i.querySelector(".swiper-slide-content");n&&(n.style.transform=`translate${e}(${t.size*-r*1.2}px)`),i.querySelectorAll(".swiper-slicer-image-clone").forEach((t=>{const i=-r;t.style.transform=`translate${e}(${100*i}%)`}))}))})()})),i("setTransition",((e,i)=>{"slicer"===t.params.effect&&a(i)})),i("slidesLengthChange",(()=>{r(),n()})),i("beforeInit",(()=>{if("slicer"!==t.params.effect)return;t.classNames.push("swiper-slicer");const e={slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),i("init",(()=>{"slicer"===t.params.effect&&(r(),s("setTranslate",t,t.translate))})),i("resize init",(()=>{"slicer"===t.params.effect&&n()}))},window.SwiperGL=function({swiper:t,on:e,extendParams:i}){t.gl=null;let s=!1;i({gl:{shader:"random",shaderPerSlide:!1,displacementMap:void 0}});const r=()=>{t.gl=new Mt({swiper:t,shader:t.params.gl.shader,shaderPerSlide:t.params.gl.shaderPerSlide})};let n,a;e("beforeInit",(()=>{if("gl"!==t.params.effect)return;if(!function(){try{const t=document.createElement("canvas");return!!window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(t){return!1}}())return void(s=!0);t.classNames.push(`${t.params.containerModifierClass}gl`);const e={watchSlidesProgress:!0};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),e("init",(()=>{"gl"!==t.params.effect||s||t.glDestroyed||t.gl||r()})),e("resize",(()=>{"gl"!==t.params.effect||s||t.glDestroyed||t.gl.resize()})),e("setTranslate",(()=>{if("gl"!==t.params.effect||s||t.glDestroyed)return;let e,i,o;t.gl||r();let h,l=!1;if(t.slides.forEach(((s,r)=>{const n=s.progress;t.params.cssMode&&0===Math.round(100*n)&&(l=!0),(n>0&&n<1||0===n&&t.progress<a)&&(e=r,i=r+1,o=n,h=e),(n<0&&n>-1||0===n&&t.progress>a)&&(e=r-1,i=r,o=1+n,h=i)})),a=t.progress||0,void 0===e&&void 0===i)return;l=l&&Math.round(o)===o;const c=Math.min(h,t.activeIndex),u=Math.max(h,t.activeIndex);t.params.loop||u===c||(e=c,i=u),t.gl.setProgress(e,i,o,n,l)})),e("setTransition",((e,i)=>{"gl"!==t.params.effect||s||t.glDestroyed||(n=i>0&&!t.params.cssMode)})),e("slidesGridLengthChange",(()=>{"gl"!==t.params.effect||s||!t.initialized||t.glDestroyed||t.gl&&t.gl.loadTextures&&t.gl.loadTextures()})),e("beforeDestroy",(()=>{"gl"!==t.params.effect||s||t.gl&&(t.glDestroyed=!0,t.gl.destroy(),t.gl=null)}))},window.EffectShutters=function({swiper:t,extendParams:e,on:i}){e({shuttersEffect:{split:5}}),i("beforeInit",(()=>{if("shutters"!==t.params.effect)return;t.classNames.push("swiper-shutters");const e={watchSlidesProgress:!0,parallax:{enabled:!0}};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),i("init",(()=>{"shutters"===t.params.effect&&t.slides.forEach((e=>{const i=e.querySelector(".swiper-shutters-image");if(!i)return;const s=i.nextElementSibling,r=document.createElement("div");r.classList.add("swiper-shutters-image-clones");for(let e=0;e<t.params.shuttersEffect.split;e+=1){const t=document.createElement("div");t.classList.add("swiper-shutters-image-clone"),t.appendChild(i.cloneNode()),r.appendChild(t)}s?i.parentNode.insertBefore(r,s):i.parentNode.appendChild(r)}))})),i("resize init",(()=>{"shutters"===t.params.effect&&(t.el.querySelectorAll(".swiper-shutters-image").forEach((e=>{e.style.width=`${t.width}px`,e.style.height=`${t.height}px`})),t.el.querySelectorAll(".swiper-slide, swiper-slide").forEach((e=>{e.querySelectorAll(".swiper-shutters-image-clone").forEach(((e,i)=>{const s=100/t.params.shuttersEffect.split,r=e.querySelector(".swiper-shutters-image");"vertical"===t.params.direction?(e.style.height=100/t.params.shuttersEffect.split+"%",e.style.top=100/t.params.shuttersEffect.split*i+"%",r.style.top=`-${100*i}%`):(e.style.width=100/t.params.shuttersEffect.split+"%",e.style.left=100/t.params.shuttersEffect.split*i+"%",r.style.left=`-${100*i}%`),r.setAttribute("data-swiper-parallax","10%"),e.setAttribute("data-swiper-parallax",s*(i+1)*(i%2==0?.5:-1)+"%")}))})))}))},window.EffectCarousel=function({swiper:t,on:e,extendParams:i}){i({carouselEffect:{opacityStep:.33,scaleStep:.2,sideSlides:2}}),e("beforeInit",(()=>{if("carousel"!==t.params.effect)return;t.classNames.push(`${t.params.containerModifierClass}carousel`);const e={watchSlidesProgress:!0,centeredSlides:!0};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),e("progress",(()=>{if("carousel"!==t.params.effect)return;const{scaleStep:e,opacityStep:i}=t.params.carouselEffect,s=Math.max(Math.min(t.params.carouselEffect.sideSlides,3),1),r={1:2,2:1,3:.2}[s],n={1:50,2:50,3:67}[s],a=t.slides.length;for(let o=0;o<t.slides.length;o+=1){const h=t.slides[o],l=t.slides[o].progress,c=Math.abs(l);let u=1;c>1&&(u=.3*(c-1)*r+1);const d=h.querySelectorAll(".swiper-carousel-animate-opacity"),m=l*u*n*(t.rtlTranslate?-1:1)+"%",p=1-c*e,g=a-Math.abs(Math.round(l));h.style.transform=`translateX(${m}) scale(${p})`,h.style.zIndex=g,h.style.opacity=c>s+1?0:1,d.forEach((t=>{t.style.opacity=1-c*i}))}})),e("setTransition",((e,i)=>{if("carousel"===t.params.effect)for(let e=0;e<t.slides.length;e+=1){const s=t.slides[e],r=s.querySelectorAll(".swiper-carousel-animate-opacity");s.style.transitionDuration=`${i}ms`,r.forEach((t=>{t.style.transitionDuration=`${i}ms`}))}}))},window.EffectMaterial=function({swiper:t,on:e,extendParams:i}){i({materialEffect:{slideSplitRatio:.65}}),e("beforeInit",(()=>{if("material"!==t.params.effect)return;t.classNames.push(`${t.params.containerModifierClass}material`),t.isElement&&t.hostEl&&t.hostEl.classList.add(`swiper-${t.params.direction}`);const e={loopAdditionalSlides:1,watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),e("setTranslate",(()=>{"material"===t.params.effect&&(()=>{const{slides:e,slidesSizesGrid:i,params:s,size:r}=t,{slidesPerView:n,spaceBetween:a,cssMode:o,centeredSlides:h}=s,l=h?.5:Math.min(Math.max(s.materialEffect.slideSplitRatio,0),1),c=h?.5:1-Math.min(Math.max(s.materialEffect.slideSplitRatio,0),1);for(let s=0;s<e.length;s+=1){const u=e[s],d=u.querySelector(".swiper-material-wrapper"),m=u.querySelectorAll(".swiper-material-animate-opacity"),p=u.querySelectorAll("[data-swiper-material-scale]"),g=-u.progress,f=u.swiperSlideOffset,x=t.translate;let w,v=0,A=0;const M=i[s],y=0!==c||h?a/2/M:0,E=o?x:0,U=h&&n%2==1,F=h&&n%2==0;if(g<=0)if(h&&n>1){if(g<=0&&g>=-(n-2)&&(v=x,w=1,A=1),U&&g<-(n-Math.ceil(n/2))){const t=Math.ceil(n/2)-Math.abs(g);w=t,A=w**4,v=x+M*(1-t)*(1+2*y)}if(F&&g<-(n/2-1)&&g>=-n/2){const t=n/2-Math.abs(g);w=l-y+(c+2*y)*(n/2-Math.abs(g)),A=((w-l)/(1-l))**4,v=x+M*(c+y)*(1-t)}if(F&&g<-n/2){let t=n/2+1-Math.abs(g);w=0,t>=0&&(t=2*-y+t*(1+2*y),t=Math.max(Math.min(t,1),0),w=(c-y)*t),v=x+M*(c+y)*(2-t)+M*(c-y)*(1-t)}}else w=1+g,v=-f,A=w**4;if(1===n)g>0&&(w=1-g,v=-f+r*Math.min(g,1),A=w**4);else{if(g>0&&g<=n-2&&(v=x,w=1,A=1),F?g>n/2-1&&g<=n/2:g>n-2&&g<=n-1){const t=F?Math.floor(n/2):1;w=l-y+(c+2*y)*(n-t-Math.abs(g)),v=x,A=1===l?w**4:((w-l)/(1-l))**4}if(U&&g>n-Math.ceil(n/2)){const t=Math.ceil(n/2)-(n-Math.abs(g));v=x-M*(2*y)*t,w=1-t,A=w**4}if(g>n-1&&g<=n&&!h){const t=n-Math.abs(g),e=c-y;w=e+(l-y-e)*t,v=x-M*(c+y)*(1-t),0===c&&(A=w**4)}if(g>(h?n/2:n)&&!U){let t=(h?n/2+1:n+1)-Math.abs(g),e=0;w=0,t>=0&&(t=2*-y+t*(1+2*y),t=Math.max(Math.min(t,1),0),w=(c-y)*t,e=-t*(c+y)*M+t*a),v=-f+r*Math.min(g,1)+e,A=0}}w<0&&(w=0),w>1&&(w=1),0===w&&(w=1e-4),u.style.setProperty("--swiper-material-scale",w),m.forEach((t=>{t.style.opacity=A})),p.forEach((t=>{let e=parseFloat(t.getAttribute("data-swiper-material-scale"));(Number.isNaN(e)||!e&&0!==e)&&(e=1),t.style.transform=`scale(${1+(e-1)*(1-w)})`})),t.isHorizontal()?(d.style.width=100*w+"%",d.style.transform=`translate3d(${v-E}px, 0, 0)`):(d.style.height=100*w+"%",d.style.transform=`translate3d(0, ${v-E}px, 0)`)}})()})),e("setTransition",((e,i)=>{"material"===t.params.effect&&(e=>{const{slides:i}=t,s=[];for(let t=0;t<i.length;t+=1){const r=i[t],n=r.querySelector(".swiper-material-wrapper"),a=r.querySelectorAll(".swiper-material-animate-opacity");[n,...r.querySelectorAll("[data-swiper-material-scale]"),...a].forEach((t=>{t.style.transitionDuration=`${e}ms`})),s.push(n)}yt({swiper:t,duration:e,transformElements:s,allSlides:!0})})(i)})),e("slidesUpdated",(()=>{if(!t.params.centeredSlides&&t.params.slidesPerView>1&&!t.params.loop&&t.params.materialEffect.slideSplitRatio<1){const e=t.snapGrid[t.snapGrid.length-1];t.snapGrid.push(e+t.slidesSizesGrid[0]+t.params.spaceBetween)}t.__preventObserver__=!0,t.el.style.setProperty("--swiper-material-slide-size",`${t.slidesSizesGrid[0]}px`),requestAnimationFrame((()=>{t.__preventObserver__=!1}))}))},window.wonder=e})();
3
3
  //# sourceMappingURL=swiper-plugin.js.map