earthnut 0.1.5 → 0.1.7-alpha.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.
- package/705/index.cjs +7 -0
- package/705/index.mjs +7 -0
- package/BackgroundRipple/index.cjs +7 -1
- package/BackgroundRipple/index.mjs +7 -1
- package/Layout/index.cjs +7 -1
- package/Layout/index.mjs +6 -0
- package/LazyBackgroundRipple/index.cjs +7 -0
- package/LazyBackgroundRipple/index.mjs +7 -0
- package/README.md +1 -1
- package/components/button/button.d.ts +6 -0
- package/components/button/index.d.ts +6 -0
- package/components/index.d.ts +11 -2
- package/components/layout/EnLayoutContent.d.ts +6 -0
- package/components/layout/content.d.ts +6 -0
- package/components/layout/footer.d.ts +6 -0
- package/components/layout/generate-class.d.ts +6 -0
- package/components/layout/get-value.d.ts +6 -0
- package/components/layout/header.d.ts +6 -0
- package/components/layout/index.d.ts +6 -0
- package/components/layout/layout.d.ts +6 -0
- package/components/layout/sideBar.d.ts +6 -0
- package/components/layout/types.d.ts +6 -0
- package/components/marquee/MarqueeEle.d.ts +6 -0
- package/components/marquee/index.d.ts +6 -0
- package/components/marquee/type.d.ts +6 -0
- package/components/menu/index.d.ts +6 -0
- package/components/menu/menu.d.ts +6 -0
- package/components/ripples/Content.d.ts +8 -0
- package/components/ripples/LazyRippleEle.d.ts +51 -0
- package/components/ripples/RipplesEle.d.ts +10 -2
- package/components/ripples/index.d.ts +7 -0
- package/components/ripples/types.d.ts +6 -0
- package/components/ripples/useOptionUpdate.d.ts +8 -2
- package/customHooks/index.d.ts +7 -0
- package/customHooks/useAnimationFrame.d.ts +6 -0
- package/customHooks/useInputIsComposing.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/create-background-color.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/create-linear-gradient.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/_createImageData.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/circleDataList.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/createDefault.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/index.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/load-image.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/run-side.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/type.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/bind-image.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/create-canvas-element.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/create-image-by-src.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/get-background-style.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/hide-css-background.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/restore-css-background.d.ts +6 -0
- package/customHooks/useRipples/callback/can-side.d.ts +6 -0
- package/customHooks/useRipples/callback/destroy.d.ts +6 -0
- package/customHooks/useRipples/callback/drop.d.ts +6 -0
- package/customHooks/useRipples/callback/extract-url.d.ts +6 -0
- package/customHooks/useRipples/callback/fade.d.ts +6 -0
- package/customHooks/useRipples/callback/get-new-image.d.ts +6 -0
- package/customHooks/useRipples/callback/reload-background.d.ts +6 -0
- package/customHooks/useRipples/callback/scale.d.ts +6 -0
- package/customHooks/useRipples/index.d.ts +8 -2
- package/customHooks/useRipples/init/index.d.ts +6 -0
- package/customHooks/useRipples/init/initEvent.d.ts +6 -0
- package/customHooks/useRipples/init/initShaders.d.ts +6 -0
- package/customHooks/useRipples/init/initTexture.d.ts +6 -0
- package/customHooks/useRipples/render/computeTextureBoundaries.d.ts +6 -0
- package/customHooks/useRipples/render/draw.d.ts +6 -0
- package/customHooks/useRipples/render/drawQuad.d.ts +6 -0
- package/customHooks/useRipples/render/dropAtPointer.d.ts +6 -0
- package/customHooks/useRipples/render/index.d.ts +6 -0
- package/customHooks/useRipples/render/swapBufferIndices.d.ts +6 -0
- package/customHooks/useRipples/render/update.d.ts +6 -0
- package/customHooks/useRipples/rippersData/defaultData.d.ts +6 -0
- package/customHooks/useRipples/rippersData/fadeData.d.ts +6 -0
- package/customHooks/useRipples/rippersData/index.d.ts +6 -0
- package/customHooks/useRipples/rippersData/loadConfig.d.ts +6 -0
- package/customHooks/useRipples/rippersData/renderData.d.ts +6 -0
- package/customHooks/useRipples/rippersData/useOptions.d.ts +6 -0
- package/customHooks/useRipples/rippersData/vertexSource.d.ts +6 -0
- package/customHooks/useRipples/ripple.html.d.ts +6 -0
- package/customHooks/useRipples/ripplesClass.d.ts +6 -0
- package/customHooks/useRipples/tools.d.ts +6 -0
- package/customHooks/useRipples/types.d.ts +8 -9
- package/customHooks/useRipples/use-lazy-ripple.d.ts +13 -0
- package/customHooks/useTimeId.d.ts +7 -1
- package/dog.d.ts +6 -0
- package/index.cjs +7 -1
- package/index.d.ts +8 -4
- package/index.mjs +7 -1
- package/package.json +16 -5
- package/useAnimationFrame/index.cjs +6 -0
- package/useAnimationFrame/index.mjs +6 -0
- package/useInputIsComposing/index.cjs +6 -0
- package/useInputIsComposing/index.mjs +6 -0
- package/useLazyRipples/index.cjs +7 -0
- package/useLazyRipples/index.mjs +7 -0
- package/useRipples/index.cjs +7 -1
- package/useRipples/index.mjs +7 -1
- package/useTimeId/index.cjs +7 -1
- package/useTimeId/index.mjs +7 -1
- package/index.js.LICENSE.txt +0 -79
package/705/index.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@705/index.cjs
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
"use client";"use strict";(self.webpackChunkearthnut=self.webpackChunkearthnut||[]).push([[705],{705:(t,e,r)=>{r.r(e),r.d(e,{useRipples:()=>ne});var n=r(953),i=r(378),o=r(570);function a(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 a,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 s=t+e,u=/uniform (\w+) (\w+)/g;!(0,o.isNull)(a=u.exec(s));){var c=a[2];l.locations[c]=r.getUniformLocation(l.id,c)}return l}function l(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 u(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 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 f(t){"@babel/helpers - typeof";return f="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},f(t)}function h(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,g(n.key),n)}}function p(t,e,r){return e&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e,r){return(e=g(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}var m=p(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,"canvas",void 0),d(this,"gl",void 0),d(this,"config",void 0),d(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,o.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(c,this,[])}),v=r(86),y={imgUrl:null,resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0,darkMode:void 0};Object.freeze(y);var b;r(713);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+""}function T(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 k(t,e,r){return t.set(P(t,e),r),r}function S(t,e){return t.get(P(t,e))}function P(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 D(t){return function(t){if(Array.isArray(t))return _(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 _(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)?_(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 _(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 x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={list:[],diameter:48,radius:0,cells:0};r.diameter%2!=0&&r.diameter++;var n=r.diameter,i=r.list,o=n/2;r.radius=o,r.cells=Math.pow(n,2);for(var a=0;a<n;a++){i[a]=[];for(var l=0;l<n;l++)i[a][l]=[0,0,0,0]}for(var s=0;s<=o;s++)for(var u=function(){var t=i[s][c],r=Math.ceil(Math.sqrt(Math.pow(s,2)+Math.pow(c,2)))<=o,n=e?10:255,a=e?25:190,l=r?e?160:120:e?160:180,u=r?e?230:160:e?250:240,f=function(){return(0,v.getRandomInt)(n,a)};t[0]=f(),t[1]=f(),t[2]=f(),t[3]=(0,v.getRandomInt)(l,u)},c=s;c<=o;c++)u();for(var f=0;f<=o;f++)for(var h=0;h<=f;h++)i[f][h]=i[h][f];for(var p=o;p<n;p++)for(var d=0;d<=o;d++)i[p][d]=i[n-p][d];for(var g=0;g<o;g++)for(var m=o;m<n;m++)i[g][m]=i[g][n-m];for(var y=o;y<n;y++)for(var b=o;b<n;b++)i[y][b]=i[y][n-b];var E=t%n;return r.list=[].concat(D(i.slice(E)),D(i.slice(0,E))),r},A=new(b=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),T(this,b,1),e=this,r="data",n=x(),(r=R(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(t){S(b,this)>100&&k(b,this,0),this.data=x(k(b,this,S(b,this)+4),t)}}])&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function O(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),a=n.getContext("2d");return(0,o.isNull)(i)||(0,o.isNull)(a)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),a.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=A.data,o=i.diameter,a=i.list,l=t*o,s=0;s<n.length;s+=4){var u=s/4%l,c=u%t%o,f=Math.floor(u/t),h=a[c][f];n[s]=h[0],n[s+1]=h[1],n[s+2]=h[2],n[s+3]=h[3]}return r}(t,e),0,0),a.fillStyle="#ffffff",a.fillRect(0,0,t,e),a.drawImage(r,0,0,t||1,e||1),a.globalCompositeOperation="source-over",n)}function I(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.fadeData,n=this.options,i=r.backgroundInfo,o=r.toBeList,a=i.width,l=i.height,s=(0,v.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});A.build(null!==(t=n.darkMode)&&void 0!==t?t:r.isDark),o.push({resource:O(a,l),width:a,height:l,kind:"default",tag:s}),e&&r.run()}function F(t,e){var r,n,i=t.imgUrl;return(0,o.isString)(i)&&i||(r=e.backgroundImage,n=/url\(["']?([^"']*)["']?\)/.exec(r),(0,o.isNull)(n)?null:n[1])}function U(t,e){return(0,o.isArray)(t.imgUrl)&&1===t.imgUrl.length&&t.imgUrl[0]||e.backgroundColor}function j(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,o.isNull)(t))return Reflect.apply(I,this,[]);var n=t.originStyle;if(s(n.backgroundColor)&&(!(0,o.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(I,this,[]);var i=document.createElement("canvas"),a=i.getContext("2d");if((0,o.isNull)(a))return Reflect.apply(I,this,[]);var l=e.backgroundInfo,u=l.width,c=l.height;i.width=u,i.height=c,a.clearRect(0,0,u,c);var f=U(r,n);a.beginPath(),a.fillStyle=f,a.fillRect(0,0,u,c),a.fill(),e.isTransitioning&&!(0,o.isEmptyArray)(e.toBeList)?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 N(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,o.isNull)(e))return Reflect.apply(j,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,o.isArray)(r.imgUrl))return Reflect.apply(j,this,[]);var i=(0,o.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(j,this,[]);var a=document.createElement("canvas"),l=a.getContext("2d");if((0,o.isNull)(l))return Reflect.apply(j,this,[]);var s=t.backgroundInfo,u=s.width,c=s.height;a.width=u,a.height=c,l.fillStyle="#fff",l.fillRect(0,0,u,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,u,c),t.isTransitioning&&!(0,o.isEmptyArray)(t.toBeList)?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:a,kind:"linear-gradient",tag:i.join("_"),width:u,height:c}),t.run()}function C(t){return function(t){if(Array.isArray(t))return L(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 L(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)?L(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 L(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 B(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,o.isNull)(e))Reflect.apply(N,this,[]);else{var i=e.lastUseStyle,a=n.backgroundInfo,l=a.width,s=a.height,u=F(r,i);if(e.imageSource=u,u){var c=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(u,l,s);c.onload=function(){clearTimeout(n.transparentId),n.isTransitioning&&!(0,o.isEmptyArray)(n.toBeList)?n.toBeList=[n.toBeList[0]].concat(C(n.toBeList.slice(1).filter(function(t){return"image"===t.kind&&(Math.abs(t.width-l)>2||Math.abs(t.height-s)>2||t.tag!==u)}))):n.toBeList=[],n.toBeList.push({resource:c,width:l,height:s,kind:"image",tag:u}),n.run()},c.onerror=function(){Reflect.apply(N,t,[])},c.crossOrigin=r.crossOrigin}else Reflect.apply(N,this,[])}}function M(){var t=this.renderData;if(!(0,o.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 X(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 W(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function z(t){"@babel/helpers - typeof";return z="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},z(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,Y(n.key),n)}}function H(t,e,r){return(e=Y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(t){var e=function(t,e){if("object"!=z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==z(e)?e:e+""}var q=function(){return t=function t(e,r,n){var i,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),H(this,"quad",null),H(this,"lastRaindropsFallTime",0),H(this,"parentElement",void 0),H(this,"mutationObserver",void 0),H(this,"resizeObserver",void 0),H(this,"renderProgram",void 0),H(this,"imageSource",""),H(this,"dropProgram",void 0),H(this,"updateProgram",void 0),H(this,"textures",[]),H(this,"backgroundTexture",[]),H(this,"textureDelta",void 0),H(this,"framebuffers",[]),H(this,"bufferWriteIndex",0),H(this,"bufferReadIndex",1),H(this,"originStyle",void 0),H(this,"lastUseStyle",void 0),H(this,"events",{}),H(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(M,n,[]),this.originStyle=this.lastUseStyle=X(this.parentElement),this.mutationObserver=new MutationObserver(function(t){t.forEach(function(t){if(t.target===a.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(a.lastUseStyle),i=X(a.parentElement),l=Object.values(i);if((0,o.isEmptyArray)(v.enArr.difference(e,l)))return;var c=u(i.backgroundImage),f=s(i.backgroundColor);if(c&&f)return;a.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(M,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===a.parentElement&&Reflect.apply(r,n,[])})}),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(W,{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 $(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r,n,i,a=t.parentElement,l=window.getComputedStyle(a),s=l.backgroundSize,u=l.backgroundAttachment,c=l.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):K(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"===u?(h.height=window.innerHeight,h.left=window.screenX,h.top=window.screenY,h.width=window.innerWidth):(h.left=0,h.top=0,h.width=a.scrollWidth,h.height=a.scrollHeight);var p=e.backgroundInfo||{width:100,height:100},d=p.width,g=p.height;if("cover"===s){var m=Math.max(h.width/d,h.height/g);n=d*m,i=g*m}else if("contain"===s){var v=Math.min(h.width/d,h.height/g);n=d*v,i=g*v}else{var y=s.split(" ");n=y[0]||"",i=y[1]||n,K(n)?n=h.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),K(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 b=f&&f[0]||"0%",E=f&&f[1]||"0%";b=K(b)?(h.left+(h.width-Number(n))*parseFloat(b)/100).toString():(h.left+parseFloat(b)).toString(),E=K(E)?(h.top+(h.height-Number(i))*parseFloat(E)/100).toString():(h.top+parseFloat(E)).toString(),t.renderProgram.uniforms.topLeft=new Float32Array([-Number(b)/n,-Number(E)/i]),t.renderProgram.uniforms.bottomRight=new Float32Array([t.renderProgram.uniforms.topLeft[0]+a.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+a.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 K(t){return t.endsWith("%")}function V(){var t=this.gl,e=this.renderData;(0,o.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 Z(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.textures,i=e.backgroundTexture,a=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(l,this,[i,0]),Reflect.apply(l,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,a),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(V,this,[]),t.disable(t.BLEND)}}function J(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function Q(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.updateProgram,i=e.textures,a=e.framebuffers,s=e.bufferWriteIndex,u=e.bufferReadIndex,c=r.resolution;t.viewport(0,0,c,c),t.bindFramebuffer(t.FRAMEBUFFER,a[s]),Reflect.apply(l,this,[i[u]]),t.useProgram(n.id),Reflect.apply(V,this,[]),Reflect.apply(J,this,[])}}function tt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)){var i=e.parentElement,a=n.isTransitioning,l=r.running,s=r.idleFluctuations,u=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply($,this,[]),l?(u||(r.lastRunningState=!0,this.show()),s&&this.raindropsFall(),a&&this.fade(),Reflect.apply(Q,this,[]),Reflect.apply(Z,this,[])):u&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(tt,t,[])})}}function et(t,e,r){var n=this.renderData;if(!(0,o.isNull)(n)){var i=n.parentElement,a=window.getComputedStyle(i),l=parseInt(a.borderLeftWidth)||0,s=parseInt(a.borderTopWidth)||0,u=i.getBoundingClientRect(),c=t.clientX-u.left-l,f=t.clientY-u.top-s;this.drop(c,f,e,r)}}function rt(){var t=this,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.parentElement,i=e.events,a=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(et,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)a(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)a(e[r])},i.mousedown=function(t){return a(t,!0)},Object.keys(i).forEach(function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})})}}var nt="\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 it(){var t=this.gl,e=this.renderData;if(!(0,o.isNull)(e)){var r=e.textureDelta;e.dropProgram=a(nt,"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=a(nt,"\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=a("\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 ot(){var t=this.gl,e=this.renderData;if(!(0,o.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 at(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,o.isNull)(r)){var i=r.backgroundTexture,a=r.parentElement,l=n.backgroundInfo,s=l.width,u=l.height,c=function(t){return(0,o.isZero)(t&t-1)},f=c(s)&&c(u)?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),a.dataset.render_img=t.tag,a.dataset.render_width=t.width+"px",a.dataset.render_height=t.height+"px",e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function lt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)&&this.config){var i=e.textures,a=e.framebuffers,l=r.resolution,s=this.gl,u=1/l;e.textureDelta=new Float32Array([u,u]),this.config.extensions.forEach(function(t){return s.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=s.createTexture(),g=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,g),s.bindTexture(s.TEXTURE_2D,d),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,h.linearSupport?s.LINEAR:s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,h.linearSupport?s.LINEAR:s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,l,l,0,s.RGBA,h.type,f),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,d,0),i.push(d),a.push(g)}e.quad=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,e.quad),s.bufferData(s.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),s.STATIC_DRAW),Reflect.apply(it,this,[]),Reflect.apply(ot,this,[]),Reflect.apply(B,this,[]),s.clearColor(0,0,0,0),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(rt,this,[]),Reflect.apply(at,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(tt,t,[])})}}function st(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,a=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=a,Reflect.apply(B,this,[])}}function ut(){var t=this.renderData,e=this.fadeData;(0,o.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 ct(t,e,r,n){var i=this.renderData,a=this.options,s=this.gl;if(!(0,o.isNull)(i)){var u=i.parentElement,c=i.dropProgram,f=i.textures,h=i.framebuffers,p=i.bufferWriteIndex,d=i.bufferReadIndex,g=a.resolution,m=u.offsetWidth,v=u.offsetHeight,y=Math.max(m,v);r/=y;var b=new Float32Array([(2*t-m)/y,(v-2*e)/y]);s.viewport(0,0,g,g),s.bindFramebuffer(s.FRAMEBUFFER,h[p]),Reflect.apply(l,this,[f[d]]),s.useProgram(c.id),s.uniform2fv(c.locations.center,b),s.uniform1f(c.locations.radius,r),s.uniform1f(c.locations.strength,n),Reflect.apply(V,this,[]),Reflect.apply(J,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 ht(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,dt(n.key),n)}}function pt(t,e,r){return(e=dt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dt(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 gt(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 mt(t,e){return t.get(yt(t,e))}function vt(t,e,r){return t.set(yt(t,e),r),r}function yt(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,Et=new WeakMap,wt=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,kt=new WeakMap,St=new WeakMap,Pt=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),gt(this,bt,y.accelerating),gt(this,Et,y.interactive),gt(this,wt,y.resolution),gt(this,Rt,y.perturbance),gt(this,Tt,y.dropRadius),pt(this,"imgUrl",y.imgUrl),gt(this,kt,y.idleFluctuations),gt(this,St,y.raindropsTimeInterval),pt(this,"crossOrigin","no-cors"),pt(this,"visible",!1),pt(this,"running",!1),gt(this,Pt,void 0),pt(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,this.darkMode=e.darkMode},(e=[{key:"accelerating",get:function(){return mt(bt,this)},set:function(t){t>100||t<2||vt(bt,this,t)}},{key:"interactive",get:function(){return mt(Et,this)},set:function(t){(0,o.isBoolean)(t)&&vt(Et,this,t)}},{key:"resolution",get:function(){return mt(wt,this)},set:function(t){t<100||t>550||vt(wt,this,t)}},{key:"perturbance",get:function(){return mt(Rt,this)},set:function(t){t<1e-4||t>1||vt(Rt,this,t)}},{key:"dropRadius",get:function(){return mt(Tt,this)},set:function(t){!isFinite(t)||t<10||vt(Tt,this,t)}},{key:"idleFluctuations",get:function(){return mt(kt,this)},set:function(t){(0,o.isBoolean)(t)&&vt(kt,this,t)}},{key:"raindropsTimeInterval",get:function(){return mt(St,this)},set:function(t){t<10||t>12e3||vt(St,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}},{key:"darkMode",get:function(){return mt(Pt,this)},set:function(t){vt(Pt,this,(0,o.isUndefined)(t)?void 0:Boolean(t))}}])&&ht(t.prototype,e),r&&ht(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function _t(){var t=this.fadeData,e=this.options,r=this.renderData;if((0,o.isNull)(r))return!0;var n=e.imgUrl,i=r.lastUseStyle,a=t.lastDrawImage,l=t.backgroundInfo,s=l.width,u=l.height,c=a.tag,f=a.kind,h=F(e,i),p=a.width===s,d=a.height===u,g=p&&d;if("image"===f&&g&&(0,o.isString)(h)&&h===c)return!0;var m=(0,o.isArray)(n)&&n.join("_")||"";if("linear-gradient"===f&&g&&m===c)return!0;var v=U(e,i);return!("background-color"!==f||!g||c!==v)}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,[]);Reflect.apply(_t,t,[])||r.run()},2*e.raindropsTimeInterval)}function At(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,o.isNull)(t))return Reflect.apply(Ot,this,["还没有准备好,即将退出"]);if((0,o.isEmptyArray)(n))return Reflect.apply(Ot,this,["由于缺少当前渲染的背景,退出"]);if(0===e.drawProgress&&n.forEach(function(t){}),e.drawProgress>1e3){if(e.lastDrawImage=n.shift(),Reflect.apply(at,this,[e.lastDrawImage]),(0,o.isEmptyArray)(n)){var i=t.lastUseStyle;((0,o.isNull)(r.imgUrl)||(0,o.isBusinessEmptyString)(r.imgUrl)||(0,o.isZero)(r.imgUrl.length))&&s(i.backgroundColor)&&u(i.backgroundImage)&&Reflect.apply(I,this,[!1])}return Reflect.apply(Ot,this,["当前执行完毕,开启下次执行"])}var a=e.lastDrawImage,l=e.backgroundInfo;e.drawProgress+=18;var c=document.createElement("canvas"),f=c.getContext("2d");if((0,o.isNull)(f)||(0,o.isNull)(a.resource)||(0,o.isEmptyArray)(n))return Reflect.apply(Ot,this,"环境值错误");var h=l.width,p=l.height;c.width=h,c.height=p,f.clearRect(0,0,h,p),f.drawImage(a.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:c,width:h,height:p,kind:"mix",tag:"".concat(a.tag," >> ").concat(n[0].tag)};Reflect.apply(at,this,[d]),n.length>1&&(e.lastDrawImage=d,n.shift(),e.drawProgress=0)}function Ot(t){this.fadeData.isTransitioning=!1,Reflect.apply(xt,this,[])}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,Nt(n.key),n)}}function Ut(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e,r){return(e=Nt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nt(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+""}function Ct(t,e){return t.get(Lt(t,e))}function Lt(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,Mt=new WeakSet,Xt=function(){return t=function t(e){var r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ut(r=this,n=Mt),n.add(r),jt(this,"backgroundInfo",{width:0,height:0}),jt(this,"transparentId",setTimeout(Boolean)),jt(this,"lastDrawImage",void 0),jt(this,"toBeList",[]),jt(this,"drawProgress",0),jt(this,"isTransitioning",!1),function(t,e,r){Ut(t,e),e.set(t,r)}(this,Bt,void 0),jt(this,"isDark",!1);var i,a,l=e.renderData;if((0,o.isNull)(l))i=10,a=10;else{var s=getComputedStyle(l.parentElement);i=parseInt(s.width),a=parseInt(s.height)}this.backgroundInfo={width:i,height:a},this.lastDrawImage={resource:O(i,a),width:i,height:a,kind:"default",tag:""},function(t,e,r){t.set(Lt(t,e),r)}(Bt,this,window.matchMedia("(prefers-color-scheme: dark)")),this.isDark=Ct(Bt,this).matches,Ct(Bt,this).addEventListener("change",Lt(Mt,this,Wt));var u=this;Object.defineProperty(Ct(Bt,this),"isDark",{get:function(){return u.isDark},set:function(t){u.isDark=t,Reflect.apply(_t,e,[])||Reflect.apply(I,e,[!0])}})},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId),Ct(Bt,this).removeEventListener("change",Lt(Mt,this,Wt))}}])&&Ft(t.prototype,e),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Wt(t){this.isDark=t.matches}function zt(t){"@babel/helpers - typeof";return zt="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},zt(t)}function Gt(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 Ht(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gt(Object(r),!0).forEach(function(e){Jt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Yt(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 qt(t,e,r){return e=Kt(e),function(t,e){if(e&&("object"==zt(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,$t()?Reflect.construct(e,r||[],Kt(t).constructor):e.apply(t,r))}function $t(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($t=function(){return!!t})()}function Kt(t){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kt(t)}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(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 Jt(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"!=zt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==zt(e)?e:e+""}function te(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 ee=new WeakMap,re=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),Jt(n=qt(this,e,[t]),"renderData",null),Jt(n,"options",void 0),Jt(n,"fadeData",void 0),Jt(n,"defaults",y),Jt(n,"initialized",!1),Zt(n,ee,(0,v.debounce)(st,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new Dt(Ht(Ht({},n.defaults),r)),n.renderData=new q(t,n.reloadBackground,n),n.fadeData=new Xt(n),(0,o.isFalse)(n.initState)||(0,o.isNull)(t.parentElement)||(0,o.isNull)(n.config)||(0,o.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,i.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(lt,n,[])),window.matchMedia("(prefers-color-scheme: dark)"),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&&Vt(t,e)}(e,t),r=e,(n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,o.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,a=e.raindropsTimeInterval,l=e.dropRadius,s=Date.now();if(!(s-i<a)){t.lastRaindropsFallTime=s;var u=function(t){return(0,v.getRandomInt)(t)},c=n.width,f=n.height;this.drop(u(c),u(f),l,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(ct,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(At,this,[])}},{key:"reloadBackground",value:function(){te(ee,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(M,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(W,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(B,this,[])):"darkMode"===t?(this.options.darkMode=e,Reflect.apply(_t,this,[])||Reflect.apply(I,this,[!0])):this.options[t]=e}}])&&Yt(r.prototype,n),a&&Yt(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(m);function ne(t,e){var r=(0,n.useRef)(null);return(0,n.useEffect)(function(){if(!(0,o.isNull)(t.current))return r.current=new re(t.current,e),function(){var t;return null===(t=r.current)||void 0===t?void 0:t.destroy()}},[]),r}},713:()=>{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})}}]);
|
package/705/index.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@705/index.mjs
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
"use client";export const __webpack_esm_id__=705;export const __webpack_esm_ids__=[705];export const __webpack_esm_modules__={705:(t,e,r)=>{r.r(e),r.d(e,{useRipples:()=>ne});var n=r(649),i=r(666),o=r(362);function a(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 a,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 s=t+e,u=/uniform (\w+) (\w+)/g;!(0,o.isNull)(a=u.exec(s));){var c=a[2];l.locations[c]=r.getUniformLocation(l.id,c)}return l}function l(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 u(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 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 f(t){"@babel/helpers - typeof";return f="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},f(t)}function h(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,g(n.key),n)}}function p(t,e,r){return e&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e,r){return(e=g(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}var m=p(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,"canvas",void 0),d(this,"gl",void 0),d(this,"config",void 0),d(this,"initState",!0),this.canvas=e;var r=e.getContext("webgl");if((0,o.isNull)(r))return this.initState=!1,void(this.config=null);this.gl=r,this.config=Reflect.apply(c,this,[])}),v=r(161),b={imgUrl:null,resolution:360,dropRadius:12,perturbance:.01,interactive:!0,crossOrigin:"no-cors",playingState:!0,accelerating:1,raindropsTimeInterval:3600,idleFluctuations:!0,darkMode:void 0};Object.freeze(b);var y;r(713);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+""}function T(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 k(t,e,r){return t.set(_(t,e),r),r}function S(t,e){return t.get(_(t,e))}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")}function P(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 x=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={list:[],diameter:48,radius:0,cells:0};r.diameter%2!=0&&r.diameter++;var n=r.diameter,i=r.list,o=n/2;r.radius=o,r.cells=Math.pow(n,2);for(var a=0;a<n;a++){i[a]=[];for(var l=0;l<n;l++)i[a][l]=[0,0,0,0]}for(var s=0;s<=o;s++)for(var u=function(){var t=i[s][c],r=Math.ceil(Math.sqrt(Math.pow(s,2)+Math.pow(c,2)))<=o,n=e?10:255,a=e?25:190,l=r?e?160:120:e?160:180,u=r?e?230:160:e?250:240,f=function(){return(0,v.getRandomInt)(n,a)};t[0]=f(),t[1]=f(),t[2]=f(),t[3]=(0,v.getRandomInt)(l,u)},c=s;c<=o;c++)u();for(var f=0;f<=o;f++)for(var h=0;h<=f;h++)i[f][h]=i[h][f];for(var p=o;p<n;p++)for(var d=0;d<=o;d++)i[p][d]=i[n-p][d];for(var g=0;g<o;g++)for(var m=o;m<n;m++)i[g][m]=i[g][n-m];for(var b=o;b<n;b++)for(var y=o;y<n;y++)i[b][y]=i[b][n-y];var E=t%n;return r.list=[].concat(P(i.slice(E)),P(i.slice(0,E))),r},A=new(y=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),T(this,y,1),e=this,r="data",n=x(),(r=R(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{key:"build",value:function(t){S(y,this)>100&&k(y,this,0),this.data=x(k(y,this,S(y,this)+4),t)}}])&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function O(t,e){var r=document.createElement("canvas"),n=document.createElement("canvas"),i=r.getContext("2d"),a=n.getContext("2d");return(0,o.isNull)(i)||(0,o.isNull)(a)?r:(r.width=n.width=t||1,r.height=n.height=e||1,i.clearRect(0,0,t,e),a.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=A.data,o=i.diameter,a=i.list,l=t*o,s=0;s<n.length;s+=4){var u=s/4%l,c=u%t%o,f=Math.floor(u/t),h=a[c][f];n[s]=h[0],n[s+1]=h[1],n[s+2]=h[2],n[s+3]=h[3]}return r}(t,e),0,0),a.fillStyle="#ffffff",a.fillRect(0,0,t,e),a.drawImage(r,0,0,t||1,e||1),a.globalCompositeOperation="source-over",n)}function I(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this.fadeData,n=this.options,i=r.backgroundInfo,o=r.toBeList,a=i.width,l=i.height,s=(0,v.getRandomString)({length:8,includeNumbers:!0,includeUppercaseLetters:!0});A.build(null!==(t=n.darkMode)&&void 0!==t?t:r.isDark),o.push({resource:O(a,l),width:a,height:l,kind:"default",tag:s}),e&&r.run()}function F(t,e){var r,n,i=t.imgUrl;return(0,o.isString)(i)&&i||(r=e.backgroundImage,n=/url\(["']?([^"']*)["']?\)/.exec(r),(0,o.isNull)(n)?null:n[1])}function U(t,e){return(0,o.isArray)(t.imgUrl)&&1===t.imgUrl.length&&t.imgUrl[0]||e.backgroundColor}function j(){var t=this.renderData,e=this.fadeData,r=this.options;if((0,o.isNull)(t))return Reflect.apply(I,this,[]);var n=t.originStyle;if(s(n.backgroundColor)&&(!(0,o.isArray)(r.imgUrl)||1!==r.imgUrl.length))return Reflect.apply(I,this,[]);var i=document.createElement("canvas"),a=i.getContext("2d");if((0,o.isNull)(a))return Reflect.apply(I,this,[]);var l=e.backgroundInfo,u=l.width,c=l.height;i.width=u,i.height=c,a.clearRect(0,0,u,c);var f=U(r,n);a.beginPath(),a.fillStyle=f,a.fillRect(0,0,u,c),a.fill(),e.isTransitioning&&!(0,o.isEmptyArray)(e.toBeList)?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 N(){var t=this.fadeData,e=this.renderData,r=this.options;if((0,o.isNull)(e))return Reflect.apply(j,this,[]);var n=e.originStyle;if(!/linear-gradient\(.*\)/.test(n.backgroundImage)&&!(0,o.isArray)(r.imgUrl))return Reflect.apply(j,this,[]);var i=(0,o.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(j,this,[]);var a=document.createElement("canvas"),l=a.getContext("2d");if((0,o.isNull)(l))return Reflect.apply(j,this,[]);var s=t.backgroundInfo,u=s.width,c=s.height;a.width=u,a.height=c,l.fillStyle="#fff",l.fillRect(0,0,u,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,u,c),t.isTransitioning&&!(0,o.isEmptyArray)(t.toBeList)?t.toBeList=[t.toBeList[0]]:t.toBeList=[],t.toBeList.push({resource:a,kind:"linear-gradient",tag:i.join("_"),width:u,height:c}),t.run()}function C(t){return function(t){if(Array.isArray(t))return L(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 L(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)?L(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 L(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 B(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if((0,o.isNull)(e))Reflect.apply(N,this,[]);else{var i=e.lastUseStyle,a=n.backgroundInfo,l=a.width,s=a.height,u=F(r,i);if(e.imageSource=u,u){var c=function(t,e,r){var n=new Image(e,r);return n.width=e,n.height=r,n.src=t,n}(u,l,s);c.onload=function(){clearTimeout(n.transparentId),n.isTransitioning&&!(0,o.isEmptyArray)(n.toBeList)?n.toBeList=[n.toBeList[0]].concat(C(n.toBeList.slice(1).filter(function(t){return"image"===t.kind&&(Math.abs(t.width-l)>2||Math.abs(t.height-s)>2||t.tag!==u)}))):n.toBeList=[],n.toBeList.push({resource:c,width:l,height:s,kind:"image",tag:u}),n.run()},c.onerror=function(){Reflect.apply(N,t,[])},c.crossOrigin=r.crossOrigin}else Reflect.apply(N,this,[])}}function M(){var t=this.renderData;if(!(0,o.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 X(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 W(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.parentElement,r=t.originStyle;e.style.setProperty("background-image",r.inlineBackgroundImage),e.style.setProperty("background-color",r.inlineBackgroundColor)}}function z(t){"@babel/helpers - typeof";return z="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},z(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,Y(n.key),n)}}function H(t,e,r){return(e=Y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(t){var e=function(t,e){if("object"!=z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==z(e)?e:e+""}var q=function(){return t=function t(e,r,n){var i,a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),H(this,"quad",null),H(this,"lastRaindropsFallTime",0),H(this,"parentElement",void 0),H(this,"mutationObserver",void 0),H(this,"resizeObserver",void 0),H(this,"renderProgram",void 0),H(this,"imageSource",""),H(this,"dropProgram",void 0),H(this,"updateProgram",void 0),H(this,"textures",[]),H(this,"backgroundTexture",[]),H(this,"textureDelta",void 0),H(this,"framebuffers",[]),H(this,"bufferWriteIndex",0),H(this,"bufferReadIndex",1),H(this,"originStyle",void 0),H(this,"lastUseStyle",void 0),H(this,"events",{}),H(this,"animationFrameId",0),this.parentElement=null!==(i=e.parentElement)&&void 0!==i?i:document.body,Reflect.apply(M,n,[]),this.originStyle=this.lastUseStyle=X(this.parentElement),this.mutationObserver=new MutationObserver(function(t){t.forEach(function(t){if(t.target===a.parentElement&&"attributes"===t.type&&n.options.visible){var e=Object.values(a.lastUseStyle),i=X(a.parentElement),l=Object.values(i);if((0,o.isEmptyArray)(v.enArr.difference(e,l)))return;var c=u(i.backgroundImage),f=s(i.backgroundColor);if(c&&f)return;a.lastUseStyle=i,Reflect.apply(r,n,[]),Reflect.apply(M,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===a.parentElement&&Reflect.apply(r,n,[])})}),this.resizeObserver.observe(this.parentElement)},e=[{key:"destroy",value:function(){if(this.animationFrameId&&window.cancelAnimationFrame(this.animationFrameId),Reflect.apply(W,{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 $(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r,n,i,a=t.parentElement,l=window.getComputedStyle(a),s=l.backgroundSize,u=l.backgroundAttachment,c=l.backgroundPosition,f=/\s+/.test(r=c)?r.replace(/center/,"50%").replace(/top|left/,"0%").replace(/bottom/,"100%").replace(/\s+/," ").split(" "):K(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"===u?(h.height=window.innerHeight,h.left=window.screenX,h.top=window.screenY,h.width=window.innerWidth):(h.left=0,h.top=0,h.width=a.scrollWidth,h.height=a.scrollHeight);var p=e.backgroundInfo||{width:100,height:100},d=p.width,g=p.height;if("cover"===s){var m=Math.max(h.width/d,h.height/g);n=d*m,i=g*m}else if("contain"===s){var v=Math.min(h.width/d,h.height/g);n=d*v,i=g*v}else{var b=s.split(" ");n=b[0]||"",i=b[1]||n,K(n)?n=h.width*parseFloat(n)/100:"auto"!==n&&(n=parseFloat(n)),K(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=K(y)?(h.left+(h.width-Number(n))*parseFloat(y)/100).toString():(h.left+parseFloat(y)).toString(),E=K(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]+a.clientWidth/n,t.renderProgram.uniforms.topLeft[1]+a.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 K(t){return t.endsWith("%")}function V(){var t=this.gl,e=this.renderData;(0,o.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 Z(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.textures,i=e.backgroundTexture,a=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(l,this,[i,0]),Reflect.apply(l,this,[n[0],1]),t.uniform1f(e.renderProgram.locations.perturbance,a),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(V,this,[]),t.disable(t.BLEND)}}function J(){var t=this.renderData;if(!(0,o.isNull)(t)){var e=t.bufferWriteIndex,r=t.bufferReadIndex;t.bufferWriteIndex=1-e,t.bufferReadIndex=1-r}}function Q(){var t=this.gl,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.updateProgram,i=e.textures,a=e.framebuffers,s=e.bufferWriteIndex,u=e.bufferReadIndex,c=r.resolution;t.viewport(0,0,c,c),t.bindFramebuffer(t.FRAMEBUFFER,a[s]),Reflect.apply(l,this,[i[u]]),t.useProgram(n.id),Reflect.apply(V,this,[]),Reflect.apply(J,this,[])}}function tt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)){var i=e.parentElement,a=n.isTransitioning,l=r.running,s=r.idleFluctuations,u=r.lastRunningState,c=getComputedStyle(i);n.backgroundInfo={width:parseInt(c.width),height:parseInt(c.height)},Reflect.apply($,this,[]),l?(u||(r.lastRunningState=!0,this.show()),s&&this.raindropsFall(),a&&this.fade(),Reflect.apply(Q,this,[]),Reflect.apply(Z,this,[])):u&&(r.lastRunningState=!1,this.hide()),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(tt,t,[])})}}function et(t,e,r){var n=this.renderData;if(!(0,o.isNull)(n)){var i=n.parentElement,a=window.getComputedStyle(i),l=parseInt(a.borderLeftWidth)||0,s=parseInt(a.borderTopWidth)||0,u=i.getBoundingClientRect(),c=t.clientX-u.left-l,f=t.clientY-u.top-s;this.drop(c,f,e,r)}}function rt(){var t=this,e=this.renderData,r=this.options;if(!(0,o.isNull)(e)){var n=e.parentElement,i=e.events,a=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(et,t,[n,r.dropRadius*(i?1.5:1),i?.03:.01]))};i.mousemove=function(t){for(var e=r.accelerating;e--;)a(t)},i.touchmove=i.touchstart=function(t){for(var e=t.touches,r=0;r<e.length;r++)a(e[r])},i.mousedown=function(t){return a(t,!0)},Object.keys(i).forEach(function(t){return null==n?void 0:n.addEventListener(t,i[t],{passive:!0})})}}var nt="\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 it(){var t=this.gl,e=this.renderData;if(!(0,o.isNull)(e)){var r=e.textureDelta;e.dropProgram=a(nt,"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=a(nt,"\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=a("\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 ot(){var t=this.gl,e=this.renderData;if(!(0,o.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 at(t){var e=this.gl,r=this.renderData,n=this.fadeData;if(!(0,o.isNull)(r)){var i=r.backgroundTexture,a=r.parentElement,l=n.backgroundInfo,s=l.width,u=l.height,c=function(t){return(0,o.isZero)(t&t-1)},f=c(s)&&c(u)?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),a.dataset.render_img=t.tag,a.dataset.render_width=t.width+"px",a.dataset.render_height=t.height+"px",e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.resource)}}function lt(){var t=this,e=this.renderData,r=this.options,n=this.fadeData;if(!(0,o.isNull)(e)&&this.config){var i=e.textures,a=e.framebuffers,l=r.resolution,s=this.gl,u=1/l;e.textureDelta=new Float32Array([u,u]),this.config.extensions.forEach(function(t){return s.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=s.createTexture(),g=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,g),s.bindTexture(s.TEXTURE_2D,d),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,h.linearSupport?s.LINEAR:s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,h.linearSupport?s.LINEAR:s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,l,l,0,s.RGBA,h.type,f),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,d,0),i.push(d),a.push(g)}e.quad=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,e.quad),s.bufferData(s.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,1,1,-1,1]),s.STATIC_DRAW),Reflect.apply(it,this,[]),Reflect.apply(ot,this,[]),Reflect.apply(B,this,[]),s.clearColor(0,0,0,0),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),r.visible=!0,r.running=!0,Reflect.apply(rt,this,[]),Reflect.apply(at,this,[n.lastDrawImage]),e.animationFrameId=requestAnimationFrame(function(){return Reflect.apply(tt,t,[])})}}function st(){var t=this.renderData,e=this.fadeData;if(!(0,o.isNull)(t)){var r=t.parentElement,n=e.backgroundInfo,i=r.offsetWidth,a=r.offsetHeight;this.canvas.width=n.width=i,this.canvas.height=n.height=a,Reflect.apply(B,this,[])}}function ut(){var t=this.renderData,e=this.fadeData;(0,o.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 ct(t,e,r,n){var i=this.renderData,a=this.options,s=this.gl;if(!(0,o.isNull)(i)){var u=i.parentElement,c=i.dropProgram,f=i.textures,h=i.framebuffers,p=i.bufferWriteIndex,d=i.bufferReadIndex,g=a.resolution,m=u.offsetWidth,v=u.offsetHeight,b=Math.max(m,v);r/=b;var y=new Float32Array([(2*t-m)/b,(v-2*e)/b]);s.viewport(0,0,g,g),s.bindFramebuffer(s.FRAMEBUFFER,h[p]),Reflect.apply(l,this,[f[d]]),s.useProgram(c.id),s.uniform2fv(c.locations.center,y),s.uniform1f(c.locations.radius,r),s.uniform1f(c.locations.strength,n),Reflect.apply(V,this,[]),Reflect.apply(J,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 ht(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,dt(n.key),n)}}function pt(t,e,r){return(e=dt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dt(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 gt(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 mt(t,e){return t.get(bt(t,e))}function vt(t,e,r){return t.set(bt(t,e),r),r}function bt(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 yt=new WeakMap,Et=new WeakMap,wt=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,kt=new WeakMap,St=new WeakMap,_t=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),gt(this,yt,b.accelerating),gt(this,Et,b.interactive),gt(this,wt,b.resolution),gt(this,Rt,b.perturbance),gt(this,Tt,b.dropRadius),pt(this,"imgUrl",b.imgUrl),gt(this,kt,b.idleFluctuations),gt(this,St,b.raindropsTimeInterval),pt(this,"crossOrigin","no-cors"),pt(this,"visible",!1),pt(this,"running",!1),gt(this,_t,void 0),pt(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,this.darkMode=e.darkMode},(e=[{key:"accelerating",get:function(){return mt(yt,this)},set:function(t){t>100||t<2||vt(yt,this,t)}},{key:"interactive",get:function(){return mt(Et,this)},set:function(t){(0,o.isBoolean)(t)&&vt(Et,this,t)}},{key:"resolution",get:function(){return mt(wt,this)},set:function(t){t<100||t>550||vt(wt,this,t)}},{key:"perturbance",get:function(){return mt(Rt,this)},set:function(t){t<1e-4||t>1||vt(Rt,this,t)}},{key:"dropRadius",get:function(){return mt(Tt,this)},set:function(t){!isFinite(t)||t<10||vt(Tt,this,t)}},{key:"idleFluctuations",get:function(){return mt(kt,this)},set:function(t){(0,o.isBoolean)(t)&&vt(kt,this,t)}},{key:"raindropsTimeInterval",get:function(){return mt(St,this)},set:function(t){t<10||t>12e3||vt(St,this,t)}},{key:"playingState",get:function(){return this.running},set:function(t){this.running=Boolean(null==t||t)}},{key:"darkMode",get:function(){return mt(_t,this)},set:function(t){vt(_t,this,(0,o.isUndefined)(t)?void 0:Boolean(t))}}])&&ht(t.prototype,e),r&&ht(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Dt(){var t=this.fadeData,e=this.options,r=this.renderData;if((0,o.isNull)(r))return!0;var n=e.imgUrl,i=r.lastUseStyle,a=t.lastDrawImage,l=t.backgroundInfo,s=l.width,u=l.height,c=a.tag,f=a.kind,h=F(e,i),p=a.width===s,d=a.height===u,g=p&&d;if("image"===f&&g&&(0,o.isString)(h)&&h===c)return!0;var m=(0,o.isArray)(n)&&n.join("_")||"";if("linear-gradient"===f&&g&&m===c)return!0;var v=U(e,i);return!("background-color"!==f||!g||c!==v)}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,[]);Reflect.apply(Dt,t,[])||r.run()},2*e.raindropsTimeInterval)}function At(){var t=this.renderData,e=this.fadeData,r=this.options,n=e.toBeList;if((0,o.isNull)(t))return Reflect.apply(Ot,this,["还没有准备好,即将退出"]);if((0,o.isEmptyArray)(n))return Reflect.apply(Ot,this,["由于缺少当前渲染的背景,退出"]);if(0===e.drawProgress&&n.forEach(function(t){}),e.drawProgress>1e3){if(e.lastDrawImage=n.shift(),Reflect.apply(at,this,[e.lastDrawImage]),(0,o.isEmptyArray)(n)){var i=t.lastUseStyle;((0,o.isNull)(r.imgUrl)||(0,o.isBusinessEmptyString)(r.imgUrl)||(0,o.isZero)(r.imgUrl.length))&&s(i.backgroundColor)&&u(i.backgroundImage)&&Reflect.apply(I,this,[!1])}return Reflect.apply(Ot,this,["当前执行完毕,开启下次执行"])}var a=e.lastDrawImage,l=e.backgroundInfo;e.drawProgress+=18;var c=document.createElement("canvas"),f=c.getContext("2d");if((0,o.isNull)(f)||(0,o.isNull)(a.resource)||(0,o.isEmptyArray)(n))return Reflect.apply(Ot,this,"环境值错误");var h=l.width,p=l.height;c.width=h,c.height=p,f.clearRect(0,0,h,p),f.drawImage(a.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:c,width:h,height:p,kind:"mix",tag:"".concat(a.tag," >> ").concat(n[0].tag)};Reflect.apply(at,this,[d]),n.length>1&&(e.lastDrawImage=d,n.shift(),e.drawProgress=0)}function Ot(t){this.fadeData.isTransitioning=!1,Reflect.apply(xt,this,[])}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,Nt(n.key),n)}}function Ut(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e,r){return(e=Nt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nt(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+""}function Ct(t,e){return t.get(Lt(t,e))}function Lt(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,Mt=new WeakSet,Xt=function(){return t=function t(e){var r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ut(r=this,n=Mt),n.add(r),jt(this,"backgroundInfo",{width:0,height:0}),jt(this,"transparentId",setTimeout(Boolean)),jt(this,"lastDrawImage",void 0),jt(this,"toBeList",[]),jt(this,"drawProgress",0),jt(this,"isTransitioning",!1),function(t,e,r){Ut(t,e),e.set(t,r)}(this,Bt,void 0),jt(this,"isDark",!1);var i,a,l=e.renderData;if((0,o.isNull)(l))i=10,a=10;else{var s=getComputedStyle(l.parentElement);i=parseInt(s.width),a=parseInt(s.height)}this.backgroundInfo={width:i,height:a},this.lastDrawImage={resource:O(i,a),width:i,height:a,kind:"default",tag:""},function(t,e,r){t.set(Lt(t,e),r)}(Bt,this,window.matchMedia("(prefers-color-scheme: dark)")),this.isDark=Ct(Bt,this).matches,Ct(Bt,this).addEventListener("change",Lt(Mt,this,Wt));var u=this;Object.defineProperty(Ct(Bt,this),"isDark",{get:function(){return u.isDark},set:function(t){u.isDark=t,Reflect.apply(Dt,e,[])||Reflect.apply(I,e,[!0])}})},(e=[{key:"run",value:function(){this.isTransitioning||(this.drawProgress=0,this.isTransitioning=!0)}},{key:"destroy",value:function(){this.transparentId&&clearTimeout(this.transparentId),Ct(Bt,this).removeEventListener("change",Lt(Mt,this,Wt))}}])&&Ft(t.prototype,e),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Wt(t){this.isDark=t.matches}function zt(t){"@babel/helpers - typeof";return zt="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},zt(t)}function Gt(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 Ht(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gt(Object(r),!0).forEach(function(e){Jt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Yt(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 qt(t,e,r){return e=Kt(e),function(t,e){if(e&&("object"==zt(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,$t()?Reflect.construct(e,r||[],Kt(t).constructor):e.apply(t,r))}function $t(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($t=function(){return!!t})()}function Kt(t){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kt(t)}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(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 Jt(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"!=zt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==zt(e)?e:e+""}function te(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 ee=new WeakMap,re=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),Jt(n=qt(this,e,[t]),"renderData",null),Jt(n,"options",void 0),Jt(n,"fadeData",void 0),Jt(n,"defaults",b),Jt(n,"initialized",!1),Zt(n,ee,(0,v.debounce)(st,{this:n})),Object.defineProperties(n,{defaults:{value:n.defaults,writable:!1,enumerable:!1,configurable:!1}}),n.options=new Pt(Ht(Ht({},n.defaults),r)),n.renderData=new q(t,n.reloadBackground,n),n.fadeData=new Xt(n),(0,o.isFalse)(n.initState)||(0,o.isNull)(t.parentElement)||(0,o.isNull)(n.config)||(0,o.isNull)(n.gl)?n.initState=!1:(!function(t){var e=t.parentElement;t.width=e.clientWidth,t.height=e.clientHeight,(0,i.setStyle)(t,{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:-1,pointerEvents:"none"})}(t),Reflect.apply(lt,n,[])),window.matchMedia("(prefers-color-scheme: dark)"),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&&Vt(t,e)}(e,t),r=e,(n=[{key:"raindropsFall",value:function(){var t=this.renderData,e=this.options,r=this.fadeData;if(!(0,o.isNull)(t)){var n=r.backgroundInfo,i=t.lastRaindropsFallTime,a=e.raindropsTimeInterval,l=e.dropRadius,s=Date.now();if(!(s-i<a)){t.lastRaindropsFallTime=s;var u=function(t){return(0,v.getRandomInt)(t)},c=n.width,f=n.height;this.drop(u(c),u(f),l,.03)}}}},{key:"drop",value:function(t,e,r,n){Reflect.apply(ct,this,[t,e,r,n])}},{key:"fade",value:function(){Reflect.apply(At,this,[])}},{key:"reloadBackground",value:function(){te(ee,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(M,this,[])}},{key:"hide",value:function(){this.options.visible=!1,this.canvas.style.visibility="hidden",Reflect.apply(W,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(B,this,[])):"darkMode"===t?(this.options.darkMode=e,Reflect.apply(Dt,this,[])||Reflect.apply(I,this,[!0])):this.options[t]=e}}])&&Yt(r.prototype,n),a&&Yt(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(m);function ne(t,e){var r=(0,n.useRef)(null);return(0,n.useEffect)(function(){if(!(0,o.isNull)(t.current))return r.current=new re(t.current,e),function(){var t;return null===(t=r.current)||void 0===t?void 0:t.destroy()}},[]),r}},713:()=>{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})}};
|