beautiful-backgrounds 0.0.7 → 1.0.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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -76
  3. package/build/bb.es.js +3038 -0
  4. package/build/bb.es.js.map +1 -0
  5. package/build/bb.js +9 -0
  6. package/build/bb.js.map +1 -0
  7. package/build/index.d.ts +7 -0
  8. package/build/src/BeautifulBackground.d.ts +25 -0
  9. package/build/src/Particle.d.ts +53 -0
  10. package/build/src/Symbol.d.ts +7 -0
  11. package/build/src/components/ambientRibbon.d.ts +25 -0
  12. package/{dist/components/DigitalRain.d.ts → build/src/components/digitalRain.d.ts} +13 -11
  13. package/build/src/components/hexagonWave.d.ts +29 -0
  14. package/build/src/components/liquidLines.d.ts +24 -0
  15. package/build/src/components/neonRails.d.ts +31 -0
  16. package/build/src/components/startTrail.d.ts +33 -0
  17. package/build/src/stories/AmbientRibbon.stories.d.ts +16 -0
  18. package/build/src/stories/DigitalRain.stories.d.ts +13 -0
  19. package/build/src/stories/HexagonWave.stories.d.ts +19 -0
  20. package/build/src/stories/LiquidLines.stories.d.ts +17 -0
  21. package/build/src/stories/NeonRails.stories.d.ts +20 -0
  22. package/build/src/stories/StartTrail.stories.d.ts +20 -0
  23. package/build/src/utils/color.d.ts +2 -0
  24. package/build/src/utils/function.d.ts +1 -0
  25. package/build/src/utils/lit.d.ts +2 -0
  26. package/{dist → build/src}/utils/number.d.ts +0 -1
  27. package/build/vite.svg +1 -0
  28. package/package.json +53 -27
  29. package/dist/beautiful-backgrounds.min.js +0 -1
  30. package/dist/components/BeautifulBackground.d.ts +0 -28
  31. package/dist/components/BeautifulBackground.js +0 -110
  32. package/dist/components/DigitalRain.js +0 -85
  33. package/dist/components/Particle.d.ts +0 -18
  34. package/dist/components/Particle.js +0 -44
  35. package/dist/components/StarTrail.d.ts +0 -30
  36. package/dist/components/StarTrail.js +0 -95
  37. package/dist/components/Symbol.d.ts +0 -7
  38. package/dist/components/Symbol.js +0 -18
  39. package/dist/index.d.ts +0 -2
  40. package/dist/index.js +0 -2
  41. package/dist/utils/color.d.ts +0 -1
  42. package/dist/utils/color.js +0 -7
  43. package/dist/utils/number.js +0 -20
  44. package/dist/utils/object.js +0 -9
  45. /package/{dist → build/src}/utils/object.d.ts +0 -0
