earthnut 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use client";(()=>{"use strict";var t={502:()=>{function t(e){"@babel/helpers - typeof";return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}function r(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(r=[{key:"clear",value:function(){}}])&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}())({name:"earthnut",type:!1})},570:t=>{t.exports=require("a-type-of-js")},705:t=>{t.exports=require("a-js-tools")},953:t=>{t.exports=require("react")}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{useRipples:()=>Yt});var i=r(953);const o=require("a-element-inline-style");var a=r(570);function l(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,l={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(l.id,i(r.VERTEX_SHADER,t)),r.attachShader(l.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(l.id),!r.getProgramParameter(l.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(l.id));r.useProgram(l.id),r.enableVertexAttribArray(0);for(var u=t+e,s=/uniform (\w+) (\w+)/g;!(0,a.isNull)(o=s.exec(u));){var f=o[2];l.locations[f]=r.getUniformLocation(l.id,f)}return l}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function s(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function f(t){return"none"===t||""===t}function c(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t}),[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var u=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){u=i[s];break}return u}function h(t){"@babel/helpers - typeof";return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function d(t,e,r){return e&&p(t.prototype,e),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m(t){var e=function(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==h(e)?e:e+""}var v=d((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),g(this,"canvas",void 0),g(this,"gl",void 0),g(this,"config",void 0),g(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,a.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(c,this,[])})),b=r(705),y={imgUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};Object.freeze(y);var E;r(502);function w(t){"@babel/helpers - typeof";return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T(n.key),n)}}function T(t){var e=function(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==w(e)?e:e+""}function S(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function P(t,e,r){return t.set(k(t,e),r),r}function x(t,e){return t.get(k(t,e))}function k(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function _(t){return function(t){if(Array.isArray(t))return D(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var O=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var l=0;l<=i;l++)for(var u=l;u<=i;u++){var s=n[l][u],f=function(){return(0,b.getRandomInt)(255,190)};s[0]=f(),s[1]=f(),s[2]=f(),s[3]=Math.ceil(Math.sqrt(Math.pow(l,2)+Math.pow(u,2)))<=i?(0,b.getRandomInt)(120,180):(0,b.getRandomInt)(160,240)}for(var c=0;c<=i;c++)for(var h=0;h<=c;h++)n[c][h]=n[h][c];for(var p=i;p<r;p++)for(var d=0;d<=i;d++)n[p][d]=n[r-p][d];for(var g=0;g<i;g++)for(var m=i;m<r;m++)n[g][m]=n[g][r-m];for(var v=i;v<r;v++)for(var y=i;y<r;y++)n[v][y]=n[v][r-y];var E=t%r;return e.list=[].concat(_(n.slice(E)),_(n.slice(0,E))),e},I=new(E=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),S(this,E,1),e=this,r="data",n=O(),(r=T(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){x(E,this)>100&&P(E,this,0),this.data=O(P(E,this,x(E,this)+3))}}])&&R(t.prototype,e),r&&R(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function A(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,a.isNull)(i)||(0,a.isNull)(o)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),o.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t||1,e||1),n=r.data,i=I.data,o=i.diameter,a=i.list,l=t*o,u=0;u<n.length;u+=4){var s=u/4%l,f=s%t%o,c=Math.floor(s/t),h=a[f][c];n[u]=h[0],n[u+1]=h[1],n[u+2]=h[2],n[u+3]=h[3]}return r}(t,e),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,t,e),o.drawImage(r,0,0,t||1,e||1),o.globalCompositeOperation="source-over",n)}function F(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,b.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});I.build(),n.push({resource:A(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function U(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,a.isNull)(t))return Reflect.apply(F,this,[]);var n=t.originStyle;if(s(n.backgroundColor)&&(!(0,a.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(F,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,a.isNull)(o))return Reflect.apply(F,this,[]);var l=e.backgroundInfo,u=l.width,f=l.height;i.width=u,i.height=f,o.clearRect(0,0,u,f);var c=(0,a.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;o.beginPath(),o.fillStyle=c,o.fillRect(0,0,u,f),o.fill(),e.isTransitioning?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var h={resource:i,kind:"background-color",tag:c,width:u,height:f};e.toBeList.push(h),e.run()}function j(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,a.isNull)(e))return Reflect.apply(U,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,a.isArray)(r.imgUrl))return Reflect.apply(U,this,[]);var i=(0,a.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map((function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t})).filter((function(t){return t.startsWith("rgb")||t.startsWith("#")}));if(i.length<2)return Reflect.apply(U,this,[]);var o=document.createElement("canvas"),l=o.getContext("2d");if((0,a.isNull)(l))return Reflect.apply(U,this,[]);var u=t.backgroundInfo,s=u.width,f=u.height;o.width=s,o.height=f,l.fillStyle="#fff",l.fillRect(0,0,s,f);var c=l.createLinearGradient(0,0,0,f);i.forEach((function(t,e){return c.addColorStop(e/(i.length-1),t)})),l.fillStyle=c,l.fillRect(0,0,s,f),t.isTransitioning?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:s,height:f}),t.run()}function N(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return C(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function L(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,a.isNull)(e))Reflect.apply(j,this,[]);else{var i,o,l=e.lastUseStyle,u=n.backgroundInfo,s=u.width,f=u.height,c=(0,a.isString)(r.imgUrl)&&r.imgUrl||(i=l.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,a.isNull)(o)?null:o[1]);if(e.imageSource=c,c){var h=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(c,s,f);h.onload=function(){clearTimeout(n.transparentId),n.isTransitioning?n.toBeList=[n.toBeList[0]].concat(N(n.toBeList.slice(1).filter((function(t){return"image"===t.kind&&(Math.abs(t.width-s)>2||Math.abs(t.height-f)>2||t.tag!==c)})))):n.toBeList=[],n.toBeList.push({resource:h,width:s,height:f,kind:"image",tag:c}),n.run()},h.onerror=function(){Reflect.apply(j,t,[])},h.crossOrigin=r.crossOrigin}else Reflect.apply(j,this,[])}}function B(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach((function(t){return e.style.setProperty(t[0],t[1],"important")}))}}function M(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function X(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function W(t){"@babel/helpers - typeof";return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H(n.key),n)}}function z(t,e,r){return(e=H(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H(t){var e=function(t,e){if("object"!=W(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=W(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==W(e)?e:e+""}var q=function(){return t=function t(e,r,n){var i,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),z(this,"quad",null),z(this,"lastRaindropsFallTime",0),z(this,"parentElement",void 0),z(this,"mutationObserver",void 0),z(this,"resizeObserver",void 0),z(this,"renderProgram",void 0),z(this,"imageSource",""),z(this,"dropProgram",void 0),z(this,"updateProgram",void 0),z(this,"textures",[]),z(this,"backgroundTexture",[]),z(this,"textureDelta",void 0),z(this,"framebuffers",[]),z(this,"bufferWriteIndex",0),z(this,"bufferReadIndex",1),z(this,"originStyle",void 0),z(this,"lastUseStyle",void 0),z(this,"events",{}),z(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(B,n,[]),this.originStyle=this.lastUseStyle=M(this.parentElement),this.mutationObserver=new MutationObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(o.lastUseStyle),i=M(o.parentElement),l=Object.values(i);if((0,a.isEmptyArray)(b.enArr.difference(e,l)))return;var u=f(i.backgroundImage),c=s(i.backgroundColor);if(u&&c)return;o.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(B,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement){var e=M(o.parentElement);Math.abs(e.width-o.originStyle.width)<3&&Math.abs(e.height-o.originStyle.height)<3||Reflect.apply(r,n,[])}}))})),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(X,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach((function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])})),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&G(t.prototype,e),r&&G(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Y(){var t=this.renderData,e=this.fadeData;if(!(0,a.isNull)(t)){var r,n,i,o=t.parentElement,l=window.getComputedStyle(o),u=l.backgroundSize,s=l.backgroundAttachment,f=l.backgroundPosition,c=/\s+/.test(r=f)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):$(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],h={left:0,top:0,width:0,height:0};"fixed"===s?(h.height=window.innerHeight,h.left=window.screenX,h.top=window.screenY,h.width=window.innerWidth):(h.left=0,h.top=0,h.width=o.scrollWidth,h.height=o.scrollHeight);var p=e.backgroundInfo||{width:100,height:100},d=p.width,g=p.height;if("cover"===u){var m=Math.max(h.width/d,h.height/g);n=d*m,i=g*m}else if("contain"===u){var v=Math.min(h.width/d,h.height/g);n=d*v,i=g*v}else{var b=u.split(" ");n=b[0]||"",i=b[1]||n,$(n)?n=h.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),$(i)?i=h.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=d,i=g):("auto"===n&&(n=d*(Number(i)/g)),"auto"===i&&(i=g*(Number(n)/d)))}var y=c&&c[0]||"0%",E=c&&c[1]||"0%";y=$(y)?(h.left+(h.width-Number(n))*parseFloat(y)/100).toString():(h.left+parseFloat(y)).toString(),E=$(E)?(h.top+(h.height-Number(i))*parseFloat(E)/100).toString():(h.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([(o.offsetLeft-Number(y))/n,(o.offsetTop-Number(E))/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function $(t){return t.endsWith("%")}function K(){var t=this.gl,e=this.renderData;(0,a.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function V(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.textures,i=e.backgroundTexture,o=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(u,this,[i,0]),Reflect.apply(u,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,o),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(K,this,[]),t.disable(t.BLEND)}}function Z(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function J(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.updateProgram,i=e.textures,o=e.framebuffers,l=e.bufferWriteIndex,s=e.bufferReadIndex,f=r.resolution;t.viewport(0,0,f,f),t.bindFramebuffer(t.FRAMEBUFFER,o[l]),Reflect.apply(u,this,[i[s]]),t.useProgram(n.id),Reflect.apply(K,this,[]),Reflect.apply(Z,this,[])}}function Q(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,a.isNull)(e)){var i=e.parentElement,o=n.isTransitioning,l=r.running,u=r.idleFluctuations,s=r.lastRunningState,f=getComputedStyle(i);n.backgroundInfo={width:parseInt(f.width),height:parseInt(f.height)},Reflect.apply(Y,this,[]),l?(s||(r.lastRunningState=!0,this.show()),u&&this.raindropsFall(),o&&this.fade(),Reflect.apply(J,this,[]),Reflect.apply(V,this,[])):s&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(Q,t,[])}))}}function tt(t,e,r){var n=this.renderData;if(!(0,a.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),l=parseInt(o.borderLeftWidth)||0,u=parseInt(o.borderTopWidth)||0,s=i.getBoundingClientRect(),f=t.clientX-s.left-l,c=t.clientY-s.top-u;this.drop(f,c,e,r)}}function et(){var t=this,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.parentElement,i=e.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(tt,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)o(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)o(e[r])},i.mousedown=function(t){return o(t,!0)},Object.keys(i).forEach((function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})}))}}var rt="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function nt(){var t=this.gl,e=this.renderData;if(!(0,a.isNull)(e)){var r=e.textureDelta;e.dropProgram=l(rt,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=l(rt,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=l("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function it(){var t=this.gl,e=this.renderData;if(!(0,a.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function ot(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,a.isNull)(r)){var i=r.backgroundTexture,o=r.parentElement,l=n.backgroundInfo,u=l.width,s=l.height,f=function(t){return(0,a.isZero)(t&t-1)},c=f(u)&&f(s)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,c),o.dataset.a=t.tag,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function at(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,a.isNull)(e)&&this.config){var i=e.textures,o=e.framebuffers,l=r.resolution,u=this.gl,s=1/l;e.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach((function(t){return u.getExtension(t)}));for(var f=this.config.arrayType,c=f?new f(l*l*4):null,h=this.config,p=0;p<2;p++){var d=u.createTexture(),g=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,g),u.bindTexture(u.TEXTURE_2D,d),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,h.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,h.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,l,l,0,u.RGBA,h.type,c),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,d,0),i.push(d),o.push(g)}e.quad=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,e.quad),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),u.STATIC_DRAW),Reflect.apply(nt,this,[]),Reflect.apply(it,this,[]),Reflect.apply(L,this,[]),u.clearColor(0,0,0,0),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(et,this,[]),Reflect.apply(ot,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(Q,t,[])}))}}function lt(){var t=this.renderData,e=this.fadeData;if(!(0,a.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(L,this,[])}}function ut(){var t=this.renderData,e=this.fadeData;(0,a.isNull)(t)||(t.destroy(),Object.keys(t).forEach((function(e){return t[e]=null})),this.renderData=null),e.destroy(),Object.keys(e).forEach((function(t){return e[t]=null})),this.fadeData=null,this.gl&&(this.gl=null)}function st(t,e,r,n){var i=this.renderData,o=this.options,l=this.gl;if(!(0,a.isNull)(i)){var s=i.parentElement,f=i.dropProgram,c=i.textures,h=i.framebuffers,p=i.bufferWriteIndex,d=i.bufferReadIndex,g=o.resolution,m=s.offsetWidth,v=s.offsetHeight,b=Math.max(m,v);r/=b;var y=new Float32Array([(2*t-m)/b,(v-2*e)/b]);l.viewport(0,0,g,g),l.bindFramebuffer(l.FRAMEBUFFER,h[p]),Reflect.apply(u,this,[c[d]]),l.useProgram(f.id),l.uniform2fv(f.locations.center,y),l.uniform1f(f.locations.radius,r),l.uniform1f(f.locations.strength,n),Reflect.apply(K,this,[]),Reflect.apply(Z,this,[])}}function ft(t){"@babel/helpers - typeof";return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function ct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pt(n.key),n)}}function ht(t,e,r){return(e=pt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pt(t){var e=function(t,e){if("object"!=ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ft(e)?e:e+""}function dt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function gt(t,e){return t.get(vt(t,e))}function mt(t,e,r){return t.set(vt(t,e),r),r}function vt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var bt=new WeakMap,yt=new WeakMap,Et=new WeakMap,wt=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,St=new WeakMap,Pt=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),dt(this,bt,y.accelerating),dt(this,yt,y.interactive),dt(this,Et,y.resolution),dt(this,wt,y.perturbance),dt(this,Rt,y.dropRadius),ht(this,"imgUrl",y.imgUrl),dt(this,Tt,y.idleFluctuations),dt(this,St,y.raindropsTimeInterval),ht(this,"crossOrigin","no-cors"),ht(this,"visible",!1),ht(this,"running",!1),ht(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return gt(bt,this)},set:function(t){t>100||t<2||mt(bt,this,t)}},{key:"interactive",get:function(){return gt(yt,this)},set:function(t){(0,a.isBoolean)(t)&&mt(yt,this,t)}},{key:"resolution",get:function(){return gt(Et,this)},set:function(t){t<100||t>550||mt(Et,this,t)}},{key:"perturbance",get:function(){return gt(wt,this)},set:function(t){t<1e-4||t>1||mt(wt,this,t)}},{key:"dropRadius",get:function(){return gt(Rt,this)},set:function(t){!isFinite(t)||t<10||mt(Rt,this,t)}},{key:"idleFluctuations",get:function(){return gt(Tt,this)},set:function(t){(0,a.isBoolean)(t)&&mt(Tt,this,t)}},{key:"raindropsTimeInterval",get:function(){return gt(St,this)},set:function(t){t<10||t>12e3||mt(St,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&ct(t.prototype,e),r&&ct(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function xt(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(xt,t,[]);"image"!==r.lastDrawImage.kind&&r.run()}),2*e.raindropsTimeInterval)}function kt(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,a.isNull)(t))return e.isTransitioning=!1,void Reflect.apply(xt,this,[]);if((0,a.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(xt,this,[]);if(0===e.drawProgress&&n.forEach((function(t){})),e.drawProgress>1e3)if(e.isTransitioning=!1,e.lastDrawImage=n.shift(),Reflect.apply(ot,this,[e.lastDrawImage]),(0,a.isEmptyArray)(n)){var i=t.lastUseStyle;(0,a.isNull)(r.imgUrl)&&s(i.backgroundColor)&&f(i.backgroundImage)&&(Reflect.apply(F,this,[!1]),Reflect.apply(xt,this,[]))}else Reflect.apply(xt,this,[]);else{var o=e.lastDrawImage,l=e.backgroundInfo;e.drawProgress+=18;var u=document.createElement("canvas"),c=u.getContext("2d");if(!((0,a.isNull)(c)||(0,a.isNull)(o.resource)||(0,a.isEmptyArray)(n))){var h=l.width,p=l.height;u.width=h,u.height=p,c.clearRect(0,0,h,p),c.drawImage(o.resource,0,0,h,p),c.globalAlpha=e.drawProgress/1e3,c.drawImage(n[0].resource,0,0,h,p),c.globalAlpha=1;var d={resource:u,width:h,height:p,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(ot,this,[d]),n.length>1&&(e.lastDrawImage=d,n.shift(),e.drawProgress=0)}}}function _t(t){"@babel/helpers - typeof";return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function Dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,It(n.key),n)}}function Ot(t,e,r){return(e=It(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function It(t){var e=function(t,e){if("object"!=_t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==_t(e)?e:e+""}var At=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ot(this,"backgroundInfo",{width:0,height:0}),Ot(this,"transparentId",setTimeout(Boolean)),Ot(this,"lastDrawImage",void 0),Ot(this,"toBeList",[]),Ot(this,"drawProgress",0),Ot(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,a.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:A(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&Dt(t.prototype,e),r&&Dt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ft(t){"@babel/helpers - typeof";return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function jt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ut(Object(r),!0).forEach((function(e){Wt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gt(n.key),n)}}function Ct(t,e,r){return e=Bt(e),function(t,e){if(e&&("object"==Ft(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lt()?Reflect.construct(e,r||[],Bt(t).constructor):e.apply(t,r))}function Lt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lt=function(){return!!t})()}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}function Mt(t,e){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mt(t,e)}function Xt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function Wt(t,e,r){return(e=Gt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gt(t){var e=function(t,e){if("object"!=Ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ft(e)?e:e+""}function zt(t,e){return t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))}var Ht=new WeakMap,qt=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Wt(n=Ct(this,e,[t]),"renderData",null),Wt(n,"options",void 0),Wt(n,"fadeData",void 0),Wt(n,"defaults",y),Wt(n,"initialized",!1),Xt(n,Ht,(0,b.debounce)(lt,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new Pt(jt(jt({},n.defaults),r)),n.renderData=new q(t,n.reloadBackground,n),n.fadeData=new At(n),(0,a.isFalse)(n.initState)||(0,a.isNull)(t.parentElement)||(0,a.isNull)(n.config)||(0,a.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,o.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(at,n,[])),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mt(t,e)}(e,t),r=e,(n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,a.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,o=e.raindropsTimeInterval,l=e.dropRadius,u=Date.now();if(!(u-i<o)){t.lastRaindropsFallTime=u;var s=function(t){return(0,b.getRandomInt)(t)},f=n.width,c=n.height;this.drop(s(f),s(c),l,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(st,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(kt,this,[])}},{key:"reloadBackground",value:function(){zt(Ht,this).call(this)}},{key:"destroy",value:function(){Reflect.apply(ut,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(B,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(X,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(L,this,[])):this.options[t]=e}}])&&Nt(r.prototype,n),i&&Nt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(v);function Yt(t,e){var r=(0,i.useRef)(null);return(0,i.useEffect)((function(){if(!(0,a.isNull)(t.current))return r.current=new qt(t.current,e&&e.option),function(){var t,e;return null!==(t=null===(e=r.current)||void 0===e?void 0:e.destroy())&&void 0!==t?t:void 0}}),[]),r}module.exports.earthnut=n})();
1
+ "use client";(()=>{"use strict";var t={570:t=>{t.exports=require("a-type-of-js")},705:t=>{t.exports=require("a-js-tools")},953:t=>{t.exports=require("react")}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{useRipples:()=>Vt});var i=r(953);const o=require("a-element-inline-style");var a=r(570);function l(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,l={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(l.id,i(r.VERTEX_SHADER,t)),r.attachShader(l.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(l.id),!r.getProgramParameter(l.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(l.id));r.useProgram(l.id),r.enableVertexAttribArray(0);for(var u=t+e,s=/uniform (\w+) (\w+)/g;!(0,a.isNull)(o=s.exec(u));){var c=o[2];l.locations[c]=r.getUniformLocation(l.id,c)}return l}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function s(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function c(t){return"none"===t||""===t}function f(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t}),[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var u=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){u=i[s];break}return u}function h(t){"@babel/helpers - typeof";return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function d(t,e,r){return e&&p(t.prototype,e),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m(t){var e=function(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==h(e)?e:e+""}var v=d((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),g(this,"canvas",void 0),g(this,"gl",void 0),g(this,"config",void 0),g(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,a.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(f,this,[])})),b=r(705),y={imgUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function E(t){"@babel/helpers - typeof";return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R(n.key),n)}}function R(t){var e=function(t,e){if("object"!=E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==E(e)?e:e+""}Object.freeze(y);var T;new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(e=[{key:"clear",value:function(){}}])&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}())({name:"earthnut",type:!1});function S(t){"@babel/helpers - typeof";return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x(n.key),n)}}function x(t){var e=function(t,e){if("object"!=S(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==S(e)?e:e+""}function k(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function _(t,e,r){return t.set(O(t,e),r),r}function D(t,e){return t.get(O(t,e))}function O(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function I(t){return function(t){if(Array.isArray(t))return A(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return A(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var F=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var l=0;l<=i;l++)for(var u=l;u<=i;u++){var s=n[l][u],c=function(){return(0,b.getRandomInt)(255,190)};s[0]=c(),s[1]=c(),s[2]=c(),s[3]=Math.ceil(Math.sqrt(Math.pow(l,2)+Math.pow(u,2)))<=i?(0,b.getRandomInt)(120,180):(0,b.getRandomInt)(160,240)}for(var f=0;f<=i;f++)for(var h=0;h<=f;h++)n[f][h]=n[h][f];for(var p=i;p<r;p++)for(var d=0;d<=i;d++)n[p][d]=n[r-p][d];for(var g=0;g<i;g++)for(var m=i;m<r;m++)n[g][m]=n[g][r-m];for(var v=i;v<r;v++)for(var y=i;y<r;y++)n[v][y]=n[v][r-y];var E=t%r;return e.list=[].concat(I(n.slice(E)),I(n.slice(0,E))),e},U=new(T=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),k(this,T,1),e=this,r="data",n=F(),(r=x(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){D(T,this)>100&&_(T,this,0),this.data=F(_(T,this,D(T,this)+3))}}])&&P(t.prototype,e),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function j(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,a.isNull)(i)||(0,a.isNull)(o)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),o.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t||1,e||1),n=r.data,i=U.data,o=i.diameter,a=i.list,l=t*o,u=0;u<n.length;u+=4){var s=u/4%l,c=s%t%o,f=Math.floor(s/t),h=a[c][f];n[u]=h[0],n[u+1]=h[1],n[u+2]=h[2],n[u+3]=h[3]}return r}(t,e),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,t,e),o.drawImage(r,0,0,t||1,e||1),o.globalCompositeOperation="source-over",n)}function N(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,b.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});U.build(),n.push({resource:j(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function C(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,a.isNull)(t))return Reflect.apply(N,this,[]);var n=t.originStyle;if(s(n.backgroundColor)&&(!(0,a.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(N,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,a.isNull)(o))return Reflect.apply(N,this,[]);var l=e.backgroundInfo,u=l.width,c=l.height;i.width=u,i.height=c,o.clearRect(0,0,u,c);var f=(0,a.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;o.beginPath(),o.fillStyle=f,o.fillRect(0,0,u,c),o.fill(),e.isTransitioning?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var h={resource:i,kind:"background-color",tag:f,width:u,height:c};e.toBeList.push(h),e.run()}function B(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,a.isNull)(e))return Reflect.apply(C,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,a.isArray)(r.imgUrl))return Reflect.apply(C,this,[]);var i=(0,a.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map((function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t})).filter((function(t){return t.startsWith("rgb")||t.startsWith("#")}));if(i.length<2)return Reflect.apply(C,this,[]);var o=document.createElement("canvas"),l=o.getContext("2d");if((0,a.isNull)(l))return Reflect.apply(C,this,[]);var u=t.backgroundInfo,s=u.width,c=u.height;o.width=s,o.height=c,l.fillStyle="#fff",l.fillRect(0,0,s,c);var f=l.createLinearGradient(0,0,0,c);i.forEach((function(t,e){return f.addColorStop(e/(i.length-1),t)})),l.fillStyle=f,l.fillRect(0,0,s,c),t.isTransitioning?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:s,height:c}),t.run()}function L(t){return function(t){if(Array.isArray(t))return M(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return M(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function X(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,a.isNull)(e))Reflect.apply(B,this,[]);else{var i,o,l=e.lastUseStyle,u=n.backgroundInfo,s=u.width,c=u.height,f=(0,a.isString)(r.imgUrl)&&r.imgUrl||(i=l.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,a.isNull)(o)?null:o[1]);if(e.imageSource=f,f){var h=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(f,s,c);h.onload=function(){clearTimeout(n.transparentId),n.isTransitioning?n.toBeList=[n.toBeList[0]].concat(L(n.toBeList.slice(1).filter((function(t){return"image"===t.kind&&(Math.abs(t.width-s)>2||Math.abs(t.height-c)>2||t.tag!==f)})))):n.toBeList=[],n.toBeList.push({resource:h,width:s,height:c,kind:"image",tag:f}),n.run()},h.onerror=function(){Reflect.apply(B,t,[])},h.crossOrigin=r.crossOrigin}else Reflect.apply(B,this,[])}}function W(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach((function(t){return e.style.setProperty(t[0],t[1],"important")}))}}function G(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function z(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function H(t){"@babel/helpers - typeof";return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$(n.key),n)}}function Y(t,e,r){return(e=$(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $(t){var e=function(t,e){if("object"!=H(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==H(e)?e:e+""}var K=function(){return t=function t(e,r,n){var i,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Y(this,"quad",null),Y(this,"lastRaindropsFallTime",0),Y(this,"parentElement",void 0),Y(this,"mutationObserver",void 0),Y(this,"resizeObserver",void 0),Y(this,"renderProgram",void 0),Y(this,"imageSource",""),Y(this,"dropProgram",void 0),Y(this,"updateProgram",void 0),Y(this,"textures",[]),Y(this,"backgroundTexture",[]),Y(this,"textureDelta",void 0),Y(this,"framebuffers",[]),Y(this,"bufferWriteIndex",0),Y(this,"bufferReadIndex",1),Y(this,"originStyle",void 0),Y(this,"lastUseStyle",void 0),Y(this,"events",{}),Y(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(W,n,[]),this.originStyle=this.lastUseStyle=G(this.parentElement),this.mutationObserver=new MutationObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(o.lastUseStyle),i=G(o.parentElement),l=Object.values(i);if((0,a.isEmptyArray)(b.enArr.difference(e,l)))return;var u=c(i.backgroundImage),f=s(i.backgroundColor);if(u&&f)return;o.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(W,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(t){t.forEach((function(t){t.target===o.parentElement&&Reflect.apply(r,n,[])}))})),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(z,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach((function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])})),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&q(t.prototype,e),r&&q(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function V(){var t=this.renderData,e=this.fadeData;if(!(0,a.isNull)(t)){var r,n,i,o=t.parentElement,l=window.getComputedStyle(o),u=l.backgroundSize,s=l.backgroundAttachment,c=l.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):Z(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],h={left:0,top:0,width:0,height:0};"fixed"===s?(h.height=window.innerHeight,h.left=window.screenX,h.top=window.screenY,h.width=window.innerWidth):(h.left=0,h.top=0,h.width=o.scrollWidth,h.height=o.scrollHeight);var p=e.backgroundInfo||{width:100,height:100},d=p.width,g=p.height;if("cover"===u){var m=Math.max(h.width/d,h.height/g);n=d*m,i=g*m}else if("contain"===u){var v=Math.min(h.width/d,h.height/g);n=d*v,i=g*v}else{var b=u.split(" ");n=b[0]||"",i=b[1]||n,Z(n)?n=h.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),Z(i)?i=h.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=d,i=g):("auto"===n&&(n=d*(Number(i)/g)),"auto"===i&&(i=g*(Number(n)/d)))}var y=f&&f[0]||"0%",E=f&&f[1]||"0%";y=Z(y)?(h.left+(h.width-Number(n))*parseFloat(y)/100).toString():(h.left+parseFloat(y)).toString(),E=Z(E)?(h.top+(h.height-Number(i))*parseFloat(E)/100).toString():(h.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([-Number(y)/n,-Number(E)/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var w=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/w,this.canvas.height/w])}}function Z(t){return t.endsWith("%")}function J(){var t=this.gl,e=this.renderData;(0,a.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function Q(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.textures,i=e.backgroundTexture,o=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(u,this,[i,0]),Reflect.apply(u,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,o),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(J,this,[]),t.disable(t.BLEND)}}function tt(){var t=this.renderData;if(!(0,a.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function et(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.updateProgram,i=e.textures,o=e.framebuffers,l=e.bufferWriteIndex,s=e.bufferReadIndex,c=r.resolution;t.viewport(0,0,c,c),t.bindFramebuffer(t.FRAMEBUFFER,o[l]),Reflect.apply(u,this,[i[s]]),t.useProgram(n.id),Reflect.apply(J,this,[]),Reflect.apply(tt,this,[])}}function rt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,a.isNull)(e)){var i=e.parentElement,o=n.isTransitioning,l=r.running,u=r.idleFluctuations,s=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply(V,this,[]),l?(s||(r.lastRunningState=!0,this.show()),u&&this.raindropsFall(),o&&this.fade(),Reflect.apply(et,this,[]),Reflect.apply(Q,this,[])):s&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(rt,t,[])}))}}function nt(t,e,r){var n=this.renderData;if(!(0,a.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),l=parseInt(o.borderLeftWidth)||0,u=parseInt(o.borderTopWidth)||0,s=i.getBoundingClientRect(),c=t.clientX-s.left-l,f=t.clientY-s.top-u;this.drop(c,f,e,r)}}function it(){var t=this,e=this.renderData,r=this.options;if(!(0,a.isNull)(e)){var n=e.parentElement,i=e.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(nt,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)o(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)o(e[r])},i.mousedown=function(t){return o(t,!0)},Object.keys(i).forEach((function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})}))}}var ot="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function at(){var t=this.gl,e=this.renderData;if(!(0,a.isNull)(e)){var r=e.textureDelta;e.dropProgram=l(ot,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=l(ot,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=l("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function lt(){var t=this.gl,e=this.renderData;if(!(0,a.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function ut(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,a.isNull)(r)){var i=r.backgroundTexture,o=r.parentElement,l=n.backgroundInfo,u=l.width,s=l.height,c=function(t){return(0,a.isZero)(t&t-1)},f=c(u)&&c(s)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,f),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,f),o.dataset.render_img=t.tag,o.dataset.render_width=t.width+"px",o.dataset.render_height=t.height+"px",e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function st(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,a.isNull)(e)&&this.config){var i=e.textures,o=e.framebuffers,l=r.resolution,u=this.gl,s=1/l;e.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach((function(t){return u.getExtension(t)}));for(var c=this.config.arrayType,f=c?new c(l*l*4):null,h=this.config,p=0;p<2;p++){var d=u.createTexture(),g=u.createFramebuffer();u.bindFramebuffer(u.FRAMEBUFFER,g),u.bindTexture(u.TEXTURE_2D,d),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,h.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,h.linearSupport?u.LINEAR:u.NEAREST),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,l,l,0,u.RGBA,h.type,f),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,d,0),i.push(d),o.push(g)}e.quad=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,e.quad),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),u.STATIC_DRAW),Reflect.apply(at,this,[]),Reflect.apply(lt,this,[]),Reflect.apply(X,this,[]),u.clearColor(0,0,0,0),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(it,this,[]),Reflect.apply(ut,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(rt,t,[])}))}}function ct(){var t=this.renderData,e=this.fadeData;if(!(0,a.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(X,this,[])}}function ft(){var t=this.renderData,e=this.fadeData;(0,a.isNull)(t)||(t.destroy(),Object.keys(t).forEach((function(e){return t[e]=null})),this.renderData=null),e.destroy(),Object.keys(e).forEach((function(t){return e[t]=null})),this.fadeData=null,this.gl&&(this.gl=null)}function ht(t,e,r,n){var i=this.renderData,o=this.options,l=this.gl;if(!(0,a.isNull)(i)){var s=i.parentElement,c=i.dropProgram,f=i.textures,h=i.framebuffers,p=i.bufferWriteIndex,d=i.bufferReadIndex,g=o.resolution,m=s.offsetWidth,v=s.offsetHeight,b=Math.max(m,v);r/=b;var y=new Float32Array([(2*t-m)/b,(v-2*e)/b]);l.viewport(0,0,g,g),l.bindFramebuffer(l.FRAMEBUFFER,h[p]),Reflect.apply(u,this,[f[d]]),l.useProgram(c.id),l.uniform2fv(c.locations.center,y),l.uniform1f(c.locations.radius,r),l.uniform1f(c.locations.strength,n),Reflect.apply(J,this,[]),Reflect.apply(tt,this,[])}}function pt(t){"@babel/helpers - typeof";return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(t)}function dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mt(n.key),n)}}function gt(t,e,r){return(e=mt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mt(t){var e=function(t,e){if("object"!=pt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==pt(e)?e:e+""}function vt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function bt(t,e){return t.get(Et(t,e))}function yt(t,e,r){return t.set(Et(t,e),r),r}function Et(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var wt=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,St=new WeakMap,Pt=new WeakMap,xt=new WeakMap,kt=new WeakMap,_t=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),vt(this,wt,y.accelerating),vt(this,Rt,y.interactive),vt(this,Tt,y.resolution),vt(this,St,y.perturbance),vt(this,Pt,y.dropRadius),gt(this,"imgUrl",y.imgUrl),vt(this,xt,y.idleFluctuations),vt(this,kt,y.raindropsTimeInterval),gt(this,"crossOrigin","no-cors"),gt(this,"visible",!1),gt(this,"running",!1),gt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return bt(wt,this)},set:function(t){t>100||t<2||yt(wt,this,t)}},{key:"interactive",get:function(){return bt(Rt,this)},set:function(t){(0,a.isBoolean)(t)&&yt(Rt,this,t)}},{key:"resolution",get:function(){return bt(Tt,this)},set:function(t){t<100||t>550||yt(Tt,this,t)}},{key:"perturbance",get:function(){return bt(St,this)},set:function(t){t<1e-4||t>1||yt(St,this,t)}},{key:"dropRadius",get:function(){return bt(Pt,this)},set:function(t){!isFinite(t)||t<10||yt(Pt,this,t)}},{key:"idleFluctuations",get:function(){return bt(xt,this)},set:function(t){(0,a.isBoolean)(t)&&yt(xt,this,t)}},{key:"raindropsTimeInterval",get:function(){return bt(kt,this)},set:function(t){t<10||t>12e3||yt(kt,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&dt(t.prototype,e),r&&dt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Dt(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(Dt,t,[]);"image"!==r.lastDrawImage.kind&&r.run()}),2*e.raindropsTimeInterval)}function Ot(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,a.isNull)(t))return e.isTransitioning=!1,void Reflect.apply(Dt,this,[]);if((0,a.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(Dt,this,[]);if(0===e.drawProgress&&n.forEach((function(t){})),e.drawProgress>1e3)if(e.isTransitioning=!1,e.lastDrawImage=n.shift(),Reflect.apply(ut,this,[e.lastDrawImage]),(0,a.isEmptyArray)(n)){var i=t.lastUseStyle;((0,a.isNull)(r.imgUrl)||(0,a.isBusinessEmptyString)(r.imgUrl)||(0,a.isZero)(r.imgUrl.length))&&s(i.backgroundColor)&&c(i.backgroundImage)&&(Reflect.apply(N,this,[!1]),Reflect.apply(Dt,this,[]))}else Reflect.apply(Dt,this,[]);else{var o=e.lastDrawImage,l=e.backgroundInfo;e.drawProgress+=18;var u=document.createElement("canvas"),f=u.getContext("2d");if(!((0,a.isNull)(f)||(0,a.isNull)(o.resource)||(0,a.isEmptyArray)(n))){var h=l.width,p=l.height;u.width=h,u.height=p,f.clearRect(0,0,h,p),f.drawImage(o.resource,0,0,h,p),f.globalAlpha=e.drawProgress/1e3,f.drawImage(n[0].resource,0,0,h,p),f.globalAlpha=1;var d={resource:u,width:h,height:p,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(ut,this,[d]),n.length>1&&(e.lastDrawImage=d,n.shift(),e.drawProgress=0)}}}function It(t){"@babel/helpers - typeof";return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function At(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ut(n.key),n)}}function Ft(t,e,r){return(e=Ut(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ut(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}var jt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ft(this,"backgroundInfo",{width:0,height:0}),Ft(this,"transparentId",setTimeout(Boolean)),Ft(this,"lastDrawImage",void 0),Ft(this,"toBeList",[]),Ft(this,"drawProgress",0),Ft(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,a.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:j(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&At(t.prototype,e),r&&At(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Nt(t){"@babel/helpers - typeof";return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(r),!0).forEach((function(e){Ht(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qt(n.key),n)}}function Mt(t,e,r){return e=Wt(e),function(t,e){if(e&&("object"==Nt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xt()?Reflect.construct(e,r||[],Wt(t).constructor):e.apply(t,r))}function Xt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xt=function(){return!!t})()}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wt(t)}function Gt(t,e){return Gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gt(t,e)}function zt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function Ht(t,e,r){return(e=qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t){var e=function(t,e){if("object"!=Nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Nt(e)?e:e+""}function Yt(t,e){return t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))}var $t=new WeakMap,Kt=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Ht(n=Mt(this,e,[t]),"renderData",null),Ht(n,"options",void 0),Ht(n,"fadeData",void 0),Ht(n,"defaults",y),Ht(n,"initialized",!1),zt(n,$t,(0,b.debounce)(ct,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new _t(Bt(Bt({},n.defaults),r)),n.renderData=new K(t,n.reloadBackground,n),n.fadeData=new jt(n),(0,a.isFalse)(n.initState)||(0,a.isNull)(t.parentElement)||(0,a.isNull)(n.config)||(0,a.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,o.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(st,n,[])),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gt(t,e)}(e,t),r=e,(n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,a.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,o=e.raindropsTimeInterval,l=e.dropRadius,u=Date.now();if(!(u-i<o)){t.lastRaindropsFallTime=u;var s=function(t){return(0,b.getRandomInt)(t)},c=n.width,f=n.height;this.drop(s(c),s(f),l,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(ht,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(Ot,this,[])}},{key:"reloadBackground",value:function(){Yt($t,this).call(this)}},{key:"destroy",value:function(){Reflect.apply(ft,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(W,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(z,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(X,this,[])):this.options[t]=e}}])&&Lt(r.prototype,n),i&&Lt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(v);function Vt(t,e){var r=(0,i.useRef)(null);return(0,i.useEffect)((function(){if(!(0,a.isNull)(t.current))return r.current=new Kt(t.current,e&&e.option),function(){var t;return null===(t=r.current)||void 0===t?void 0:t.destroy()}}),[]),r}module.exports.earthnut=n})();
@@ -1 +1 @@
1
- "use client";import*as t from"a-js-tools";import*as e from"a-type-of-js";import*as r from"react";import*as n from"a-element-inline-style";var i={161:(e,r,n)=>{e.exports=(t=>{var e={};return n.d(e,t),e})({debounce:()=>t.debounce,enArr:()=>t.enArr,getRandomInt:()=>t.getRandomInt,getRandomString:()=>t.getRandomString})},362:(t,r,n)=>{t.exports=(t=>{var e={};return n.d(e,t),e})({isArray:()=>e.isArray,isBoolean:()=>e.isBoolean,isEmptyArray:()=>e.isEmptyArray,isFalse:()=>e.isFalse,isNull:()=>e.isNull,isString:()=>e.isString,isZero:()=>e.isZero})},502:()=>{function t(e){"@babel/helpers - typeof";return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}function r(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(r=[{key:"clear",value:function(){}}])&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}())({name:"earthnut",type:!1})},649:(t,e,n)=>{t.exports=(t=>{var e={};return n.d(e,t),e})({useEffect:()=>r.useEffect,useRef:()=>r.useRef})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return i[t](r,r.exports,a),r.exports}a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var l={};a.d(l,{n:()=>Vt});var u=a(649);const s=(t=>{var e={};return a.d(e,t),e})({setStyle:()=>n.setStyle});var f=a(362);function c(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,a={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(a.id,i(r.VERTEX_SHADER,t)),r.attachShader(a.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(a.id),!r.getProgramParameter(a.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(a.id));r.useProgram(a.id),r.enableVertexAttribArray(0);for(var l=t+e,u=/uniform (\w+) (\w+)/g;!(0,f.isNull)(o=u.exec(l));){var s=o[2];a.locations[s]=r.getUniformLocation(a.id,s)}return a}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function h(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function d(t){return"none"===t||""===t}function g(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t}),[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var u=null,s=0;s<i.length;s++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[s].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){u=i[s];break}return u}function m(t){"@babel/helpers - typeof";return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E(n.key),n)}}function b(t,e,r){return e&&v(t.prototype,e),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t){var e=function(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==m(e)?e:e+""}var R=b((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,"canvas",void 0),y(this,"gl",void 0),y(this,"config",void 0),y(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,f.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(g,this,[])})),w=a(161),T={imgUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};Object.freeze(T);var S;a(502);function P(t){"@babel/helpers - typeof";return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function x(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k(n.key),n)}}function k(t){var e=function(t,e){if("object"!=P(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==P(e)?e:e+""}function _(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function D(t,e,r){return t.set(O(t,e),r),r}function A(t,e){return t.get(O(t,e))}function O(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function I(t){return function(t){if(Array.isArray(t))return F(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var l=0;l<=i;l++)for(var u=l;u<=i;u++){var s=n[l][u],f=function(){return(0,w.getRandomInt)(255,190)};s[0]=f(),s[1]=f(),s[2]=f(),s[3]=Math.ceil(Math.sqrt(Math.pow(l,2)+Math.pow(u,2)))<=i?(0,w.getRandomInt)(120,180):(0,w.getRandomInt)(160,240)}for(var c=0;c<=i;c++)for(var p=0;p<=c;p++)n[c][p]=n[p][c];for(var h=i;h<r;h++)for(var d=0;d<=i;d++)n[h][d]=n[r-h][d];for(var g=0;g<i;g++)for(var m=i;m<r;m++)n[g][m]=n[g][r-m];for(var v=i;v<r;v++)for(var b=i;b<r;b++)n[v][b]=n[v][r-b];var y=t%r;return e.list=[].concat(I(n.slice(y)),I(n.slice(0,y))),e},j=new(S=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),_(this,S,1),e=this,r="data",n=U(),(r=k(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){A(S,this)>100&&D(S,this,0),this.data=U(D(S,this,A(S,this)+3))}}])&&x(t.prototype,e),r&&x(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function N(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,f.isNull)(i)||(0,f.isNull)(o)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),o.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t||1,e||1),n=r.data,i=j.data,o=i.diameter,a=i.list,l=t*o,u=0;u<n.length;u+=4){var s=u/4%l,f=s%t%o,c=Math.floor(s/t),p=a[f][c];n[u]=p[0],n[u+1]=p[1],n[u+2]=p[2],n[u+3]=p[3]}return r}(t,e),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,t,e),o.drawImage(r,0,0,t||1,e||1),o.globalCompositeOperation="source-over",n)}function C(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,w.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});j.build(),n.push({resource:N(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function B(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,f.isNull)(t))return Reflect.apply(C,this,[]);var n=t.originStyle;if(h(n.backgroundColor)&&(!(0,f.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(C,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,f.isNull)(o))return Reflect.apply(C,this,[]);var a=e.backgroundInfo,l=a.width,u=a.height;i.width=l,i.height=u,o.clearRect(0,0,l,u);var s=(0,f.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;o.beginPath(),o.fillStyle=s,o.fillRect(0,0,l,u),o.fill(),e.isTransitioning?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var c={resource:i,kind:"background-color",tag:s,width:l,height:u};e.toBeList.push(c),e.run()}function L(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,f.isNull)(e))return Reflect.apply(B,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,f.isArray)(r.imgUrl))return Reflect.apply(B,this,[]);var i=(0,f.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map((function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t})).filter((function(t){return t.startsWith("rgb")||t.startsWith("#")}));if(i.length<2)return Reflect.apply(B,this,[]);var o=document.createElement("canvas"),a=o.getContext("2d");if((0,f.isNull)(a))return Reflect.apply(B,this,[]);var l=t.backgroundInfo,u=l.width,s=l.height;o.width=u,o.height=s,a.fillStyle="#fff",a.fillRect(0,0,u,s);var c=a.createLinearGradient(0,0,0,s);i.forEach((function(t,e){return c.addColorStop(e/(i.length-1),t)})),a.fillStyle=c,a.fillRect(0,0,u,s),t.isTransitioning?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:u,height:s}),t.run()}function M(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return X(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function W(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,f.isNull)(e))Reflect.apply(L,this,[]);else{var i,o,a=e.lastUseStyle,l=n.backgroundInfo,u=l.width,s=l.height,c=(0,f.isString)(r.imgUrl)&&r.imgUrl||(i=a.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,f.isNull)(o)?null:o[1]);if(e.imageSource=c,c){var p=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(c,u,s);p.onload=function(){clearTimeout(n.transparentId),n.isTransitioning?n.toBeList=[n.toBeList[0]].concat(M(n.toBeList.slice(1).filter((function(t){return"image"===t.kind&&(Math.abs(t.width-u)>2||Math.abs(t.height-s)>2||t.tag!==c)})))):n.toBeList=[],n.toBeList.push({resource:p,width:u,height:s,kind:"image",tag:c}),n.run()},p.onerror=function(){Reflect.apply(L,t,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(L,this,[])}}function G(){var t=this.renderData;if(!(0,f.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach((function(t){return e.style.setProperty(t[0],t[1],"important")}))}}function z(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function H(){var t=this.renderData;if(!(0,f.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function Y(t){"@babel/helpers - typeof";return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Z(n.key),n)}}function $(t,e,r){return(e=Z(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z(t){var e=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Y(e)?e:e+""}var K=function(){return t=function t(e,r,n){var i,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$(this,"quad",null),$(this,"lastRaindropsFallTime",0),$(this,"parentElement",void 0),$(this,"mutationObserver",void 0),$(this,"resizeObserver",void 0),$(this,"renderProgram",void 0),$(this,"imageSource",""),$(this,"dropProgram",void 0),$(this,"updateProgram",void 0),$(this,"textures",[]),$(this,"backgroundTexture",[]),$(this,"textureDelta",void 0),$(this,"framebuffers",[]),$(this,"bufferWriteIndex",0),$(this,"bufferReadIndex",1),$(this,"originStyle",void 0),$(this,"lastUseStyle",void 0),$(this,"events",{}),$(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(G,n,[]),this.originStyle=this.lastUseStyle=z(this.parentElement),this.mutationObserver=new MutationObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(o.lastUseStyle),i=z(o.parentElement),a=Object.values(i);if((0,f.isEmptyArray)(w.enArr.difference(e,a)))return;var l=d(i.backgroundImage),u=h(i.backgroundColor);if(l&&u)return;o.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(G,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement){var e=z(o.parentElement);Math.abs(e.width-o.originStyle.width)<3&&Math.abs(e.height-o.originStyle.height)<3||Reflect.apply(r,n,[])}}))})),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(H,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach((function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])})),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&q(t.prototype,e),r&&q(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function V(){var t=this.renderData,e=this.fadeData;if(!(0,f.isNull)(t)){var r,n,i,o=t.parentElement,a=window.getComputedStyle(o),l=a.backgroundSize,u=a.backgroundAttachment,s=a.backgroundPosition,c=/\s+/.test(r=s)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):J(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===u?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var h=e.backgroundInfo||{width:100,height:100},d=h.width,g=h.height;if("cover"===l){var m=Math.max(p.width/d,p.height/g);n=d*m,i=g*m}else if("contain"===l){var v=Math.min(p.width/d,p.height/g);n=d*v,i=g*v}else{var b=l.split(" ");n=b[0]||"",i=b[1]||n,J(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),J(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=d,i=g):("auto"===n&&(n=d*(Number(i)/g)),"auto"===i&&(i=g*(Number(n)/d)))}var y=c&&c[0]||"0%",E=c&&c[1]||"0%";y=J(y)?(p.left+(p.width-Number(n))*parseFloat(y)/100).toString():(p.left+parseFloat(y)).toString(),E=J(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([(o.offsetLeft-Number(y))/n,(o.offsetTop-Number(E))/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var R=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/R,this.canvas.height/R])}}function J(t){return t.endsWith("%")}function Q(){var t=this.gl,e=this.renderData;(0,f.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function tt(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,f.isNull)(e)){var n=e.textures,i=e.backgroundTexture,o=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(p,this,[i,0]),Reflect.apply(p,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,o),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(Q,this,[]),t.disable(t.BLEND)}}function et(){var t=this.renderData;if(!(0,f.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function rt(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,f.isNull)(e)){var n=e.updateProgram,i=e.textures,o=e.framebuffers,a=e.bufferWriteIndex,l=e.bufferReadIndex,u=r.resolution;t.viewport(0,0,u,u),t.bindFramebuffer(t.FRAMEBUFFER,o[a]),Reflect.apply(p,this,[i[l]]),t.useProgram(n.id),Reflect.apply(Q,this,[]),Reflect.apply(et,this,[])}}function nt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,f.isNull)(e)){var i=e.parentElement,o=n.isTransitioning,a=r.running,l=r.idleFluctuations,u=r.lastRunningState,s=getComputedStyle(i);n.backgroundInfo={width:parseInt(s.width),height:parseInt(s.height)},Reflect.apply(V,this,[]),a?(u||(r.lastRunningState=!0,this.show()),l&&this.raindropsFall(),o&&this.fade(),Reflect.apply(rt,this,[]),Reflect.apply(tt,this,[])):u&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(nt,t,[])}))}}function it(t,e,r){var n=this.renderData;if(!(0,f.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),a=parseInt(o.borderLeftWidth)||0,l=parseInt(o.borderTopWidth)||0,u=i.getBoundingClientRect(),s=t.clientX-u.left-a,c=t.clientY-u.top-l;this.drop(s,c,e,r)}}function ot(){var t=this,e=this.renderData,r=this.options;if(!(0,f.isNull)(e)){var n=e.parentElement,i=e.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(it,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)o(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)o(e[r])},i.mousedown=function(t){return o(t,!0)},Object.keys(i).forEach((function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})}))}}var at="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function lt(){var t=this.gl,e=this.renderData;if(!(0,f.isNull)(e)){var r=e.textureDelta;e.dropProgram=c(at,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=c(at,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=c("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function ut(){var t=this.gl,e=this.renderData;if(!(0,f.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function st(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,f.isNull)(r)){var i=r.backgroundTexture,o=r.parentElement,a=n.backgroundInfo,l=a.width,u=a.height,s=function(t){return(0,f.isZero)(t&t-1)},c=s(l)&&s(u)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,c),o.dataset.a=t.tag,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function ft(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,f.isNull)(e)&&this.config){var i=e.textures,o=e.framebuffers,a=r.resolution,l=this.gl,u=1/a;e.textureDelta=new Float32Array([u,u]),this.config.extensions.forEach((function(t){return l.getExtension(t)}));for(var s=this.config.arrayType,c=s?new s(a*a*4):null,p=this.config,h=0;h<2;h++){var d=l.createTexture(),g=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,g),l.bindTexture(l.TEXTURE_2D,d),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,a,a,0,l.RGBA,p.type,c),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,d,0),i.push(d),o.push(g)}e.quad=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,e.quad),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),l.STATIC_DRAW),Reflect.apply(lt,this,[]),Reflect.apply(ut,this,[]),Reflect.apply(W,this,[]),l.clearColor(0,0,0,0),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(ot,this,[]),Reflect.apply(st,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(nt,t,[])}))}}function ct(){var t=this.renderData,e=this.fadeData;if(!(0,f.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(W,this,[])}}function pt(){var t=this.renderData,e=this.fadeData;(0,f.isNull)(t)||(t.destroy(),Object.keys(t).forEach((function(e){return t[e]=null})),this.renderData=null),e.destroy(),Object.keys(e).forEach((function(t){return e[t]=null})),this.fadeData=null,this.gl&&(this.gl=null)}function ht(t,e,r,n){var i=this.renderData,o=this.options,a=this.gl;if(!(0,f.isNull)(i)){var l=i.parentElement,u=i.dropProgram,s=i.textures,c=i.framebuffers,h=i.bufferWriteIndex,d=i.bufferReadIndex,g=o.resolution,m=l.offsetWidth,v=l.offsetHeight,b=Math.max(m,v);r/=b;var y=new Float32Array([(2*t-m)/b,(v-2*e)/b]);a.viewport(0,0,g,g),a.bindFramebuffer(a.FRAMEBUFFER,c[h]),Reflect.apply(p,this,[s[d]]),a.useProgram(u.id),a.uniform2fv(u.locations.center,y),a.uniform1f(u.locations.radius,r),a.uniform1f(u.locations.strength,n),Reflect.apply(Q,this,[]),Reflect.apply(et,this,[])}}function dt(t){"@babel/helpers - typeof";return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(t)}function gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vt(n.key),n)}}function mt(t,e,r){return(e=vt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vt(t){var e=function(t,e){if("object"!=dt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dt(e)?e:e+""}function bt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function yt(t,e){return t.get(Rt(t,e))}function Et(t,e,r){return t.set(Rt(t,e),r),r}function Rt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var wt=new WeakMap,Tt=new WeakMap,St=new WeakMap,Pt=new WeakMap,xt=new WeakMap,kt=new WeakMap,_t=new WeakMap,Dt=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),bt(this,wt,T.accelerating),bt(this,Tt,T.interactive),bt(this,St,T.resolution),bt(this,Pt,T.perturbance),bt(this,xt,T.dropRadius),mt(this,"imgUrl",T.imgUrl),bt(this,kt,T.idleFluctuations),bt(this,_t,T.raindropsTimeInterval),mt(this,"crossOrigin","no-cors"),mt(this,"visible",!1),mt(this,"running",!1),mt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return yt(wt,this)},set:function(t){t>100||t<2||Et(wt,this,t)}},{key:"interactive",get:function(){return yt(Tt,this)},set:function(t){(0,f.isBoolean)(t)&&Et(Tt,this,t)}},{key:"resolution",get:function(){return yt(St,this)},set:function(t){t<100||t>550||Et(St,this,t)}},{key:"perturbance",get:function(){return yt(Pt,this)},set:function(t){t<1e-4||t>1||Et(Pt,this,t)}},{key:"dropRadius",get:function(){return yt(xt,this)},set:function(t){!isFinite(t)||t<10||Et(xt,this,t)}},{key:"idleFluctuations",get:function(){return yt(kt,this)},set:function(t){(0,f.isBoolean)(t)&&Et(kt,this,t)}},{key:"raindropsTimeInterval",get:function(){return yt(_t,this)},set:function(t){t<10||t>12e3||Et(_t,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&gt(t.prototype,e),r&&gt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function At(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(At,t,[]);"image"!==r.lastDrawImage.kind&&r.run()}),2*e.raindropsTimeInterval)}function Ot(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,f.isNull)(t))return e.isTransitioning=!1,void Reflect.apply(At,this,[]);if((0,f.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(At,this,[]);if(0===e.drawProgress&&n.forEach((function(t){})),e.drawProgress>1e3)if(e.isTransitioning=!1,e.lastDrawImage=n.shift(),Reflect.apply(st,this,[e.lastDrawImage]),(0,f.isEmptyArray)(n)){var i=t.lastUseStyle;(0,f.isNull)(r.imgUrl)&&h(i.backgroundColor)&&d(i.backgroundImage)&&(Reflect.apply(C,this,[!1]),Reflect.apply(At,this,[]))}else Reflect.apply(At,this,[]);else{var o=e.lastDrawImage,a=e.backgroundInfo;e.drawProgress+=18;var l=document.createElement("canvas"),u=l.getContext("2d");if(!((0,f.isNull)(u)||(0,f.isNull)(o.resource)||(0,f.isEmptyArray)(n))){var s=a.width,c=a.height;l.width=s,l.height=c,u.clearRect(0,0,s,c),u.drawImage(o.resource,0,0,s,c),u.globalAlpha=e.drawProgress/1e3,u.drawImage(n[0].resource,0,0,s,c),u.globalAlpha=1;var p={resource:l,width:s,height:c,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(st,this,[p]),n.length>1&&(e.lastDrawImage=p,n.shift(),e.drawProgress=0)}}}function It(t){"@babel/helpers - typeof";return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jt(n.key),n)}}function Ut(t,e,r){return(e=jt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jt(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}var Nt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ut(this,"backgroundInfo",{width:0,height:0}),Ut(this,"transparentId",setTimeout(Boolean)),Ut(this,"lastDrawImage",void 0),Ut(this,"toBeList",[]),Ut(this,"drawProgress",0),Ut(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,f.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:N(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&Ft(t.prototype,e),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ct(t){"@babel/helpers - typeof";return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(t)}function Bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Lt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bt(Object(r),!0).forEach((function(e){Yt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qt(n.key),n)}}function Xt(t,e,r){return e=Gt(e),function(t,e){if(e&&("object"==Ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Wt()?Reflect.construct(e,r||[],Gt(t).constructor):e.apply(t,r))}function Wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Wt=function(){return!!t})()}function Gt(t){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gt(t)}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}function Ht(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function Yt(t,e,r){return(e=qt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t){var e=function(t,e){if("object"!=Ct(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ct(e)?e:e+""}function $t(t,e){return t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))}var Zt=new WeakMap,Kt=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Yt(n=Xt(this,t,[e]),"renderData",null),Yt(n,"options",void 0),Yt(n,"fadeData",void 0),Yt(n,"defaults",T),Yt(n,"initialized",!1),Ht(n,Zt,(0,w.debounce)(ct,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new Dt(Lt(Lt({},n.defaults),r)),n.renderData=new K(e,n.reloadBackground,n),n.fadeData=new Nt(n),(0,f.isFalse)(n.initState)||(0,f.isNull)(e.parentElement)||(0,f.isNull)(n.config)||(0,f.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,s.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(e),Reflect.apply(ft,n,[])),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zt(t,e)}(t,R),e=t,r=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,f.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,o=e.raindropsTimeInterval,a=e.dropRadius,l=Date.now();if(!(l-i<o)){t.lastRaindropsFallTime=l;var u=function(t){return(0,w.getRandomInt)(t)},s=n.width,c=n.height;this.drop(u(s),u(c),a,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(ht,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(Ot,this,[])}},{key:"reloadBackground",value:function(){$t(Zt,this).call(this)}},{key:"destroy",value:function(){Reflect.apply(pt,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(G,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(H,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(W,this,[])):this.options[t]=e}}],r&&Mt(e.prototype,r),n&&Mt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Vt(t,e){var r=(0,u.useRef)(null);return(0,u.useEffect)((function(){if(!(0,f.isNull)(t.current))return r.current=new Kt(t.current,e&&e.option),function(){var t,e;return null!==(t=null===(e=r.current)||void 0===e?void 0:e.destroy())&&void 0!==t?t:void 0}}),[]),r}const Jt=l.n;export{Jt as useRipples};
1
+ "use client";import*as t from"a-js-tools";import*as e from"a-type-of-js";import*as r from"react";import*as n from"a-element-inline-style";var i={161:(e,r,n)=>{e.exports=(t=>{var e={};return n.d(e,t),e})({debounce:()=>t.debounce,enArr:()=>t.enArr,getRandomInt:()=>t.getRandomInt,getRandomString:()=>t.getRandomString})},362:(t,r,n)=>{t.exports=(t=>{var e={};return n.d(e,t),e})({isArray:()=>e.isArray,isBoolean:()=>e.isBoolean,isBusinessEmptyString:()=>e.isBusinessEmptyString,isEmptyArray:()=>e.isEmptyArray,isFalse:()=>e.isFalse,isNull:()=>e.isNull,isString:()=>e.isString,isZero:()=>e.isZero})},649:(t,e,n)=>{t.exports=(t=>{var e={};return n.d(e,t),e})({useEffect:()=>r.useEffect,useRef:()=>r.useRef})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return i[t](r,r.exports,a),r.exports}a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var l={};a.d(l,{n:()=>te});var s=a(649);const u=(t=>{var e={};return a.d(e,t),e})({setStyle:()=>n.setStyle});var f=a(362);function c(t,e,r,n){function i(t,e){var n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error("compile error: "+r.getShaderInfoLog(n));return n}var o,a={id:r.createProgram(),uniforms:{},locations:{}};if(r.attachShader(a.id,i(r.VERTEX_SHADER,t)),r.attachShader(a.id,i(r.FRAGMENT_SHADER,e)),r.linkProgram(a.id),!r.getProgramParameter(a.id,r.LINK_STATUS))throw new Error("link error: "+r.getProgramInfoLog(a.id));r.useProgram(a.id),r.enableVertexAttribArray(0);for(var l=t+e,s=/uniform (\w+) (\w+)/g;!(0,f.isNull)(o=s.exec(l));){var u=o[2];a.locations[u]=r.getUniformLocation(a.id,u)}return a}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.gl;r.activeTexture(r.TEXTURE0+(e||0)),r.bindTexture(r.TEXTURE_2D,t)}function h(t){return"rgba(0, 0, 0, 0)"===t||"#ffffffff"===t||"transport"===t}function d(t){return"none"===t||""===t}function g(){var t=this,e=function(){return t.initState=!1,null};if(!this.gl)return e();var r=this.gl,n=Object.fromEntries(["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear"].reduce((function(t,e){var n=r.getExtension(e);return n&&t.push([e,n]),t}),[]));if(!n.OES_texture_float)return e();var i=[];function o(t,e,r){var i="OES_texture_"+t,o=i+"_linear",a=o in n;return{type:e,linearSupport:a,arrayType:r,extensions:a?[i,o]:[i]}}i.push(o("float",r.FLOAT,Float32Array)),n.OES_texture_half_float&&i.push(o("half_float",n.OES_texture_half_float.HALF_FLOAT_OES,null));var a=r.createTexture(),l=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,l),r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var s=null,u=0;u<i.length;u++)if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,32,32,0,r.RGBA,i[u].type,null),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,a,0),r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE){s=i[u];break}return s}function m(t){"@babel/helpers - typeof";return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E(n.key),n)}}function b(t,e,r){return e&&v(t.prototype,e),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t){var e=function(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==m(e)?e:e+""}var R=b((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),y(this,"canvas",void 0),y(this,"gl",void 0),y(this,"config",void 0),y(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,f.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(g,this,[])})),w=a(161),T={imgUrl:"",resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0};function S(t){"@babel/helpers - typeof";return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x(n.key),n)}}function x(t){var e=function(t,e){if("object"!=S(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==S(e)?e:e+""}Object.freeze(T);var k;new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(){};return Object.setPrototypeOf(e,this),Object.defineProperties(e,{info:{value:function(){},configurable:!1,writable:!1},warn:{value:function(){},configurable:!1,writable:!1},error:{value:function(){},configurable:!1,writable:!1},type:{value:!1,configurable:!1,writable:!1}}),e},(e=[{key:"clear",value:function(){}}])&&P(t.prototype,e),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}())({name:"earthnut",type:!1});function _(t){"@babel/helpers - typeof";return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function D(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,A(n.key),n)}}function A(t){var e=function(t,e){if("object"!=_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==_(e)?e:e+""}function O(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function I(t,e,r){return t.set(U(t,e),r),r}function F(t,e){return t.get(U(t,e))}function U(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function j(t){return function(t){if(Array.isArray(t))return N(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return N(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var C=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={list:[],diameter:48,radius:0,cells:0};e.diameter%2!=0&&e.diameter++;var r=e.diameter,n=e.list,i=r/2;e.radius=i,e.cells=Math.pow(r,2);for(var o=0;o<r;o++){n[o]=[];for(var a=0;a<r;a++)n[o][a]=[0,0,0,0]}for(var l=0;l<=i;l++)for(var s=l;s<=i;s++){var u=n[l][s],f=function(){return(0,w.getRandomInt)(255,190)};u[0]=f(),u[1]=f(),u[2]=f(),u[3]=Math.ceil(Math.sqrt(Math.pow(l,2)+Math.pow(s,2)))<=i?(0,w.getRandomInt)(120,180):(0,w.getRandomInt)(160,240)}for(var c=0;c<=i;c++)for(var p=0;p<=c;p++)n[c][p]=n[p][c];for(var h=i;h<r;h++)for(var d=0;d<=i;d++)n[h][d]=n[r-h][d];for(var g=0;g<i;g++)for(var m=i;m<r;m++)n[g][m]=n[g][r-m];for(var v=i;v<r;v++)for(var b=i;b<r;b++)n[v][b]=n[v][r-b];var y=t%r;return e.list=[].concat(j(n.slice(y)),j(n.slice(0,y))),e},B=new(k=new WeakMap,function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),O(this,k,1),e=this,r="data",n=C(),(r=A(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(){F(k,this)>100&&I(k,this,0),this.data=C(I(k,this,F(k,this)+3))}}])&&D(t.prototype,e),r&&D(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function L(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),o=n.getContext("2d");return(0,f.isNull)(i)||(0,f.isNull)(o)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),o.clearRect(0,0,t,e),i.globalAlpha=1,i.putImageData(function(t,e){Date.now();for(var r=new ImageData(t||1,e||1),n=r.data,i=B.data,o=i.diameter,a=i.list,l=t*o,s=0;s<n.length;s+=4){var u=s/4%l,f=u%t%o,c=Math.floor(u/t),p=a[f][c];n[s]=p[0],n[s+1]=p[1],n[s+2]=p[2],n[s+3]=p[3]}return r}(t,e),0,0),o.fillStyle="#ffffff",o.fillRect(0,0,t,e),o.drawImage(r,0,0,t||1,e||1),o.globalCompositeOperation="source-over",n)}function M(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.fadeData,r=e.backgroundInfo,n=e.toBeList,i=r.width,o=r.height,a=(0,w.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});B.build(),n.push({resource:L(i,o),width:i,height:o,kind:"default",tag:a}),t&&e.run()}function X(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,f.isNull)(t))return Reflect.apply(M,this,[]);var n=t.originStyle;if(h(n.backgroundColor)&&(!(0,f.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(M,this,[]);var i=document.createElement("canvas"),o=i.getContext("2d");if((0,f.isNull)(o))return Reflect.apply(M,this,[]);var a=e.backgroundInfo,l=a.width,s=a.height;i.width=l,i.height=s,o.clearRect(0,0,l,s);var u=(0,f.isArray)(r.imgUrl)&&1===r.imgUrl.length&&r.imgUrl[0]||n.backgroundColor;o.beginPath(),o.fillStyle=u,o.fillRect(0,0,l,s),o.fill(),e.isTransitioning?e.toBeList=[e.toBeList[0]]:e.toBeList=[];var c={resource:i,kind:"background-color",tag:u,width:l,height:s};e.toBeList.push(c),e.run()}function W(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,f.isNull)(e))return Reflect.apply(X,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,f.isArray)(r.imgUrl))return Reflect.apply(X,this,[]);var i=(0,f.isArray)(r.imgUrl)&&r.imgUrl.length>1&&r.imgUrl||n.backgroundImage.replace(/^.*linear-gradient\((.*)\).*$/,"$1").split("),").map((function(t){return(t=t.trim()).endsWith(")")||(t+=")"),t})).filter((function(t){return t.startsWith("rgb")||t.startsWith("#")}));if(i.length<2)return Reflect.apply(X,this,[]);var o=document.createElement("canvas"),a=o.getContext("2d");if((0,f.isNull)(a))return Reflect.apply(X,this,[]);var l=t.backgroundInfo,s=l.width,u=l.height;o.width=s,o.height=u,a.fillStyle="#fff",a.fillRect(0,0,s,u);var c=a.createLinearGradient(0,0,0,u);i.forEach((function(t,e){return c.addColorStop(e/(i.length-1),t)})),a.fillStyle=c,a.fillRect(0,0,s,u),t.isTransitioning?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:o,kind:"linear-gradient",tag:i.join("_"),width:s,height:u}),t.run()}function G(t){return function(t){if(Array.isArray(t))return z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function H(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,f.isNull)(e))Reflect.apply(W,this,[]);else{var i,o,a=e.lastUseStyle,l=n.backgroundInfo,s=l.width,u=l.height,c=(0,f.isString)(r.imgUrl)&&r.imgUrl||(i=a.backgroundImage,o=/url\(["']?([^"']*)["']?\)/.exec(i),(0,f.isNull)(o)?null:o[1]);if(e.imageSource=c,c){var p=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(c,s,u);p.onload=function(){clearTimeout(n.transparentId),n.isTransitioning?n.toBeList=[n.toBeList[0]].concat(G(n.toBeList.slice(1).filter((function(t){return"image"===t.kind&&(Math.abs(t.width-s)>2||Math.abs(t.height-u)>2||t.tag!==c)})))):n.toBeList=[],n.toBeList.push({resource:p,width:s,height:u,kind:"image",tag:c}),n.run()},p.onerror=function(){Reflect.apply(W,t,[])},p.crossOrigin=r.crossOrigin}else Reflect.apply(W,this,[])}}function Y(){var t=this.renderData;if(!(0,f.isNull)(t)){var e=t.parentElement;e&&[["background-image","none"],["background-color","transparent"]].forEach((function(t){return e.style.setProperty(t[0],t[1],"important")}))}}function q(t){var e=window.getComputedStyle(t),r=t.style;return{inlineBackground:r.background,inlineBackgroundColor:r.backgroundColor,inlineBackgroundImage:r.backgroundImage,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat,backgroundClip:e.backgroundClip,backgroundOrigin:e.backgroundOrigin,backgroundAttachment:e.backgroundAttachment,position:e.position,width:parseInt(e.width),height:parseInt(e.height)}}function Z(){var t=this.renderData;if(!(0,f.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function $(t){"@babel/helpers - typeof";return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function K(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,J(n.key),n)}}function V(t,e,r){return(e=J(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J(t){var e=function(t,e){if("object"!=$(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$(e)?e:e+""}var Q=function(){return t=function t(e,r,n){var i,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),V(this,"quad",null),V(this,"lastRaindropsFallTime",0),V(this,"parentElement",void 0),V(this,"mutationObserver",void 0),V(this,"resizeObserver",void 0),V(this,"renderProgram",void 0),V(this,"imageSource",""),V(this,"dropProgram",void 0),V(this,"updateProgram",void 0),V(this,"textures",[]),V(this,"backgroundTexture",[]),V(this,"textureDelta",void 0),V(this,"framebuffers",[]),V(this,"bufferWriteIndex",0),V(this,"bufferReadIndex",1),V(this,"originStyle",void 0),V(this,"lastUseStyle",void 0),V(this,"events",{}),V(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(Y,n,[]),this.originStyle=this.lastUseStyle=q(this.parentElement),this.mutationObserver=new MutationObserver((function(t){t.forEach((function(t){if(t.target===o.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(o.lastUseStyle),i=q(o.parentElement),a=Object.values(i);if((0,f.isEmptyArray)(w.enArr.difference(e,a)))return;var l=d(i.backgroundImage),s=h(i.backgroundColor);if(l&&s)return;o.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(Y,n,[])}}))})),this.mutationObserver.observe(this.parentElement,{subtree:!0,attributes:!0,attributeFilter:["class","style"]}),this.resizeObserver=new ResizeObserver((function(t){t.forEach((function(t){t.target===o.parentElement&&Reflect.apply(r,n,[])}))})),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(Z,{renderData:this},[]),this.parentElement&&this.events){var t,e,r,n=this.parentElement,i=this.events;Object.keys(i).forEach((function(t){return n.removeEventListener&&n.removeEventListener(t,i[t])})),n.removeAttribute&&n.removeAttribute("data-ripples"),null===(t=this.mutationObserver)||void 0===t||t.takeRecords(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null===(r=this.resizeObserver)||void 0===r||r.disconnect(),this.resizeObserver=null}}}],e&&K(t.prototype,e),r&&K(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function tt(){var t=this.renderData,e=this.fadeData;if(!(0,f.isNull)(t)){var r,n,i,o=t.parentElement,a=window.getComputedStyle(o),l=a.backgroundSize,s=a.backgroundAttachment,u=a.backgroundPosition,c=/\s+/.test(r=u)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):et(r)?[r,"50%"]:{center:["50%","50%"],top:["50%","0%"],bottom:["50%","100%"],left:["0%","50%"],right:["100%","50%"]}[r],p={left:0,top:0,width:0,height:0};"fixed"===s?(p.height=window.innerHeight,p.left=window.screenX,p.top=window.screenY,p.width=window.innerWidth):(p.left=0,p.top=0,p.width=o.scrollWidth,p.height=o.scrollHeight);var h=e.backgroundInfo||{width:100,height:100},d=h.width,g=h.height;if("cover"===l){var m=Math.max(p.width/d,p.height/g);n=d*m,i=g*m}else if("contain"===l){var v=Math.min(p.width/d,p.height/g);n=d*v,i=g*v}else{var b=l.split(" ");n=b[0]||"",i=b[1]||n,et(n)?n=p.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),et(i)?i=p.height*parseFloat(i)/100:"auto"!==i&&(i=parseFloat(i)),"auto"===n&&"auto"===i?(n=d,i=g):("auto"===n&&(n=d*(Number(i)/g)),"auto"===i&&(i=g*(Number(n)/d)))}var y=c&&c[0]||"0%",E=c&&c[1]||"0%";y=et(y)?(p.left+(p.width-Number(n))*parseFloat(y)/100).toString():(p.left+parseFloat(y)).toString(),E=et(E)?(p.top+(p.height-Number(i))*parseFloat(E)/100).toString():(p.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([-Number(y)/n,-Number(E)/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+o.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+o.clientHeight/i]);var R=Math.max(this.canvas.width,this.canvas.height);t.renderProgram.uniforms.containerRatio=new Float32Array([this.canvas.width/R,this.canvas.height/R])}}function et(t){return t.endsWith("%")}function rt(){var t=this.gl,e=this.renderData;(0,f.isNull)(e)||(t.bindBuffer(t.ARRAY_BUFFER,e.quad),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLE_FAN,0,4))}function nt(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,f.isNull)(e)){var n=e.textures,i=e.backgroundTexture,o=r.perturbance;t.bindFramebuffer(t.FRAMEBUFFER,null),t.viewport(0,0,this.canvas.width,this.canvas.height),t.enable(t.BLEND),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(e.renderProgram.id),Reflect.apply(p,this,[i,0]),Reflect.apply(p,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,o),t.uniform2fv(e.renderProgram.locations.topLeft,e.renderProgram.uniforms.topLeft),t.uniform2fv(e.renderProgram.locations.bottomRight,e.renderProgram.uniforms.bottomRight),t.uniform2fv(e.renderProgram.locations.containerRatio,e.renderProgram.uniforms.containerRatio),t.uniform1i(e.renderProgram.locations.samplerBackground,0),t.uniform1i(e.renderProgram.locations.samplerRipples,1),Reflect.apply(rt,this,[]),t.disable(t.BLEND)}}function it(){var t=this.renderData;if(!(0,f.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function ot(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,f.isNull)(e)){var n=e.updateProgram,i=e.textures,o=e.framebuffers,a=e.bufferWriteIndex,l=e.bufferReadIndex,s=r.resolution;t.viewport(0,0,s,s),t.bindFramebuffer(t.FRAMEBUFFER,o[a]),Reflect.apply(p,this,[i[l]]),t.useProgram(n.id),Reflect.apply(rt,this,[]),Reflect.apply(it,this,[])}}function at(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,f.isNull)(e)){var i=e.parentElement,o=n.isTransitioning,a=r.running,l=r.idleFluctuations,s=r.lastRunningState,u=getComputedStyle(i);n.backgroundInfo={width:parseInt(u.width),height:parseInt(u.height)},Reflect.apply(tt,this,[]),a?(s||(r.lastRunningState=!0,this.show()),l&&this.raindropsFall(),o&&this.fade(),Reflect.apply(ot,this,[]),Reflect.apply(nt,this,[])):s&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(at,t,[])}))}}function lt(t,e,r){var n=this.renderData;if(!(0,f.isNull)(n)){var i=n.parentElement,o=window.getComputedStyle(i),a=parseInt(o.borderLeftWidth)||0,l=parseInt(o.borderTopWidth)||0,s=i.getBoundingClientRect(),u=t.clientX-s.left-a,c=t.clientY-s.top-l;this.drop(u,c,e,r)}}function st(){var t=this,e=this.renderData,r=this.options;if(!(0,f.isNull)(e)){var n=e.parentElement,i=e.events,o=function(n){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.visible&&r.running&&r.interactive&&(e.lastRaindropsFallTime=Date.now(),Reflect.apply(lt,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)o(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)o(e[r])},i.mousedown=function(t){return o(t,!0)},Object.keys(i).forEach((function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})}))}}var ut="\n attribute vec2 vertex;\n varying vec2 coord;\n void main() {\n coord = vertex * 0.5 + 0.5;\n gl_Position = vec4(vertex, 0.0, 1.0);\n }";function ft(){var t=this.gl,e=this.renderData;if(!(0,f.isNull)(e)){var r=e.textureDelta;e.dropProgram=c(ut,"precision highp float;\n\n const float PI = 3.141592653589793;\n uniform sampler2D texture;\n uniform vec2 center;\n uniform float radius;\n uniform float strength;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n\n float drop = max(0.0, 1.0 - length(center * 0.5 + 0.5 - coord) / radius);\n drop = 0.5 - cos(drop * PI) * 0.5;\n info.r += drop * strength;\n gl_FragColor = info;\n }",t);var n=e.updateProgram=c(ut,"\n precision highp float;\n\n uniform sampler2D texture;\n uniform vec2 delta;\n\n varying vec2 coord;\n\n void main() {\n vec4 info = texture2D(texture, coord);\n \n vec2 dx = vec2(delta.x, 0.0);\n vec2 dy = vec2(0.0, delta.y);\n \n float average = (\n texture2D(texture, coord - dx).r +\n texture2D(texture, coord - dy).r +\n texture2D(texture, coord + dx).r +\n texture2D(texture, coord + dy).r\n ) * 0.25;\n \n info.g += (average - info.r) * 2.0;\n info.g *= 0.995;\n info.r += info.g;\n \n gl_FragColor = info;\n }\n ",this.gl);t.uniform2fv(n.locations.delta,r),e.renderProgram=c("\n precision highp float;\n\n attribute vec2 vertex;\n uniform vec2 topLeft;\n uniform vec2 bottomRight;\n uniform vec2 containerRatio;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n void main() {\n backgroundCoord = mix(topLeft, bottomRight, vertex * 0.5 + 0.5);\n backgroundCoord.y = 1.0 - backgroundCoord.y;\n ripplesCoord = vec2(vertex.x, -vertex.y) * containerRatio * 0.5 + 0.5;\n gl_Position = vec4(vertex.x, -vertex.y, 0.0, 1.0);\n }\n ","\n precision highp float;\n\n uniform sampler2D samplerBackground;\n uniform sampler2D samplerRipples;\n uniform vec2 delta;\n\n uniform float perturbance;\n varying vec2 ripplesCoord;\n varying vec2 backgroundCoord;\n\n void main() {\n float height = texture2D(samplerRipples, ripplesCoord).r;\n float heightX = texture2D(samplerRipples, vec2(ripplesCoord.x + delta.x, ripplesCoord.y)).r;\n float heightY = texture2D(samplerRipples, vec2(ripplesCoord.x, ripplesCoord.y + delta.y)).r;\n vec3 dx = vec3(delta.x, heightX - height, 0.0);\n vec3 dy = vec3(0.0, heightY - height, delta.y);\n vec2 offset = -normalize(cross(dy, dx)).xz;\n float specular = pow(max(0.0, dot(offset, normalize(vec2(-0.6, 1.0)))), 4.0);\n gl_FragColor = texture2D(samplerBackground, backgroundCoord + offset * perturbance) + specular;\n }",t),t.uniform2fv(e.renderProgram.locations.delta,r)}}function ct(){var t=this.gl,e=this.renderData;if(!(0,f.isNull)(e)){var r=e.backgroundTexture=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)}}function pt(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,f.isNull)(r)){var i=r.backgroundTexture,o=r.parentElement,a=n.backgroundInfo,l=a.width,s=a.height,u=function(t){return(0,f.isZero)(t&t-1)},c=u(l)&&u(s)?e.REPEAT:e.CLAMP_TO_EDGE;e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,c),o.dataset.render_img=t.tag,o.dataset.render_width=t.width+"px",o.dataset.render_height=t.height+"px",e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function ht(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,f.isNull)(e)&&this.config){var i=e.textures,o=e.framebuffers,a=r.resolution,l=this.gl,s=1/a;e.textureDelta=new Float32Array([s,s]),this.config.extensions.forEach((function(t){return l.getExtension(t)}));for(var u=this.config.arrayType,c=u?new u(a*a*4):null,p=this.config,h=0;h<2;h++){var d=l.createTexture(),g=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,g),l.bindTexture(l.TEXTURE_2D,d),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,p.linearSupport?l.LINEAR:l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,a,a,0,l.RGBA,p.type,c),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,d,0),i.push(d),o.push(g)}e.quad=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,e.quad),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),l.STATIC_DRAW),Reflect.apply(ft,this,[]),Reflect.apply(ct,this,[]),Reflect.apply(H,this,[]),l.clearColor(0,0,0,0),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(st,this,[]),Reflect.apply(pt,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame((function(){return Reflect.apply(at,t,[])}))}}function dt(){var t=this.renderData,e=this.fadeData;if(!(0,f.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,o=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=o,Reflect.apply(H,this,[])}}function gt(){var t=this.renderData,e=this.fadeData;(0,f.isNull)(t)||(t.destroy(),Object.keys(t).forEach((function(e){return t[e]=null})),this.renderData=null),e.destroy(),Object.keys(e).forEach((function(t){return e[t]=null})),this.fadeData=null,this.gl&&(this.gl=null)}function mt(t,e,r,n){var i=this.renderData,o=this.options,a=this.gl;if(!(0,f.isNull)(i)){var l=i.parentElement,s=i.dropProgram,u=i.textures,c=i.framebuffers,h=i.bufferWriteIndex,d=i.bufferReadIndex,g=o.resolution,m=l.offsetWidth,v=l.offsetHeight,b=Math.max(m,v);r/=b;var y=new Float32Array([(2*t-m)/b,(v-2*e)/b]);a.viewport(0,0,g,g),a.bindFramebuffer(a.FRAMEBUFFER,c[h]),Reflect.apply(p,this,[u[d]]),a.useProgram(s.id),a.uniform2fv(s.locations.center,y),a.uniform1f(s.locations.radius,r),a.uniform1f(s.locations.strength,n),Reflect.apply(rt,this,[]),Reflect.apply(it,this,[])}}function vt(t){"@babel/helpers - typeof";return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(t)}function bt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Et(n.key),n)}}function yt(t,e,r){return(e=Et(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Et(t){var e=function(t,e){if("object"!=vt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vt(e)?e:e+""}function Rt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function wt(t,e){return t.get(St(t,e))}function Tt(t,e,r){return t.set(St(t,e),r),r}function St(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Pt=new WeakMap,xt=new WeakMap,kt=new WeakMap,_t=new WeakMap,Dt=new WeakMap,At=new WeakMap,Ot=new WeakMap,It=function(){return t=function t(e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rt(this,Pt,T.accelerating),Rt(this,xt,T.interactive),Rt(this,kt,T.resolution),Rt(this,_t,T.perturbance),Rt(this,Dt,T.dropRadius),yt(this,"imgUrl",T.imgUrl),Rt(this,At,T.idleFluctuations),Rt(this,Ot,T.raindropsTimeInterval),yt(this,"crossOrigin","no-cors"),yt(this,"visible",!1),yt(this,"running",!1),yt(this,"lastRunningState",!1),this.perturbance=e.perturbance,this.resolution=e.resolution,this.raindropsTimeInterval=e.raindropsTimeInterval,this.accelerating=e.accelerating,this.interactive=e.interactive,this.dropRadius=e.dropRadius,this.imgUrl=e.imgUrl,this.idleFluctuations=e.idleFluctuations,this.running=Boolean(null===(r=e.playingState)||void 0===r||r),this.crossOrigin=e.crossOrigin},(e=[{key:"accelerating",get:function(){return wt(Pt,this)},set:function(t){t>100||t<2||Tt(Pt,this,t)}},{key:"interactive",get:function(){return wt(xt,this)},set:function(t){(0,f.isBoolean)(t)&&Tt(xt,this,t)}},{key:"resolution",get:function(){return wt(kt,this)},set:function(t){t<100||t>550||Tt(kt,this,t)}},{key:"perturbance",get:function(){return wt(_t,this)},set:function(t){t<1e-4||t>1||Tt(_t,this,t)}},{key:"dropRadius",get:function(){return wt(Dt,this)},set:function(t){!isFinite(t)||t<10||Tt(Dt,this,t)}},{key:"idleFluctuations",get:function(){return wt(At,this)},set:function(t){(0,f.isBoolean)(t)&&Tt(At,this,t)}},{key:"raindropsTimeInterval",get:function(){return wt(Ot,this)},set:function(t){t<10||t>12e3||Tt(Ot,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}}])&&bt(t.prototype,e),r&&bt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ft(){var t=this,e=this.options,r=this.fadeData;r.transparentId=setTimeout((function(){if(clearTimeout(r.transparentId),r.isTransitioning)return Reflect.apply(Ft,t,[]);"image"!==r.lastDrawImage.kind&&r.run()}),2*e.raindropsTimeInterval)}function Ut(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,f.isNull)(t))return e.isTransitioning=!1,void Reflect.apply(Ft,this,[]);if((0,f.isEmptyArray)(n))return e.isTransitioning=!1,void Reflect.apply(Ft,this,[]);if(0===e.drawProgress&&n.forEach((function(t){})),e.drawProgress>1e3)if(e.isTransitioning=!1,e.lastDrawImage=n.shift(),Reflect.apply(pt,this,[e.lastDrawImage]),(0,f.isEmptyArray)(n)){var i=t.lastUseStyle;((0,f.isNull)(r.imgUrl)||(0,f.isBusinessEmptyString)(r.imgUrl)||(0,f.isZero)(r.imgUrl.length))&&h(i.backgroundColor)&&d(i.backgroundImage)&&(Reflect.apply(M,this,[!1]),Reflect.apply(Ft,this,[]))}else Reflect.apply(Ft,this,[]);else{var o=e.lastDrawImage,a=e.backgroundInfo;e.drawProgress+=18;var l=document.createElement("canvas"),s=l.getContext("2d");if(!((0,f.isNull)(s)||(0,f.isNull)(o.resource)||(0,f.isEmptyArray)(n))){var u=a.width,c=a.height;l.width=u,l.height=c,s.clearRect(0,0,u,c),s.drawImage(o.resource,0,0,u,c),s.globalAlpha=e.drawProgress/1e3,s.drawImage(n[0].resource,0,0,u,c),s.globalAlpha=1;var p={resource:l,width:u,height:c,kind:"mix",tag:"".concat(o.tag," >> ").concat(n[0].tag)};Reflect.apply(pt,this,[p]),n.length>1&&(e.lastDrawImage=p,n.shift(),e.drawProgress=0)}}}function jt(t){"@babel/helpers - typeof";return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}function Nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bt(n.key),n)}}function Ct(t,e,r){return(e=Bt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bt(t){var e=function(t,e){if("object"!=jt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==jt(e)?e:e+""}var Lt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ct(this,"backgroundInfo",{width:0,height:0}),Ct(this,"transparentId",setTimeout(Boolean)),Ct(this,"lastDrawImage",void 0),Ct(this,"toBeList",[]),Ct(this,"drawProgress",0),Ct(this,"isTransitioning",!1);var r,n,i=e.renderData;if((0,f.isNull)(i))r=10,n=10;else{var o=getComputedStyle(i.parentElement);r=parseInt(o.width),n=parseInt(o.height)}this.backgroundInfo={width:r,height:n},this.lastDrawImage={resource:L(r,n),width:r,height:n,kind:"default",tag:""}},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId)}}])&&Nt(t.prototype,e),r&&Nt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Mt(t){"@babel/helpers - typeof";return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(t)}function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(r),!0).forEach((function(e){$t(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kt(n.key),n)}}function zt(t,e,r){return e=Yt(e),function(t,e){if(e&&("object"==Mt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ht()?Reflect.construct(e,r||[],Yt(t).constructor):e.apply(t,r))}function Ht(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ht=function(){return!!t})()}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yt(t)}function qt(t,e){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qt(t,e)}function Zt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function $t(t,e,r){return(e=Kt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kt(t){var e=function(t,e){if("object"!=Mt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mt(e)?e:e+""}function Vt(t,e){return t.get(function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}(t,e))}var Jt=new WeakMap,Qt=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$t(n=zt(this,t,[e]),"renderData",null),$t(n,"options",void 0),$t(n,"fadeData",void 0),$t(n,"defaults",T),$t(n,"initialized",!1),Zt(n,Jt,(0,w.debounce)(dt,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new It(Wt(Wt({},n.defaults),r)),n.renderData=new Q(e,n.reloadBackground,n),n.fadeData=new Lt(n),(0,f.isFalse)(n.initState)||(0,f.isNull)(e.parentElement)||(0,f.isNull)(n.config)||(0,f.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,u.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(e),Reflect.apply(ht,n,[])),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qt(t,e)}(t,R),e=t,r=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,f.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,o=e.raindropsTimeInterval,a=e.dropRadius,l=Date.now();if(!(l-i<o)){t.lastRaindropsFallTime=l;var s=function(t){return(0,w.getRandomInt)(t)},u=n.width,c=n.height;this.drop(s(u),s(c),a,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(mt,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(Ut,this,[])}},{key:"reloadBackground",value:function(){Vt(Jt,this).call(this)}},{key:"destroy",value:function(){Reflect.apply(gt,this,[])}},{key:"show",value:function(){this.options.visible=!0,this.canvas.style.visibility="visible",Reflect.apply(Y,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(Z,this,[])}},{key:"pause",value:function(){this.options.running=!1}},{key:"play",value:function(){this.options.running=!0}},{key:"changePlayingState",value:function(){var t=this.options;t.running=!t.running}},{key:"set",value:function(t,e){"imgUrl"===t?(this.options.imgUrl=e,Reflect.apply(H,this,[])):this.options[t]=e}}],r&&Gt(e.prototype,r),n&&Gt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function te(t,e){var r=(0,s.useRef)(null);return(0,s.useEffect)((function(){if(!(0,f.isNull)(t.current))return r.current=new Qt(t.current,e&&e.option),function(){var t;return null===(t=r.current)||void 0===t?void 0:t.destroy()}}),[]),r}const ee=l.n;export{ee as useRipples};