package/build/bb.js ADDED
@@ -0,0 +1,9 @@
1
+ (function(u,k){typeof exports=="object"&&typeof module<"u"?k(exports):typeof define=="function"&&define.amd?define(["exports"],k):(u=typeof globalThis<"u"?globalThis:u||self,k(u.bb={}))})(this,(function(u){"use strict";const k=globalThis,Ut=k.ShadowRoot&&(k.ShadyCSS===void 0||k.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wt=Symbol(),de=new WeakMap;let be=class{constructor(t,i,n){if(this._$cssResult$=!0,n!==Wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const i=this.t;if(Ut&&t===void 0){const n=i!==void 0&&i.length===1;n&&(t=de.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&de.set(i,t))}return t}toString(){return this.cssText}};const mi=e=>new be(typeof e=="string"?e:e+"",void 0,Wt),_i=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((n,r,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[s+1],e[0]);return new be(i,e,Wt)},vi=(e,t)=>{if(Ut)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),r=k.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=i.cssText,e.appendChild(n)}},ge=Ut?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return mi(i)})(e):e;const{is:wi,defineProperty:xi,getOwnPropertyDescriptor:Si,getOwnPropertyNames:$i,getOwnPropertySymbols:Ai,getPrototypeOf:Ci}=Object,wt=globalThis,ye=wt.trustedTypes,Mi=ye?ye.emptyScript:"",Ni=wt.reactiveElementPolyfillSupport,rt=(e,t)=>e,xt={toAttribute(e,t){switch(t){case Boolean:e=e?Mi:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Xt=(e,t)=>!wi(e,t),me={attribute:!0,type:String,converter:xt,reflect:!1,useDefault:!1,hasChanged:Xt};Symbol.metadata??=Symbol("metadata"),wt.litPropertyMetadata??=new WeakMap;let G=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=me){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(t,n,i);r!==void 0&&xi(this.prototype,t,r)}}static getPropertyDescriptor(t,i,n){const{get:r,set:s}=Si(this.prototype,t)??{get(){return this[i]},set(o){this[i]=o}};return{get:r,set(o){const a=r?.call(this);s?.call(this,o),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??me}static _$Ei(){if(this.hasOwnProperty(rt("elementProperties")))return;const t=Ci(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(rt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rt("properties"))){const i=this.properties,n=[...$i(i),...Ai(i)];for(const r of n)this.createProperty(r,i[r])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,r]of i)this.elementProperties.set(n,r)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const r=this._$Eu(i,n);r!==void 0&&this._$Eh.set(r,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const r of n)i.unshift(ge(r))}else t!==void 0&&i.push(ge(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return vi(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$ET(t,i){const n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(r!==void 0&&n.reflect===!0){const s=(n.converter?.toAttribute!==void 0?n.converter:xt).toAttribute(i,n.type);this._$Em=t,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(t,i){const n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const s=n.getPropertyOptions(r),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:xt;this._$Em=r;const a=o.fromAttribute(i,s.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,i,n,r=!1,s){if(t!==void 0){const o=this.constructor;if(r===!1&&(s=this[t]),n??=o.getPropertyOptions(t),!((n.hasChanged??Xt)(s,i)||n.useDefault&&n.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,n))))return;this.C(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:n,reflect:r,wrapped:s},o){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??i??this[t]),s!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(i=void 0),this._$AL.set(t,i)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,s]of n){const{wrapped:o}=s,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,s,a)}}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(i)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach(i=>i.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(i=>this._$ET(i,this[i])),this._$EM()}updated(t){}firstUpdated(t){}};G.elementStyles=[],G.shadowRootOptions={mode:"open"},G[rt("elementProperties")]=new Map,G[rt("finalized")]=new Map,Ni?.({ReactiveElement:G}),(wt.reactiveElementVersions??=[]).push("2.1.2");const Yt=globalThis,_e=e=>e,St=Yt.trustedTypes,ve=St?St.createPolicy("lit-html",{createHTML:e=>e}):void 0,we="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,xe="?"+F,Ei=`<${xe}>`,q=document,st=()=>q.createComment(""),ot=e=>e===null||typeof e!="object"&&typeof e!="function",Vt=Array.isArray,Ri=e=>Vt(e)||typeof e?.[Symbol.iterator]=="function",Gt=`[
2
+ \f\r]`,at=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Se=/-->/g,$e=/>/g,U=RegExp(`>|${Gt}(?:([^\\s"'>=/]+)(${Gt}*=${Gt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ae=/'/g,Ce=/"/g,Me=/^(?:script|style|textarea|title)$/i,K=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),Ne=new WeakMap,W=q.createTreeWalker(q,129);function Ee(e,t){if(!Vt(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return ve!==void 0?ve.createHTML(t):t}const Bi=(e,t)=>{const i=e.length-1,n=[];let r,s=t===2?"<svg>":t===3?"<math>":"",o=at;for(let a=0;a<i;a++){const h=e[a];let l,c,f=-1,d=0;for(;d<h.length&&(o.lastIndex=d,c=o.exec(h),c!==null);)d=o.lastIndex,o===at?c[1]==="!--"?o=Se:c[1]!==void 0?o=$e:c[2]!==void 0?(Me.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=U):c[3]!==void 0&&(o=U):o===U?c[0]===">"?(o=r??at,f=-1):c[1]===void 0?f=-2:(f=o.lastIndex-c[2].length,l=c[1],o=c[3]===void 0?U:c[3]==='"'?Ce:Ae):o===Ce||o===Ae?o=U:o===Se||o===$e?o=at:(o=U,r=void 0);const b=o===U&&e[a+1].startsWith("/>")?" ":"";s+=o===at?h+Ei:f>=0?(n.push(l),h.slice(0,f)+we+h.slice(f)+F+b):h+F+(f===-2?a:b)}return[Ee(e,s+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]};class ht{constructor({strings:t,_$litType$:i},n){let r;this.parts=[];let s=0,o=0;const a=t.length-1,h=this.parts,[l,c]=Bi(t,i);if(this.el=ht.createElement(l,n),W.currentNode=this.el.content,i===2||i===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(r=W.nextNode())!==null&&h.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const f of r.getAttributeNames())if(f.endsWith(we)){const d=c[o++],b=r.getAttribute(f).split(F),g=/([.?@])?(.*)/.exec(d);h.push({type:1,index:s,name:g[2],strings:b,ctor:g[1]==="."?Hi:g[1]==="?"?Li:g[1]==="@"?Ti:$t}),r.removeAttribute(f)}else f.startsWith(F)&&(h.push({type:6,index:s}),r.removeAttribute(f));if(Me.test(r.tagName)){const f=r.textContent.split(F),d=f.length-1;if(d>0){r.textContent=St?St.emptyScript:"";for(let b=0;b<d;b++)r.append(f[b],st()),W.nextNode(),h.push({type:2,index:++s});r.append(f[d],st())}}}else if(r.nodeType===8)if(r.data===xe)h.push({type:2,index:s});else{let f=-1;for(;(f=r.data.indexOf(F,f+1))!==-1;)h.push({type:7,index:s}),f+=F.length-1}s++}}static createElement(t,i){const n=q.createElement("template");return n.innerHTML=t,n}}function Z(e,t,i=e,n){if(t===K)return t;let r=n!==void 0?i._$Co?.[n]:i._$Cl;const s=ot(t)?void 0:t._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(e),r._$AT(e,i,n)),n!==void 0?(i._$Co??=[])[n]=r:i._$Cl=r),r!==void 0&&(t=Z(e,r._$AS(e,t.values),r,n)),t}class Pi{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:n}=this._$AD,r=(t?.creationScope??q).importNode(i,!0);W.currentNode=r;let s=W.nextNode(),o=0,a=0,h=n[0];for(;h!==void 0;){if(o===h.index){let l;h.type===2?l=new lt(s,s.nextSibling,this,t):h.type===1?l=new h.ctor(s,h.name,h.strings,this,t):h.type===6&&(l=new Oi(s,this,t)),this._$AV.push(l),h=n[++a]}o!==h?.index&&(s=W.nextNode(),o++)}return W.currentNode=q,r}p(t){let i=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,i),i+=n.strings.length-2):n._$AI(t[i])),i++}}class lt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,n,r){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Z(this,t,i),ot(t)?t===v||t==null||t===""?(this._$AH!==v&&this._$AR(),this._$AH=v):t!==this._$AH&&t!==K&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ri(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==v&&ot(this._$AH)?this._$AA.nextSibling.data=t:this.T(q.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:n}=t,r=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=ht.createElement(Ee(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(i);else{const s=new Pi(r,this),o=s.u(this.options);s.p(i),this.T(o),this._$AH=s}}_$AC(t){let i=Ne.get(t.strings);return i===void 0&&Ne.set(t.strings,i=new ht(t)),i}k(t){Vt(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let n,r=0;for(const s of t)r===i.length?i.push(n=new lt(this.O(st()),this.O(st()),this,this.options)):n=i[r],n._$AI(s),r++;r<i.length&&(this._$AR(n&&n._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){const n=_e(t).nextSibling;_e(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class $t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,n,r,s){this.type=1,this._$AH=v,this._$AN=void 0,this.element=t,this.name=i,this._$AM=r,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=v}_$AI(t,i=this,n,r){const s=this.strings;let o=!1;if(s===void 0)t=Z(this,t,i,0),o=!ot(t)||t!==this._$AH&&t!==K,o&&(this._$AH=t);else{const a=t;let h,l;for(t=s[0],h=0;h<s.length-1;h++)l=Z(this,a[n+h],i,h),l===K&&(l=this._$AH[h]),o||=!ot(l)||l!==this._$AH[h],l===v?t=v:t!==v&&(t+=(l??"")+s[h+1]),this._$AH[h]=l}o&&!r&&this.j(t)}j(t){t===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Hi extends $t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===v?void 0:t}}class Li extends $t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==v)}}class Ti extends $t{constructor(t,i,n,r,s){super(t,i,n,r,s),this.type=5}_$AI(t,i=this){if((t=Z(this,t,i,0)??v)===K)return;const n=this._$AH,r=t===v&&n!==v||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==v&&(n===v||r);r&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Oi{constructor(t,i,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const zi=Yt.litHtmlPolyfillSupport;zi?.(ht,lt),(Yt.litHtmlVersions??=[]).push("3.3.2");const Di=(e,t,i)=>{const n=i?.renderBefore??t;let r=n._$litPart$;if(r===void 0){const s=i?.renderBefore??null;n._$litPart$=r=new lt(t.insertBefore(st(),s),s,void 0,i??{})}return r._$AI(e),r};const Kt=globalThis;class ct extends G{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Di(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}}ct._$litElement$=!0,ct.finalized=!0,Kt.litElementHydrateSupport?.({LitElement:ct});const ki=Kt.litElementPolyfillSupport;ki?.({LitElement:ct}),(Kt.litElementVersions??=[]).push("4.2.2");const J=e=>(t,i)=>{i!==void 0?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const Fi={attribute:!0,type:String,converter:xt,reflect:!1,hasChanged:Xt},Ii=(e=Fi,t,i)=>{const{kind:n,metadata:r}=i;let s=globalThis.litPropertyMetadata.get(r);if(s===void 0&&globalThis.litPropertyMetadata.set(r,s=new Map),n==="setter"&&((e=Object.create(e)).wrapped=!0),s.set(i.name,e),n==="accessor"){const{name:o}=i;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,e,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,e,a),a}}}if(n==="setter"){const{name:o}=i;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,e,!0,a)}}throw Error("Unsupported decorator location: "+n)};function p(e){return(t,i)=>typeof i=="object"?Ii(e,t,i):((n,r,s)=>{const o=r.hasOwnProperty(s);return r.constructor.createProperty(s,n),o?Object.getOwnPropertyDescriptor(r,s):void 0})(e,t,i)}function qi(e,t){let i;return function(...n){clearTimeout(i),i=setTimeout(()=>e.apply(this,n),t)}}const Q={fromAttribute:e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[],toAttribute:e=>e.join(",")};var Ui=Object.defineProperty,At=(e,t,i,n)=>{for(var r=void 0,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=o(t,i,r)||r);return r&&Ui(t,i,r),r};const fe=class fe extends ct{constructor(){super(),this.bgColors=["#000","#000"],this.bgAngle=0,this.backgroundColor="0, 0, 0",this.width=0,this.height=0,this.animationFrameId=null,this.trailOpacity=.1,this.handleVisibilityChange=()=>{document.visibilityState==="hidden"?this.stopAnimation():this.startAnimation()},this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.debouncedResize=qi(this.resizeCanvas.bind(this),100)}firstUpdated(){this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(this.canvas),this.resizeCanvas(),this.initialize(),this.startAnimation(),window.addEventListener("resize",this.debouncedResize),document.addEventListener("visibilitychange",this.handleVisibilityChange)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.debouncedResize),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.stopAnimation()}drawBackground(t){const i=this.bgAngle*Math.PI/180,r=Math.sqrt(this.width**2+this.height**2)/2,s=this.width/2,o=this.height/2,a=s-Math.cos(i)*r,h=o-Math.sin(i)*r,l=s+Math.cos(i)*r,c=o+Math.sin(i)*r,f=t.createLinearGradient(a,h,l,c),d=this.bgColors.length>0?this.bgColors:["#000","#000"];try{d.forEach((b,g)=>{const y=g/(d.length-1||1);f.addColorStop(y,b)})}catch{f.addColorStop(0,"#000"),f.addColorStop(1,"#000")}t.fillStyle=f,t.fillRect(0,0,this.width,this.height)}resizeCanvas(){const t=this.getBoundingClientRect(),i=window.devicePixelRatio||1;t.width===this.width&&t.height===this.height||(this.width=t.width,this.height=t.height,this.canvas.width=Math.floor(this.width*i),this.canvas.height=Math.floor(this.height*i),this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.style.borderRadius="inherit",this.ctx.scale(i,i),this.drawBackground(this.ctx))}initialize(){}startAnimation(){if(this.animationFrameId!==null)return;let t=performance.now();const i=n=>{const r=(n-t)/1e3;t=n,this.loop(r),this.animationFrameId=requestAnimationFrame(i)};this.animationFrameId=requestAnimationFrame(i)}stopAnimation(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}render(){}};fe.styles=_i`
4
+ :host {
5
+ border-radius: inherit;
6
+ display: flex;
7
+ }
8
+ `;let C=fe;At([p({type:Array,attribute:"bg-colors",converter:Q})],C.prototype,"bgColors"),At([p({type:Number,attribute:"bg-angle"})],C.prototype,"bgAngle"),At([p({type:String,attribute:"background-color"})],C.prototype,"backgroundColor"),At([p({type:Number,attribute:"trail-opacity"})],C.prototype,"trailOpacity");function M(e,t){return Math.random()*(t-e)+e}function Ct(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}function Zt(e=[0,360],t=[0,100],i=[40,60]){const n=Ct(e[0],e[1]),r=Ct(t[0],t[1]),s=Ct(i[0],i[1]);return`hsl(${n}, ${r}%, ${s}%)`}function Wi(e,t,i,n){return`hsla(${e}, ${t}%, ${i}%, ${n})`}var Xi=Object.defineProperty,Yi=Object.getOwnPropertyDescriptor,x=(e,t,i,n)=>{for(var r=n>1?void 0:n?Yi(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(n?o(t,i,r):o(r))||r);return n&&r&&Xi(t,i,r),r};class Vi{constructor(t,i){this.angle=t,this.color=i}}class Gi{constructor(t,i){this.speed=[],this.lines=[],this.angle=[M(0,Math.PI*2),M(0,Math.PI*2),M(0,Math.PI*2),M(0,Math.PI*2)];const n=()=>Math.random()>.5?1:-1;this.speedSeeds=[Math.random(),Math.random(),Math.random(),Math.random()],this.speedSigns=[n(),n(),n(),n()],this.updateSpeeds(t,i)}updateSpeeds(t,i){this.speed=this.speedSeeds.map((n,r)=>this.speedSigns[r]*(t+n*(i-t)))}update(t){this.angle[0]+=this.speed[0],this.angle[1]+=this.speed[1],this.angle[2]+=this.speed[2],this.angle[3]+=this.speed[3];const i=[Math.sin(this.angle[0]),Math.sin(this.angle[1]),Math.sin(this.angle[2]),Math.sin(this.angle[3])];this.lines.push(new Vi(i,"")),this.lines.length>t&&this.lines.shift()}}u.BbAmbientRibbon=class extends C{constructor(){super(...arguments),this.ribbonCount=5,this.ribbonWidth=100,this.ribbonRotation=45,this.ribbonHueStart=11,this.ribbonHueEnd=14,this.ribbonSaturationStart=100,this.ribbonSaturationEnd=100,this.ribbonLightnessStart=50,this.ribbonLightnessEnd=50,this.ribbonAmplitude=.5,this.ribbonSpeedMin=.004,this.ribbonSpeedMax=.008,this.ribbonLineWidth=2,this.ribbonLineOpacity=.2,this.ribbons=[],this.hue=11,this.hueForward=!0}initialize(){this.hue=this.ribbonHueStart,this.ribbons=[];for(let t=0;t<this.ribbonCount;t++)this.ribbons.push(new Gi(this.ribbonSpeedMin,this.ribbonSpeedMax));for(let t=0;t<this.ribbonCount;t++)for(let i=0;i<this.ribbonWidth;i++)this.updateColor(),this.ribbons[t].update(this.ribbonWidth)}updated(t){super.updated(t),(t.has("ribbonSpeedMin")||t.has("ribbonSpeedMax"))&&this.ribbons.forEach(i=>i.updateSpeeds(this.ribbonSpeedMin,this.ribbonSpeedMax)),t.has("ribbonCount")&&this.initialize(),t.has("ribbonWidth")&&this.ribbons.forEach(i=>{i.lines.length>this.ribbonWidth&&(i.lines=i.lines.slice(-this.ribbonWidth))})}updateColor(){this.hue+=this.hueForward?.05:-.05,this.hue>this.ribbonHueEnd&&this.hueForward?(this.hue=this.ribbonHueEnd,this.hueForward=!1):this.hue<this.ribbonHueStart&&!this.hueForward&&(this.hue=this.ribbonHueStart,this.hueForward=!0)}loop(){this.updateColor(),this.ctx.clearRect(0,0,this.width,this.height),this.drawBackground(this.ctx);const t=Math.sqrt(this.width**2+this.height**2),i=this.width/2,n=this.height/2,r=t/2,s=r/3,o=this.ribbonRotation*Math.PI/180;this.ctx.lineWidth=this.ribbonLineWidth,this.ribbons.forEach(a=>{a.update(this.ribbonWidth),a.lines.forEach((h,l)=>{const c=h.angle,f=i-r*Math.cos(c[0]*this.ribbonAmplitude+o),d=n-r*Math.sin(c[0]*this.ribbonAmplitude+o),b=i+r*Math.cos(c[3]*this.ribbonAmplitude+o),g=n+r*Math.sin(c[3]*this.ribbonAmplitude+o),y=i-s*Math.cos(c[1]*this.ribbonAmplitude*2),w=n-s*Math.sin(c[1]*this.ribbonAmplitude*2),L=i+s*Math.cos(c[2]*this.ribbonAmplitude*2),T=n+s*Math.sin(c[2]*this.ribbonAmplitude*2),O=l/(a.lines.length-1||1),it=this.ribbonHueEnd+(this.ribbonHueStart-this.ribbonHueEnd)*O,nt=this.ribbonSaturationEnd+(this.ribbonSaturationStart-this.ribbonSaturationEnd)*O,pe=this.ribbonLightnessEnd+(this.ribbonLightnessStart-this.ribbonLightnessEnd)*O;this.ctx.strokeStyle=Wi(it,nt,pe,this.ribbonLineOpacity),this.ctx.beginPath(),this.ctx.moveTo(f,d),this.ctx.bezierCurveTo(y,w,L,T,b,g),this.ctx.stroke()})})}},x([p({type:Number,attribute:"ribbon-count"})],u.BbAmbientRibbon.prototype,"ribbonCount",2),x([p({type:Number,attribute:"ribbon-width"})],u.BbAmbientRibbon.prototype,"ribbonWidth",2),x([p({type:Number,attribute:"ribbon-rotation"})],u.BbAmbientRibbon.prototype,"ribbonRotation",2),x([p({type:Number,attribute:"ribbon-hue-start"})],u.BbAmbientRibbon.prototype,"ribbonHueStart",2),x([p({type:Number,attribute:"ribbon-hue-end"})],u.BbAmbientRibbon.prototype,"ribbonHueEnd",2),x([p({type:Number,attribute:"ribbon-saturation-start"})],u.BbAmbientRibbon.prototype,"ribbonSaturationStart",2),x([p({type:Number,attribute:"ribbon-saturation-end"})],u.BbAmbientRibbon.prototype,"ribbonSaturationEnd",2),x([p({type:Number,attribute:"ribbon-lightness-start"})],u.BbAmbientRibbon.prototype,"ribbonLightnessStart",2),x([p({type:Number,attribute:"ribbon-lightness-end"})],u.BbAmbientRibbon.prototype,"ribbonLightnessEnd",2),x([p({type:Number,attribute:"ribbon-amplitude"})],u.BbAmbientRibbon.prototype,"ribbonAmplitude",2),x([p({type:Number,attribute:"ribbon-speed-min"})],u.BbAmbientRibbon.prototype,"ribbonSpeedMin",2),x([p({type:Number,attribute:"ribbon-speed-max"})],u.BbAmbientRibbon.prototype,"ribbonSpeedMax",2),x([p({type:Number,attribute:"ribbon-line-width"})],u.BbAmbientRibbon.prototype,"ribbonLineWidth",2),x([p({type:Number,attribute:"ribbon-line-opacity"})],u.BbAmbientRibbon.prototype,"ribbonLineOpacity",2),u.BbAmbientRibbon=x([J("bb-ambient-ribbon")],u.BbAmbientRibbon);let Ki=class{constructor(t,i){this.x=t,this.y=i}update(t,i,n,r,s,o=30){const a=s/o;this.y*n*a>t&&Math.random()>i?this.y=0:this.y+=s*r}draw(t,i,n,r,s,o=30){const a=s/o;t.fillStyle=n,t.fillText(i,this.x*r,this.y*r*a)}};var Zi=Object.defineProperty,Ji=Object.getOwnPropertyDescriptor,N=(e,t,i,n)=>{for(var r=n>1?void 0:n?Ji(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(n?o(t,i,r):o(r))||r);return n&&r&&Zi(t,i,r),r};u.BbDigitalRain=class extends C{constructor(){super(),this.speed=10,this.characters="ヲアウエオカキケコサシスセソタツテナニヌネハヒホマミムメモヤユラリワ",this.randomness=.975,this.fontSize=24,this.fontColorHueStart=60,this.fontColorHueEnd=150,this.fontColorSaturationStart=90,this.fontColorSaturationEnd=100,this.fontColorLightnessStart=50,this.fontColorLightnessEnd=50,this.fontColors=[],this.columns=0,this.symbols=[],this.fontColorHueEnd=this.fontColorHueStart+90}initialize(){this.symbols=[],this.createSymbols(),this.drawBackground(this.ctx)}createSymbols(){this.columns=Math.floor(this.width/this.fontSize);for(let t=0;t<this.columns;t++)this.symbols[t]=this.createSymbol(t)}updateSymbols(){const t=Math.floor(this.width/this.fontSize);for(let i=this.symbols.length;i<t;i++)this.symbols[i]=this.createSymbol(i);this.symbols.length>t&&(this.symbols.length=t)}loop(t){this.updateSymbols(),this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1,this.ctx.textAlign="center",this.ctx.font=`${this.fontSize}px monospace`,this.symbols.forEach(i=>{i.draw(this.ctx,this.characters.charAt(Math.floor(Math.random()*this.characters.length)),this.fontColors&&this.fontColors.length>0?this.fontColors[Math.floor(Math.random()*this.fontColors.length)]:Zt([this.fontColorHueStart,this.fontColorHueEnd],[this.fontColorSaturationStart,this.fontColorSaturationEnd],[this.fontColorLightnessStart,this.fontColorLightnessEnd]),this.fontSize,this.speed*3),i.update(this.height,this.randomness,this.fontSize,t,this.speed*3)})}createSymbol(t){return new Ki(t,Ct(0,-this.height/this.fontSize))}},N([p({type:Number,attribute:"speed"})],u.BbDigitalRain.prototype,"speed",2),N([p({type:String,attribute:"characters"})],u.BbDigitalRain.prototype,"characters",2),N([p({type:Number,attribute:"randomness"})],u.BbDigitalRain.prototype,"randomness",2),N([p({type:Number,attribute:"font-size"})],u.BbDigitalRain.prototype,"fontSize",2),N([p({type:Number,attribute:"font-color-hue-start"})],u.BbDigitalRain.prototype,"fontColorHueStart",2),N([p({type:Number,attribute:"font-color-hue-end"})],u.BbDigitalRain.prototype,"fontColorHueEnd",2),N([p({type:Number,attribute:"font-color-saturation-start"})],u.BbDigitalRain.prototype,"fontColorSaturationStart",2),N([p({type:Number,attribute:"font-color-saturation-end"})],u.BbDigitalRain.prototype,"fontColorSaturationEnd",2),N([p({type:Number,attribute:"font-color-lightness-start"})],u.BbDigitalRain.prototype,"fontColorLightnessStart",2),N([p({type:Number,attribute:"font-color-lightness-end"})],u.BbDigitalRain.prototype,"fontColorLightnessEnd",2),N([p({type:Array,attribute:"font-colors",converter:Q})],u.BbDigitalRain.prototype,"fontColors",2),u.BbDigitalRain=N([J("bb-digital-rain")],u.BbDigitalRain);var Qi={value:()=>{}};function Re(){for(var e=0,t=arguments.length,i={},n;e<t;++e){if(!(n=arguments[e]+"")||n in i||/[\s.]/.test(n))throw new Error("illegal type: "+n);i[n]=[]}return new Mt(i)}function Mt(e){this._=e}function ji(e,t){return e.trim().split(/^|\s+/).map(function(i){var n="",r=i.indexOf(".");if(r>=0&&(n=i.slice(r+1),i=i.slice(0,r)),i&&!t.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}Mt.prototype=Re.prototype={constructor:Mt,on:function(e,t){var i=this._,n=ji(e+"",i),r,s=-1,o=n.length;if(arguments.length<2){for(;++s<o;)if((r=(e=n[s]).type)&&(r=tn(i[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(r=(e=n[s]).type)i[r]=Be(i[r],e.name,t);else if(t==null)for(r in i)i[r]=Be(i[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new Mt(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var i=new Array(r),n=0,r,s;n<r;++n)i[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],n=0,r=s.length;n<r;++n)s[n].value.apply(t,i)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],r=0,s=n.length;r<s;++r)n[r].value.apply(t,i)}};function tn(e,t){for(var i=0,n=e.length,r;i<n;++i)if((r=e[i]).name===t)return r.value}function Be(e,t,i){for(var n=0,r=e.length;n<r;++n)if(e[n].name===t){e[n]=Qi,e=e.slice(0,n).concat(e.slice(n+1));break}return i!=null&&e.push({name:t,value:i}),e}var Jt="http://www.w3.org/1999/xhtml";const Pe={svg:"http://www.w3.org/2000/svg",xhtml:Jt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nt(e){var t=e+="",i=t.indexOf(":");return i>=0&&(t=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Pe.hasOwnProperty(t)?{space:Pe[t],local:e}:e}function en(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===Jt&&t.documentElement.namespaceURI===Jt?t.createElement(e):t.createElementNS(i,e)}}function nn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function He(e){var t=Nt(e);return(t.local?nn:en)(t)}function rn(){}function Qt(e){return e==null?rn:function(){return this.querySelector(e)}}function sn(e){typeof e!="function"&&(e=Qt(e));for(var t=this._groups,i=t.length,n=new Array(i),r=0;r<i;++r)for(var s=t[r],o=s.length,a=n[r]=new Array(o),h,l,c=0;c<o;++c)(h=s[c])&&(l=e.call(h,h.__data__,c,s))&&("__data__"in h&&(l.__data__=h.__data__),a[c]=l);return new E(n,this._parents)}function on(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function an(){return[]}function Le(e){return e==null?an:function(){return this.querySelectorAll(e)}}function hn(e){return function(){return on(e.apply(this,arguments))}}function ln(e){typeof e=="function"?e=hn(e):e=Le(e);for(var t=this._groups,i=t.length,n=[],r=[],s=0;s<i;++s)for(var o=t[s],a=o.length,h,l=0;l<a;++l)(h=o[l])&&(n.push(e.call(h,h.__data__,l,o)),r.push(h));return new E(n,r)}function Te(e){return function(){return this.matches(e)}}function Oe(e){return function(t){return t.matches(e)}}var cn=Array.prototype.find;function un(e){return function(){return cn.call(this.children,e)}}function fn(){return this.firstElementChild}function pn(e){return this.select(e==null?fn:un(typeof e=="function"?e:Oe(e)))}var dn=Array.prototype.filter;function bn(){return Array.from(this.children)}function gn(e){return function(){return dn.call(this.children,e)}}function yn(e){return this.selectAll(e==null?bn:gn(typeof e=="function"?e:Oe(e)))}function mn(e){typeof e!="function"&&(e=Te(e));for(var t=this._groups,i=t.length,n=new Array(i),r=0;r<i;++r)for(var s=t[r],o=s.length,a=n[r]=[],h,l=0;l<o;++l)(h=s[l])&&e.call(h,h.__data__,l,s)&&a.push(h);return new E(n,this._parents)}function ze(e){return new Array(e.length)}function _n(){return new E(this._enter||this._groups.map(ze),this._parents)}function Et(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Et.prototype={constructor:Et,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function vn(e){return function(){return e}}function wn(e,t,i,n,r,s){for(var o=0,a,h=t.length,l=s.length;o<l;++o)(a=t[o])?(a.__data__=s[o],n[o]=a):i[o]=new Et(e,s[o]);for(;o<h;++o)(a=t[o])&&(r[o]=a)}function xn(e,t,i,n,r,s,o){var a,h,l=new Map,c=t.length,f=s.length,d=new Array(c),b;for(a=0;a<c;++a)(h=t[a])&&(d[a]=b=o.call(h,h.__data__,a,t)+"",l.has(b)?r[a]=h:l.set(b,h));for(a=0;a<f;++a)b=o.call(e,s[a],a,s)+"",(h=l.get(b))?(n[a]=h,h.__data__=s[a],l.delete(b)):i[a]=new Et(e,s[a]);for(a=0;a<c;++a)(h=t[a])&&l.get(d[a])===h&&(r[a]=h)}function Sn(e){return e.__data__}function $n(e,t){if(!arguments.length)return Array.from(this,Sn);var i=t?xn:wn,n=this._parents,r=this._groups;typeof e!="function"&&(e=vn(e));for(var s=r.length,o=new Array(s),a=new Array(s),h=new Array(s),l=0;l<s;++l){var c=n[l],f=r[l],d=f.length,b=An(e.call(c,c&&c.__data__,l,n)),g=b.length,y=a[l]=new Array(g),w=o[l]=new Array(g),L=h[l]=new Array(d);i(c,f,y,w,L,b,t);for(var T=0,O=0,it,nt;T<g;++T)if(it=y[T]){for(T>=O&&(O=T+1);!(nt=w[O])&&++O<g;);it._next=nt||null}}return o=new E(o,n),o._enter=a,o._exit=h,o}function An(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Cn(){return new E(this._exit||this._groups.map(ze),this._parents)}function Mn(e,t,i){var n=this.enter(),r=this,s=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),i==null?s.remove():i(s),n&&r?n.merge(r).order():r}function Nn(e){for(var t=e.selection?e.selection():e,i=this._groups,n=t._groups,r=i.length,s=n.length,o=Math.min(r,s),a=new Array(r),h=0;h<o;++h)for(var l=i[h],c=n[h],f=l.length,d=a[h]=new Array(f),b,g=0;g<f;++g)(b=l[g]||c[g])&&(d[g]=b);for(;h<r;++h)a[h]=i[h];return new E(a,this._parents)}function En(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var n=e[t],r=n.length-1,s=n[r],o;--r>=0;)(o=n[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function Rn(e){e||(e=Bn);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var i=this._groups,n=i.length,r=new Array(n),s=0;s<n;++s){for(var o=i[s],a=o.length,h=r[s]=new Array(a),l,c=0;c<a;++c)(l=o[c])&&(h[c]=l);h.sort(t)}return new E(r,this._parents).order()}function Bn(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pn(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Hn(){return Array.from(this)}function Ln(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var n=e[t],r=0,s=n.length;r<s;++r){var o=n[r];if(o)return o}return null}function Tn(){let e=0;for(const t of this)++e;return e}function On(){return!this.node()}function zn(e){for(var t=this._groups,i=0,n=t.length;i<n;++i)for(var r=t[i],s=0,o=r.length,a;s<o;++s)(a=r[s])&&e.call(a,a.__data__,s,r);return this}function Dn(e){return function(){this.removeAttribute(e)}}function kn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fn(e,t){return function(){this.setAttribute(e,t)}}function In(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function qn(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function Un(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function Wn(e,t){var i=Nt(e);if(arguments.length<2){var n=this.node();return i.local?n.getAttributeNS(i.space,i.local):n.getAttribute(i)}return this.each((t==null?i.local?kn:Dn:typeof t=="function"?i.local?Un:qn:i.local?In:Fn)(i,t))}function De(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Xn(e){return function(){this.style.removeProperty(e)}}function Yn(e,t,i){return function(){this.style.setProperty(e,t,i)}}function Vn(e,t,i){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,i)}}function Gn(e,t,i){return arguments.length>1?this.each((t==null?Xn:typeof t=="function"?Vn:Yn)(e,t,i??"")):j(this.node(),e)}function j(e,t){return e.style.getPropertyValue(t)||De(e).getComputedStyle(e,null).getPropertyValue(t)}function Kn(e){return function(){delete this[e]}}function Zn(e,t){return function(){this[e]=t}}function Jn(e,t){return function(){var i=t.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function Qn(e,t){return arguments.length>1?this.each((t==null?Kn:typeof t=="function"?Jn:Zn)(e,t)):this.node()[e]}function ke(e){return e.trim().split(/^|\s+/)}function jt(e){return e.classList||new Fe(e)}function Fe(e){this._node=e,this._names=ke(e.getAttribute("class")||"")}Fe.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ie(e,t){for(var i=jt(e),n=-1,r=t.length;++n<r;)i.add(t[n])}function qe(e,t){for(var i=jt(e),n=-1,r=t.length;++n<r;)i.remove(t[n])}function jn(e){return function(){Ie(this,e)}}function tr(e){return function(){qe(this,e)}}function er(e,t){return function(){(t.apply(this,arguments)?Ie:qe)(this,e)}}function ir(e,t){var i=ke(e+"");if(arguments.length<2){for(var n=jt(this.node()),r=-1,s=i.length;++r<s;)if(!n.contains(i[r]))return!1;return!0}return this.each((typeof t=="function"?er:t?jn:tr)(i,t))}function nr(){this.textContent=""}function rr(e){return function(){this.textContent=e}}function sr(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function or(e){return arguments.length?this.each(e==null?nr:(typeof e=="function"?sr:rr)(e)):this.node().textContent}function ar(){this.innerHTML=""}function hr(e){return function(){this.innerHTML=e}}function lr(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function cr(e){return arguments.length?this.each(e==null?ar:(typeof e=="function"?lr:hr)(e)):this.node().innerHTML}function ur(){this.nextSibling&&this.parentNode.appendChild(this)}function fr(){return this.each(ur)}function pr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dr(){return this.each(pr)}function br(e){var t=typeof e=="function"?e:He(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function gr(){return null}function yr(e,t){var i=typeof e=="function"?e:He(e),n=t==null?gr:typeof t=="function"?t:Qt(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),n.apply(this,arguments)||null)})}function mr(){var e=this.parentNode;e&&e.removeChild(this)}function _r(){return this.each(mr)}function vr(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wr(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xr(e){return this.select(e?wr:vr)}function Sr(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $r(e){return function(t){e.call(this,t,this.__data__)}}function Ar(e){return e.trim().split(/^|\s+/).map(function(t){var i="",n=t.indexOf(".");return n>=0&&(i=t.slice(n+1),t=t.slice(0,n)),{type:t,name:i}})}function Cr(e){return function(){var t=this.__on;if(t){for(var i=0,n=-1,r=t.length,s;i<r;++i)s=t[i],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++n]=s;++n?t.length=n:delete this.__on}}}function Mr(e,t,i){return function(){var n=this.__on,r,s=$r(t);if(n){for(var o=0,a=n.length;o<a;++o)if((r=n[o]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=t;return}}this.addEventListener(e.type,s,i),r={type:e.type,name:e.name,value:t,listener:s,options:i},n?n.push(r):this.__on=[r]}}function Nr(e,t,i){var n=Ar(e+""),r,s=n.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var h=0,l=a.length,c;h<l;++h)for(r=0,c=a[h];r<s;++r)if((o=n[r]).type===c.type&&o.name===c.name)return c.value}return}for(a=t?Mr:Cr,r=0;r<s;++r)this.each(a(n[r],t,i));return this}function Ue(e,t,i){var n=De(e),r=n.CustomEvent;typeof r=="function"?r=new r(t,i):(r=n.document.createEvent("Event"),i?(r.initEvent(t,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Er(e,t){return function(){return Ue(this,e,t)}}function Rr(e,t){return function(){return Ue(this,e,t.apply(this,arguments))}}function Br(e,t){return this.each((typeof t=="function"?Rr:Er)(e,t))}function*Pr(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var n=e[t],r=0,s=n.length,o;r<s;++r)(o=n[r])&&(yield o)}var Hr=[null];function E(e,t){this._groups=e,this._parents=t}function ut(){return new E([[document.documentElement]],Hr)}function Lr(){return this}E.prototype=ut.prototype={constructor:E,select:sn,selectAll:ln,selectChild:pn,selectChildren:yn,filter:mn,data:$n,enter:_n,exit:Cn,join:Mn,merge:Nn,selection:Lr,order:En,sort:Rn,call:Pn,nodes:Hn,node:Ln,size:Tn,empty:On,each:zn,attr:Wn,style:Gn,property:Qn,classed:ir,text:or,html:cr,raise:fr,lower:dr,append:br,insert:yr,remove:_r,clone:xr,datum:Sr,on:Nr,dispatch:Br,[Symbol.iterator]:Pr};function te(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function We(e,t){var i=Object.create(e.prototype);for(var n in t)i[n]=t[n];return i}function ft(){}var pt=.7,Rt=1/pt,tt="\\s*([+-]?\\d+)\\s*",dt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",P="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tr=/^#([0-9a-f]{3,8})$/,Or=new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`),zr=new RegExp(`^rgb\\(${P},${P},${P}\\)$`),Dr=new RegExp(`^rgba\\(${tt},${tt},${tt},${dt}\\)$`),kr=new RegExp(`^rgba\\(${P},${P},${P},${dt}\\)$`),Fr=new RegExp(`^hsl\\(${dt},${P},${P}\\)$`),Ir=new RegExp(`^hsla\\(${dt},${P},${P},${dt}\\)$`),Xe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};te(ft,bt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ye,formatHex:Ye,formatHex8:qr,formatHsl:Ur,formatRgb:Ve,toString:Ve});function Ye(){return this.rgb().formatHex()}function qr(){return this.rgb().formatHex8()}function Ur(){return Qe(this).formatHsl()}function Ve(){return this.rgb().formatRgb()}function bt(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=Tr.exec(e))?(i=t[1].length,t=parseInt(t[1],16),i===6?Ge(t):i===3?new $(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):i===8?Bt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):i===4?Bt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Or.exec(e))?new $(t[1],t[2],t[3],1):(t=zr.exec(e))?new $(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Dr.exec(e))?Bt(t[1],t[2],t[3],t[4]):(t=kr.exec(e))?Bt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fr.exec(e))?Je(t[1],t[2]/100,t[3]/100,1):(t=Ir.exec(e))?Je(t[1],t[2]/100,t[3]/100,t[4]):Xe.hasOwnProperty(e)?Ge(Xe[e]):e==="transparent"?new $(NaN,NaN,NaN,0):null}function Ge(e){return new $(e>>16&255,e>>8&255,e&255,1)}function Bt(e,t,i,n){return n<=0&&(e=t=i=NaN),new $(e,t,i,n)}function Wr(e){return e instanceof ft||(e=bt(e)),e?(e=e.rgb(),new $(e.r,e.g,e.b,e.opacity)):new $}function ee(e,t,i,n){return arguments.length===1?Wr(e):new $(e,t,i,n??1)}function $(e,t,i,n){this.r=+e,this.g=+t,this.b=+i,this.opacity=+n}te($,ee,We(ft,{brighter(e){return e=e==null?Rt:Math.pow(Rt,e),new $(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pt:Math.pow(pt,e),new $(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $(X(this.r),X(this.g),X(this.b),Pt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ke,formatHex:Ke,formatHex8:Xr,formatRgb:Ze,toString:Ze}));function Ke(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}`}function Xr(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}${Y((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ze(){const e=Pt(this.opacity);return`${e===1?"rgb(":"rgba("}${X(this.r)}, ${X(this.g)}, ${X(this.b)}${e===1?")":`, ${e})`}`}function Pt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function X(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Y(e){return e=X(e),(e<16?"0":"")+e.toString(16)}function Je(e,t,i,n){return n<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new R(e,t,i,n)}function Qe(e){if(e instanceof R)return new R(e.h,e.s,e.l,e.opacity);if(e instanceof ft||(e=bt(e)),!e)return new R;if(e instanceof R)return e;e=e.rgb();var t=e.r/255,i=e.g/255,n=e.b/255,r=Math.min(t,i,n),s=Math.max(t,i,n),o=NaN,a=s-r,h=(s+r)/2;return a?(t===s?o=(i-n)/a+(i<n)*6:i===s?o=(n-t)/a+2:o=(t-i)/a+4,a/=h<.5?s+r:2-s-r,o*=60):a=h>0&&h<1?0:o,new R(o,a,h,e.opacity)}function Ht(e,t,i,n){return arguments.length===1?Qe(e):new R(e,t,i,n??1)}function R(e,t,i,n){this.h=+e,this.s=+t,this.l=+i,this.opacity=+n}te(R,Ht,We(ft,{brighter(e){return e=e==null?Rt:Math.pow(Rt,e),new R(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pt:Math.pow(pt,e),new R(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*t,r=2*i-n;return new $(ie(e>=240?e-240:e+120,r,n),ie(e,r,n),ie(e<120?e+240:e-120,r,n),this.opacity)},clamp(){return new R(je(this.h),Lt(this.s),Lt(this.l),Pt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Pt(this.opacity);return`${e===1?"hsl(":"hsla("}${je(this.h)}, ${Lt(this.s)*100}%, ${Lt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function je(e){return e=(e||0)%360,e<0?e+360:e}function Lt(e){return Math.max(0,Math.min(1,e||0))}function ie(e,t,i){return(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)*255}const ti=e=>()=>e;function Yr(e,t){return function(i){return e+i*t}}function Vr(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(n){return Math.pow(e+n*t,i)}}function Gr(e){return(e=+e)==1?ei:function(t,i){return i-t?Vr(t,i,e):ti(isNaN(t)?i:t)}}function ei(e,t){var i=t-e;return i?Yr(e,i):ti(isNaN(e)?t:e)}const ii=(function e(t){var i=Gr(t);function n(r,s){var o=i((r=ee(r)).r,(s=ee(s)).r),a=i(r.g,s.g),h=i(r.b,s.b),l=ei(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=h(c),r.opacity=l(c),r+""}}return n.gamma=e,n})(1);function I(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}var ne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,re=new RegExp(ne.source,"g");function Kr(e){return function(){return e}}function Zr(e){return function(t){return e(t)+""}}function Jr(e,t){var i=ne.lastIndex=re.lastIndex=0,n,r,s,o=-1,a=[],h=[];for(e=e+"",t=t+"";(n=ne.exec(e))&&(r=re.exec(t));)(s=r.index)>i&&(s=t.slice(i,s),a[o]?a[o]+=s:a[++o]=s),(n=n[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,h.push({i:o,x:I(n,r)})),i=re.lastIndex;return i<t.length&&(s=t.slice(i),a[o]?a[o]+=s:a[++o]=s),a.length<2?h[0]?Zr(h[0].x):Kr(t):(t=h.length,function(l){for(var c=0,f;c<t;++c)a[(f=h[c]).i]=f.x(l);return a.join("")})}var ni=180/Math.PI,se={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ri(e,t,i,n,r,s){var o,a,h;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(h=e*i+t*n)&&(i-=e*h,n-=t*h),(a=Math.sqrt(i*i+n*n))&&(i/=a,n/=a,h/=a),e*n<t*i&&(e=-e,t=-t,h=-h,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*ni,skewX:Math.atan(h)*ni,scaleX:o,scaleY:a}}var Tt;function Qr(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?se:ri(t.a,t.b,t.c,t.d,t.e,t.f)}function jr(e){return e==null||(Tt||(Tt=document.createElementNS("http://www.w3.org/2000/svg","g")),Tt.setAttribute("transform",e),!(e=Tt.transform.baseVal.consolidate()))?se:(e=e.matrix,ri(e.a,e.b,e.c,e.d,e.e,e.f))}function si(e,t,i,n){function r(l){return l.length?l.pop()+" ":""}function s(l,c,f,d,b,g){if(l!==f||c!==d){var y=b.push("translate(",null,t,null,i);g.push({i:y-4,x:I(l,f)},{i:y-2,x:I(c,d)})}else(f||d)&&b.push("translate("+f+t+d+i)}function o(l,c,f,d){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,n)-2,x:I(l,c)})):c&&f.push(r(f)+"rotate("+c+n)}function a(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,n)-2,x:I(l,c)}):c&&f.push(r(f)+"skewX("+c+n)}function h(l,c,f,d,b,g){if(l!==f||c!==d){var y=b.push(r(b)+"scale(",null,",",null,")");g.push({i:y-4,x:I(l,f)},{i:y-2,x:I(c,d)})}else(f!==1||d!==1)&&b.push(r(b)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),s(l.translateX,l.translateY,c.translateX,c.translateY,f,d),o(l.rotate,c.rotate,f,d),a(l.skewX,c.skewX,f,d),h(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(b){for(var g=-1,y=d.length,w;++g<y;)f[(w=d[g]).i]=w.x(b);return f.join("")}}}var ts=si(Qr,"px, ","px)","deg)"),es=si(jr,", ",")",")"),et=0,gt=0,yt=0,oi=1e3,Ot,mt,zt=0,V=0,Dt=0,_t=typeof performance=="object"&&performance.now?performance:Date,ai=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function oe(){return V||(ai(is),V=_t.now()+Dt)}function is(){V=0}function kt(){this._call=this._time=this._next=null}kt.prototype=hi.prototype={constructor:kt,restart:function(e,t,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?oe():+i)+(t==null?0:+t),!this._next&&mt!==this&&(mt?mt._next=this:Ot=this,mt=this),this._call=e,this._time=i,ae()},stop:function(){this._call&&(this._call=null,this._time=1/0,ae())}};function hi(e,t,i){var n=new kt;return n.restart(e,t,i),n}function ns(){oe(),++et;for(var e=Ot,t;e;)(t=V-e._time)>=0&&e._call.call(void 0,t),e=e._next;--et}function li(){V=(zt=_t.now())+Dt,et=gt=0;try{ns()}finally{et=0,ss(),V=0}}function rs(){var e=_t.now(),t=e-zt;t>oi&&(Dt-=t,zt=e)}function ss(){for(var e,t=Ot,i,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(i=t._next,t._next=null,t=e?e._next=i:Ot=i);mt=e,ae(n)}function ae(e){if(!et){gt&&(gt=clearTimeout(gt));var t=e-V;t>24?(e<1/0&&(gt=setTimeout(li,e-_t.now()-Dt)),yt&&(yt=clearInterval(yt))):(yt||(zt=_t.now(),yt=setInterval(rs,oi)),et=1,ai(li))}}function ci(e,t,i){var n=new kt;return t=t==null?0:+t,n.restart(r=>{n.stop(),e(r+t)},t,i),n}var os=Re("start","end","cancel","interrupt"),as=[],ui=0,fi=1,he=2,Ft=3,pi=4,le=5,It=6;function qt(e,t,i,n,r,s){var o=e.__transition;if(!o)e.__transition={};else if(i in o)return;hs(e,i,{name:t,index:n,group:r,on:os,tween:as,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:ui})}function ce(e,t){var i=B(e,t);if(i.state>ui)throw new Error("too late; already scheduled");return i}function H(e,t){var i=B(e,t);if(i.state>Ft)throw new Error("too late; already running");return i}function B(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function hs(e,t,i){var n=e.__transition,r;n[t]=i,i.timer=hi(s,0,i.time);function s(l){i.state=fi,i.timer.restart(o,i.delay,i.time),i.delay<=l&&o(l-i.delay)}function o(l){var c,f,d,b;if(i.state!==fi)return h();for(c in n)if(b=n[c],b.name===i.name){if(b.state===Ft)return ci(o);b.state===pi?(b.state=It,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete n[c]):+c<t&&(b.state=It,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete n[c])}if(ci(function(){i.state===Ft&&(i.state=pi,i.timer.restart(a,i.delay,i.time),a(l))}),i.state=he,i.on.call("start",e,e.__data__,i.index,i.group),i.state===he){for(i.state=Ft,r=new Array(d=i.tween.length),c=0,f=-1;c<d;++c)(b=i.tween[c].value.call(e,e.__data__,i.index,i.group))&&(r[++f]=b);r.length=f+1}}function a(l){for(var c=l<i.duration?i.ease.call(null,l/i.duration):(i.timer.restart(h),i.state=le,1),f=-1,d=r.length;++f<d;)r[f].call(e,c);i.state===le&&(i.on.call("end",e,e.__data__,i.index,i.group),h())}function h(){i.state=It,i.timer.stop(),delete n[t];for(var l in n)return;delete e.__transition}}function ls(e,t){var i=e.__transition,n,r,s=!0,o;if(i){t=t==null?null:t+"";for(o in i){if((n=i[o]).name!==t){s=!1;continue}r=n.state>he&&n.state<le,n.state=It,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]}s&&delete e.__transition}}function cs(e){return this.each(function(){ls(this,e)})}function us(e,t){var i,n;return function(){var r=H(this,e),s=r.tween;if(s!==i){n=i=s;for(var o=0,a=n.length;o<a;++o)if(n[o].name===t){n=n.slice(),n.splice(o,1);break}}r.tween=n}}function fs(e,t,i){var n,r;if(typeof i!="function")throw new Error;return function(){var s=H(this,e),o=s.tween;if(o!==n){r=(n=o).slice();for(var a={name:t,value:i},h=0,l=r.length;h<l;++h)if(r[h].name===t){r[h]=a;break}h===l&&r.push(a)}s.tween=r}}function ps(e,t){var i=this._id;if(e+="",arguments.length<2){for(var n=B(this.node(),i).tween,r=0,s=n.length,o;r<s;++r)if((o=n[r]).name===e)return o.value;return null}return this.each((t==null?us:fs)(i,e,t))}function ue(e,t,i){var n=e._id;return e.each(function(){var r=H(this,n);(r.value||(r.value={}))[t]=i.apply(this,arguments)}),function(r){return B(r,n).value[t]}}function di(e,t){var i;return(typeof t=="number"?I:t instanceof bt?ii:(i=bt(t))?(t=i,ii):Jr)(e,t)}function ds(e){return function(){this.removeAttribute(e)}}function bs(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gs(e,t,i){var n,r=i+"",s;return function(){var o=this.getAttribute(e);return o===r?null:o===n?s:s=t(n=o,i)}}function ys(e,t,i){var n,r=i+"",s;return function(){var o=this.getAttributeNS(e.space,e.local);return o===r?null:o===n?s:s=t(n=o,i)}}function ms(e,t,i){var n,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttribute(e):(o=this.getAttribute(e),h=a+"",o===h?null:o===n&&h===r?s:(r=h,s=t(n=o,a)))}}function _s(e,t,i){var n,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),h=a+"",o===h?null:o===n&&h===r?s:(r=h,s=t(n=o,a)))}}function vs(e,t){var i=Nt(e),n=i==="transform"?es:di;return this.attrTween(e,typeof t=="function"?(i.local?_s:ms)(i,n,ue(this,"attr."+e,t)):t==null?(i.local?bs:ds)(i):(i.local?ys:gs)(i,n,t))}function ws(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}function xs(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}function Ss(e,t){var i,n;function r(){var s=t.apply(this,arguments);return s!==n&&(i=(n=s)&&xs(e,s)),i}return r._value=t,r}function $s(e,t){var i,n;function r(){var s=t.apply(this,arguments);return s!==n&&(i=(n=s)&&ws(e,s)),i}return r._value=t,r}function As(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;var n=Nt(e);return this.tween(i,(n.local?Ss:$s)(n,t))}function Cs(e,t){return function(){ce(this,e).delay=+t.apply(this,arguments)}}function Ms(e,t){return t=+t,function(){ce(this,e).delay=t}}function Ns(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cs:Ms)(t,e)):B(this.node(),t).delay}function Es(e,t){return function(){H(this,e).duration=+t.apply(this,arguments)}}function Rs(e,t){return t=+t,function(){H(this,e).duration=t}}function Bs(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Es:Rs)(t,e)):B(this.node(),t).duration}function Ps(e,t){if(typeof t!="function")throw new Error;return function(){H(this,e).ease=t}}function Hs(e){var t=this._id;return arguments.length?this.each(Ps(t,e)):B(this.node(),t).ease}function Ls(e,t){return function(){var i=t.apply(this,arguments);if(typeof i!="function")throw new Error;H(this,e).ease=i}}function Ts(e){if(typeof e!="function")throw new Error;return this.each(Ls(this._id,e))}function Os(e){typeof e!="function"&&(e=Te(e));for(var t=this._groups,i=t.length,n=new Array(i),r=0;r<i;++r)for(var s=t[r],o=s.length,a=n[r]=[],h,l=0;l<o;++l)(h=s[l])&&e.call(h,h.__data__,l,s)&&a.push(h);return new z(n,this._parents,this._name,this._id)}function zs(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,n=t.length,r=i.length,s=Math.min(n,r),o=new Array(n),a=0;a<s;++a)for(var h=t[a],l=i[a],c=h.length,f=o[a]=new Array(c),d,b=0;b<c;++b)(d=h[b]||l[b])&&(f[b]=d);for(;a<n;++a)o[a]=t[a];return new z(o,this._parents,this._name,this._id)}function Ds(e){return(e+"").trim().split(/^|\s+/).every(function(t){var i=t.indexOf(".");return i>=0&&(t=t.slice(0,i)),!t||t==="start"})}function ks(e,t,i){var n,r,s=Ds(t)?ce:H;return function(){var o=s(this,e),a=o.on;a!==n&&(r=(n=a).copy()).on(t,i),o.on=r}}function Fs(e,t){var i=this._id;return arguments.length<2?B(this.node(),i).on.on(e):this.each(ks(i,e,t))}function Is(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}function qs(){return this.on("end.remove",Is(this._id))}function Us(e){var t=this._name,i=this._id;typeof e!="function"&&(e=Qt(e));for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o)for(var a=n[o],h=a.length,l=s[o]=new Array(h),c,f,d=0;d<h;++d)(c=a[d])&&(f=e.call(c,c.__data__,d,a))&&("__data__"in c&&(f.__data__=c.__data__),l[d]=f,qt(l[d],t,i,d,l,B(c,i)));return new z(s,this._parents,t,i)}function Ws(e){var t=this._name,i=this._id;typeof e!="function"&&(e=Le(e));for(var n=this._groups,r=n.length,s=[],o=[],a=0;a<r;++a)for(var h=n[a],l=h.length,c,f=0;f<l;++f)if(c=h[f]){for(var d=e.call(c,c.__data__,f,h),b,g=B(c,i),y=0,w=d.length;y<w;++y)(b=d[y])&&qt(b,t,i,y,d,g);s.push(d),o.push(c)}return new z(s,o,t,i)}var Xs=ut.prototype.constructor;function Ys(){return new Xs(this._groups,this._parents)}function Vs(e,t){var i,n,r;return function(){var s=j(this,e),o=(this.style.removeProperty(e),j(this,e));return s===o?null:s===i&&o===n?r:r=t(i=s,n=o)}}function bi(e){return function(){this.style.removeProperty(e)}}function Gs(e,t,i){var n,r=i+"",s;return function(){var o=j(this,e);return o===r?null:o===n?s:s=t(n=o,i)}}function Ks(e,t,i){var n,r,s;return function(){var o=j(this,e),a=i(this),h=a+"";return a==null&&(h=a=(this.style.removeProperty(e),j(this,e))),o===h?null:o===n&&h===r?s:(r=h,s=t(n=o,a))}}function Zs(e,t){var i,n,r,s="style."+t,o="end."+s,a;return function(){var h=H(this,e),l=h.on,c=h.value[s]==null?a||(a=bi(t)):void 0;(l!==i||r!==c)&&(n=(i=l).copy()).on(o,r=c),h.on=n}}function Js(e,t,i){var n=(e+="")=="transform"?ts:di;return t==null?this.styleTween(e,Vs(e,n)).on("end.style."+e,bi(e)):typeof t=="function"?this.styleTween(e,Ks(e,n,ue(this,"style."+e,t))).each(Zs(this._id,e)):this.styleTween(e,Gs(e,n,t),i).on("end.style."+e,null)}function Qs(e,t,i){return function(n){this.style.setProperty(e,t.call(this,n),i)}}function js(e,t,i){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Qs(e,o,i)),n}return s._value=t,s}function to(e,t,i){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,js(e,t,i??""))}function eo(e){return function(){this.textContent=e}}function io(e){return function(){var t=e(this);this.textContent=t??""}}function no(e){return this.tween("text",typeof e=="function"?io(ue(this,"text",e)):eo(e==null?"":e+""))}function ro(e){return function(t){this.textContent=e.call(this,t)}}function so(e){var t,i;function n(){var r=e.apply(this,arguments);return r!==i&&(t=(i=r)&&ro(r)),t}return n._value=e,n}function oo(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,so(e))}function ao(){for(var e=this._name,t=this._id,i=gi(),n=this._groups,r=n.length,s=0;s<r;++s)for(var o=n[s],a=o.length,h,l=0;l<a;++l)if(h=o[l]){var c=B(h,t);qt(h,e,i,l,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new z(n,this._parents,e,i)}function ho(){var e,t,i=this,n=i._id,r=i.size();return new Promise(function(s,o){var a={value:o},h={value:function(){--r===0&&s()}};i.each(function(){var l=H(this,n),c=l.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(h)),l.on=t}),r===0&&s()})}var lo=0;function z(e,t,i,n){this._groups=e,this._parents=t,this._name=i,this._id=n}function gi(){return++lo}var D=ut.prototype;z.prototype={constructor:z,select:Us,selectAll:Ws,selectChild:D.selectChild,selectChildren:D.selectChildren,filter:Os,merge:zs,selection:Ys,transition:ao,call:D.call,nodes:D.nodes,node:D.node,size:D.size,empty:D.empty,each:D.each,on:Fs,attr:vs,attrTween:As,style:Js,styleTween:to,text:no,textTween:oo,remove:qs,tween:ps,delay:Ns,duration:Bs,ease:Hs,easeVarying:Ts,end:ho,[Symbol.iterator]:D[Symbol.iterator]};function co(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var uo={time:null,delay:0,duration:250,ease:co};function fo(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}function po(e){var t,i;e instanceof z?(t=e._id,e=e._name):(t=gi(),(i=uo).time=oe(),e=e==null?null:e+"");for(var n=this._groups,r=n.length,s=0;s<r;++s)for(var o=n[s],a=o.length,h,l=0;l<a;++l)(h=o[l])&&qt(h,e,t,l,o,i||fo(h,t));return new z(n,this._parents,e,t)}ut.prototype.interrupt=cs,ut.prototype.transition=po;function vt(e,t,i){this.k=e,this.x=t,this.y=i}vt.prototype={constructor:vt,scale:function(e){return e===1?this:new vt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new vt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},vt.prototype;var bo=Object.defineProperty,go=Object.getOwnPropertyDescriptor,S=(e,t,i,n)=>{for(var r=n>1?void 0:n?go(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(n?o(t,i,r):o(r))||r);return n&&r&&bo(t,i,r),r};u.BbHexagonWave=class extends C{constructor(){super(...arguments),this.hexSize=50,this.waveAmplitude=5.5,this.waveSpeed=1,this.waveXFactor=-.005,this.waveYFactor=-.005,this.shadeAmplitude=.5,this.shadeLightnessBoost=15,this.baseLightness=10,this.lightnessRange=25,this.hexHueStart=310,this.hexHueEnd=200,this.hexSaturation=100,this.hexScale=1,this.hexColors=[],this.grid=[],this.time=0}updated(t){super.updated(t),t.has("hexSize")&&this.initialize()}initialize(){this.grid=[],this.time=0;const t=this.hexSize,n=Math.sqrt(3)*t,r=t*1.5,s=Math.ceil(this.width/n)+2,o=Math.ceil(this.height/r)+2;for(let a=-1;a<o;a++)for(let h=-1;h<s;h++){const l=a%2!==0?n/2:0;this.grid.push({x:h*n+l,y:a*r,phase:Math.random()*Math.PI*2,colorIndex:Math.floor(Math.random()*1e3)})}}loop(t){this.time+=t,this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1;for(const i of this.grid){const n=i.x*this.waveXFactor,r=i.y*this.waveYFactor,s=Math.sin(this.time*this.waveSpeed+n+r),o=s*this.waveAmplitude,a=i.x+i.y,h=Math.sin(this.time+a)*this.shadeAmplitude,l=this.baseLightness+s*this.lightnessRange+h;let c;if(this.hexColors&&this.hexColors.length>0){const f=this.hexColors[(i.colorIndex||0)%this.hexColors.length],d=Ht(f);c=`hsl(${d.h}, ${d.s*100}%, ${l}%)`}else{const f=this.width+this.height,d=(i.x+i.y)/f;c=`hsl(${this.hexHueStart+(this.hexHueEnd-this.hexHueStart)*d}, ${this.hexSaturation}%, ${l}%)`}this.drawHex(i.x,i.y+o,this.hexSize*this.hexScale,c)}}drawHex(t,i,n,r){const s=this.ctx;s.beginPath();for(let o=0;o<6;o++){const a=Math.PI*2/6*o-Math.PI/2,h=t+Math.cos(a)*n,l=i+Math.sin(a)*n;o===0?s.moveTo(h,l):s.lineTo(h,l)}s.closePath(),s.fillStyle=r,s.fill()}},S([p({type:Number,attribute:"hex-size"})],u.BbHexagonWave.prototype,"hexSize",2),S([p({type:Number,attribute:"wave-amplitude"})],u.BbHexagonWave.prototype,"waveAmplitude",2),S([p({type:Number,attribute:"wave-speed"})],u.BbHexagonWave.prototype,"waveSpeed",2),S([p({type:Number,attribute:"wave-x-factor"})],u.BbHexagonWave.prototype,"waveXFactor",2),S([p({type:Number,attribute:"wave-y-factor"})],u.BbHexagonWave.prototype,"waveYFactor",2),S([p({type:Number,attribute:"shade-amplitude"})],u.BbHexagonWave.prototype,"shadeAmplitude",2),S([p({type:Number,attribute:"shade-lightness-boost"})],u.BbHexagonWave.prototype,"shadeLightnessBoost",2),S([p({type:Number,attribute:"base-lightness"})],u.BbHexagonWave.prototype,"baseLightness",2),S([p({type:Number,attribute:"lightness-range"})],u.BbHexagonWave.prototype,"lightnessRange",2),S([p({type:Number,attribute:"hex-hue-start"})],u.BbHexagonWave.prototype,"hexHueStart",2),S([p({type:Number,attribute:"hex-hue-end"})],u.BbHexagonWave.prototype,"hexHueEnd",2),S([p({type:Number,attribute:"hex-saturation"})],u.BbHexagonWave.prototype,"hexSaturation",2),S([p({type:Number,attribute:"hex-scale"})],u.BbHexagonWave.prototype,"hexScale",2),S([p({type:Array,attribute:"hex-colors",converter:Q})],u.BbHexagonWave.prototype,"hexColors",2),u.BbHexagonWave=S([J("bb-hexagon-wave")],u.BbHexagonWave);var yo=Object.defineProperty,mo=Object.getOwnPropertyDescriptor,A=(e,t,i,n)=>{for(var r=n>1?void 0:n?mo(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(n?o(t,i,r):o(r))||r);return n&&r&&yo(t,i,r),r};u.BbLiquidLines=class extends C{constructor(){super(...arguments),this.lineCount=20,this.lineAmplitude=30,this.lineFrequency=.005,this.speed=.5,this.lineSpacing=40,this.lineWidth=2,this.lineHueStart=200,this.lineHueEnd=280,this.lineSaturation=80,this.lineOffsetStep=.2,this.wiggleAmplitude=20,this.wiggleSpeed=.3,this.lineColors=[],this.time=0}loop(t){this.time+=t,this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1;const n=this.height/2-this.lineCount*this.lineSpacing/2;for(let r=0;r<this.lineCount;r++)this.drawLine(r,n+r*this.lineSpacing)}drawLine(t,i){const n=this.ctx,r=100,s=this.width/(r-1),o=t*this.lineOffsetStep;n.beginPath(),n.lineWidth=this.lineWidth;const a=t/this.lineCount,h=this.lineHueStart+(this.lineHueEnd-this.lineHueStart)*a,c=40+Math.sin(this.time*.001+t*.5)*10,f=this.lineColors&&this.lineColors.length>0?Ht(this.lineColors[t%this.lineColors.length]):Ht(h,this.lineSaturation/100,c/100);this.lineColors&&this.lineColors.length>0&&(f.l=c/100),n.strokeStyle=f.toString();for(let d=0;d<r-1;d++){const b=d*s,g=Math.sin(b*this.lineFrequency+this.time*this.speed+o)*this.lineAmplitude,y=Math.sin(this.time*this.wiggleSpeed+o+t)*this.wiggleAmplitude,w=i+g+y,L=(d+1)*s,T=Math.sin(L*this.lineFrequency+this.time*this.speed+o)*this.lineAmplitude,O=Math.sin(this.time*this.wiggleSpeed+o+t)*this.wiggleAmplitude,it=i+T+O,nt=(b+L)/2,pe=(w+it)/2;d===0&&n.moveTo(b,w),n.quadraticCurveTo(b,w,nt,pe)}n.stroke()}},A([p({type:Number,attribute:"line-count"})],u.BbLiquidLines.prototype,"lineCount",2),A([p({type:Number,attribute:"line-amplitude"})],u.BbLiquidLines.prototype,"lineAmplitude",2),A([p({type:Number,attribute:"line-frequency"})],u.BbLiquidLines.prototype,"lineFrequency",2),A([p({type:Number,attribute:"speed"})],u.BbLiquidLines.prototype,"speed",2),A([p({type:Number,attribute:"line-spacing"})],u.BbLiquidLines.prototype,"lineSpacing",2),A([p({type:Number,attribute:"line-width"})],u.BbLiquidLines.prototype,"lineWidth",2),A([p({type:Number,attribute:"line-hue-start"})],u.BbLiquidLines.prototype,"lineHueStart",2),A([p({type:Number,attribute:"line-hue-end"})],u.BbLiquidLines.prototype,"lineHueEnd",2),A([p({type:Number,attribute:"line-saturation"})],u.BbLiquidLines.prototype,"lineSaturation",2),A([p({type:Number,attribute:"line-offset-step"})],u.BbLiquidLines.prototype,"lineOffsetStep",2),A([p({type:Number,attribute:"wiggle-amplitude"})],u.BbLiquidLines.prototype,"wiggleAmplitude",2),A([p({type:Number,attribute:"wiggle-speed"})],u.BbLiquidLines.prototype,"wiggleSpeed",2),A([p({type:Array,attribute:"line-colors",converter:Q})],u.BbLiquidLines.prototype,"lineColors",2),u.BbLiquidLines=A([J("bb-liquid-lines")],u.BbLiquidLines);class yi{constructor(t){this.initialized=!1,this.railFromX=0,this.railFromY=0,this.railToX=0,this.railToY=0,this.railProgress=0,this.size=t.size,this.speed=t.speed,this.color=t.color,this.radius=t.radius??1,this.angle=t.angle,this.lifespan=t.lifespan,this.force=t.force??1,this.frequencyX=t.frequencyX??1,this.frequencyY=t.frequencyY??1,this.gridSides=t.gridSides??6,this.gridSize=t.gridSize??40,this.gridAngle=t.gridAngle??Math.PI/2,this.x=t.x??0,this.y=t.y??0,this.px=this.x,this.py=this.y,this.born=Date.now(),this.fadeInDuration=this.lifespan*.25,this.fadeOutDuration=this.lifespan*.5}circularMove(t,i,n){this.angle+=this.speed*n,this.radius+=this.force*n;const r=t+Math.cos(this.angle*this.frequencyX)*this.radius,s=i+Math.sin(this.angle*this.frequencyY)*this.radius;this.initialized?(this.px=this.x,this.py=this.y,this.x=r,this.y=s):(this.x=r,this.y=s,this.px=r,this.py=s,this.initialized=!0)}sinusMove(t,i,n){this.angle+=this.speed*n;const r=t+this.angle*100,s=i+Math.sin(this.angle*this.frequencyY)*this.radius;this.initialized?(this.px=this.x,this.py=this.y,this.x=r,this.y=s):(this.x=r,this.y=s,this.px=r,this.py=s,this.initialized=!0)}draw(t){t.globalAlpha=this.calculateOpacity(),t.beginPath(),t.lineCap="round",t.lineWidth=this.size*2,t.strokeStyle=this.color,t.moveTo(this.px,this.py),t.lineTo(this.x,this.y),t.stroke(),t.globalAlpha=1}isDead(){return Date.now()-this.born>this.lifespan}railMove(t,i,n){if(!this.initialized){const l=this.x,c=this.y,f=this.snapToGrid(l,c,t,i);this.railFromX=f.x,this.railFromY=f.y,this.pickNextRailTarget(),this.x=this.railFromX,this.y=this.railFromY,this.px=this.x,this.py=this.y,this.initialized=!0,this.railProgress=0}const r=Math.abs(this.speed)*20;this.railProgress+=r/this.gridSize*n,this.railProgress>=1&&(this.railProgress-=1,this.railFromX=this.railToX,this.railFromY=this.railToY,this.pickNextRailTarget());const s=this.railToX-this.railFromX,o=this.railToY-this.railFromY,a=this.railFromX+s*this.railProgress,h=this.railFromY+o*this.railProgress;this.updatePosition(a,h)}pickNextRailTarget(){const t=Math.PI*2/this.gridSides,n=Math.floor(Math.random()*this.gridSides)*t+this.gridAngle;this.railToX=this.railFromX+Math.cos(n)*this.gridSize,this.railToY=this.railFromY+Math.sin(n)*this.gridSize}snapToGrid(t,i,n,r){let s=t-n,o=i-r;const a=Math.cos(-this.gridAngle),h=Math.sin(-this.gridAngle),l=s*a-o*h,c=s*h+o*a;let f=l,d=c;const b=this.gridSize;if(this.gridSides===6||this.gridSides===3){const w=b*Math.sqrt(3)/2;let L=Math.round(c/w);f=Math.round((l-L*b/2)/b)*b+L*b/2,d=L*w}else this.gridSides===4&&(f=Math.round(l/b)*b,d=Math.round(c/b)*b);const g=f*Math.cos(this.gridAngle)-d*Math.sin(this.gridAngle),y=f*Math.sin(this.gridAngle)+d*Math.cos(this.gridAngle);return{x:g+n,y:y+r}}updatePosition(t,i){this.initialized?(this.px=this.x,this.py=this.y,this.x=t,this.y=i):(this.x=t,this.y=i,this.px=t,this.py=i,this.initialized=!0)}calculateOpacity(){const t=Date.now()-this.born;return t<this.fadeInDuration?t/this.fadeInDuration:t>this.lifespan-this.fadeOutDuration?(this.lifespan-t)/this.fadeOutDuration:1}}var _o=Object.defineProperty,vo=Object.getOwnPropertyDescriptor,_=(e,t,i,n)=>{for(var r=n>1?void 0:n?vo(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(n?o(t,i,r):o(r))||r);return n&&r&&_o(t,i,r),r};u.BbNeonRails=class extends C{constructor(){super(...arguments),this.particleSizeMin=1,this.particleSizeMax=1,this.particleSpeedMin=-30,this.particleSpeedMax=30,this.particleColorHueStart=130,this.particleColorHueEnd=300,this.particleColorSaturationStart=100,this.particleColorSaturationEnd=100,this.particleColorLightnessStart=50,this.particleColorLightnessEnd=0,this.particleLifespanMin=100,this.particleLifespanMax=5e4,this.particleAmount=2e3,this.gridSides=3,this.gridSize=60,this.gridAngle=Math.PI/2,this.particleColors=[],this.particles=[],this.trailOpacity=.0125}initialize(){this.particles=[],this.drawBackground(this.ctx);for(let t=0;t<this.particleAmount;t++)this.particles.push(this.createParticle())}loop(t){for(this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1,this.particles=this.particles.filter(i=>!i.isDead());this.particles.length<this.particleAmount;)this.particles.push(this.createParticle());this.particles.forEach(i=>{i.railMove(this.width/2,this.height/2,t),i.draw(this.ctx)})}createParticle(){const t=M(this.particleSizeMin,this.particleSizeMax),i=M(this.particleSpeedMin,this.particleSpeedMax),n=M(this.particleLifespanMin,this.particleLifespanMax);let r;this.particleColors&&this.particleColors.length>0?r=this.particleColors[Math.floor(Math.random()*this.particleColors.length)]:r=Zt([this.particleColorHueStart,this.particleColorHueEnd],[this.particleColorSaturationStart,this.particleColorSaturationEnd],[this.particleColorLightnessStart,this.particleColorLightnessEnd]);const s=M(0,this.width),o=M(0,this.height),a=s-this.width/2,h=o-this.height/2,l=Math.atan2(h,a);return new yi({size:t,speed:i,color:r,angle:l,lifespan:n,gridSides:this.gridSides,gridSize:this.gridSize,gridAngle:this.gridAngle,x:s,y:o})}},_([p({type:Number,attribute:"particle-size-min"})],u.BbNeonRails.prototype,"particleSizeMin",2),_([p({type:Number,attribute:"particle-size-max"})],u.BbNeonRails.prototype,"particleSizeMax",2),_([p({type:Number,attribute:"particle-speed-min"})],u.BbNeonRails.prototype,"particleSpeedMin",2),_([p({type:Number,attribute:"particle-speed-max"})],u.BbNeonRails.prototype,"particleSpeedMax",2),_([p({type:Number,attribute:"particle-color-hue-start"})],u.BbNeonRails.prototype,"particleColorHueStart",2),_([p({type:Number,attribute:"particle-color-hue-end"})],u.BbNeonRails.prototype,"particleColorHueEnd",2),_([p({type:Number,attribute:"particle-color-saturation-start"})],u.BbNeonRails.prototype,"particleColorSaturationStart",2),_([p({type:Number,attribute:"particle-color-saturation-end"})],u.BbNeonRails.prototype,"particleColorSaturationEnd",2),_([p({type:Number,attribute:"particle-color-lightness-start"})],u.BbNeonRails.prototype,"particleColorLightnessStart",2),_([p({type:Number,attribute:"particle-color-lightness-end"})],u.BbNeonRails.prototype,"particleColorLightnessEnd",2),_([p({type:Number,attribute:"particle-lifespan-min"})],u.BbNeonRails.prototype,"particleLifespanMin",2),_([p({type:Number,attribute:"particle-lifespan-max"})],u.BbNeonRails.prototype,"particleLifespanMax",2),_([p({type:Number,attribute:"particle-amount"})],u.BbNeonRails.prototype,"particleAmount",2),_([p({type:Number,attribute:"grid-sides"})],u.BbNeonRails.prototype,"gridSides",2),_([p({type:Number,attribute:"grid-size"})],u.BbNeonRails.prototype,"gridSize",2),_([p({type:Number,attribute:"grid-angle"})],u.BbNeonRails.prototype,"gridAngle",2),_([p({type:Array,attribute:"particle-colors",converter:Q})],u.BbNeonRails.prototype,"particleColors",2),_([p({type:Number,attribute:"trail-opacity"})],u.BbNeonRails.prototype,"trailOpacity",2),u.BbNeonRails=_([J("bb-neon-rails")],u.BbNeonRails);var wo=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,m=(e,t,i,n)=>{for(var r=n>1?void 0:n?xo(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(n?o(t,i,r):o(r))||r);return n&&r&&wo(t,i,r),r};u.BbStarTrail=class extends C{constructor(){super(...arguments),this.particleForce=0,this.particleSizeMin=.5,this.particleSizeMax=1.5,this.particleSpeedMin=.025,this.particleSpeedMax=.05,this.particleColorHueStart=30,this.particleColorHueEnd=75,this.particleColorSaturationStart=100,this.particleColorSaturationEnd=100,this.particleColorLightnessStart=50,this.particleColorLightnessEnd=50,this.particleRadiusMin=1,this.particleRadiusMax=100,this.particleLifespanMin=1e3,this.particleLifespanMax=1e4,this.particleAmount=1e3,this.gridSides=6,this.gridSize=40,this.gridAngle=0,this.particleColors=[],this.particles=[]}initialize(){this.particles=[],this.drawBackground(this.ctx),this.particleRadiusMax=this.particleRadiusMax||this.width;for(let t=0;t<this.particleAmount;t++)this.particles.push(this.createParticle())}loop(t){for(this.ctx.globalAlpha=this.trailOpacity,this.drawBackground(this.ctx),this.ctx.globalAlpha=1,this.particles=this.particles.filter(i=>!i.isDead());this.particles.length<this.particleAmount;)this.particles.push(this.createParticle());this.particles.forEach(i=>{i.circularMove(this.width/2,this.height/2,t),i.draw(this.ctx)})}createParticle(){const t=M(this.particleSizeMin,this.particleSizeMax),i=M(this.particleSpeedMin,this.particleSpeedMax),n=M(this.particleLifespanMin,this.particleLifespanMax);let r;this.particleColors&&this.particleColors.length>0?r=this.particleColors[Math.floor(Math.random()*this.particleColors.length)]:r=Zt([this.particleColorHueStart,this.particleColorHueEnd],[this.particleColorSaturationStart,this.particleColorSaturationEnd],[this.particleColorLightnessStart,this.particleColorLightnessEnd]);const s=M(0,Math.PI*2),o=this.particleRadiusMax-this.particleRadiusMin,a=Math.sqrt(Math.random())*o+this.particleRadiusMin;return new yi({size:t,speed:i,color:r,radius:a,angle:s,lifespan:n,gridSides:this.gridSides,gridSize:this.gridSize,gridAngle:this.gridAngle,force:this.particleForce})}},m([p({type:Number,attribute:"particle-force"})],u.BbStarTrail.prototype,"particleForce",2),m([p({type:Number,attribute:"particle-size-min"})],u.BbStarTrail.prototype,"particleSizeMin",2),m([p({type:Number,attribute:"particle-size-max"})],u.BbStarTrail.prototype,"particleSizeMax",2),m([p({type:Number,attribute:"particle-speed-min"})],u.BbStarTrail.prototype,"particleSpeedMin",2),m([p({type:Number,attribute:"particle-speed-max"})],u.BbStarTrail.prototype,"particleSpeedMax",2),m([p({type:Number,attribute:"particle-color-hue-start"})],u.BbStarTrail.prototype,"particleColorHueStart",2),m([p({type:Number,attribute:"particle-color-hue-end"})],u.BbStarTrail.prototype,"particleColorHueEnd",2),m([p({type:Number,attribute:"particle-color-saturation-start"})],u.BbStarTrail.prototype,"particleColorSaturationStart",2),m([p({type:Number,attribute:"particle-color-saturation-end"})],u.BbStarTrail.prototype,"particleColorSaturationEnd",2),m([p({type:Number,attribute:"particle-color-lightness-start"})],u.BbStarTrail.prototype,"particleColorLightnessStart",2),m([p({type:Number,attribute:"particle-color-lightness-end"})],u.BbStarTrail.prototype,"particleColorLightnessEnd",2),m([p({type:Number,attribute:"particle-radius-min"})],u.BbStarTrail.prototype,"particleRadiusMin",2),m([p({type:Number,attribute:"particle-radius-max"})],u.BbStarTrail.prototype,"particleRadiusMax",2),m([p({type:Number,attribute:"particle-lifespan-min"})],u.BbStarTrail.prototype,"particleLifespanMin",2),m([p({type:Number,attribute:"particle-lifespan-max"})],u.BbStarTrail.prototype,"particleLifespanMax",2),m([p({type:Number,attribute:"particle-amount"})],u.BbStarTrail.prototype,"particleAmount",2),m([p({type:Number,attribute:"grid-sides"})],u.BbStarTrail.prototype,"gridSides",2),m([p({type:Number,attribute:"grid-size"})],u.BbStarTrail.prototype,"gridSize",2),m([p({type:Number,attribute:"grid-angle"})],u.BbStarTrail.prototype,"gridAngle",2),m([p({type:Array,attribute:"particle-colors",converter:Q})],u.BbStarTrail.prototype,"particleColors",2),u.BbStarTrail=m([J("bb-star-trail")],u.BbStarTrail),u.BeautifulBackground=C,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
9
+ //# sourceMappingURL=bb.js.map