diff --git a/package.json b/package.json index c7b37c2..5dc76ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slime2", - "version": "0.1.2", + "version": "0.1.3", "private": true, "homepage": ".", "scripts": { diff --git a/release/base.html b/release/base.html index 27a5f20..a628a97 100644 --- a/release/base.html +++ b/release/base.html @@ -18,8 +18,8 @@ type="image/x-icon" href="https://slime2.stream/favicon.ico" /> - - + +
diff --git a/release/slime2.css b/release/slime2.css index 601e9b8..3a222e2 100644 --- a/release/slime2.css +++ b/release/slime2.css @@ -1 +1 @@ -@import"https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&family=Grandstander:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Radio+Canada:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.\!fixed{position:fixed!important}.absolute{position:absolute}.inset-x-3{left:.75rem;right:.75rem}.top-3{top:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.inline{display:inline}.flex{display:flex}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:1rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-emerald-800{--tw-border-opacity: 1;border-color:rgb(6 95 70 / var(--tw-border-opacity))}.bg-emerald-800{--tw-bg-opacity: 1;background-color:rgb(6 95 70 / var(--tw-bg-opacity))}.bg-rose-900{--tw-bg-opacity: 1;background-color:rgb(136 19 55 / var(--tw-bg-opacity))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-lime-600{--tw-gradient-from: #65a30d var(--tw-gradient-from-position);--tw-gradient-to: rgb(101 163 13 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-emerald-700{--tw-gradient-to: #047857 var(--tw-gradient-to-position)}.p-3{padding:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.text-center{text-align:center}.font-grandstander{font-family:Grandstander,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.font-radiocanada{font-family:Radio Canada,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.font-semibold{font-weight:600}.text-lime-100{--tw-text-opacity: 1;color:rgb(236 252 203 / var(--tw-text-opacity))}.text-lime-200{--tw-text-opacity: 1;color:rgb(217 249 157 / var(--tw-text-opacity))}.text-rose-200{--tw-text-opacity: 1;color:rgb(254 205 211 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.text-shadow{text-shadow:var(--tw-text-shadow-x-offset, 0) var(--tw-text-shadow-y-offset, 0) var(--tw-text-shadow-blur,) var(--tw-text-shadow-color,)}.text-shadow-c-black\/75{--tw-text-shadow-color: rgb(0 0 0 / .75)}.text-shadow-y-px{--tw-text-shadow-y-offset: 1px}*{box-sizing:border-box;overflow-wrap:break-word;margin:0;padding:0}.btn-shadow-i{box-shadow:inset 0 -.25rem #00000040,inset 0 1px 0 1px #ffffff40;position:relative}.btn-shadow-i:active{box-shadow:none}.btn-shadow-i:after{content:"";position:absolute;top:0;bottom:50%;left:0;right:0;background-color:#ffffff1a}.btn-shadow-i:active:after{display:none}.hover\:from-lime-500:hover{--tw-gradient-from: #84cc16 var(--tw-gradient-from-position);--tw-gradient-to: rgb(132 204 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-emerald-600:hover{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.focus\:outline-offset-8:focus{outline-offset:8px} +@import"https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&family=Grandstander:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Radio+Canada:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.\!fixed{position:fixed!important}.absolute{position:absolute}.inset-x-3{left:.75rem;right:.75rem}.top-3{top:.75rem}.z-\[999\]{z-index:999}.mx-3{margin-left:.75rem;margin-right:.75rem}.inline{display:inline}.flex{display:flex}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:1rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-emerald-800{--tw-border-opacity: 1;border-color:rgb(6 95 70 / var(--tw-border-opacity))}.bg-emerald-800{--tw-bg-opacity: 1;background-color:rgb(6 95 70 / var(--tw-bg-opacity))}.bg-rose-900{--tw-bg-opacity: 1;background-color:rgb(136 19 55 / var(--tw-bg-opacity))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-lime-600{--tw-gradient-from: #65a30d var(--tw-gradient-from-position);--tw-gradient-to: rgb(101 163 13 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-emerald-700{--tw-gradient-to: #047857 var(--tw-gradient-to-position)}.p-3{padding:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.text-center{text-align:center}.font-grandstander{font-family:Grandstander,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.font-radiocanada{font-family:Radio Canada,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.font-semibold{font-weight:600}.text-lime-100{--tw-text-opacity: 1;color:rgb(236 252 203 / var(--tw-text-opacity))}.text-lime-200{--tw-text-opacity: 1;color:rgb(217 249 157 / var(--tw-text-opacity))}.text-rose-200{--tw-text-opacity: 1;color:rgb(254 205 211 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.text-shadow{text-shadow:var(--tw-text-shadow-x-offset, 0) var(--tw-text-shadow-y-offset, 0) var(--tw-text-shadow-blur,) var(--tw-text-shadow-color,)}.text-shadow-c-black\/75{--tw-text-shadow-color: rgb(0 0 0 / .75)}.text-shadow-y-px{--tw-text-shadow-y-offset: 1px}*{box-sizing:border-box;overflow-wrap:break-word;margin:0;padding:0}.btn-shadow-i{box-shadow:inset 0 -.25rem #00000040,inset 0 1px 0 1px #ffffff40;position:relative}.btn-shadow-i:active{box-shadow:none}.btn-shadow-i:after{content:"";position:absolute;top:0;bottom:50%;left:0;right:0;background-color:#ffffff1a}.btn-shadow-i:active:after{display:none}.hover\:from-lime-500:hover{--tw-gradient-from: #84cc16 var(--tw-gradient-from-position);--tw-gradient-to: rgb(132 204 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-emerald-600:hover{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.focus\:outline-offset-8:focus{outline-offset:8px} diff --git a/release/slime2.js b/release/slime2.js index a9d8aa1..7e2f24f 100644 --- a/release/slime2.js +++ b/release/slime2.js @@ -68,4 +68,4 @@ Make sure you're not executing any actions when you want to remove a user.`),thi * MIT License */(function(t){(function(e,r){t.exports?t.exports=r(e,iO()):e.imagesLoaded=r(e,e.EvEmitter)})(typeof window<"u"?window:Ym,function(r,n){let i=r.jQuery,s=r.console;function o(d){return Array.isArray(d)?d:typeof d=="object"&&typeof d.length=="number"?[...d]:[d]}function a(d,p,m){if(!(this instanceof a))return new a(d,p,m);let _=d;if(typeof d=="string"&&(_=document.querySelectorAll(d)),!_){s.error(`Bad element for imagesLoaded ${_||d}`);return}this.elements=o(_),this.options={},typeof p=="function"?m=p:Object.assign(this.options,p),m&&this.on("always",m),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))}a.prototype=Object.create(n.prototype),a.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const l=[1,9,11];a.prototype.addElementImages=function(d){d.nodeName==="IMG"&&this.addImage(d),this.options.background===!0&&this.addElementBackgroundImages(d);let{nodeType:p}=d;if(!p||!l.includes(p))return;let m=d.querySelectorAll("img");for(let _ of m)this.addImage(_);if(typeof this.options.background=="string"){let _=d.querySelectorAll(this.options.background);for(let w of _)this.addElementBackgroundImages(w)}};const u=/url\((['"])?(.*?)\1\)/gi;a.prototype.addElementBackgroundImages=function(d){let p=getComputedStyle(d);if(!p)return;let m=u.exec(p.backgroundImage);for(;m!==null;){let _=m&&m[2];_&&this.addBackground(_,d),m=u.exec(p.backgroundImage)}},a.prototype.addImage=function(d){let p=new c(d);this.images.push(p)},a.prototype.addBackground=function(d,p){let m=new h(d,p);this.images.push(m)},a.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length){this.complete();return}let d=(p,m,_)=>{setTimeout(()=>{this.progress(p,m,_)})};this.images.forEach(function(p){p.once("progress",d),p.check()})},a.prototype.progress=function(d,p,m){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!d.isLoaded,this.emitEvent("progress",[this,d,p]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,d),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${m}`,d,p)},a.prototype.complete=function(){let d=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(d,[this]),this.emitEvent("always",[this]),this.jqDeferred){let p=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[p](this)}};function c(d){this.img=d}c.prototype=Object.create(n.prototype),c.prototype.check=function(){if(this.getIsImageComplete()){this.confirm(this.img.naturalWidth!==0,"naturalWidth");return}this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src},c.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},c.prototype.confirm=function(d,p){this.isLoaded=d;let{parentNode:m}=this.img,_=m.nodeName==="PICTURE"?m:this.img;this.emitEvent("progress",[this,_,p])},c.prototype.handleEvent=function(d){let p="on"+d.type;this[p]&&this[p](d)},c.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},c.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},c.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)};function h(d,p){this.url=d,this.element=p,this.img=new Image}return h.prototype=Object.create(c.prototype),h.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(this.img.naturalWidth!==0,"naturalWidth"),this.unbindEvents())},h.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},h.prototype.confirm=function(d,p){this.isLoaded=d,this.emitEvent("progress",[this,this.element,p])},a.makeJQueryPlugin=function(d){d=d||r.jQuery,d&&(i=d,i.fn.imagesLoaded=function(p,m){return new a(this,p,m).jqDeferred.promise(i(this))})},a.makeJQueryPlugin(),a})})(NT);var sO=NT.exports;const oO=_s(sO);function aO(t){const e=sy(),r=U.useRef(null),n=U.useRef(!1);function i(){e({type:"remove",payload:t.id,moderator:!1})}const s=slime2Chat.onMessage({message:t,deleteMessage:i}),[o,a]=s||[];let l="";if(o){const u=o instanceof DocumentFragment?o:o[0],c=document.createElement("div");c.appendChild(u),l=c.innerHTML,c.remove()}return U.useEffect(()=>{if(o&&a&&r.current&&!n.current){n.current=!0;const u=r.current.firstElementChild;oO(u,()=>{a(u)})}},[]),o?de.jsx("div",{id:"slime2-chat-message",dangerouslySetInnerHTML:{__html:l},ref:r}):(i(),null)}const lO=U.memo(aO);function uO(){const t=b3();function e(){return t.map(r=>de.jsx(lO,{...r},r.id))}return de.jsx("div",{id:"slime2-chat-list",children:e()})}let Bl,Iw=!1;function cO(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){Iw||(Bl=await ms.bits.getCheermotes(r.id)),e(!1),Iw=!0}n()},[r]),{loading:t}}function wy(){function t(){return Bl.getPossibleNames()}function e(n,i){return Bl.getCheermoteDisplayInfo(n,i,{background:"light",scale:"4",state:"animated"}).color}function r(n,i,s=!1){function o(a="4"){return Bl.getCheermoteDisplayInfo(n,i,{background:"light",scale:a,state:s?"static":"animated"}).url}return{x1:o("1"),x2:o("2"),x4:o("4")}}return{getCheermoteNames:t,getCheerColor:e,getCheermoteUrls:r}}function BT(t,e){return function(){return t.apply(e,arguments)}}const{toString:dO}=Object.prototype,{getPrototypeOf:xy}=Object,qc=(t=>e=>{const r=dO.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),_r=t=>(t=t.toLowerCase(),e=>qc(e)===t),Vc=t=>e=>typeof e===t,{isArray:Ps}=Array,la=Vc("undefined");function hO(t){return t!==null&&!la(t)&&t.constructor!==null&&!la(t.constructor)&&Lt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const LT=_r("ArrayBuffer");function fO(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&<(t.buffer),e}const pO=Vc("string"),Lt=Vc("function"),FT=Vc("number"),Hc=t=>t!==null&&typeof t=="object",mO=t=>t===!0||t===!1,Ll=t=>{if(qc(t)!=="object")return!1;const e=xy(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},gO=_r("Date"),yO=_r("File"),vO=_r("Blob"),_O=_r("FileList"),wO=t=>Hc(t)&&Lt(t.pipe),xO=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Lt(t.append)&&((e=qc(t))==="formdata"||e==="object"&&Lt(t.toString)&&t.toString()==="[object FormData]"))},SO=_r("URLSearchParams"),bO=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ta(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Ps(t))for(n=0,i=t.length;n0;)if(i=r[n],e===i.toLowerCase())return i;return null}const jT=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),$T=t=>!la(t)&&t!==jT;function Cm(){const{caseless:t}=$T(this)&&this||{},e={},r=(n,i)=>{const s=t&&UT(e,i)||i;Ll(e[s])&&Ll(n)?e[s]=Cm(e[s],n):Ll(n)?e[s]=Cm({},n):Ps(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n(Ta(e,(i,s)=>{r&&Lt(i)?t[s]=BT(i,r):t[s]=i},{allOwnKeys:n}),t),TO=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),EO=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},PO=(t,e,r,n)=>{let i,s,o;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&xy(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},AO=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},IO=t=>{if(!t)return null;if(Ps(t))return t;let e=t.length;if(!FT(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},kO=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&xy(Uint8Array)),RO=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},MO=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},OO=_r("HTMLFormElement"),DO=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),kw=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),NO=_r("RegExp"),qT=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Ta(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},BO=t=>{qT(t,(e,r)=>{if(Lt(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(Lt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},LO=(t,e)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Ps(t)?n(t):n(String(t).split(e)),r},FO=()=>{},UO=(t,e)=>(t=+t,Number.isFinite(t)?t:e),bf="abcdefghijklmnopqrstuvwxyz",Rw="0123456789",VT={DIGIT:Rw,ALPHA:bf,ALPHA_DIGIT:bf+bf.toUpperCase()+Rw},jO=(t=16,e=VT.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function $O(t){return!!(t&&Lt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const qO=t=>{const e=new Array(10),r=(n,i)=>{if(Hc(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const s=Ps(n)?[]:{};return Ta(n,(o,a)=>{const l=r(o,i+1);!la(l)&&(s[a]=l)}),e[i]=void 0,s}}return n};return r(t,0)},VO=_r("AsyncFunction"),HO=t=>t&&(Hc(t)||Lt(t))&&Lt(t.then)&&Lt(t.catch),R={isArray:Ps,isArrayBuffer:LT,isBuffer:hO,isFormData:xO,isArrayBufferView:fO,isString:pO,isNumber:FT,isBoolean:mO,isObject:Hc,isPlainObject:Ll,isUndefined:la,isDate:gO,isFile:yO,isBlob:vO,isRegExp:NO,isFunction:Lt,isStream:wO,isURLSearchParams:SO,isTypedArray:kO,isFileList:_O,forEach:Ta,merge:Cm,extend:CO,trim:bO,stripBOM:TO,inherits:EO,toFlatObject:PO,kindOf:qc,kindOfTest:_r,endsWith:AO,toArray:IO,forEachEntry:RO,matchAll:MO,isHTMLForm:OO,hasOwnProperty:kw,hasOwnProp:kw,reduceDescriptors:qT,freezeMethods:BO,toObjectSet:LO,toCamelCase:DO,noop:FO,toFiniteNumber:UO,findKey:UT,global:jT,isContextDefined:$T,ALPHABET:VT,generateString:jO,isSpecCompliantForm:$O,toJSONObject:qO,isAsyncFn:VO,isThenable:HO};function ae(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}R.inherits(ae,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:R.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const HT=ae.prototype,zT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{zT[t]={value:t}});Object.defineProperties(ae,zT);Object.defineProperty(HT,"isAxiosError",{value:!0});ae.from=(t,e,r,n,i,s)=>{const o=Object.create(HT);return R.toFlatObject(t,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ae.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const zO=null;function Tm(t){return R.isPlainObject(t)||R.isArray(t)}function GT(t){return R.endsWith(t,"[]")?t.slice(0,-2):t}function Mw(t,e,r){return t?t.concat(e).map(function(i,s){return i=GT(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function GO(t){return R.isArray(t)&&!t.some(Tm)}const WO=R.toFlatObject(R,{},null,function(e){return/^is[A-Z]/.test(e)});function zc(t,e,r){if(!R.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=R.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,w){return!R.isUndefined(w[_])});const n=r.metaTokens,i=r.visitor||c,s=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(e);if(!R.isFunction(i))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(R.isDate(m))return m.toISOString();if(!l&&R.isBlob(m))throw new ae("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(m)||R.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,_,w){let v=m;if(m&&!w&&typeof m=="object"){if(R.endsWith(_,"{}"))_=n?_:_.slice(0,-2),m=JSON.stringify(m);else if(R.isArray(m)&&GO(m)||(R.isFileList(m)||R.endsWith(_,"[]"))&&(v=R.toArray(m)))return _=GT(_),v.forEach(function(y,x){!(R.isUndefined(y)||y===null)&&e.append(o===!0?Mw([_],x,s):o===null?_:_+"[]",u(y))}),!1}return Tm(m)?!0:(e.append(Mw(w,_,s),u(m)),!1)}const h=[],d=Object.assign(WO,{defaultVisitor:c,convertValue:u,isVisitable:Tm});function p(m,_){if(!R.isUndefined(m)){if(h.indexOf(m)!==-1)throw Error("Circular reference detected in "+_.join("."));h.push(m),R.forEach(m,function(v,g){(!(R.isUndefined(v)||v===null)&&i.call(e,v,R.isString(g)?g.trim():g,_,d))===!0&&p(v,_?_.concat(g):[g])}),h.pop()}}if(!R.isObject(t))throw new TypeError("data must be an object");return p(t),e}function Ow(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Sy(t,e){this._pairs=[],t&&zc(t,this,e)}const WT=Sy.prototype;WT.append=function(e,r){this._pairs.push([e,r])};WT.toString=function(e){const r=e?function(n){return e.call(this,n,Ow)}:Ow;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function QO(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function QT(t,e,r){if(!e)return t;const n=r&&r.encode||QO,i=r&&r.serialize;let s;if(i?s=i(e,r):s=R.isURLSearchParams(e)?e.toString():new Sy(e,r).toString(n),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class KO{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){R.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Dw=KO,KT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},YO=typeof URLSearchParams<"u"?URLSearchParams:Sy,XO=typeof FormData<"u"?FormData:null,JO=typeof Blob<"u"?Blob:null,ZO=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),eD=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Xt={isBrowser:!0,classes:{URLSearchParams:YO,FormData:XO,Blob:JO},isStandardBrowserEnv:ZO,isStandardBrowserWebWorkerEnv:eD,protocols:["http","https","file","blob","url","data"]};function tD(t,e){return zc(t,new Xt.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Xt.isNode&&R.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function rD(t){return R.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function nD(t){const e={},r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n=r.length;return o=!o&&R.isArray(i)?i.length:o,l?(R.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!R.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&R.isArray(i[o])&&(i[o]=nD(i[o])),!a)}if(R.isFormData(t)&&R.isFunction(t.entries)){const r={};return R.forEachEntry(t,(n,i)=>{e(rD(n),i,r,0)}),r}return null}function iD(t,e,r){if(R.isString(t))try{return(e||JSON.parse)(t),R.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const by={transitional:KT,adapter:Xt.isNode?"http":"xhr",transformRequest:[function(e,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=R.isObject(e);if(s&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return i&&i?JSON.stringify(YT(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return tD(e,this.formSerializer).toString();if((a=R.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return zc(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),iD(e)):e}],transformResponse:[function(e){const r=this.transitional||by.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&R.isString(e)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?ae.from(a,ae.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xt.classes.FormData,Blob:Xt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],t=>{by.headers[t]={}});const Cy=by,sD=R.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oD=t=>{const e={};let r,n,i;return t&&t.split(` `).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||e[r]&&sD[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},Nw=Symbol("internals");function qs(t){return t&&String(t).trim().toLowerCase()}function Fl(t){return t===!1||t==null?t:R.isArray(t)?t.map(Fl):String(t)}function aD(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const lD=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Cf(t,e,r,n,i){if(R.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!R.isString(e)){if(R.isString(n))return e.indexOf(n)!==-1;if(R.isRegExp(n))return n.test(e)}}function uD(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function cD(t,e){const r=R.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,o){return this[n].call(this,e,i,s,o)},configurable:!0})})}class Gc{constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function s(a,l,u){const c=qs(l);if(!c)throw new Error("header name must be a non-empty string");const h=R.findKey(i,c);(!h||i[h]===void 0||u===!0||u===void 0&&i[h]!==!1)&&(i[h||l]=Fl(a))}const o=(a,l)=>R.forEach(a,(u,c)=>s(u,c,l));return R.isPlainObject(e)||e instanceof this.constructor?o(e,r):R.isString(e)&&(e=e.trim())&&!lD(e)?o(oD(e),r):e!=null&&s(r,e,n),this}get(e,r){if(e=qs(e),e){const n=R.findKey(this,e);if(n){const i=this[n];if(!r)return i;if(r===!0)return aD(i);if(R.isFunction(r))return r.call(this,i,n);if(R.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=qs(e),e){const n=R.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||Cf(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let i=!1;function s(o){if(o=qs(o),o){const a=R.findKey(n,o);a&&(!r||Cf(n,n[a],a,r))&&(delete n[a],i=!0)}}return R.isArray(e)?e.forEach(s):s(e),i}clear(e){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!e||Cf(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const r=this,n={};return R.forEach(this,(i,s)=>{const o=R.findKey(n,s);if(o){r[o]=Fl(i),delete r[s];return}const a=e?uD(s):String(s).trim();a!==s&&delete r[s],r[a]=Fl(i),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return R.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&R.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[Nw]=this[Nw]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=qs(o);n[a]||(cD(i,o),n[a]=!0)}return R.isArray(e)?e.forEach(s):s(e),this}}Gc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);R.reduceDescriptors(Gc.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});R.freezeMethods(Gc);const Ar=Gc;function Tf(t,e){const r=this||Cy,n=e||r,i=Ar.from(n.headers);let s=n.data;return R.forEach(t,function(a){s=a.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function XT(t){return!!(t&&t.__CANCEL__)}function Ea(t,e,r){ae.call(this,t??"canceled",ae.ERR_CANCELED,e,r),this.name="CanceledError"}R.inherits(Ea,ae,{__CANCEL__:!0});function dD(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new ae("Request failed with status code "+r.status,[ae.ERR_BAD_REQUEST,ae.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const hD=Xt.isStandardBrowserEnv?function(){return{write:function(r,n,i,s,o,a){const l=[];l.push(r+"="+encodeURIComponent(n)),R.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),R.isString(s)&&l.push("path="+s),R.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function fD(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function pD(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function JT(t,e){return t&&!fD(e)?pD(t,e):e}const mD=Xt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(s){let o=s;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(o){const a=R.isString(o)?i(o):o;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function gD(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function yD(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=n[s];o||(o=u),r[i]=l,n[i]=u;let h=s,d=0;for(;h!==i;)d+=r[h++],h=h%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-r,l=n(a),u=s<=o;r=s;const c={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&u?(o-s)/l:void 0,event:i};c[e?"download":"upload"]=!0,t(c)}}const vD=typeof XMLHttpRequest<"u",_D=vD&&function(t){return new Promise(function(r,n){let i=t.data;const s=Ar.from(t.headers).normalize(),o=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}R.isFormData(i)&&(Xt.isStandardBrowserEnv||Xt.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(t.auth){const p=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(p+":"+m))}const c=JT(t.baseURL,t.url);u.open(t.method.toUpperCase(),QT(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout;function h(){if(!u)return;const p=Ar.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),_={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:p,config:t,request:u};dD(function(v){r(v),l()},function(v){n(v),l()},_),u=null}if("onloadend"in u?u.onloadend=h:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(h)},u.onabort=function(){u&&(n(new ae("Request aborted",ae.ECONNABORTED,t,u)),u=null)},u.onerror=function(){n(new ae("Network Error",ae.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const _=t.transitional||KT;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),n(new ae(m,_.clarifyTimeoutError?ae.ETIMEDOUT:ae.ECONNABORTED,t,u)),u=null},Xt.isStandardBrowserEnv){const p=(t.withCredentials||mD(c))&&t.xsrfCookieName&&hD.read(t.xsrfCookieName);p&&s.set(t.xsrfHeaderName,p)}i===void 0&&s.setContentType(null),"setRequestHeader"in u&&R.forEach(s.toJSON(),function(m,_){u.setRequestHeader(_,m)}),R.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&o!=="json"&&(u.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&u.addEventListener("progress",Bw(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Bw(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=p=>{u&&(n(!p||p.type?new Ea(null,t,u):p),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const d=gD(c);if(d&&Xt.protocols.indexOf(d)===-1){n(new ae("Unsupported protocol "+d+":",ae.ERR_BAD_REQUEST,t));return}u.send(i||null)})},Ul={http:zO,xhr:_D};R.forEach(Ul,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ZT={getAdapter:t=>{t=R.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let i=0;it instanceof Ar?t.toJSON():t;function gs(t,e){e=e||{};const r={};function n(u,c,h){return R.isPlainObject(u)&&R.isPlainObject(c)?R.merge.call({caseless:h},u,c):R.isPlainObject(c)?R.merge({},c):R.isArray(c)?c.slice():c}function i(u,c,h){if(R.isUndefined(c)){if(!R.isUndefined(u))return n(void 0,u,h)}else return n(u,c,h)}function s(u,c){if(!R.isUndefined(c))return n(void 0,c)}function o(u,c){if(R.isUndefined(c)){if(!R.isUndefined(u))return n(void 0,u)}else return n(void 0,c)}function a(u,c,h){if(h in e)return n(u,c);if(h in t)return n(void 0,u)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,c)=>i(Fw(u),Fw(c),!0)};return R.forEach(Object.keys(Object.assign({},t,e)),function(c){const h=l[c]||i,d=h(t[c],e[c],c);R.isUndefined(d)&&h!==a||(r[c]=d)}),r}const eE="1.5.0",Ty={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ty[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Uw={};Ty.transitional=function(e,r,n){function i(s,o){return"[Axios v"+eE+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new ae(i(o," has been removed"+(r?" in "+r:"")),ae.ERR_DEPRECATED);return r&&!Uw[o]&&(Uw[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};function wD(t,e,r){if(typeof t!="object")throw new ae("options must be an object",ae.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],o=e[s];if(o){const a=t[s],l=a===void 0||o(a,s,t);if(l!==!0)throw new ae("option "+s+" must be "+l,ae.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ae("Unknown option "+s,ae.ERR_BAD_OPTION)}}const Em={assertOptions:wD,validators:Ty},Wr=Em.validators;class Xu{constructor(e){this.defaults=e,this.interceptors={request:new Dw,response:new Dw}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=gs(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&Em.assertOptions(n,{silentJSONParsing:Wr.transitional(Wr.boolean),forcedJSONParsing:Wr.transitional(Wr.boolean),clarifyTimeoutError:Wr.transitional(Wr.boolean)},!1),i!=null&&(R.isFunction(i)?r.paramsSerializer={serialize:i}:Em.assertOptions(i,{encode:Wr.function,serialize:Wr.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&R.merge(s.common,s[r.method]);s&&R.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),r.headers=Ar.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(r)===!1||(l=l&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});const u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let c,h=0,d;if(!l){const m=[Lw.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,u),d=m.length,c=Promise.resolve(r);h{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new Ea(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new Ey(function(i){e=i}),cancel:e}}}const xD=Ey;function SD(t){return function(r){return t.apply(null,r)}}function bD(t){return R.isObject(t)&&t.isAxiosError===!0}const Pm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pm).forEach(([t,e])=>{Pm[e]=t});const CD=Pm;function tE(t){const e=new jl(t),r=BT(jl.prototype.request,e);return R.extend(r,jl.prototype,e,{allOwnKeys:!0}),R.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return tE(gs(t,i))},r}const Ue=tE(Cy);Ue.Axios=jl;Ue.CanceledError=Ea;Ue.CancelToken=xD;Ue.isCancel=XT;Ue.VERSION=eE;Ue.toFormData=zc;Ue.AxiosError=ae;Ue.Cancel=Ue.CanceledError;Ue.all=function(e){return Promise.all(e)};Ue.spread=SD;Ue.isAxiosError=bD;Ue.mergeConfig=gs;Ue.AxiosHeaders=Ar;Ue.formToJSON=t=>YT(R.isHTMLForm(t)?new FormData(t):t);Ue.getAdapter=ZT.getAdapter;Ue.HttpStatusCode=CD;Ue.default=Ue;const Py=Ue,TD=Py.create({baseURL:"https://api.betterttv.net/3/cached"});class ED{static async getEmotes(e,r){const n=await PD(e,r);if(!n)return null;const i=new Map;return n.forEach(s=>{i.set(s.code,{id:s.id,name:s.code,images:{default:jw(s.id),static:jw(s.id,!0)},source:"betterTTV"})}),i}}function jw(t,e=!1){function r(n=3){return`https://cdn.betterttv.net/emote/${t}${e?"/static":""}/${n}x`}return{x1:r(1),x2:r(2),x4:r(3)}}async function PD(t,e){const r=await AD(`/users/${t}/${e}`);if(!r)return null;const{channelEmotes:n,sharedEmotes:i}=r;return!n||!i||n.length===0&&i.length===0?null:[...n,...i]}async function AD(t){return await TD.get(t).then(e=>e.data).catch(()=>null)}const ID=Py.create({baseURL:"https://api.frankerfacez.com/v1"});class kD{static async getEmotes(e,r){const n=await RD(e,r);if(!n)return null;const i=new Map;return n.forEach(s=>{i.set(s.name,{id:s.id.toString(),name:s.name,images:{default:$w(s),static:$w(s,!0)},source:"frankerFaceZ"})}),i}}function $w(t,e=!1){let r=t.urls[1],n=t.urls[2]||r,i=t.urls[4]||n;return!e&&t.animated&&(r=t.animated[1],n=t.animated[2]||r,i=t.animated[4]||n),{x1:r,x2:n,x4:i}}async function RD(t,e){const r=OD[t],n=await MD(`/room/${r}/${e}`);if(!n)return null;const{sets:i}=n;if(!i)return null;const s=Object.keys(i),o=[];return s.forEach(a=>{const l=i[a];o.push(...l.emoticons)}),o.length===0?null:o}async function MD(t){return await ID.get(t).then(e=>e.data).catch(()=>null)}const OD={twitch:"id",youtube:"yt"},$l=new Map;let qw=!1;function rE(){function t(n){return $l.get(n)}function e(){return Array.from($l.keys())}function r(){return Array.from($l.values())}return{getOtherEmote:t,getOtherEmoteNames:e,getAllOtherEmotes:r}}function DD(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){if(!qw){const[i,s]=await Promise.all([ED.getEmotes("twitch",r.id),kD.getEmotes("twitch",r.id)]);i&&i.forEach(Vw),s&&s.forEach(Vw)}e(!1),qw=!0}n()},[r]),{loading:t}}function Vw(t,e){$l.set(e,t)}function ND(){const{getOtherEmote:t,getOtherEmoteNames:e}=rE(),{getCheerColor:r,getCheermoteUrls:n}=wy();function i(a,l){const{position:u,length:c,id:h,name:d}=a,p=l.slice(u,u+c),m=t(p);return m?{type:"emote",text:p,emote:m}:{type:"emote",text:l.slice(u,u+c),emote:{id:h,name:d,images:{default:Hw(h),static:Hw(h,!0)},source:"twitch"}}}function s(a,l){const{name:u,amount:c,position:h,length:d}=a;return{type:"cheer",text:l.slice(h,h+d),cheer:{color:r(u,c),images:{default:n(u,c),static:n(u,c,!0)},name:u,amount:c}}}function o(a){const{text:l}=a,u=BD(e());return l.split(u).filter(h=>h!=="").map(h=>{const d=t(h);return d?{type:"emote",text:h,emote:d}:{type:"text",text:h}})}return{transformTextPart:o,transformEmotePart:i,transformCheerPart:s}}function Hw(t,e=!1){function r(n="3.0"){return DT(t,{animationSettings:e?"static":"default",backgroundType:"light",size:n})}return{x1:r("1.0"),x2:r("2.0"),x4:r("3.0")}}function BD(t){const e=t.map(LD).join("|"),r=String.raw`(?<=\s|[.,!]|^)(${e})(?=\s|[.,!]|$)`;return new RegExp(r,"g")}function LD(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FD(){const{transformTextPart:t,transformCheerPart:e,transformEmotePart:r}=ND(),{getCheermoteNames:n}=wy();function i(s,o,a=!1){if(!s)return[];const l=nO(s,o,a?n():void 0),u=[];return l.forEach(c=>{switch(c.type){default:case"text":u.push(...t(c));break;case"cheer":u.push(e(c,s));break;case"emote":u.push(r(c,s));break}}),u}return{transformText:i}}const UD=Py.create({baseURL:"https://pronouns.alejo.io/api"}),jD=1e3*60*5,zw=new Map,Am=new Map;let Im=!1;function nE(){async function t(r){if(!Im)return;let n=zw.get(r);if(!n||n.expire{async function r(){if(!Im){const n=await VD();n&&n.forEach(({name:i,display:s})=>{Am.set(i,s)})}e(!1),Im=!0}r()},[]),{loading:t}}async function qD(t){const e=await iE(`/users/${t}`);if(!e)return;const[r]=e;if(r)return r.pronoun_id}async function VD(){return iE("/pronouns")}async function iE(t){return await UD.get(t).then(e=>e.data).catch(()=>null)}const km=new Map;let Gw=!1;function sE(){function t(r){const n=[];return r.forEach((i,s)=>{var a,l;const o=(l=(a=km.get(s))==null?void 0:a.get(i))==null?void 0:l.getImageUrl(4);o&&n.push({id:s,image:o})}),n}function e(r){var i,s;const n=(s=(i=km.get(r))==null?void 0:i.get(r==="subscriber"||r==="founder"?"0":"1"))==null?void 0:s.getImageUrl(4);if(n)return{id:r,image:n}}return{transformBadges:t,getBadge:e}}function HD(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){if(!Gw){const[i,s]=await Promise.all([ms.chat.getChannelBadges(r.id),ms.chat.getGlobalBadges()]);Ww(s),Ww(i)}e(!1),Gw=!0}n()},[r]),{loading:t}}function Ww(t){t.forEach(e=>{const r=new Map;e.versions.forEach(n=>{r.set(n.id,n)}),km.set(e.id,r)})}function Le(t,e){let r=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(o=>[o]));let n=e[0].length,i=e[0].map((o,a)=>e.map(l=>l[a])),s=t.map(o=>i.map(a=>{let l=0;if(!Array.isArray(o)){for(let u of a)l+=o*u;return l}for(let u=0;uo[0]):s}function Pa(t){return gn(t)==="string"}function gn(t){return(Object.prototype.toString.call(t).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Ju(t,e){t=+t,e=+e;let r=(Math.floor(t)+"").length;if(e>r)return+t.toFixed(e-r);{let n=10**(r-e);return Math.round(t/n)*n}}function oE(t){if(!t)return;t=t.trim();const e=/^([a-z]+)\((.+?)\)$/i,r=/^-?[\d.]+$/;let n=t.match(e);if(n){let i=[];return n[2].replace(/\/?\s*([-\w.]+(?:%|deg)?)/g,(s,o)=>{/%$/.test(o)?(o=new Number(o.slice(0,-1)/100),o.type=""):/deg$/.test(o)?(o=new Number(+o.slice(0,-3)),o.type="",o.unit="deg"):r.test(o)&&(o=new Number(o),o.type=""),s.startsWith("/")&&(o=o instanceof Number?o:new Number(o),o.alpha=!0),i.push(o)}),{name:n[1].toLowerCase(),rawName:n[1],rawArgs:n[2],args:i}}}function aE(t){return t[t.length-1]}function Zu(t,e,r){return isNaN(t)?e:isNaN(e)?t:t+(e-t)*r}function lE(t,e,r){return(r-t)/(e-t)}function Ay(t,e,r){return Zu(e[0],e[1],lE(t[0],t[1],r))}function uE(t){return t.map(e=>e.split("|").map(r=>{r=r.trim();let n=r.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(n){let i=new String(n[1]);return i.range=[+n[2],+n[3]],i}return r}))}var zD=Object.freeze({__proto__:null,interpolate:Zu,interpolateInv:lE,isString:Pa,last:aE,mapRange:Ay,multiplyMatrices:Le,parseCoordGrammar:uE,parseFunction:oE,toPrecision:Ju,type:gn});class GD{add(e,r,n){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(e,r){this[e]=this[e]||[],this[e].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}}const Tn=new GD;var gr={gamut_mapping:"lch.c",precision:5,deltaE:"76"};const Jt={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Rm(t){return Array.isArray(t)?t:Jt[t]}function ec(t,e,r,n={}){if(t=Rm(t),e=Rm(e),!t||!e)throw new TypeError(`Missing white point to convert ${t?"":"from"}${!t&&!e?"/":""}${e?"":"to"}`);if(t===e)return r;let i={W1:t,W2:e,XYZ:r,options:n};if(Tn.run("chromatic-adaptation-start",i),i.M||(i.W1===Jt.D65&&i.W2===Jt.D50?i.M=[[1.0479298208405488,.022946793341019088,-.05019222954313557],[.029627815688159344,.990434484573249,-.01707382502938514],[-.009243058152591178,.015055144896577895,.7518742899580008]]:i.W1===Jt.D50&&i.W2===Jt.D65&&(i.M=[[.9554734527042182,-.023098536874261423,.0632593086610217],[-.028369706963208136,1.0099954580058226,.021041398966943008],[.012314001688319899,-.020507696433477912,1.3303659366080753]])),Tn.run("chromatic-adaptation-end",i),i.M)return Le(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const WD=75e-6,_t=class _t{constructor(e){var i,s,o;this.id=e.id,this.name=e.name,this.base=e.base?_t.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let a in r)"name"in r[a]||(r[a].name=a);this.coords=r;let n=e.white??this.base.white??"D65";this.white=Rm(n),this.formats=e.formats??{};for(let a in this.formats){let l=this.formats[a];l.type||(l.type="function"),l.name||(l.name=a)}e.cssId&&!((i=this.formats.functions)!=null&&i.color)?(this.formats.color={id:e.cssId},Object.defineProperty(this,"cssId",{value:e.cssId})):(s=this.formats)!=null&&s.color&&!((o=this.formats)!=null&&o.color.id)&&(this.formats.color.id=this.id),this.referred=e.referred,Object.defineProperty(this,"path",{value:QD(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Tn.run("colorspace-init-end",this)}inGamut(e,{epsilon:r=WD}={}){if(this.isPolar)return e=this.toBase(e),this.base.inGamut(e,{epsilon:r});let n=Object.values(this.coords);return e.every((i,s)=>{let o=n[s];if(o.type!=="angle"&&o.range){if(Number.isNaN(i))return!0;let[a,l]=o.range;return(a===void 0||i>=a-r)&&(l===void 0||i<=l+r)}return!0})}get cssId(){var e,r;return((r=(e=this.formats.functions)==null?void 0:e.color)==null?void 0:r.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=Qw(e,this),e;let r;return e==="default"?r=Object.values(this.formats)[0]:r=this.formats[e],r?(r=Qw(r,this),r):null}equals(e){return e?this===e||this.id===e.id:!1}to(e,r){if(arguments.length===1&&([e,r]=[e.space,e.coords]),e=_t.get(e),this.equals(e))return r;r=r.map(a=>Number.isNaN(a)?0:a);let n=this.path,i=e.path,s,o;for(let a=0;ao;a--)r=n[a].toBase(r);for(let a=o+1;a=0){let u=Object.entries(i.coords)[s];if(u)return{space:i,id:u[0],index:s,...u[1]}}i=_t.get(i);let o=s.toLowerCase(),a=0;for(let u in i.coords){let c=i.coords[u];if(u.toLowerCase()===o||((l=c.name)==null?void 0:l.toLowerCase())===o)return{space:i,id:u,index:a,...c};a++}throw new TypeError(`No "${s}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(", ")}`)}};fd(_t,"registry",{}),fd(_t,"DEFAULT_FORMAT",{type:"functions",name:"color"});let Y=_t;function QD(t){let e=[t];for(let r=t;r=r.base;)e.push(r);return e}function Qw(t,{coords:e}={}){if(t.coords&&!t.coordGrammar){t.type||(t.type="function"),t.name||(t.name="color"),t.coordGrammar=uE(t.coords);let r=Object.entries(e).map(([n,i],s)=>{let o=t.coordGrammar[s][0],a=i.range||i.refRange,l=o.range,u="";return o==""?(l=[0,100],u="%"):o==""&&(u="deg"),{fromRange:a,toRange:l,suffix:u}});t.serializeCoords=(n,i)=>n.map((s,o)=>{let{fromRange:a,toRange:l,suffix:u}=r[o];return a&&l&&(s=Ay(a,l,s)),s=Ju(s,i),u&&(s+=u),s})}return t}var Ft=new Y({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class gt extends Y{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Ft),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=r=>{let n=Le(e.toXYZ_M,r);return this.white!==this.base.white&&(n=ec(this.white,this.base.white,n)),n}),e.fromBase??(e.fromBase=r=>(r=ec(this.base.white,this.white,r),Le(e.fromXYZ_M,r)))),e.referred??(e.referred="display"),super(e)}}function cE(t,{meta:e}={}){var n,i,s,o,a;let r={str:(n=String(t))==null?void 0:n.trim()};if(Tn.run("parse-start",r),r.color)return r.color;if(r.parsed=oE(r.str),r.parsed){let l=r.parsed.name;if(l==="color"){let u=r.parsed.args.shift(),c=r.parsed.rawArgs.indexOf("/")>0?r.parsed.args.pop():1;for(let d of Y.all){let p=d.getFormat("color");if(p&&(u===p.id||(i=p.ids)!=null&&i.includes(u))){const m=Object.keys(d.coords).map((_,w)=>r.parsed.args[w]||0);return e&&(e.formatId="color"),{spaceId:d.id,coords:m,alpha:c}}}let h="";if(u in Y.registry){let d=(a=(o=(s=Y.registry[u].formats)==null?void 0:s.functions)==null?void 0:o.color)==null?void 0:a.id;d&&(h=`Did you mean color(${d})?`)}throw new TypeError(`Cannot parse color(${u}). `+(h||"Missing a plugin?"))}else for(let u of Y.all){let c=u.getFormat(l);if(c&&c.type==="function"){let h=1;(c.lastAlpha||aE(r.parsed.args).alpha)&&(h=r.parsed.args.pop());let d=r.parsed.args,p;return c.coordGrammar&&(p=Object.entries(u.coords).map(([m,_],w)=>{var k;let v=c.coordGrammar[w],g=(k=d[w])==null?void 0:k.type,y=v.find(O=>O==g);if(!y){let O=_.name||m;throw new TypeError(`${g} not allowed for ${O} in ${l}()`)}let x=y.range;g===""&&(x||(x=[0,1]));let C=_.range||_.refRange;return x&&C&&(d[w]=Ay(x,C,d[w])),y})),e&&Object.assign(e,{formatId:c.name,types:p}),{spaceId:u.id,coords:d,alpha:h}}}}else for(let l of Y.all)for(let u in l.formats){let c=l.formats[u];if(c.type!=="custom"||c.test&&!c.test(r.str))continue;let h=c.parse(r.str);if(h)return h.alpha??(h.alpha=1),e&&(e.formatId=u),h}throw new TypeError(`Could not parse ${t} as a color. Missing a plugin?`)}function fe(t){if(!t)throw new TypeError("Empty color reference");Pa(t)&&(t=cE(t));let e=t.space||t.spaceId;return e instanceof Y||(t.space=Y.get(e)),t.alpha===void 0&&(t.alpha=1),t}function Aa(t,e){return e=Y.get(e),e.from(t)}function Ut(t,e){let{space:r,index:n}=Y.resolveCoord(e,t.space);return Aa(t,r)[n]}function dE(t,e,r){return e=Y.get(e),t.coords=e.to(t.space,r),t}function En(t,e,r){if(t=fe(t),arguments.length===2&&gn(arguments[1])==="object"){let n=arguments[1];for(let i in n)En(t,i,n[i])}else{typeof r=="function"&&(r=r(Ut(t,e)));let{space:n,index:i}=Y.resolveCoord(e,t.space),s=Aa(t,n);s[i]=r,dE(t,n,s)}return t}var Iy=new Y({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Ft,fromBase:t=>ec(Ft.white,"D50",t),toBase:t=>ec("D50",Ft.white,t),formats:{color:{}}});const KD=216/24389,Kw=24/116,al=24389/27;let Pf=Jt.D50;var St=new Y({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"L"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Pf,base:Iy,fromBase(t){let r=t.map((n,i)=>n/Pf[i]).map(n=>n>KD?Math.cbrt(n):(al*n+16)/116);return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(t){let e=[];return e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200,[e[0]>Kw?Math.pow(e[0],3):(116*e[0]-16)/al,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/al,e[2]>Kw?Math.pow(e[2],3):(116*e[2]-16)/al].map((n,i)=>n*Pf[i])},formats:{lab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function Wc(t){return(t%360+360)%360}function YD(t,e){if(t==="raw")return e;let[r,n]=e.map(Wc),i=n-r;return t==="increasing"?i<0&&(n+=360):t==="decreasing"?i>0&&(r+=360):t==="longer"?-1800?r+=360:n+=360):t==="shorter"&&(i>180?r+=360:i<-180&&(n+=360)),[r,n]}var ua=new Y({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:St,fromBase(t){let[e,r,n]=t,i;const s=.02;return Math.abs(r) | "," | "," | "]}}});const Yw=25**7,tc=Math.PI,Xw=180/tc,Si=tc/180;function Mm(t,e,{kL:r=1,kC:n=1,kH:i=1}={}){let[s,o,a]=St.from(t),l=ua.from(St,[s,o,a])[1],[u,c,h]=St.from(e),d=ua.from(St,[u,c,h])[1];l<0&&(l=0),d<0&&(d=0);let m=((l+d)/2)**7,_=.5*(1-Math.sqrt(m/(m+Yw))),w=(1+_)*o,v=(1+_)*c,g=Math.sqrt(w**2+a**2),y=Math.sqrt(v**2+h**2),x=w===0&&a===0?0:Math.atan2(a,w),C=v===0&&h===0?0:Math.atan2(h,v);x<0&&(x+=2*tc),C<0&&(C+=2*tc),x*=Xw,C*=Xw;let k=u-s,O=y-g,A=C-x,N=x+C,j=Math.abs(A),Q;g*y===0?Q=0:j<=180?Q=A:A>180?Q=A-360:A<-180?Q=A+360:console.log("the unthinkable has happened");let re=2*Math.sqrt(y*g)*Math.sin(Q*Si/2),Z=(s+u)/2,T=(g+y)/2,I=Math.pow(T,7),V;g*y===0?V=N:j<=180?V=N/2:N<360?V=(N+360)/2:V=(N-360)/2;let se=(Z-50)**2,L=1+.015*se/Math.sqrt(20+se),F=1+.045*T,z=1;z-=.17*Math.cos((V-30)*Si),z+=.24*Math.cos(2*V*Si),z+=.32*Math.cos((3*V+6)*Si),z-=.2*Math.cos((4*V-63)*Si);let H=1+.015*T*z,oe=30*Math.exp(-1*((V-275)/25)**2),Ht=2*Math.sqrt(I/(I+Yw)),Ye=-1*Math.sin(2*oe*Si)*Ht,yt=(k/(r*L))**2;return yt+=(O/(n*F))**2,yt+=(re/(i*H))**2,yt+=Ye*(O/(n*F))*(re/(i*H)),Math.sqrt(yt)}const XD=75e-6;function fo(t,e=t.space,{epsilon:r=XD}={}){t=fe(t),e=Y.get(e);let n=t.coords;return e!==t.space&&(n=e.from(t)),e.inGamut(n,{epsilon:r})}function ca(t){return{space:t.space,coords:t.coords.slice(),alpha:t.alpha}}function Pn(t,{method:e=gr.gamut_mapping,space:r=t.space}={}){if(Pa(arguments[1])&&(r=arguments[1]),r=Y.get(r),fo(t,r,{epsilon:0}))return fe(t);let n=Ot(t,r);if(e!=="clip"&&!fo(t,r)){let i=Pn(ca(n),{method:"clip",space:r});if(Mm(t,i)>2){let s=Y.resolveCoord(e),o=s.space,a=s.id,l=Ot(n,o),c=(s.range||s.refRange)[0],h=.01,d=c,p=Ut(l,a);for(;p-d>h;){let m=ca(l);m=Pn(m,{space:r,method:"clip"}),Mm(l,m)-2s.range||[]);n.coords=n.coords.map((s,o)=>{let[a,l]=i[o];return a!==void 0&&(s=Math.max(a,s)),l!==void 0&&(s=Math.min(s,l)),s})}return r!==t.space&&(n=Ot(n,t.space)),t.coords=n.coords,t}Pn.returns="color";function Ot(t,e,{inGamut:r}={}){t=fe(t),e=Y.get(e);let n=e.from(t),i={space:e,coords:n,alpha:t.alpha};return r&&(i=Pn(i)),i}Ot.returns="color";function rc(t,{precision:e=gr.precision,format:r="default",inGamut:n=!0,...i}={}){var l;let s;t=fe(t);let o=r;r=t.space.getFormat(r)??t.space.getFormat("default")??Y.DEFAULT_FORMAT,n||(n=r.toGamut);let a=t.coords;if(a=a.map(u=>u||0),n&&!fo(t)&&(a=Pn(ca(t),n===!0?void 0:n).coords),r.type==="custom")if(i.precision=e,r.serialize)s=r.serialize(a,t.alpha,i);else throw new TypeError(`format ${o} can only be used to parse colors, not for serialization`);else{let u=r.name||"color";r.serializeCoords?a=r.serializeCoords(a,e):e!==null&&(a=a.map(p=>Ju(p,e)));let c=[...a];if(u==="color"){let p=r.id||((l=r.ids)==null?void 0:l[0])||t.space.id;c.unshift(p)}let h=t.alpha;e!==null&&(h=Ju(h,e));let d=t.alpha<1&&!r.noAlpha?`${r.commas?",":" /"} ${h}`:"";s=`${u}(${c.join(r.commas?", ":" ")}${d})`}return s}const JD=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],ZD=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var Qc=new gt({id:"rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:JD,fromXYZ_M:ZD,formats:{color:{}}});const ll=1.09929682680944,Jw=.018053968510807;var hE=new gt({id:"rec2020",name:"REC.2020",base:Qc,toBase(t){return t.map(function(e){return e=Jw?ll*Math.pow(e,.45)-(ll-1):4.5*e})},formats:{color:{}}});const eN=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],tN=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var fE=new gt({id:"p3-linear",name:"Linear P3",white:"D65",toXYZ_M:eN,fromXYZ_M:tN});const rN=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],nN=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var pE=new gt({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:rN,fromXYZ_M:nN,formats:{color:{}}}),Zw={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let e1=Array(3).fill(" | [0, 255]"),t1=Array(3).fill("[0, 255]");var da=new gt({id:"srgb",name:"sRGB",base:pE,fromBase:t=>t.map(e=>{let r=e<0?-1:1,n=e*r;return n>.0031308?r*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:t=>t.map(e=>{let r=e<0?-1:1,n=e*r;return n<.04045?e/12.92:r*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:e1},rgb_number:{name:"rgb",commas:!0,coords:t1,noAlpha:!0},color:{},rgba:{coords:e1,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:t1},hex:{type:"custom",toGamut:!0,test:t=>/^#([a-f0-9]{3,4}){1,2}$/i.test(t),parse(t){t.length<=5&&(t=t.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return t.replace(/[a-f0-9]{2}/gi,r=>{e.push(parseInt(r,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(t,e,{collapse:r=!0}={})=>{e<1&&t.push(e),t=t.map(s=>Math.round(s*255));let n=r&&t.every(s=>s%17===0);return"#"+t.map(s=>n?(s/17).toString(16):s.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:t=>/^[a-z]+$/i.test(t),parse(t){t=t.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(t==="transparent"?(e.coords=Zw.black,e.alpha=0):e.coords=Zw[t],e.coords)return e}}}}),mE=new gt({id:"p3",name:"P3",base:fE,fromBase:da.fromBase,toBase:da.toBase,formats:{color:{id:"display-p3"}}});gr.display_space=da;if(typeof CSS<"u"&&CSS.supports)for(let t of[St,hE,mE]){let e=t.getMinCoords(),n=rc({space:t,coords:e,alpha:1});if(CSS.supports("color",n)){gr.display_space=t;break}}function iN(t,{space:e=gr.display_space,...r}={}){let n=rc(t,r);if(typeof CSS>"u"||CSS.supports("color",n)||!gr.display_space)n=new String(n),n.color=t;else{let i=Ot(t,e);n=new String(rc(i,r)),n.color=i}return n}function gE(t,e,r="lab"){r=Y.get(r);let n=r.from(t),i=r.from(e);return Math.sqrt(n.reduce((s,o,a)=>{let l=i[a];return isNaN(o)||isNaN(l)?s:s+(l-o)**2},0))}function sN(t,e){return t=fe(t),e=fe(e),t.space===e.space&&t.alpha===e.alpha&&t.coords.every((r,n)=>r===e.coords[n])}function An(t){return Ut(t,[Ft,"y"])}function yE(t,e){En(t,[Ft,"y"],e)}function oN(t){Object.defineProperty(t.prototype,"luminance",{get(){return An(this)},set(e){yE(this,e)}})}var aN=Object.freeze({__proto__:null,getLuminance:An,register:oN,setLuminance:yE});function lN(t,e){t=fe(t),e=fe(e);let r=Math.max(An(t),0),n=Math.max(An(e),0);return n>r&&([r,n]=[n,r]),(r+.05)/(n+.05)}const uN=.56,cN=.57,dN=.62,hN=.65,r1=.022,fN=1.414,pN=.1,mN=5e-4,gN=1.14,n1=.027,yN=1.14;function i1(t){return t>=r1?t:t+(r1-t)**fN}function bi(t){let e=t<0?-1:1,r=Math.abs(t);return e*Math.pow(r,2.4)}function vN(t,e){e=fe(e),t=fe(t);let r,n,i,s,o,a;e=Ot(e,"srgb"),[s,o,a]=e.coords;let l=bi(s)*.2126729+bi(o)*.7151522+bi(a)*.072175;t=Ot(t,"srgb"),[s,o,a]=t.coords;let u=bi(s)*.2126729+bi(o)*.7151522+bi(a)*.072175,c=i1(l),h=i1(u),d=h>c;return Math.abs(h-c)0?i=n-n1:i=n+n1,i*100}function _N(t,e){t=fe(t),e=fe(e);let r=Math.max(An(t),0),n=Math.max(An(e),0);n>r&&([r,n]=[n,r]);let i=r+n;return i===0?0:(r-n)/i}const wN=5e4;function xN(t,e){t=fe(t),e=fe(e);let r=Math.max(An(t),0),n=Math.max(An(e),0);return n>r&&([r,n]=[n,r]),n===0?wN:(r-n)/n}function SN(t,e){t=fe(t),e=fe(e);let r=Ut(t,[St,"l"]),n=Ut(e,[St,"l"]);return Math.abs(r-n)}const bN=216/24389,s1=24/116,ul=24389/27;let Af=Jt.D65;var Om=new Y({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"L"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Af,base:Ft,fromBase(t){let r=t.map((n,i)=>n/Af[i]).map(n=>n>bN?Math.cbrt(n):(ul*n+16)/116);return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(t){let e=[];return e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200,[e[0]>s1?Math.pow(e[0],3):(116*e[0]-16)/ul,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/ul,e[2]>s1?Math.pow(e[2],3):(116*e[2]-16)/ul].map((n,i)=>n*Af[i])},formats:{"lab-d65":{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});const If=Math.pow(5,.5)*.5+.5;function CN(t,e){t=fe(t),e=fe(e);let r=Ut(t,[Om,"l"]),n=Ut(e,[Om,"l"]),i=Math.abs(Math.pow(r,If)-Math.pow(n,If)),s=Math.pow(i,1/If)*Math.SQRT2-40;return s<7.5?0:s}var ql=Object.freeze({__proto__:null,contrastAPCA:vN,contrastDeltaPhi:CN,contrastLstar:SN,contrastMichelson:_N,contrastWCAG21:lN,contrastWeber:xN});function TN(t,e,r={}){Pa(r)&&(r={algorithm:r});let{algorithm:n,...i}=r;if(!n){let s=Object.keys(ql).map(o=>o.replace(/^contrast/,"")).join(", ");throw new TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${s}`)}t=fe(t),e=fe(e);for(let s in ql)if("contrast"+n.toLowerCase()===s.toLowerCase())return ql[s](t,e,i);throw new TypeError(`Unknown contrast algorithm: ${n}`)}function vE(t){let[e,r,n]=Aa(t,Ft),i=e+15*r+3*n;return[4*e/i,9*r/i]}function _E(t){let[e,r,n]=Aa(t,Ft),i=e+r+n;return[e/i,r/i]}function EN(t){Object.defineProperty(t.prototype,"uv",{get(){return vE(this)}}),Object.defineProperty(t.prototype,"xy",{get(){return _E(this)}})}var PN=Object.freeze({__proto__:null,register:EN,uv:vE,xy:_E});function AN(t,e){return gE(t,e,"lab")}const IN=Math.PI,o1=IN/180;function kN(t,e,{l:r=2,c:n=1}={}){let[i,s,o]=St.from(t),[,a,l]=ua.from(St,[i,s,o]),[u,c,h]=St.from(e),d=ua.from(St,[u,c,h])[1];a<0&&(a=0),d<0&&(d=0);let p=i-u,m=a-d,_=s-c,w=o-h,v=_**2+w**2-m**2,g=.511;i>=16&&(g=.040975*i/(1+.01765*i));let y=.0638*a/(1+.0131*a)+.638,x;Number.isNaN(l)&&(l=0),l>=164&&l<=345?x=.56+Math.abs(.2*Math.cos((l+168)*o1)):x=.36+Math.abs(.4*Math.cos((l+35)*o1));let C=Math.pow(a,4),k=Math.sqrt(C/(C+1900)),O=y*(k*x+1-k),A=(p/(r*g))**2;return A+=(m/(n*y))**2,A+=v/O**2,Math.sqrt(A)}const a1=203;var ky=new Y({id:"xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Ft,fromBase(t){return t.map(e=>Math.max(e*a1,0))},toBase(t){return t.map(e=>Math.max(e/a1,0))}});const cl=1.15,dl=.66,l1=2610/2**14,RN=2**14/2610,u1=3424/2**12,c1=2413/2**7,d1=2392/2**7,MN=1.7*2523/2**5,h1=2**5/(1.7*2523),hl=-.56,kf=16295499532821565e-27,ON=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],DN=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],NN=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],BN=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var wE=new Y({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:ky,fromBase(t){let[e,r,n]=t,i=cl*e-(cl-1)*n,s=dl*r-(dl-1)*e,a=Le(ON,[i,s,n]).map(function(d){let p=u1+c1*(d/1e4)**l1,m=1+d1*(d/1e4)**l1;return(p/m)**MN}),[l,u,c]=Le(NN,a);return[(1+hl)*l/(1+hl*l)-kf,u,c]},toBase(t){let[e,r,n]=t,i=(e+kf)/(1+hl-hl*(e+kf)),o=Le(BN,[i,r,n]).map(function(d){let p=u1-d**h1,m=d1*d**h1-c1;return 1e4*(p/m)**RN}),[a,l,u]=Le(DN,o),c=(a+(cl-1)*u)/cl,h=(l+(dl-1)*c)/dl;return[c,h,u]},formats:{color:{}}}),Dm=new Y({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:wE,fromBase(t){let[e,r,n]=t,i;const s=2e-4;return Math.abs(r)Math.cbrt(n));return Le(KN,r)},toBase(t){let r=Le(YN,t).map(n=>n**3);return Le(QN,r)},formats:{oklab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function XN(t,e){let[r,n,i]=nc.from(t),[s,o,a]=nc.from(e),l=r-s,u=n-o,c=i-a;return Math.sqrt(l**2+u**2+c**2)}var ic={deltaE76:AN,deltaECMC:kN,deltaE2000:Mm,deltaEJz:LN,deltaEITP:GN,deltaEOK:XN};function Ys(t,e,r={}){Pa(r)&&(r={method:r});let{method:n=gr.deltaE,...i}=r;t=fe(t),e=fe(e);for(let s in ic)if("deltae"+n.toLowerCase()===s.toLowerCase())return ic[s](t,e,i);throw new TypeError(`Unknown deltaE method: ${n}`)}function JN(t,e=.25){let n=[Y.get("oklch","lch"),"l"];return En(t,n,i=>i*(1+e))}function ZN(t,e=.25){let n=[Y.get("oklch","lch"),"l"];return En(t,n,i=>i*(1-e))}var e4=Object.freeze({__proto__:null,darken:ZN,lighten:JN});function CE(t,e,r=.5,n={}){[t,e]=[fe(t),fe(e)],gn(r)==="object"&&([r,n]=[.5,r]);let{space:i,outputSpace:s,premultiplied:o}=n;return Ia(t,e,{space:i,outputSpace:s,premultiplied:o})(r)}function TE(t,e,r={}){let n;Ry(t)&&([n,r]=[t,e],[t,e]=n.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:s,steps:o=2,maxSteps:a=1e3,...l}=r;n||([t,e]=[fe(t),fe(e)],n=Ia(t,e,l));let u=Ys(t,e),c=i>0?Math.max(o,Math.ceil(u/i)+1):o,h=[];if(a!==void 0&&(c=Math.min(c,a)),c===1)h=[{p:.5,color:n(.5)}];else{let d=1/(c-1);h=Array.from({length:c},(p,m)=>{let _=m*d;return{p:_,color:n(_)}})}if(i>0){let d=h.reduce((p,m,_)=>{if(_===0)return 0;let w=Ys(m.color,h[_-1].color,s);return Math.max(p,w)},0);for(;d>i;){d=0;for(let p=1;pd.color),h}function Ia(t,e,r={}){if(Ry(t)){let[l,u]=[t,e];return Ia(...l.rangeArgs.colors,{...l.rangeArgs.options,...u})}let{space:n,outputSpace:i,progression:s,premultiplied:o}=r;t=fe(t),e=fe(e),t=ca(t),e=ca(e);let a={colors:[t,e],options:r};if(n?n=Y.get(n):n=Y.registry[gr.interpolationSpace]||t.space,i=i?Y.get(i):n,t=Ot(t,n),e=Ot(e,n),t=Pn(t),e=Pn(e),n.coords.h&&n.coords.h.type==="angle"){let l=r.hue=r.hue||"shorter",u=[n,"h"],[c,h]=[Ut(t,u),Ut(e,u)];[c,h]=YD(l,[c,h]),En(t,u,c),En(e,u,h)}return o&&(t.coords=t.coords.map(l=>l*t.alpha),e.coords=e.coords.map(l=>l*e.alpha)),Object.assign(l=>{l=s?s(l):l;let u=t.coords.map((d,p)=>{let m=e.coords[p];return Zu(d,m,l)}),c=Zu(t.alpha,e.alpha,l),h={space:n,coords:u,alpha:c};return o&&(h.coords=h.coords.map(d=>d/c)),i!==n&&(h=Ot(h,i)),h},{rangeArgs:a})}function Ry(t){return gn(t)==="function"&&!!t.rangeArgs}gr.interpolationSpace="lab";function t4(t){t.defineFunction("mix",CE,{returns:"color"}),t.defineFunction("range",Ia,{returns:"function"}),t.defineFunction("steps",TE,{returns:"array"})}var r4=Object.freeze({__proto__:null,isRange:Ry,mix:CE,range:Ia,register:t4,steps:TE}),EE=new Y({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:da,fromBase:t=>{let e=Math.max(...t),r=Math.min(...t),[n,i,s]=t,[o,a,l]=[NaN,0,(r+e)/2],u=e-r;if(u!==0){switch(a=l===0||l===1?0:(e-l)/Math.min(l,1-l),e){case n:o=(i-s)/u+(i{let[e,r,n]=t;e=e%360,e<0&&(e+=360),r/=100,n/=100;function i(s){let o=(s+e/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(o-3,9-o,1))}return[i(0),i(8),i(4)]},formats:{hsl:{toGamut:!0,coords:[" | ","",""]},hsla:{coords:[" | ","",""],commas:!0,lastAlpha:!0}}}),PE=new Y({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:EE,fromBase(t){let[e,r,n]=t;r/=100,n/=100;let i=n+r*Math.min(n,1-n);return[e,i===0?0:200*(1-n/i),100*i]},toBase(t){let[e,r,n]=t;r/=100,n/=100;let i=n*(1-r/2);return[e,i===0||i===1?0:(n-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{toGamut:!0}}}),n4=new Y({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:PE,fromBase(t){let[e,r,n]=t;return[e,n*(100-r)/100,100-n]},toBase(t){let[e,r,n]=t;r/=100,n/=100;let i=r+n;if(i>=1){let a=r/i;return[e,0,a*100]}let s=1-n,o=s===0?0:1-r/s;return[e,o*100,s*100]},formats:{hwb:{toGamut:!0,coords:[" | ","",""]}}});const i4=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],s4=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var AE=new gt({id:"a98rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:i4,fromXYZ_M:s4}),o4=new gt({id:"a98rgb",name:"Adobe® 98 RGB compatible",base:AE,toBase:t=>t.map(e=>Math.pow(Math.abs(e),563/256)*Math.sign(e)),fromBase:t=>t.map(e=>Math.pow(Math.abs(e),256/563)*Math.sign(e)),formats:{color:{id:"a98-rgb"}}});const a4=[[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],l4=[[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]];var IE=new gt({id:"prophoto-linear",name:"Linear ProPhoto",white:"D50",base:Iy,toXYZ_M:a4,fromXYZ_M:l4});const u4=1/512,c4=16/512;var d4=new gt({id:"prophoto",name:"ProPhoto",base:IE,toBase(t){return t.map(e=>ee>=u4?e**(1/1.8):16*e)},formats:{color:{id:"prophoto-rgb"}}}),h4=new Y({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:nc,fromBase(t){let[e,r,n]=t,i;const s=2e-4;return Math.abs(r) | "," | [0,1]"," | "]}}});const m1=203,g1=2610/2**14,f4=2**14/2610,p4=2523/2**5,y1=2**5/2523,v1=3424/2**12,_1=2413/2**7,w1=2392/2**7;var m4=new gt({id:"rec2100pq",name:"REC.2100-PQ",base:Qc,toBase(t){return t.map(function(e){return(Math.max(e**y1-v1,0)/(_1-w1*e**y1))**f4*1e4/m1})},fromBase(t){return t.map(function(e){let r=Math.max(e*m1/1e4,0),n=v1+_1*r**g1,i=1+w1*r**g1;return(n/i)**p4})},formats:{color:{id:"rec2100-pq"}}});const x1=.17883277,S1=.28466892,b1=.55991073,Rf=3.7743;var g4=new gt({id:"rec2100hlg",cssid:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:Qc,toBase(t){return t.map(function(e){return e<=.5?e**2/3*Rf:(Math.exp((e-b1)/x1)+S1)/12*Rf})},fromBase(t){return t.map(function(e){return e/=Rf,e<=1/12?Math.sqrt(3*e):x1*Math.log(12*e-S1)+b1})},formats:{color:{id:"rec2100-hlg"}}});const kE={};Tn.add("chromatic-adaptation-start",t=>{t.options.method&&(t.M=RE(t.W1,t.W2,t.options.method))});Tn.add("chromatic-adaptation-end",t=>{t.M||(t.M=RE(t.W1,t.W2,t.options.method))});function Kc({id:t,toCone_M:e,fromCone_M:r}){kE[t]=arguments[0]}function RE(t,e,r="Bradford"){let n=kE[r],[i,s,o]=Le(n.toCone_M,t),[a,l,u]=Le(n.toCone_M,e),c=[[a/i,0,0],[0,l/s,0],[0,0,u/o]],h=Le(c,n.toCone_M);return Le(n.fromCone_M,h)}Kc({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599364,-1.1293816,.2198974],[.3611914,.6388125,-64e-7],[0,0,1.0890636]]});Kc({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929,-.1470543,.1599627],[.4323053,.5183603,.0492912],[-.0085287,.0400428,.9684867]]});Kc({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238,-.278869,.1827452],[.454369,.4735332,.0720978],[-.0096276,-.005698,1.0153256]]});Kc({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.011254630531685,.1491867754444518],[.3875265432361372,.6214474419314753,-.008973985167612518],[-.01584149884933386,-.03412293802851557,1.04996443687785]]});Object.assign(Jt,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]});Jt.ACES=[.32168/.33767,1,(1-.32168-.33767)/.33767];const y4=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],v4=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var ME=new gt({id:"acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:Jt.ACES,toXYZ_M:y4,fromXYZ_M:v4,formats:{color:{}}});const fl=2**-16,Mf=-.35828683,pl=(Math.log2(65504)+9.72)/17.52;var _4=new gt({id:"acescc",name:"ACEScc",coords:{r:{range:[Mf,pl],name:"Red"},g:{range:[Mf,pl],name:"Green"},b:{range:[Mf,pl],name:"Blue"}},referred:"scene",base:ME,toBase(t){const e=-.3013698630136986;return t.map(function(r){return r<=e?(2**(r*17.52-9.72)-fl)*2:rthis.get(o),set:a=>this.set(o,a)})}get spaceId(){return this.space.id}clone(){return new pe(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...e){let r=iN(this,...e);return r.color=new pe(r.color),r}static get(e,...r){return e instanceof pe?e:new pe(e,...r)}static defineFunction(e,r,n=r){let{instance:i=!0,returns:s}=n,o=function(...a){let l=r(...a);if(s==="color")l=pe.get(l);else if(s==="function"){let u=l;l=function(...c){let h=u(...c);return pe.get(h)},Object.assign(l,u)}else s==="array"&&(l=l.map(u=>pe.get(u)));return l};e in pe||(pe[e]=o),i&&(pe.prototype[e]=function(...a){return o(this,...a)})}static defineFunctions(e){for(let r in e)pe.defineFunction(r,e[r],e[r])}static extend(e){if(e.register)e.register(pe);else for(let r in e)pe.defineFunction(r,e[r])}}pe.defineFunctions({get:Ut,getAll:Aa,set:En,setAll:dE,to:Ot,equals:sN,inGamut:fo,toGamut:Pn,distance:gE,toString:rc});Object.assign(pe,{util:zD,hooks:Tn,WHITES:Jt,Space:Y,spaces:Y.registry,parse:cE,defaults:gr});for(let t of Object.keys(C1))Y.register(C1[t]);for(let t in Y.registry)Bm(t,Y.registry[t]);Tn.add("colorspace-init-end",t=>{var e;Bm(t.id,t),(e=t.aliases)==null||e.forEach(r=>{Bm(r,t)})});function Bm(t,e){Object.keys(e.coords),Object.values(e.coords).map(n=>n.name);let r=t.replace(/-/g,"_");Object.defineProperty(pe.prototype,r,{get(){let n=this.getAll(t);return typeof Proxy>"u"?n:new Proxy(n,{has:(i,s)=>{try{return Y.resolveCoord([e,s]),!0}catch{}return Reflect.has(i,s)},get:(i,s,o)=>{if(s&&typeof s!="symbol"&&!(s in i)){let{index:a}=Y.resolveCoord([e,s]);if(a>=0)return i[a]}return Reflect.get(i,s,o)},set:(i,s,o,a)=>{if(s&&typeof s!="symbol"&&!(s in i)||s>=0){let{index:l}=Y.resolveCoord([e,s]);if(l>=0)return i[l]=o,this.setAll(t,i),!0}return Reflect.set(i,s,o,a)}})},set(n){this.setAll(t,n)},configurable:!0,enumerable:!0})}pe.extend(ic);pe.extend({deltaE:Ys});Object.assign(pe,{deltaEMethods:ic});pe.extend(e4);pe.extend({contrast:TN});pe.extend(PN);pe.extend(aN);pe.extend(r4);pe.extend(ql);const T1=new Map,w4=1e3*60*60,x4=new pe("black"),S4=new pe("white");function b4(){const{getPronouns:t}=nE(),{broadcaster:e}=Nn(),{transformBadges:r}=sE();async function n(s){const{userId:o,userName:a,displayName:l,badges:u,color:c,isBroadcaster:h,isMod:d,isArtist:p,isVip:m,isFounder:_,isSubscriber:w}=s;return{id:o,userName:a,displayName:l,pronouns:await t(a),badges:r(u),color:c,colorBrightness:c?C4(c):void 0,roles:{broadcaster:h,moderator:d,artist:p,vip:m,founder:_,subscriber:w,followDate:await i(o)}}}async function i(s){if(s===e.id)return new Date(0);let o=T1.get(s);if(!o||o.expiren?"dark":"light"}const OE=new Map;let E1=!1;function T4(){function t(e){return OE.get(e)}return{getReward:t}}function E4(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){E1||(await ms.channelPoints.getCustomRewards(r.id)).forEach(s=>{OE.set(s.id,s)}),e(!1),E1=!0}n()},[r]),{loading:t}}function P4(){const{getReward:t}=T4(),{transformText:e}=FD(),{transformUser:r}=b4();async function n(i,s,o){if(s instanceof $c&&(o=s.text),!o)return;const{type:a}=i,l={id:s.id,first:s.tags.get("first-msg")==="1",date:s.date,text:o,parts:e(o,s.emoteOffsets,a==="cheer"),user:await r(s.userInfo),tags:s.tags,...i};if(a!=="basic")return l;if(s.tags.get("msg-id")==="highlighted-message")return{...l,type:"highlight"};const u=s.tags.get("custom-reward-id");if(u){const d=t(u);if(d){const p={id:d.id,name:d.title,cost:d.cost,image:d.getImageUrl(4),color:d.backgroundColor};return{...l,type:"redeem",redeem:p}}}const c=d=>s.tags.get(`reply-parent-${d}`)||"",h=c("msg-id");if(h){const d={id:h,text:c("msg-body"),user:{id:c("user-id"),userName:c("user-login"),displayName:c("display-name")}};return{...l,type:"reply",reply:d}}return l}return{transformMessage:n}}function A4(){const t=sy(),{broadcaster:e}=Nn(),{transformMessage:r}=P4(),i=U.useRef(new Yu({authProvider:JC,channels:[e.userName]})).current;i.isConnected||i.connect();function s(l){l&&t({type:"add",payload:l})}slime2Chat.ready({test:s});function o(l=null){t({type:"clear",payload:l})}function a(l){t({type:"remove",payload:l,moderator:!0})}return U.useEffect(()=>{const l=[];return l.push(i.onMessage(async(u,c,h,d)=>{const{bits:p}=d,_=await r(p?{type:"cheer",cheer:{amount:p}}:{type:"basic"},d,h);s(_)}),i.onAction(async(u,c,h,d)=>{const p=await r({type:"action"},d,h);s(p)}),i.onResub(async(u,c,h,d)=>{const p={type:"resub",resub:{months:h.months,tier:h.plan}},m=await r(p,d);s(m)}),i.onAnnouncement(async(u,c,h,d)=>{const p={type:"announcement",announcement:{color:h.color}},m=await r(p,d);s(m)}),i.onChatClear(()=>{o()}),i.onTimeout((u,c,h,d)=>{o(d.targetUserId)}),i.onBan((u,c,h)=>{o(h.targetUserId)}),i.onMessageRemove((u,c)=>{a(c)})),()=>{l.forEach(u=>{u&&i.removeListener(u)})}}),de.jsx(uO,{})}const DE=U.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Yc=U.createContext({}),My=U.createContext(null),Xc=typeof document<"u",I4=Xc?U.useLayoutEffect:U.useEffect,NE=U.createContext({strict:!1});function k4(t,e,r,n){const{visualElement:i}=U.useContext(Yc),s=U.useContext(NE),o=U.useContext(My),a=U.useContext(DE).reducedMotion,l=U.useRef();n=n||s.renderer,!l.current&&n&&(l.current=n(t,{visualState:e,parent:i,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;U.useInsertionEffect(()=>{u&&u.update(r,o)});const c=U.useRef(!!window.HandoffAppearAnimations);return I4(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),U.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function $i(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function R4(t,e,r){return U.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):$i(r)&&(r.current=n))},[e])}function ha(t){return typeof t=="string"||Array.isArray(t)}function Jc(t){return typeof t=="object"&&typeof t.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Dy=["initial",...Oy];function Zc(t){return Jc(t.animate)||Dy.some(e=>ha(t[e]))}function BE(t){return!!(Zc(t)||t.variants)}function M4(t,e){if(Zc(t)){const{initial:r,animate:n}=t;return{initial:r===!1||ha(r)?r:void 0,animate:ha(n)?n:void 0}}return t.inherit!==!1?e:{}}function O4(t){const{initial:e,animate:r}=M4(t,U.useContext(Yc));return U.useMemo(()=>({initial:e,animate:r}),[P1(e),P1(r)])}function P1(t){return Array.isArray(t)?t.join(" "):t}const A1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},fa={};for(const t in A1)fa[t]={isEnabled:e=>A1[t].some(r=>!!e[r])};function D4(t){for(const e in t)fa[e]={...fa[e],...t[e]}}const LE=U.createContext({}),FE=U.createContext({}),N4=Symbol.for("motionComponentSymbol");function B4({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){t&&D4(t);function s(a,l){let u;const c={...U.useContext(DE),...a,layoutId:L4(a)},{isStatic:h}=c,d=O4(a),p=n(a,h);if(!h&&Xc){d.visualElement=k4(i,p,c,e);const m=U.useContext(FE),_=U.useContext(NE).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,_,t,m))}return U.createElement(Yc.Provider,{value:d},u&&d.visualElement?U.createElement(u,{visualElement:d.visualElement,...c}):null,r(i,a,R4(p,d.visualElement,l),p,h,d.visualElement))}const o=U.forwardRef(s);return o[N4]=i,o}function L4({layoutId:t}){const e=U.useContext(LE).id;return e&&t!==void 0?e+"-"+t:t}function F4(t){function e(n,i={}){return B4(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const U4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(t){return typeof t!="string"||t.includes("-")?!1:!!(U4.indexOf(t)>-1||/[A-Z]/.test(t))}const sc={};function j4(t){Object.assign(sc,t)}const ka=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mi=new Set(ka);function UE(t,{layout:e,layoutId:r}){return mi.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!sc[t]||t==="opacity")}const mt=t=>!!(t&&t.getVelocity),$4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},q4=ka.length;function V4(t,{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},n,i){let s="";for(let o=0;oe=>typeof e=="string"&&e.startsWith(t),$E=jE("--"),Lm=jE("var(--"),H4=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,z4=(t,e)=>e&&typeof t=="number"?e.transform(t):t,In=(t,e,r)=>Math.min(Math.max(r,t),e),gi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},po={...gi,transform:t=>In(0,1,t)},ml={...gi,default:1},mo=t=>Math.round(t*1e5)/1e5,ed=/(-)?([\d]*\.?[\d])+/g,qE=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,G4=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ra(t){return typeof t=="string"}const Ma=t=>({test:e=>Ra(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Qr=Ma("deg"),pr=Ma("%"),K=Ma("px"),W4=Ma("vh"),Q4=Ma("vw"),I1={...pr,parse:t=>pr.parse(t)/100,transform:t=>pr.transform(t*100)},k1={...gi,transform:Math.round},VE={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,radius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,size:K,top:K,right:K,bottom:K,left:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,rotate:Qr,rotateX:Qr,rotateY:Qr,rotateZ:Qr,scale:ml,scaleX:ml,scaleY:ml,scaleZ:ml,skew:Qr,skewX:Qr,skewY:Qr,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:po,originX:I1,originY:I1,originZ:K,zIndex:k1,fillOpacity:po,strokeOpacity:po,numOctaves:k1};function By(t,e,r,n){const{style:i,vars:s,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const h in e){const d=e[h];if($E(h)){s[h]=d;continue}const p=VE[h],m=z4(d,p);if(mi.has(h)){if(l=!0,o[h]=m,!c)continue;d!==(p.default||0)&&(c=!1)}else h.startsWith("origin")?(u=!0,a[h]=m):i[h]=m}if(e.transform||(l||n?i.transform=V4(t.transform,r,c,n):i.transform&&(i.transform="none")),u){const{originX:h="50%",originY:d="50%",originZ:p=0}=a;i.transformOrigin=`${h} ${d} ${p}`}}const Ly=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HE(t,e,r){for(const n in e)!mt(e[n])&&!UE(n,r)&&(t[n]=e[n])}function K4({transformTemplate:t},e,r){return U.useMemo(()=>{const n=Ly();return By(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function Y4(t,e,r){const n=t.style||{},i={};return HE(i,n,t),Object.assign(i,K4(t,e,r)),t.transformValues?t.transformValues(i):i}function X4(t,e,r){const n={},i=Y4(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const J4=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function oc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||J4.has(t)}let zE=t=>!oc(t);function Z4(t){t&&(zE=e=>e.startsWith("on")?!oc(e):t(e))}try{Z4(require("@emotion/is-prop-valid").default)}catch{}function eB(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(zE(i)||r===!0&&oc(i)||!e&&!oc(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function R1(t,e,r){return typeof t=="string"?t:K.transform(e+r*t)}function tB(t,e,r){const n=R1(e,t.x,t.width),i=R1(r,t.y,t.height);return`${n} ${i}`}const rB={offset:"stroke-dashoffset",array:"stroke-dasharray"},nB={offset:"strokeDashoffset",array:"strokeDasharray"};function iB(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?rB:nB;t[s.offset]=K.transform(-n);const o=K.transform(e),a=K.transform(r);t[s.array]=`${o} ${a}`}function Fy(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h,d){if(By(t,u,c,d),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:_}=t;p.transform&&(_&&(m.transform=p.transform),delete p.transform),_&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=tB(_,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(p.x=e),r!==void 0&&(p.y=r),n!==void 0&&(p.scale=n),o!==void 0&&iB(p,o,a,l,!1)}const GE=()=>({...Ly(),attrs:{}}),Uy=t=>typeof t=="string"&&t.toLowerCase()==="svg";function sB(t,e,r,n){const i=U.useMemo(()=>{const s=GE();return Fy(s,e,{enableHardwareAcceleration:!1},Uy(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};HE(s,t.style,t),i.style={...s,...i.style}}return i}function oB(t=!1){return(r,n,i,{latestValues:s},o)=>{const l=(Ny(r)?sB:X4)(n,s,o,r),c={...eB(n,typeof r=="string",t),...l,ref:i},{children:h}=n,d=U.useMemo(()=>mt(h)?h.get():h,[h]);return U.createElement(r,{...c,children:d})}}const jy=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function WE(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const QE=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function KE(t,e,r,n){WE(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(QE.has(i)?i:jy(i),e.attrs[i])}function $y(t,e){const{style:r}=t,n={};for(const i in r)(mt(r[i])||e.style&&mt(e.style[i])||UE(i,t))&&(n[i]=r[i]);return n}function YE(t,e){const r=$y(t,e);for(const n in t)if(mt(t[n])||mt(e[n])){const i=ka.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;r[i]=t[n]}return r}function qy(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}function aB(t){const e=U.useRef(null);return e.current===null&&(e.current=t()),e.current}const ac=t=>Array.isArray(t),lB=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),uB=t=>ac(t)?t[t.length-1]||0:t;function Vl(t){const e=mt(t)?t.get():t;return lB(e)?e.toValue():e}function cB({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:dB(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const XE=t=>(e,r)=>{const n=U.useContext(Yc),i=U.useContext(My),s=()=>cB(t,e,n,i);return r?s():aB(s)};function dB(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=Vl(s[d]);let{initial:o,animate:a}=t;const l=Zc(t),u=BE(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=r?r.initial===!1:!1;c=c||o===!1;const h=c?a:o;return h&&typeof h!="boolean"&&!Jc(h)&&(Array.isArray(h)?h:[h]).forEach(p=>{const m=qy(t,p);if(!m)return;const{transitionEnd:_,transition:w,...v}=m;for(const g in v){let y=v[g];if(Array.isArray(y)){const x=c?y.length-1:0;y=y[x]}y!==null&&(i[g]=y)}for(const g in _)i[g]=_[g]}),i}const Re=t=>t;class M1{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const r=this.order.indexOf(e);r!==-1&&(this.order.splice(r,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function hB(t){let e=new M1,r=new M1,n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const h=c&&i,d=h?e:r;return u&&o.add(l),d.add(l)&&h&&i&&(n=e.order.length),l},cancel:l=>{r.remove(l),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.clear(),n=e.order.length,n)for(let u=0;u(h[d]=hB(()=>r=!0),h),{}),o=h=>s[h].process(i),a=()=>{const h=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(h-i.timestamp,fB),1),i.timestamp=h,i.isProcessing=!0,gl.forEach(o),i.isProcessing=!1,r&&e&&(n=!1,t(a))},l=()=>{r=!0,n=!0,i.isProcessing||t(a)};return{schedule:gl.reduce((h,d)=>{const p=s[d];return h[d]=(m,_=!1,w=!1)=>(r||l(),p.schedule(m,_,w)),h},{}),cancel:h=>gl.forEach(d=>s[d].cancel(h)),state:i,steps:s}}const{schedule:be,cancel:Nr,state:He,steps:Of}=pB(typeof requestAnimationFrame<"u"?requestAnimationFrame:Re,!0),mB={useVisualState:XE({scrapeMotionValuesFromProps:YE,createRenderState:GE,onMount:(t,e,{renderState:r,latestValues:n})=>{be.read(()=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),be.render(()=>{Fy(r,n,{enableHardwareAcceleration:!1},Uy(e.tagName),t.transformTemplate),KE(e,r)})}})},gB={useVisualState:XE({scrapeMotionValuesFromProps:$y,createRenderState:Ly})};function yB(t,{forwardMotionProps:e=!1},r,n){return{...Ny(t)?mB:gB,preloadedFeatures:r,useRender:oB(e),createVisualElement:n,Component:t}}function Er(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}const JE=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function td(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const vB=t=>e=>JE(e)&&t(e,td(e));function Ir(t,e,r,n){return Er(t,e,vB(r),n)}const _B=(t,e)=>r=>e(t(r)),yn=(...t)=>t.reduce(_B);function ZE(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const O1=ZE("dragHorizontal"),D1=ZE("dragVertical");function e5(t){let e=!1;if(t==="y")e=D1();else if(t==="x")e=O1();else{const r=O1(),n=D1();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function t5(){const t=e5(!0);return t?(t(),!1):!0}class Bn{constructor(e){this.isMounted=!1,this.node=e}update(){}}function N1(t,e){const r="pointer"+(e?"enter":"leave"),n="onHover"+(e?"Start":"End"),i=(s,o)=>{if(s.type==="touch"||t5())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e),a[n]&&be.update(()=>a[n](s,o))};return Ir(t.current,r,i,{passive:!t.getProps()[n]})}class wB extends Bn{mount(){this.unmount=yn(N1(this.node,!0),N1(this.node,!1))}unmount(){}}class xB extends Bn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yn(Er(this.node.current,"focus",()=>this.onFocus()),Er(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const r5=(t,e)=>e?t===e?!0:r5(t,e.parentElement):!1;function Df(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,td(r))}class SB extends Bn{constructor(){super(...arguments),this.removeStartListeners=Re,this.removeEndListeners=Re,this.removeAccessibleListeners=Re,this.startPointerPress=(e,r)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=Ir(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();be.update(()=>{r5(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(n.onTap||n.onPointerUp)}),o=Ir(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=yn(s,o),this.startPress(e,r)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Df("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&be.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Er(this.node.current,"keyup",o),Df("down",(a,l)=>{this.startPress(a,l)})},r=Er(this.node.current,"keydown",e),n=()=>{this.isPressing&&Df("cancel",(s,o)=>this.cancelPress(s,o))},i=Er(this.node.current,"blur",n);this.removeAccessibleListeners=yn(r,i)}}startPress(e,r){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&be.update(()=>n(e,r))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!t5()}cancelPress(e,r){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&be.update(()=>n(e,r))}mount(){const e=this.node.getProps(),r=Ir(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Er(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=yn(r,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Fm=new WeakMap,Nf=new WeakMap,bB=t=>{const e=Fm.get(t.target);e&&e(t)},CB=t=>{t.forEach(bB)};function TB({root:t,...e}){const r=t||document;Nf.has(r)||Nf.set(r,{});const n=Nf.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(CB,{root:t,...e})),n[i]}function EB(t,e,r){const n=TB(e);return Fm.set(t,r),n.observe(t),()=>{Fm.delete(t),n.unobserve(t)}}const PB={some:0,all:1};class AB extends Bn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=e,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:PB[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),d=u?c:h;d&&d(l)};return EB(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(IB(e,r))&&this.startObserver()}unmount(){}}function IB({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const kB={inView:{Feature:AB},tap:{Feature:SB},focus:{Feature:xB},hover:{Feature:wB}};function n5(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;ne[n]=r.get()),e}function MB(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function rd(t,e,r){const n=t.getProps();return qy(n,e,r!==void 0?r:n.custom,RB(t),MB(t))}const OB="framerAppearId",DB="data-"+jy(OB);let NB=Re,Vy=Re;const vn=t=>t*1e3,kr=t=>t/1e3,BB={current:!1},i5=t=>Array.isArray(t)&&typeof t[0]=="number";function s5(t){return!!(!t||typeof t=="string"&&o5[t]||i5(t)||Array.isArray(t)&&t.every(s5))}const Xs=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,o5={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xs([0,.65,.55,1]),circOut:Xs([.55,0,1,.45]),backIn:Xs([.31,.01,.66,-.59]),backOut:Xs([.33,1.53,.69,.99])};function a5(t){if(t)return i5(t)?Xs(t):Array.isArray(t)?t.map(a5):o5[t]}function LB(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:r};l&&(u.offset=l);const c=a5(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function FB(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const l5=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,UB=1e-7,jB=12;function $B(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=l5(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>UB&&++a$B(s,0,1,t,r);return s=>s===0||s===1?s:l5(i(s),e,n)}const qB=Oa(.42,0,1,1),VB=Oa(0,0,.58,1),u5=Oa(.42,0,.58,1),HB=t=>Array.isArray(t)&&typeof t[0]!="number",c5=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,d5=t=>e=>1-t(1-e),h5=t=>1-Math.sin(Math.acos(t)),Hy=d5(h5),zB=c5(Hy),f5=Oa(.33,1.53,.69,.99),zy=d5(f5),GB=c5(zy),WB=t=>(t*=2)<1?.5*zy(t):.5*(2-Math.pow(2,-10*(t-1))),QB={linear:Re,easeIn:qB,easeInOut:u5,easeOut:VB,circIn:h5,circInOut:zB,circOut:Hy,backIn:zy,backInOut:GB,backOut:f5,anticipate:WB},B1=t=>{if(Array.isArray(t)){Vy(t.length===4);const[e,r,n,i]=t;return Oa(e,r,n,i)}else if(typeof t=="string")return QB[t];return t},Gy=(t,e)=>r=>!!(Ra(r)&&G4.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),p5=(t,e,r)=>n=>{if(!Ra(n))return n;const[i,s,o,a]=n.match(ed);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},KB=t=>In(0,255,t),Bf={...gi,transform:t=>Math.round(KB(t))},Kn={test:Gy("rgb","red"),parse:p5("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Bf.transform(t)+", "+Bf.transform(e)+", "+Bf.transform(r)+", "+mo(po.transform(n))+")"};function YB(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Um={test:Gy("#"),parse:YB,transform:Kn.transform},qi={test:Gy("hsl","hue"),parse:p5("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+pr.transform(mo(e))+", "+pr.transform(mo(r))+", "+mo(po.transform(n))+")"},nt={test:t=>Kn.test(t)||Um.test(t)||qi.test(t),parse:t=>Kn.test(t)?Kn.parse(t):qi.test(t)?qi.parse(t):Um.parse(t),transform:t=>Ra(t)?t:t.hasOwnProperty("red")?Kn.transform(t):qi.transform(t)},Pe=(t,e,r)=>-r*t+r*e+t;function Lf(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function XB({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=Lf(l,a,t+1/3),s=Lf(l,a,t),o=Lf(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const Ff=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},JB=[Um,Kn,qi],ZB=t=>JB.find(e=>e.test(t));function L1(t){const e=ZB(t);let r=e.parse(t);return e===qi&&(r=XB(r)),r}const m5=(t,e)=>{const r=L1(t),n=L1(e),i={...r};return s=>(i.red=Ff(r.red,n.red,s),i.green=Ff(r.green,n.green,s),i.blue=Ff(r.blue,n.blue,s),i.alpha=Pe(r.alpha,n.alpha,s),Kn.transform(i))};function eL(t){var e,r;return isNaN(t)&&Ra(t)&&(((e=t.match(ed))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(qE))===null||r===void 0?void 0:r.length)||0)>0}const g5={regex:H4,countKey:"Vars",token:"${v}",parse:Re},y5={regex:qE,countKey:"Colors",token:"${c}",parse:nt.parse},v5={regex:ed,countKey:"Numbers",token:"${n}",parse:gi.parse};function Uf(t,{regex:e,countKey:r,token:n,parse:i}){const s=t.tokenised.match(e);s&&(t["num"+r]=s.length,t.tokenised=t.tokenised.replace(e,n),t.values.push(...s.map(i)))}function lc(t){const e=t.toString(),r={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return r.value.includes("var(--")&&Uf(r,g5),Uf(r,y5),Uf(r,v5),r}function _5(t){return lc(t).values}function w5(t){const{values:e,numColors:r,numVars:n,tokenised:i}=lc(t),s=e.length;return o=>{let a=i;for(let l=0;ltypeof t=="number"?0:t;function rL(t){const e=_5(t);return w5(t)(e.map(tL))}const kn={test:eL,parse:_5,createTransformer:w5,getAnimatableNone:rL},x5=(t,e)=>r=>`${r>0?e:t}`;function S5(t,e){return typeof t=="number"?r=>Pe(t,e,r):nt.test(t)?m5(t,e):t.startsWith("var(")?x5(t,e):C5(t,e)}const b5=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>S5(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=S5(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},C5=(t,e)=>{const r=kn.createTransformer(e),n=lc(t),i=lc(e);return n.numVars===i.numVars&&n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?yn(b5(n.values,i.values),r):x5(t,e)},pa=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},F1=(t,e)=>r=>Pe(t,e,r);function iL(t){return typeof t=="number"?F1:typeof t=="string"?nt.test(t)?m5:C5:Array.isArray(t)?b5:typeof t=="object"?nL:F1}function sL(t,e,r){const n=[],i=r||iL(t[0]),s=t.length-1;for(let o=0;oe[0];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=sL(e,n,i),a=o.length,l=u=>{let c=0;if(a>1)for(;cl(In(t[0],t[s-1],u)):l}function oL(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=pa(0,e,n);t.push(Pe(r,1,i))}}function aL(t){const e=[0];return oL(e,t.length-1),e}function lL(t,e){return t.map(r=>r*e)}function uL(t,e){return t.map(()=>e||u5).splice(0,t.length-1)}function uc({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=HB(n)?n.map(B1):B1(n),s={done:!1,value:e[0]},o=lL(r&&r.length===e.length?r:aL(e),t),a=T5(o,e,{ease:Array.isArray(i)?i:uL(e,i)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}function E5(t,e){return e?t*(1e3/e):0}const cL=5;function P5(t,e,r){const n=Math.max(e-cL,0);return E5(r-t(n),e-n)}const jf=.001,dL=.01,U1=10,hL=.05,fL=1;function pL({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;NB(t<=vn(U1));let o=1-e;o=In(hL,fL,o),t=In(dL,U1,kr(t)),o<1?(i=u=>{const c=u*o,h=c*t,d=c-r,p=jm(u,o),m=Math.exp(-h);return jf-d/p*m},s=u=>{const h=u*o*t,d=h*r+r,p=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-h),_=jm(Math.pow(u,2),o);return(-i(u)+jf>0?-1:1)*((d-p)*m)/_}):(i=u=>{const c=Math.exp(-u*t),h=(u-r)*t+1;return-jf+c*h},s=u=>{const c=Math.exp(-u*t),h=(r-u)*(t*t);return c*h});const a=5/t,l=gL(i,s,a);if(t=vn(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const mL=12;function gL(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function _L(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!j1(t,vL)&&j1(t,yL)){const r=pL(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}function A5({keyframes:t,restDelta:e,restSpeed:r,...n}){const i=t[0],s=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=_L(n),p=c?-kr(c):0,m=l/(2*Math.sqrt(a*u)),_=s-i,w=kr(Math.sqrt(a/u)),v=Math.abs(_)<5;r||(r=v?.01:2),e||(e=v?.005:.5);let g;if(m<1){const y=jm(w,m);g=x=>{const C=Math.exp(-m*w*x);return s-C*((p+m*w*_)/y*Math.sin(y*x)+_*Math.cos(y*x))}}else if(m===1)g=y=>s-Math.exp(-w*y)*(_+(p+w*_)*y);else{const y=w*Math.sqrt(m*m-1);g=x=>{const C=Math.exp(-m*w*x),k=Math.min(y*x,300);return s-C*((p+m*w*_)*Math.sinh(k)+y*_*Math.cosh(k))/y}}return{calculatedDuration:d&&h||null,next:y=>{const x=g(y);if(d)o.done=y>=h;else{let C=p;y!==0&&(m<1?C=P5(g,y,x):C=0);const k=Math.abs(C)<=r,O=Math.abs(s-x)<=e;o.done=k&&O}return o.value=o.done?s:x,o}}}function $1({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=A=>a!==void 0&&Al,m=A=>a===void 0?l:l===void 0||Math.abs(a-A)-_*Math.exp(-A/n),y=A=>v+g(A),x=A=>{const N=g(A),j=y(A);d.done=Math.abs(N)<=u,d.value=d.done?v:j};let C,k;const O=A=>{p(d.value)&&(C=A,k=A5({keyframes:[d.value,m(d.value)],velocity:P5(y,A,d.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return O(0),{calculatedDuration:null,next:A=>{let N=!1;return!k&&C===void 0&&(N=!0,x(A),O(A)),C!==void 0&&A>C?k.next(A-C):(!N&&x(A),d)}}}const wL=t=>{const e=({timestamp:r})=>t(r);return{start:()=>be.update(e,!0),stop:()=>Nr(e),now:()=>He.isProcessing?He.timestamp:performance.now()}},q1=2e4;function V1(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=q1?1/0:e}const xL={decay:$1,inertia:$1,tween:uc,keyframes:uc,spring:A5};function cc({autoplay:t=!0,delay:e=0,driver:r=wL,keyframes:n,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:h,...d}){let p=1,m=!1,_,w;const v=()=>{w=new Promise(H=>{_=H})};v();let g;const y=xL[i]||uc;let x;y!==uc&&typeof n[0]!="number"&&(x=T5([0,100],n,{clamp:!1}),n=[0,100]);const C=y({...d,keyframes:n});let k;a==="mirror"&&(k=y({...d,keyframes:[...n].reverse(),velocity:-(d.velocity||0)}));let O="idle",A=null,N=null,j=null;C.calculatedDuration===null&&s&&(C.calculatedDuration=V1(C));const{calculatedDuration:Q}=C;let re=1/0,Z=1/0;Q!==null&&(re=Q+o,Z=re*(s+1)-o);let T=0;const I=H=>{if(N===null)return;p>0&&(N=Math.min(N,H)),p<0&&(N=Math.min(H-Z/p,N)),A!==null?T=A:T=Math.round(H-N)*p;const oe=T-e*(p>=0?1:-1),Ht=p>=0?oe<0:oe>Z;T=Math.max(oe,0),O==="finished"&&A===null&&(T=Z);let Ye=T,yt=C;if(s){const As=T/re;let yi=Math.floor(As),nr=As%1;!nr&&As>=1&&(nr=1),nr===1&&yi--,yi=Math.min(yi,s+1);const Da=!!(yi%2);Da&&(a==="reverse"?(nr=1-nr,o&&(nr-=o/re)):a==="mirror"&&(yt=k));let Na=In(0,1,nr);T>Z&&(Na=a==="reverse"&&Da?1:0),Ye=Na*re}const Xe=Ht?{done:!1,value:n[0]}:yt.next(Ye);x&&(Xe.value=x(Xe.value));let{done:wr}=Xe;!Ht&&Q!==null&&(wr=p>=0?T>=Z:T<=0);const nd=A===null&&(O==="finished"||O==="running"&&wr);return h&&h(Xe.value),nd&&L(),Xe},V=()=>{g&&g.stop(),g=void 0},se=()=>{O="idle",V(),_(),v(),N=j=null},L=()=>{O="finished",c&&c(),V(),_()},F=()=>{if(m)return;g||(g=r(I));const H=g.now();l&&l(),A!==null?N=H-A:(!N||O==="finished")&&(N=H),O==="finished"&&v(),j=N,A=null,O="running",g.start()};t&&F();const z={then(H,oe){return w.then(H,oe)},get time(){return kr(T)},set time(H){H=vn(H),T=H,A!==null||!g||p===0?A=H:N=g.now()-H/p},get duration(){const H=C.calculatedDuration===null?V1(C):C.calculatedDuration;return kr(H)},get speed(){return p},set speed(H){H===p||!g||(p=H,z.time=kr(T))},get state(){return O},play:F,pause:()=>{O="paused",A=T},stop:()=>{m=!0,O!=="idle"&&(O="idle",u&&u(),se())},cancel:()=>{j!==null&&I(j),se()},complete:()=>{O="finished"},sample:H=>(N=0,I(H))};return z}function SL(t){let e;return()=>(e===void 0&&(e=t()),e)}const bL=SL(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),CL=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),yl=10,TL=2e4,EL=(t,e)=>e.type==="spring"||t==="backgroundColor"||!s5(e.ease);function PL(t,e,{onUpdate:r,onComplete:n,...i}){if(!(bL()&&CL.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let o=!1,a,l;const u=()=>{l=new Promise(g=>{a=g})};u();let{keyframes:c,duration:h=300,ease:d,times:p}=i;if(EL(e,i)){const g=cc({...i,repeat:0,delay:0});let y={done:!1,value:c[0]};const x=[];let C=0;for(;!y.done&&Cm.cancel(),w=()=>{be.update(_),a(),u()};return m.onfinish=()=>{t.set(FB(c,i)),n&&n(),w()},{then(g,y){return l.then(g,y)},attachTimeline(g){return m.timeline=g,m.onfinish=null,Re},get time(){return kr(m.currentTime||0)},set time(g){m.currentTime=vn(g)},get speed(){return m.playbackRate},set speed(g){m.playbackRate=g},get duration(){return kr(h)},play:()=>{o||(m.play(),Nr(_))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:g}=m;if(g){const y=cc({...i,autoplay:!1});t.setWithVelocity(y.sample(g-yl).value,y.sample(g).value,yl)}w()},complete:()=>m.finish(),cancel:w}}function AL({keyframes:t,delay:e,onUpdate:r,onComplete:n}){const i=()=>(r&&r(t[t.length-1]),n&&n(),{time:0,speed:1,duration:0,play:Re,pause:Re,stop:Re,then:s=>(s(),Promise.resolve()),cancel:Re,complete:Re});return e?cc({keyframes:[0,1],duration:0,delay:e,onComplete:i}):i()}const IL={type:"spring",stiffness:500,damping:25,restSpeed:10},kL=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),RL={type:"keyframes",duration:.8},ML={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},OL=(t,{keyframes:e})=>e.length>2?RL:mi.has(t)?t.startsWith("scale")?kL(e[1]):IL:ML,$m=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(kn.test(e)||e==="0")&&!e.startsWith("url(")),DL=new Set(["brightness","contrast","saturate","opacity"]);function NL(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(ed)||[];if(!n)return t;const i=r.replace(n,"");let s=DL.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const BL=/([a-z-]*)\(.*?\)/g,qm={...kn,getAnimatableNone:t=>{const e=t.match(BL);return e?e.map(NL).join(" "):t}},LL={...VE,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:qm,WebkitFilter:qm},Wy=t=>LL[t];function I5(t,e){let r=Wy(t);return r!==qm&&(r=kn),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const k5=t=>/^0[^.\s]+$/.test(t);function FL(t){if(typeof t=="number")return t===0;if(t!==null)return t==="none"||t==="0"||k5(t)}function UL(t,e,r,n){const i=$m(e,r);let s;Array.isArray(r)?s=[...r]:s=[null,r];const o=n.from!==void 0?n.from:t.get();let a;const l=[];for(let u=0;ui=>{const s=R5(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-vn(o);const l=UL(e,t,r,s),u=l[0],c=l[l.length-1],h=$m(t,u),d=$m(t,c);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:m=>{e.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(jL(s)||(p={...p,...OL(t,p)}),p.duration&&(p.duration=vn(p.duration)),p.repeatDelay&&(p.repeatDelay=vn(p.repeatDelay)),!h||!d||BB.current||s.type===!1)return AL(p);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const m=PL(e,t,p);if(m)return m}return cc(p)};function dc(t){return!!(mt(t)&&t.add)}const M5=t=>/^\-?\d*\.?\d+$/.test(t);function Ky(t,e){t.indexOf(e)===-1&&t.push(e)}function Yy(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class Xy{constructor(){this.subscriptions=[]}add(e){return Ky(this.subscriptions,e),()=>Yy(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class qL{constructor(e,r={}){this.version="10.16.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=He;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,be.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>be.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=$L(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new Xy);const n=this.events[e].add(r);return e==="change"?()=>{n(),be.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?E5(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ys(t,e){return new qL(t,e)}const O5=t=>e=>e.test(t),VL={test:t=>t==="auto",parse:t=>t},D5=[gi,K,pr,Qr,Q4,W4,VL],Vs=t=>D5.find(O5(t)),HL=[...D5,nt,kn],zL=t=>HL.find(O5(t));function GL(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,ys(r))}function WL(t,e){const r=rd(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=uB(s[o]);GL(t,o,a)}}function QL(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(h))),u.push(_)}return o&&Promise.all(u).then(()=>{o&&WL(t,o)}),u}function Vm(t,e,r={}){const n=rd(t,e,r.custom);let{transition:i=t.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const s=n?()=>Promise.all(N5(t,n,r)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=i;return JL(t,e,u+l,c,h,r)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(r.delay)])}function JL(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,l=i===1?(u=0)=>u*n:(u=0)=>a-u*n;return Array.from(t.variantChildren).sort(ZL).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Vm(u,e,{...s,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function ZL(t,e){return t.sortNodePosition(e)}function e6(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>Vm(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=Vm(t,e,r);else{const i=typeof e=="function"?rd(t,e,r.custom):e;n=Promise.all(N5(t,i,r))}return n.then(()=>t.notify("AnimationComplete",e))}const t6=[...Oy].reverse(),r6=Oy.length;function n6(t){return e=>Promise.all(e.map(({animation:r,options:n})=>e6(t,r,n)))}function i6(t){let e=n6(t);const r=o6();let n=!0;const i=(l,u)=>{const c=rd(t,u);if(c){const{transition:h,transitionEnd:d,...p}=c;l={...l,...p,...d}}return l};function s(l){e=l(t)}function o(l,u){const c=t.getProps(),h=t.getVariantContext(!0)||{},d=[],p=new Set;let m={},_=1/0;for(let v=0;v_&&C;const j=Array.isArray(x)?x:[x];let Q=j.reduce(i,{});k===!1&&(Q={});const{prevResolvedValues:re={}}=y,Z={...re,...Q},T=I=>{N=!0,p.delete(I),y.needsAnimating[I]=!0};for(const I in Z){const V=Q[I],se=re[I];m.hasOwnProperty(I)||(V!==se?ac(V)&&ac(se)?!n5(V,se)||A?T(I):y.protectedKeys[I]=!0:V!==void 0?T(I):p.add(I):V!==void 0&&p.has(I)?T(I):y.protectedKeys[I]=!0)}y.prevProp=x,y.prevResolvedValues=Q,y.isActive&&(m={...m,...Q}),n&&t.blockInitialAnimation&&(N=!1),N&&!O&&d.push(...j.map(I=>({animation:I,options:{type:g,...l}})))}if(p.size){const v={};p.forEach(g=>{const y=t.getBaseTarget(g);y!==void 0&&(v[g]=y)}),d.push({animation:v})}let w=!!d.length;return n&&c.initial===!1&&!t.manuallyAnimateOnMount&&(w=!1),n=!1,w?e(d):Promise.resolve()}function a(l,u,c){var h;if(r[l].isActive===u)return Promise.resolve();(h=t.variantChildren)===null||h===void 0||h.forEach(p=>{var m;return(m=p.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),r[l].isActive=u;const d=o(c,l);for(const p in r)r[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function s6(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!n5(e,t):!1}function Fn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function o6(){return{animate:Fn(!0),whileInView:Fn(),whileHover:Fn(),whileTap:Fn(),whileDrag:Fn(),whileFocus:Fn(),exit:Fn()}}class a6 extends Bn{constructor(e){super(e),e.animationState||(e.animationState=i6(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Jc(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){}}let l6=0;class u6 extends Bn{constructor(){super(...arguments),this.id=l6++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r,custom:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const s=this.node.animationState.setActive("exit",!e,{custom:n??this.node.getProps().custom});r&&!e&&s.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const c6={animation:{Feature:a6},exit:{Feature:u6}},H1=(t,e)=>Math.abs(t-e);function d6(t,e){const r=H1(t.x,e.x),n=H1(t.y,e.y);return Math.sqrt(r**2+n**2)}class B5{constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=qf(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,h=d6(u.offset,{x:0,y:0})>=3;if(!c&&!h)return;const{point:d}=u,{timestamp:p}=He;this.history.push({...d,timestamp:p});const{onStart:m,onMove:_}=this.handlers;c||(m&&m(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=$f(c,this.transformPagePoint),be.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:h,onSessionEnd:d}=this.handlers,p=qf(u.type==="pointercancel"?this.lastMoveEventInfo:$f(c,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,p),d&&d(u,p)},!JE(e))return;this.handlers=r,this.transformPagePoint=n;const i=td(e),s=$f(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=He;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=r;l&&l(e,qf(s,this.history)),this.removeListeners=yn(Ir(window,"pointermove",this.handlePointerMove),Ir(window,"pointerup",this.handlePointerUp),Ir(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Nr(this.updatePoint)}}function $f(t,e){return e?{point:e(t.point)}:t}function z1(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qf({point:t},e){return{point:t,delta:z1(t,L5(e)),offset:z1(t,h6(e)),velocity:f6(e,.1)}}function h6(t){return t[0]}function L5(t){return t[t.length-1]}function f6(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=L5(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>vn(e)));)r--;if(!n)return{x:0,y:0};const s=kr(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Tt(t){return t.max-t.min}function Hm(t,e=0,r=.01){return Math.abs(t-e)<=r}function G1(t,e,r,n=.5){t.origin=n,t.originPoint=Pe(e.min,e.max,t.origin),t.scale=Tt(r)/Tt(e),(Hm(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Pe(r.min,r.max,t.origin)-t.originPoint,(Hm(t.translate)||isNaN(t.translate))&&(t.translate=0)}function go(t,e,r,n){G1(t.x,e.x,r.x,n?n.originX:void 0),G1(t.y,e.y,r.y,n?n.originY:void 0)}function W1(t,e,r){t.min=r.min+e.min,t.max=t.min+Tt(e)}function p6(t,e,r){W1(t.x,e.x,r.x),W1(t.y,e.y,r.y)}function Q1(t,e,r){t.min=e.min-r.min,t.max=t.min+Tt(e)}function yo(t,e,r){Q1(t.x,e.x,r.x),Q1(t.y,e.y,r.y)}function m6(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?Pe(r,t,n.max):Math.min(t,r)),t}function K1(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function g6(t,{top:e,left:r,bottom:n,right:i}){return{x:K1(t.x,r,i),y:K1(t.y,e,n)}}function Y1(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=pa(e.min,e.max-n,t.min):n>i&&(r=pa(t.min,t.max-i,e.min)),In(0,1,r)}function _6(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const zm=.35;function w6(t=zm){return t===!1?t=0:t===!0&&(t=zm),{x:X1(t,"left","right"),y:X1(t,"top","bottom")}}function X1(t,e,r){return{min:J1(t,e),max:J1(t,r)}}function J1(t,e){return typeof t=="number"?t:t[e]||0}const Z1=()=>({translate:0,scale:1,origin:0,originPoint:0}),Vi=()=>({x:Z1(),y:Z1()}),ex=()=>({min:0,max:0}),De=()=>({x:ex(),y:ex()});function lr(t){return[t("x"),t("y")]}function F5({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function x6({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function S6(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Vf(t){return t===void 0||t===1}function Gm({scale:t,scaleX:e,scaleY:r}){return!Vf(t)||!Vf(e)||!Vf(r)}function $n(t){return Gm(t)||U5(t)||t.z||t.rotate||t.rotateX||t.rotateY}function U5(t){return tx(t.x)||tx(t.y)}function tx(t){return t&&t!=="0%"}function hc(t,e,r){const n=t-r,i=e*n;return r+i}function rx(t,e,r,n,i){return i!==void 0&&(t=hc(t,i,n)),hc(t,r,n)+e}function Wm(t,e=0,r=1,n,i){t.min=rx(t.min,e,r,n,i),t.max=rx(t.max,e,r,n,i)}function j5(t,{x:e,y:r}){Wm(t.x,e.translate,e.scale,e.originPoint),Wm(t.y,r.translate,r.scale,r.originPoint)}function b6(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a1.0000000000001||t<.999999999999?t:1}function Xr(t,e){t.min=t.min+e,t.max=t.max+e}function ix(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=Pe(t.min,t.max,s);Wm(t,e[r],e[n],o,e.scale)}const C6=["x","scaleX","originX"],T6=["y","scaleY","originY"];function Hi(t,e){ix(t.x,e,C6),ix(t.y,e,T6)}function $5(t,e){return F5(S6(t.getBoundingClientRect(),e))}function E6(t,e,r){const n=$5(t,r),{scroll:i}=e;return i&&(Xr(n.x,i.offset.x),Xr(n.y,i.offset.y)),n}const P6=new WeakMap;class A6{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=De(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=l=>{this.stopAnimation(),r&&this.snapToCursor(td(l,"page").point)},s=(l,u)=>{const{drag:c,dragPropagation:h,onDragStart:d}=this.getProps();if(c&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=e5(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),lr(m=>{let _=this.getAxisMotionValue(m).get()||0;if(pr.test(_)){const{projection:w}=this.visualElement;if(w&&w.layout){const v=w.layout.layoutBox[m];v&&(_=Tt(v)*(parseFloat(_)/100))}}this.originPoint[m]=_}),d&&be.update(()=>d(l,u),!1,!0);const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},o=(l,u)=>{const{dragPropagation:c,dragDirectionLock:h,onDirectionLock:d,onDrag:p}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:m}=u;if(h&&this.currentDirection===null){this.currentDirection=I6(m),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,m),this.updateAxis("y",u.point,m),this.visualElement.render(),p&&p(l,u)},a=(l,u)=>this.stop(l,u);this.panSession=new B5(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&be.update(()=>s(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!vl(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=m6(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&$i(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=g6(n.layoutBox,e):this.constraints=!1,this.elastic=w6(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&lr(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=_6(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!$i(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=E6(n,i.root,this.visualElement.getTransformPagePoint());let o=y6(i.layout.layoutBox,s);if(r){const a=r(x6(o));this.hasMutatedConstraints=!!a,a&&(o=F5(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=lr(c=>{if(!vl(c,r,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const d=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:n?e[c]:0,bounceStiffness:d,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(Qy(e,n,0,r))}stopAnimation(){lr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const r="_drag"+e.toUpperCase(),n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){lr(r=>{const{drag:n}=this.getProps();if(!vl(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-Pe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!$i(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};lr(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();i[o]=v6({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),lr(o=>{if(!vl(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Pe(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;P6.set(this.visualElement,this);const e=this.visualElement.current,r=Ir(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();$i(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),n();const o=Er(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(lr(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=zm,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function vl(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function I6(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class k6 extends Bn{constructor(e){super(e),this.removeGroupControls=Re,this.removeListeners=Re,this.controls=new A6(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Re}unmount(){this.removeGroupControls(),this.removeListeners()}}const sx=t=>(e,r)=>{t&&be.update(()=>t(e,r))};class R6 extends Bn{constructor(){super(...arguments),this.removePointerDownListener=Re}onPointerDown(e){this.session=new B5(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:sx(e),onStart:sx(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&be.update(()=>i(s,o))}}}mount(){this.removePointerDownListener=Ir(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function M6(){const t=U.useContext(My);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=U.useId();return U.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}const Hl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ox(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Hs={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(K.test(t))t=parseFloat(t);else return t;const r=ox(t,e.target.x),n=ox(t,e.target.y);return`${r}% ${n}%`}},O6={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=kn.parse(t);if(i.length>5)return n;const s=kn.createTransformer(t),o=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,l=r.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=Pe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class D6 extends tg.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;j4(N6),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Hl.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||be.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function q5(t){const[e,r]=M6(),n=U.useContext(LE);return tg.createElement(D6,{...t,layoutGroup:n,switchLayoutGroup:U.useContext(FE),isPresent:e,safeToRemove:r})}const N6={borderRadius:{...Hs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Hs,borderTopRightRadius:Hs,borderBottomLeftRadius:Hs,borderBottomRightRadius:Hs,boxShadow:O6},V5=["TopLeft","TopRight","BottomLeft","BottomRight"],B6=V5.length,ax=t=>typeof t=="string"?parseFloat(t):t,lx=t=>typeof t=="number"||K.test(t);function L6(t,e,r,n,i,s){i?(t.opacity=Pe(0,r.opacity!==void 0?r.opacity:1,F6(n)),t.opacityExit=Pe(e.opacity!==void 0?e.opacity:1,0,U6(n))):s&&(t.opacity=Pe(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(pa(t,e,n))}function cx(t,e){t.min=e.min,t.max=e.max}function At(t,e){cx(t.x,e.x),cx(t.y,e.y)}function dx(t,e,r,n,i){return t-=e,t=hc(t,1/r,n),i!==void 0&&(t=hc(t,1/i,n)),t}function j6(t,e=0,r=1,n=.5,i,s=t,o=t){if(pr.test(e)&&(e=parseFloat(e),e=Pe(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Pe(s.min,s.max,n);t===s&&(a-=e),t.min=dx(t.min,e,r,a,i),t.max=dx(t.max,e,r,a,i)}function hx(t,e,[r,n,i],s,o){j6(t,e[r],e[n],e[i],e.scale,s,o)}const $6=["x","scaleX","originX"],q6=["y","scaleY","originY"];function fx(t,e,r,n){hx(t.x,e,$6,r?r.x:void 0,n?n.x:void 0),hx(t.y,e,q6,r?r.y:void 0,n?n.y:void 0)}function px(t){return t.translate===0&&t.scale===1}function z5(t){return px(t.x)&&px(t.y)}function V6(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function G5(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function mx(t){return Tt(t.x)/Tt(t.y)}class H6{constructor(){this.members=[]}add(e){Ky(this.members,e),e.scheduleRender()}remove(e){if(Yy(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gx(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:l,rotateX:u,rotateY:c}=r;l&&(n+=`rotate(${l}deg) `),u&&(n+=`rotateX(${u}deg) `),c&&(n+=`rotateY(${c}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const z6=(t,e)=>t.depth-e.depth;class G6{constructor(){this.children=[],this.isDirty=!1}add(e){Ky(this.children,e),this.isDirty=!0}remove(e){Yy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(z6),this.isDirty=!1,this.children.forEach(e)}}function W6(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(Nr(n),t(s-e))};return be.read(n,!0),()=>Nr(n)}function Q6(t){window.MotionDebug&&window.MotionDebug.record(t)}function K6(t){return t instanceof SVGElement&&t.tagName!=="svg"}function Y6(t,e,r){const n=mt(t)?t:ys(t);return n.start(Qy("",n,e,r)),n.animation}const yx=["","X","Y","Z"],vx=1e3;let X6=0;const qn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function W5({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=X6++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{qn.totalNodes=qn.resolvedTargetDeltas=qn.recalculatedProjection=0,this.nodes.forEach(e8),this.nodes.forEach(s8),this.nodes.forEach(o8),this.nodes.forEach(t8),Q6(qn)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=W6(d,250),Hl.hasAnimatedSinceResize&&(Hl.hasAnimatedSinceResize=!1,this.nodes.forEach(wx))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||c.getDefaultTransition()||d8,{onLayoutAnimationStart:w,onLayoutAnimationComplete:v}=c.getProps(),g=!this.targetLayout||!G5(this.targetLayout,m)||p,y=!d&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,y);const x={...R5(_,"layout"),onPlay:w,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x)}else d||wx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Nr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(a8),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(r8),this.sharedNodes.forEach(l8)}scheduleUpdateProjection(){be.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){be.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const C=x/1e3;xx(h.x,o.x,C),xx(h.y,o.y,C),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yo(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),u8(this.relativeTarget,this.relativeTargetOrigin,d,C),y&&V6(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=De()),At(y,this.relativeTarget)),_&&(this.animationValues=c,L6(c,u,this.latestValues,C,g,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Nr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=be.update(()=>{Hl.hasAnimatedSinceResize=!0,this.currentAnimation=Y6(0,vx,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Q5(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||De();const h=Tt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=Tt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}At(a,l),Hi(a,c),go(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new H6),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let c=0;c{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(_x),this.root.sharedNodes.clear()}}}function J6(t){t.updateLayout()}function Z6(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=r.source!==t.layout.source;s==="size"?lr(h=>{const d=o?r.measuredBox[h]:r.layoutBox[h],p=Tt(d);d.min=n[h].min,d.max=d.min+p}):Q5(s,r.layoutBox,n)&&lr(h=>{const d=o?r.measuredBox[h]:r.layoutBox[h],p=Tt(n[h]);d.max=d.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+p)});const a=Vi();go(a,n,r.layoutBox);const l=Vi();o?go(l,t.applyTransform(i,!0),r.measuredBox):go(l,n,r.layoutBox);const u=!z5(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:p}=h;if(d&&p){const m=De();yo(m,r.layoutBox,d.layoutBox);const _=De();yo(_,n,p.layoutBox),G5(m,_)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=_,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function e8(t){qn.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function t8(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function r8(t){t.clearSnapshot()}function _x(t){t.clearMeasurements()}function n8(t){t.isLayoutDirty=!1}function i8(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function wx(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function s8(t){t.resolveTargetDelta()}function o8(t){t.calcProjection()}function a8(t){t.resetRotation()}function l8(t){t.removeLeadSnapshot()}function xx(t,e,r){t.translate=Pe(e.translate,0,r),t.scale=Pe(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function Sx(t,e,r,n){t.min=Pe(e.min,r.min,n),t.max=Pe(e.max,r.max,n)}function u8(t,e,r,n){Sx(t.x,e.x,r.x,n),Sx(t.y,e.y,r.y,n)}function c8(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const d8={duration:.45,ease:[.4,0,.1,1]},bx=t=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(t),Cx=bx("applewebkit/")&&!bx("chrome/")?Math.round:Re;function Tx(t){t.min=Cx(t.min),t.max=Cx(t.max)}function h8(t){Tx(t.x),Tx(t.y)}function Q5(t,e,r){return t==="position"||t==="preserve-aspect"&&!Hm(mx(e),mx(r),.2)}const f8=W5({attachResizeListener:(t,e)=>Er(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hf={current:void 0},K5=W5({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Hf.current){const t=new f8({});t.mount(window),t.setOptions({layoutScroll:!0}),Hf.current=t}return Hf.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),p8={pan:{Feature:R6},drag:{Feature:k6,ProjectionNode:K5,MeasureLayout:q5}},m8=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function g8(t){const e=m8.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function Qm(t,e,r=1){const[n,i]=g8(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const o=s.trim();return M5(o)?parseFloat(o):o}else return Lm(i)?Qm(i,e,r+1):i}function y8(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!Lm(s))return;const o=Qm(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!Lm(s))continue;const o=Qm(s,n);o&&(e[i]=o,r||(r={}),r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const v8=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Y5=t=>v8.has(t),_8=t=>Object.keys(t).some(Y5),Ex=t=>t===gi||t===K,Px=(t,e)=>parseFloat(t.split(", ")[e]),Ax=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return Px(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?Px(s[1],t):0}},w8=new Set(["x","y","z"]),x8=ka.filter(t=>!w8.has(t));function S8(t){const e=[];return x8.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const vs={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Ax(4,13),y:Ax(5,14)};vs.translateX=vs.x;vs.translateY=vs.y;const b8=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(u=>{a[u]=vs[u](n,s)}),e.render();const l=e.measureViewportBox();return r.forEach(u=>{const c=e.getValue(u);c&&c.jump(a[u]),t[u]=vs[u](l,s)}),t},C8=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(Y5);let s=[],o=!1;const a=[];if(i.forEach(l=>{const u=t.getValue(l);if(!t.hasValue(l))return;let c=r[l],h=Vs(c);const d=e[l];let p;if(ac(d)){const m=d.length,_=d[0]===null?1:0;c=d[_],h=Vs(c);for(let w=_;w=0?window.pageYOffset:null,u=b8(e,t,a);return s.length&&s.forEach(([c,h])=>{t.getValue(c).set(h)}),t.render(),Xc&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:n}}else return{target:e,transitionEnd:n}};function T8(t,e,r,n){return _8(e)?C8(t,e,r,n):{target:e,transitionEnd:n}}const E8=(t,e,r,n)=>{const i=y8(t,e,n);return e=i.target,n=i.transitionEnd,T8(t,e,r,n)},Km={current:null},X5={current:!1};function P8(){if(X5.current=!0,!!Xc)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Km.current=t.matches;t.addListener(e),e()}else Km.current=!1}function A8(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(mt(s))t.addValue(i,s),dc(n)&&n.add(i);else if(mt(o))t.addValue(i,ys(s,{owner:t})),dc(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,ys(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const Ix=new WeakMap,J5=Object.keys(fa),I8=J5.length,kx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],k8=Dy.length;class R8{constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>be.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=r.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=Zc(r),this.isVariantNode=BE(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(r,{});for(const h in c){const d=c[h];a[h]!==void 0&&mt(d)&&(d.set(a[h],!1),dc(u)&&u.add(h))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){this.current=e,Ix.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),X5.current||P8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Km.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ix.delete(this.current),this.projection&&this.projection.unmount(),Nr(this.notifyUpdate),Nr(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,r){const n=mi.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&be.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,layoutScroll:d,layoutRoot:p})}return a}updateFeatures(){for(const e in this.features){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):De()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=ys(r,{owner:this}),this.addValue(e,n)),n}readValue(e){var r;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=qy(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!mt(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new Xy),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class Z5 extends R8{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=YL(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){QL(this,n,o);const a=E8(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function M8(t){return window.getComputedStyle(t)}class O8 extends Z5{readValueFromInstance(e,r){if(mi.has(r)){const n=Wy(r);return n&&n.default||0}else{const n=M8(e),i=($E(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return $5(e,r)}build(e,r,n,i){By(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return $y(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;mt(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){WE(e,r,n,i)}}class D8 extends Z5{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(mi.has(r)){const n=Wy(r);return n&&n.default||0}return r=QE.has(r)?r:jy(r),e.getAttribute(r)}measureInstanceViewportBox(){return De()}scrapeMotionValuesFromProps(e,r){return YE(e,r)}build(e,r,n,i){Fy(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){KE(e,r,n,i)}mount(e){this.isSVGTag=Uy(e.tagName),super.mount(e)}}const N8=(t,e)=>Ny(t)?new D8(e,{enableHardwareAcceleration:!1}):new O8(e,{enableHardwareAcceleration:!0}),B8={layout:{ProjectionNode:K5,MeasureLayout:q5}},L8={...c6,...kB,...p8,...B8},F8=F4((t,e)=>yB(t,e,L8,N8));function U8(){const[t,e]=U.useState(!1),{broadcaster:r}=Nn();return U.useEffect(()=>{setTimeout(()=>{e(!0)},2e3)},[]),t?null:de.jsx(F8.div,{initial:{opacity:1},animate:{opacity:0},transition:{duration:.3,delay:1},className:"bg-emerald-800 absolute top-3 inset-x-3 rounded-xl p-3 flex items-center justify-center",children:de.jsxs("span",{className:"text-lime-100 text-md mx-3 font-grandstander",children:["Connected to [",de.jsx("strong",{className:"text-lime-200",children:r.userName}),"]"]})})}const eP=new Map;let Rx=!1;function j8(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){Rx||(await ms.chat.getChannelEmotes(r)).forEach(s=>{eP.set(s.name,{id:s.id,name:s.name,images:{default:Mx(s),static:Mx(s,!0)},source:"twitch"})}),e(!1),Rx=!0}n()},[r]),{loading:t}}function $8(){function t(){return Array.from(eP.values())}return{getAllChannelEmotes:t}}function Mx(t,e=!1){function r(n="3.0"){const i=e?"static":"default",s="light";return DT(t.id,{animationSettings:i,backgroundType:s,size:n})}return{x1:r("1.0"),x2:r("2.0"),x4:r("3.0")}}const Ox=["broadcaster","moderator","artist","vip","founder","subscriber"],Dx=["action","highlight","cheer","reply","redeem","resub","announcement"],Nx=["1000","2000","3000","Prime"],Bx=["PRIMARY","BLUE","GREEN","ORANGE","PURPLE"],Lx=[1,5,10,50,100,500,1e3,5e3,1e4];function q8(){const t=sy(),{getAllOtherEmotes:e}=rE(),{getAllChannelEmotes:r}=$8(),{getCheerColor:n,getCheermoteUrls:i}=wy(),{getBadge:s}=sE(),{getAllPronouns:o}=nE();function a(){const l=o(),u=[...r(),...e()],c=new Date,h=!ut(0,4);let d="test message",p=d;h&&(d=`${d} (first time chat)`);const m=[],_={id:`test-user-${c.getTime()}`,userName:"testuser",displayName:"testUser",pronouns:ut(0,1)?void 0:l[ut(0,l.length-1)],badges:[],roles:{broadcaster:!1,moderator:!1,artist:!1,vip:!1,founder:!1,subscriber:!1,followDate:new Date(0)}},w=ut(0,1)?"user":Ox[ut(0,Ox.length-1)],v=s(w);w!=="user"&&v&&(_.badges=[v],_.roles[w]=!0,_.userName=`test${w}`,_.displayName=`test${w.charAt(0).toUpperCase()}${w.slice(1)}`);let g={type:"basic"};if(ut(0,1)){const x=Dx[ut(0,Dx.length-1)];switch(x){case"action":d=`${d} (/me action message)`,p=d;break;case"highlight":d=`${d} (highlighted message)`,p=d;break;case"cheer":const C=Lx[ut(0,Lx.length-1)],k="Cheer";g={type:x,cheer:{amount:C}};const O=`${k}${C}`;p=`${d} (cheer message)`,d=`${O} ${p}`,m.unshift({type:"text",text:" "}),m.unshift({type:"cheer",text:O,cheer:{name:k,amount:C,color:n(k,C),images:{default:i(k,C),static:i(k,C,!0)}}});break;case"reply":g={type:x,reply:{id:`test-reply-${c.getTime()}`,text:"test message being replied to",user:{id:`test-user-reply-${c.getTime()}`,userName:"testreplyuser",displayName:"testReplyUser"}}},d=`${d} (reply message)`,p=d;break;case"redeem":g={type:x,redeem:{id:`test-redeem-${c.getTime()}`,name:"Test Redeem",image:"https://static-cdn.jtvnw.net/custom-reward-images/default-4.png",color:"#FFC6FF",cost:ut(1,1e3)}},d=`${d} (channel point redemption requiring text)`,p=d;break;case"resub":g={type:x,resub:{months:ut(1,24),tier:Nx[ut(0,Nx.length-1)]}},d=`${d} (resub message)`,p=d;break;case"announcement":(w==="broadcaster"||w==="moderator")&&(g={type:x,announcement:{color:Bx[ut(0,Bx.length-1)]}},d=`${d} (announcement message)`,p=d);break}}if(ut(0,1)&&u.length){const x=u[ut(0,u.length-1)];m.unshift({type:"text",text:" "}),m.unshift({type:"emote",emote:x,text:x.name}),d=`${x.name} ${d}`}m.push({type:"text",text:p});const y={...g,id:`test-message-${c.getTime()}`,first:h,date:c,user:_,text:d,parts:m,tags:new Map([["test","1"]])};t({type:"add",payload:y})}return{sendTestMessage:a}}function ut(t,e){return Math.floor(Math.random()*(e-t+1))+t}const or=20;function V8(){const[t,e]=U.useState({bottom:or,right:or}),[r,n]=U.useState(!1),{sendTestMessage:i}=q8();return U.useEffect(()=>{function s(l){const u=window.innerWidth,c=window.innerHeight,h=l.clientX,d=l.clientY;h>u*.3&&hc*.3&&d{window.removeEventListener("mousemove",s),document.removeEventListener("mouseenter",o),document.removeEventListener("mouseleave",a)}},[i]),r?de.jsx("button",{onClick:i,className:"px-3 py-1 !fixed btn-shadow-i flex justify-center gap-2 overflow-hidden rounded-2xl border-2 border-emerald-800 bg-gradient-to-b from-lime-600 to-emerald-700 text-center hover:from-lime-500 hover:to-emerald-600 focus:outline-offset-8",style:{...t},children:de.jsx("span",{className:"font-grandstander font-semibold text-lime-100 text-shadow text-shadow-c-black/75 text-shadow-y-px",children:"Send Test Message"})}):null}function H8(){const{loading:t}=$D(),{loading:e}=E4(),{loading:r}=cO(),{loading:n}=DD(),{loading:i}=HD(),{loading:s}=j8();return t||e||r||n||i||s?de.jsx(ZC,{message:"Connecting to Chat..."}):de.jsx(de.Fragment,{children:de.jsxs(S3,{children:[de.jsx(U8,{}),de.jsx(A4,{}),de.jsx(V8,{})]})})}function z8(){const{loading:t,tokenInfo:e}=p3();return t?de.jsx(ZC,{message:"Checking Token..."}):e?de.jsx(H8,{}):de.jsx(x3,{})}function G8(){return de.jsx(z8,{})}function ns(){}slime2Chat||(slime2Chat={onMessage:ns,onModDelete:ns,ready:ns});slime2Chat.onMessage||(slime2Chat.onMessage=ns);slime2Chat.onModDelete||(slime2Chat.onModDelete=ns);slime2Chat.ready||(slime2Chat.ready=ns);slime2Tokens||(slime2Tokens={});const W8=zf.createRoot(document.getElementById("slime2-root"));W8.render(de.jsx(tg.StrictMode,{children:de.jsx(G8,{})})); +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[Nw]=this[Nw]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=qs(o);n[a]||(cD(i,o),n[a]=!0)}return R.isArray(e)?e.forEach(s):s(e),this}}Gc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);R.reduceDescriptors(Gc.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});R.freezeMethods(Gc);const Ar=Gc;function Tf(t,e){const r=this||Cy,n=e||r,i=Ar.from(n.headers);let s=n.data;return R.forEach(t,function(a){s=a.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function XT(t){return!!(t&&t.__CANCEL__)}function Ea(t,e,r){ae.call(this,t??"canceled",ae.ERR_CANCELED,e,r),this.name="CanceledError"}R.inherits(Ea,ae,{__CANCEL__:!0});function dD(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new ae("Request failed with status code "+r.status,[ae.ERR_BAD_REQUEST,ae.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const hD=Xt.isStandardBrowserEnv?function(){return{write:function(r,n,i,s,o,a){const l=[];l.push(r+"="+encodeURIComponent(n)),R.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),R.isString(s)&&l.push("path="+s),R.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function fD(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function pD(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function JT(t,e){return t&&!fD(e)?pD(t,e):e}const mD=Xt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(s){let o=s;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(o){const a=R.isString(o)?i(o):o;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function gD(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function yD(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=n[s];o||(o=u),r[i]=l,n[i]=u;let h=s,d=0;for(;h!==i;)d+=r[h++],h=h%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-r,l=n(a),u=s<=o;r=s;const c={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&u?(o-s)/l:void 0,event:i};c[e?"download":"upload"]=!0,t(c)}}const vD=typeof XMLHttpRequest<"u",_D=vD&&function(t){return new Promise(function(r,n){let i=t.data;const s=Ar.from(t.headers).normalize(),o=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}R.isFormData(i)&&(Xt.isStandardBrowserEnv||Xt.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(t.auth){const p=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(p+":"+m))}const c=JT(t.baseURL,t.url);u.open(t.method.toUpperCase(),QT(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout;function h(){if(!u)return;const p=Ar.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),_={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:p,config:t,request:u};dD(function(v){r(v),l()},function(v){n(v),l()},_),u=null}if("onloadend"in u?u.onloadend=h:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(h)},u.onabort=function(){u&&(n(new ae("Request aborted",ae.ECONNABORTED,t,u)),u=null)},u.onerror=function(){n(new ae("Network Error",ae.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const _=t.transitional||KT;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),n(new ae(m,_.clarifyTimeoutError?ae.ETIMEDOUT:ae.ECONNABORTED,t,u)),u=null},Xt.isStandardBrowserEnv){const p=(t.withCredentials||mD(c))&&t.xsrfCookieName&&hD.read(t.xsrfCookieName);p&&s.set(t.xsrfHeaderName,p)}i===void 0&&s.setContentType(null),"setRequestHeader"in u&&R.forEach(s.toJSON(),function(m,_){u.setRequestHeader(_,m)}),R.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),o&&o!=="json"&&(u.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&u.addEventListener("progress",Bw(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Bw(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=p=>{u&&(n(!p||p.type?new Ea(null,t,u):p),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const d=gD(c);if(d&&Xt.protocols.indexOf(d)===-1){n(new ae("Unsupported protocol "+d+":",ae.ERR_BAD_REQUEST,t));return}u.send(i||null)})},Ul={http:zO,xhr:_D};R.forEach(Ul,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ZT={getAdapter:t=>{t=R.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let i=0;it instanceof Ar?t.toJSON():t;function gs(t,e){e=e||{};const r={};function n(u,c,h){return R.isPlainObject(u)&&R.isPlainObject(c)?R.merge.call({caseless:h},u,c):R.isPlainObject(c)?R.merge({},c):R.isArray(c)?c.slice():c}function i(u,c,h){if(R.isUndefined(c)){if(!R.isUndefined(u))return n(void 0,u,h)}else return n(u,c,h)}function s(u,c){if(!R.isUndefined(c))return n(void 0,c)}function o(u,c){if(R.isUndefined(c)){if(!R.isUndefined(u))return n(void 0,u)}else return n(void 0,c)}function a(u,c,h){if(h in e)return n(u,c);if(h in t)return n(void 0,u)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,c)=>i(Fw(u),Fw(c),!0)};return R.forEach(Object.keys(Object.assign({},t,e)),function(c){const h=l[c]||i,d=h(t[c],e[c],c);R.isUndefined(d)&&h!==a||(r[c]=d)}),r}const eE="1.5.0",Ty={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ty[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Uw={};Ty.transitional=function(e,r,n){function i(s,o){return"[Axios v"+eE+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new ae(i(o," has been removed"+(r?" in "+r:"")),ae.ERR_DEPRECATED);return r&&!Uw[o]&&(Uw[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};function wD(t,e,r){if(typeof t!="object")throw new ae("options must be an object",ae.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],o=e[s];if(o){const a=t[s],l=a===void 0||o(a,s,t);if(l!==!0)throw new ae("option "+s+" must be "+l,ae.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ae("Unknown option "+s,ae.ERR_BAD_OPTION)}}const Em={assertOptions:wD,validators:Ty},Wr=Em.validators;class Xu{constructor(e){this.defaults=e,this.interceptors={request:new Dw,response:new Dw}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=gs(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&Em.assertOptions(n,{silentJSONParsing:Wr.transitional(Wr.boolean),forcedJSONParsing:Wr.transitional(Wr.boolean),clarifyTimeoutError:Wr.transitional(Wr.boolean)},!1),i!=null&&(R.isFunction(i)?r.paramsSerializer={serialize:i}:Em.assertOptions(i,{encode:Wr.function,serialize:Wr.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&R.merge(s.common,s[r.method]);s&&R.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),r.headers=Ar.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(r)===!1||(l=l&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});const u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let c,h=0,d;if(!l){const m=[Lw.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,u),d=m.length,c=Promise.resolve(r);h{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new Ea(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new Ey(function(i){e=i}),cancel:e}}}const xD=Ey;function SD(t){return function(r){return t.apply(null,r)}}function bD(t){return R.isObject(t)&&t.isAxiosError===!0}const Pm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pm).forEach(([t,e])=>{Pm[e]=t});const CD=Pm;function tE(t){const e=new jl(t),r=BT(jl.prototype.request,e);return R.extend(r,jl.prototype,e,{allOwnKeys:!0}),R.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return tE(gs(t,i))},r}const Ue=tE(Cy);Ue.Axios=jl;Ue.CanceledError=Ea;Ue.CancelToken=xD;Ue.isCancel=XT;Ue.VERSION=eE;Ue.toFormData=zc;Ue.AxiosError=ae;Ue.Cancel=Ue.CanceledError;Ue.all=function(e){return Promise.all(e)};Ue.spread=SD;Ue.isAxiosError=bD;Ue.mergeConfig=gs;Ue.AxiosHeaders=Ar;Ue.formToJSON=t=>YT(R.isHTMLForm(t)?new FormData(t):t);Ue.getAdapter=ZT.getAdapter;Ue.HttpStatusCode=CD;Ue.default=Ue;const Py=Ue,TD=Py.create({baseURL:"https://api.betterttv.net/3/cached"});class ED{static async getEmotes(e,r){const n=await PD(e,r);if(!n)return null;const i=new Map;return n.forEach(s=>{i.set(s.code,{id:s.id,name:s.code,images:{default:jw(s.id),static:jw(s.id,!0)},source:"betterTTV"})}),i}}function jw(t,e=!1){function r(n=3){return`https://cdn.betterttv.net/emote/${t}${e?"/static":""}/${n}x`}return{x1:r(1),x2:r(2),x4:r(3)}}async function PD(t,e){const r=await AD(`/users/${t}/${e}`);if(!r)return null;const{channelEmotes:n,sharedEmotes:i}=r;return!n||!i||n.length===0&&i.length===0?null:[...n,...i]}async function AD(t){return await TD.get(t).then(e=>e.data).catch(()=>null)}const ID=Py.create({baseURL:"https://api.frankerfacez.com/v1"});class kD{static async getEmotes(e,r){const n=await RD(e,r);if(!n)return null;const i=new Map;return n.forEach(s=>{i.set(s.name,{id:s.id.toString(),name:s.name,images:{default:$w(s),static:$w(s,!0)},source:"frankerFaceZ"})}),i}}function $w(t,e=!1){let r=t.urls[1],n=t.urls[2]||r,i=t.urls[4]||n;return!e&&t.animated&&(r=t.animated[1],n=t.animated[2]||r,i=t.animated[4]||n),{x1:r,x2:n,x4:i}}async function RD(t,e){const r=OD[t],n=await MD(`/room/${r}/${e}`);if(!n)return null;const{sets:i}=n;if(!i)return null;const s=Object.keys(i),o=[];return s.forEach(a=>{const l=i[a];o.push(...l.emoticons)}),o.length===0?null:o}async function MD(t){return await ID.get(t).then(e=>e.data).catch(()=>null)}const OD={twitch:"id",youtube:"yt"},$l=new Map;let qw=!1;function rE(){function t(n){return $l.get(n)}function e(){return Array.from($l.keys())}function r(){return Array.from($l.values())}return{getOtherEmote:t,getOtherEmoteNames:e,getAllOtherEmotes:r}}function DD(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){if(!qw){const[i,s]=await Promise.all([ED.getEmotes("twitch",r.id),kD.getEmotes("twitch",r.id)]);i&&i.forEach(Vw),s&&s.forEach(Vw)}e(!1),qw=!0}n()},[r]),{loading:t}}function Vw(t,e){$l.set(e,t)}function ND(){const{getOtherEmote:t,getOtherEmoteNames:e}=rE(),{getCheerColor:r,getCheermoteUrls:n}=wy();function i(a,l){const{position:u,length:c,id:h,name:d}=a,p=l.slice(u,u+c),m=t(p);return m?{type:"emote",text:p,emote:m}:{type:"emote",text:l.slice(u,u+c),emote:{id:h,name:d,images:{default:Hw(h),static:Hw(h,!0)},source:"twitch"}}}function s(a,l){const{name:u,amount:c,position:h,length:d}=a;return{type:"cheer",text:l.slice(h,h+d),cheer:{color:r(u,c),images:{default:n(u,c),static:n(u,c,!0)},name:u,amount:c}}}function o(a){const{text:l}=a,u=BD(e());return l.split(u).filter(h=>h!=="").map(h=>{const d=t(h);return d?{type:"emote",text:h,emote:d}:{type:"text",text:h}})}return{transformTextPart:o,transformEmotePart:i,transformCheerPart:s}}function Hw(t,e=!1){function r(n="3.0"){return DT(t,{animationSettings:e?"static":"default",backgroundType:"light",size:n})}return{x1:r("1.0"),x2:r("2.0"),x4:r("3.0")}}function BD(t){const e=t.map(LD).join("|"),r=String.raw`(?<=\s|[.,!]|^)(${e})(?=\s|[.,!]|$)`;return new RegExp(r,"g")}function LD(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FD(){const{transformTextPart:t,transformCheerPart:e,transformEmotePart:r}=ND(),{getCheermoteNames:n}=wy();function i(s,o,a=!1){if(!s)return[];const l=nO(s,o,a?n():void 0),u=[];return l.forEach(c=>{switch(c.type){default:case"text":u.push(...t(c));break;case"cheer":u.push(e(c,s));break;case"emote":u.push(r(c,s));break}}),u}return{transformText:i}}const UD=Py.create({baseURL:"https://pronouns.alejo.io/api"}),jD=1e3*60*5,zw=new Map,Am=new Map;let Im=!1;function nE(){async function t(r){if(!Im)return;let n=zw.get(r);if(!n||n.expire{async function r(){if(!Im){const n=await VD();n&&n.forEach(({name:i,display:s})=>{Am.set(i,s)})}e(!1),Im=!0}r()},[]),{loading:t}}async function qD(t){const e=await iE(`/users/${t}`);if(!e)return;const[r]=e;if(r)return r.pronoun_id}async function VD(){return iE("/pronouns")}async function iE(t){return await UD.get(t).then(e=>e.data).catch(()=>null)}const km=new Map;let Gw=!1;function sE(){function t(r){const n=[];return r.forEach((i,s)=>{var a,l;const o=(l=(a=km.get(s))==null?void 0:a.get(i))==null?void 0:l.getImageUrl(4);o&&n.push({id:s,image:o})}),n}function e(r){var i,s;const n=(s=(i=km.get(r))==null?void 0:i.get(r==="subscriber"||r==="founder"?"0":"1"))==null?void 0:s.getImageUrl(4);if(n)return{id:r,image:n}}return{transformBadges:t,getBadge:e}}function HD(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){if(!Gw){const[i,s]=await Promise.all([ms.chat.getChannelBadges(r.id),ms.chat.getGlobalBadges()]);Ww(s),Ww(i)}e(!1),Gw=!0}n()},[r]),{loading:t}}function Ww(t){t.forEach(e=>{const r=new Map;e.versions.forEach(n=>{r.set(n.id,n)}),km.set(e.id,r)})}function Le(t,e){let r=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(o=>[o]));let n=e[0].length,i=e[0].map((o,a)=>e.map(l=>l[a])),s=t.map(o=>i.map(a=>{let l=0;if(!Array.isArray(o)){for(let u of a)l+=o*u;return l}for(let u=0;uo[0]):s}function Pa(t){return gn(t)==="string"}function gn(t){return(Object.prototype.toString.call(t).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Ju(t,e){t=+t,e=+e;let r=(Math.floor(t)+"").length;if(e>r)return+t.toFixed(e-r);{let n=10**(r-e);return Math.round(t/n)*n}}function oE(t){if(!t)return;t=t.trim();const e=/^([a-z]+)\((.+?)\)$/i,r=/^-?[\d.]+$/;let n=t.match(e);if(n){let i=[];return n[2].replace(/\/?\s*([-\w.]+(?:%|deg)?)/g,(s,o)=>{/%$/.test(o)?(o=new Number(o.slice(0,-1)/100),o.type=""):/deg$/.test(o)?(o=new Number(+o.slice(0,-3)),o.type="",o.unit="deg"):r.test(o)&&(o=new Number(o),o.type=""),s.startsWith("/")&&(o=o instanceof Number?o:new Number(o),o.alpha=!0),i.push(o)}),{name:n[1].toLowerCase(),rawName:n[1],rawArgs:n[2],args:i}}}function aE(t){return t[t.length-1]}function Zu(t,e,r){return isNaN(t)?e:isNaN(e)?t:t+(e-t)*r}function lE(t,e,r){return(r-t)/(e-t)}function Ay(t,e,r){return Zu(e[0],e[1],lE(t[0],t[1],r))}function uE(t){return t.map(e=>e.split("|").map(r=>{r=r.trim();let n=r.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(n){let i=new String(n[1]);return i.range=[+n[2],+n[3]],i}return r}))}var zD=Object.freeze({__proto__:null,interpolate:Zu,interpolateInv:lE,isString:Pa,last:aE,mapRange:Ay,multiplyMatrices:Le,parseCoordGrammar:uE,parseFunction:oE,toPrecision:Ju,type:gn});class GD{add(e,r,n){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(e,r){this[e]=this[e]||[],this[e].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}}const Tn=new GD;var gr={gamut_mapping:"lch.c",precision:5,deltaE:"76"};const Jt={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Rm(t){return Array.isArray(t)?t:Jt[t]}function ec(t,e,r,n={}){if(t=Rm(t),e=Rm(e),!t||!e)throw new TypeError(`Missing white point to convert ${t?"":"from"}${!t&&!e?"/":""}${e?"":"to"}`);if(t===e)return r;let i={W1:t,W2:e,XYZ:r,options:n};if(Tn.run("chromatic-adaptation-start",i),i.M||(i.W1===Jt.D65&&i.W2===Jt.D50?i.M=[[1.0479298208405488,.022946793341019088,-.05019222954313557],[.029627815688159344,.990434484573249,-.01707382502938514],[-.009243058152591178,.015055144896577895,.7518742899580008]]:i.W1===Jt.D50&&i.W2===Jt.D65&&(i.M=[[.9554734527042182,-.023098536874261423,.0632593086610217],[-.028369706963208136,1.0099954580058226,.021041398966943008],[.012314001688319899,-.020507696433477912,1.3303659366080753]])),Tn.run("chromatic-adaptation-end",i),i.M)return Le(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const WD=75e-6,_t=class _t{constructor(e){var i,s,o;this.id=e.id,this.name=e.name,this.base=e.base?_t.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let a in r)"name"in r[a]||(r[a].name=a);this.coords=r;let n=e.white??this.base.white??"D65";this.white=Rm(n),this.formats=e.formats??{};for(let a in this.formats){let l=this.formats[a];l.type||(l.type="function"),l.name||(l.name=a)}e.cssId&&!((i=this.formats.functions)!=null&&i.color)?(this.formats.color={id:e.cssId},Object.defineProperty(this,"cssId",{value:e.cssId})):(s=this.formats)!=null&&s.color&&!((o=this.formats)!=null&&o.color.id)&&(this.formats.color.id=this.id),this.referred=e.referred,Object.defineProperty(this,"path",{value:QD(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Tn.run("colorspace-init-end",this)}inGamut(e,{epsilon:r=WD}={}){if(this.isPolar)return e=this.toBase(e),this.base.inGamut(e,{epsilon:r});let n=Object.values(this.coords);return e.every((i,s)=>{let o=n[s];if(o.type!=="angle"&&o.range){if(Number.isNaN(i))return!0;let[a,l]=o.range;return(a===void 0||i>=a-r)&&(l===void 0||i<=l+r)}return!0})}get cssId(){var e,r;return((r=(e=this.formats.functions)==null?void 0:e.color)==null?void 0:r.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=Qw(e,this),e;let r;return e==="default"?r=Object.values(this.formats)[0]:r=this.formats[e],r?(r=Qw(r,this),r):null}equals(e){return e?this===e||this.id===e.id:!1}to(e,r){if(arguments.length===1&&([e,r]=[e.space,e.coords]),e=_t.get(e),this.equals(e))return r;r=r.map(a=>Number.isNaN(a)?0:a);let n=this.path,i=e.path,s,o;for(let a=0;ao;a--)r=n[a].toBase(r);for(let a=o+1;a=0){let u=Object.entries(i.coords)[s];if(u)return{space:i,id:u[0],index:s,...u[1]}}i=_t.get(i);let o=s.toLowerCase(),a=0;for(let u in i.coords){let c=i.coords[u];if(u.toLowerCase()===o||((l=c.name)==null?void 0:l.toLowerCase())===o)return{space:i,id:u,index:a,...c};a++}throw new TypeError(`No "${s}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(", ")}`)}};fd(_t,"registry",{}),fd(_t,"DEFAULT_FORMAT",{type:"functions",name:"color"});let Y=_t;function QD(t){let e=[t];for(let r=t;r=r.base;)e.push(r);return e}function Qw(t,{coords:e}={}){if(t.coords&&!t.coordGrammar){t.type||(t.type="function"),t.name||(t.name="color"),t.coordGrammar=uE(t.coords);let r=Object.entries(e).map(([n,i],s)=>{let o=t.coordGrammar[s][0],a=i.range||i.refRange,l=o.range,u="";return o==""?(l=[0,100],u="%"):o==""&&(u="deg"),{fromRange:a,toRange:l,suffix:u}});t.serializeCoords=(n,i)=>n.map((s,o)=>{let{fromRange:a,toRange:l,suffix:u}=r[o];return a&&l&&(s=Ay(a,l,s)),s=Ju(s,i),u&&(s+=u),s})}return t}var Ft=new Y({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class gt extends Y{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Ft),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=r=>{let n=Le(e.toXYZ_M,r);return this.white!==this.base.white&&(n=ec(this.white,this.base.white,n)),n}),e.fromBase??(e.fromBase=r=>(r=ec(this.base.white,this.white,r),Le(e.fromXYZ_M,r)))),e.referred??(e.referred="display"),super(e)}}function cE(t,{meta:e}={}){var n,i,s,o,a;let r={str:(n=String(t))==null?void 0:n.trim()};if(Tn.run("parse-start",r),r.color)return r.color;if(r.parsed=oE(r.str),r.parsed){let l=r.parsed.name;if(l==="color"){let u=r.parsed.args.shift(),c=r.parsed.rawArgs.indexOf("/")>0?r.parsed.args.pop():1;for(let d of Y.all){let p=d.getFormat("color");if(p&&(u===p.id||(i=p.ids)!=null&&i.includes(u))){const m=Object.keys(d.coords).map((_,w)=>r.parsed.args[w]||0);return e&&(e.formatId="color"),{spaceId:d.id,coords:m,alpha:c}}}let h="";if(u in Y.registry){let d=(a=(o=(s=Y.registry[u].formats)==null?void 0:s.functions)==null?void 0:o.color)==null?void 0:a.id;d&&(h=`Did you mean color(${d})?`)}throw new TypeError(`Cannot parse color(${u}). `+(h||"Missing a plugin?"))}else for(let u of Y.all){let c=u.getFormat(l);if(c&&c.type==="function"){let h=1;(c.lastAlpha||aE(r.parsed.args).alpha)&&(h=r.parsed.args.pop());let d=r.parsed.args,p;return c.coordGrammar&&(p=Object.entries(u.coords).map(([m,_],w)=>{var k;let v=c.coordGrammar[w],g=(k=d[w])==null?void 0:k.type,y=v.find(O=>O==g);if(!y){let O=_.name||m;throw new TypeError(`${g} not allowed for ${O} in ${l}()`)}let x=y.range;g===""&&(x||(x=[0,1]));let C=_.range||_.refRange;return x&&C&&(d[w]=Ay(x,C,d[w])),y})),e&&Object.assign(e,{formatId:c.name,types:p}),{spaceId:u.id,coords:d,alpha:h}}}}else for(let l of Y.all)for(let u in l.formats){let c=l.formats[u];if(c.type!=="custom"||c.test&&!c.test(r.str))continue;let h=c.parse(r.str);if(h)return h.alpha??(h.alpha=1),e&&(e.formatId=u),h}throw new TypeError(`Could not parse ${t} as a color. Missing a plugin?`)}function fe(t){if(!t)throw new TypeError("Empty color reference");Pa(t)&&(t=cE(t));let e=t.space||t.spaceId;return e instanceof Y||(t.space=Y.get(e)),t.alpha===void 0&&(t.alpha=1),t}function Aa(t,e){return e=Y.get(e),e.from(t)}function Ut(t,e){let{space:r,index:n}=Y.resolveCoord(e,t.space);return Aa(t,r)[n]}function dE(t,e,r){return e=Y.get(e),t.coords=e.to(t.space,r),t}function En(t,e,r){if(t=fe(t),arguments.length===2&&gn(arguments[1])==="object"){let n=arguments[1];for(let i in n)En(t,i,n[i])}else{typeof r=="function"&&(r=r(Ut(t,e)));let{space:n,index:i}=Y.resolveCoord(e,t.space),s=Aa(t,n);s[i]=r,dE(t,n,s)}return t}var Iy=new Y({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Ft,fromBase:t=>ec(Ft.white,"D50",t),toBase:t=>ec("D50",Ft.white,t),formats:{color:{}}});const KD=216/24389,Kw=24/116,al=24389/27;let Pf=Jt.D50;var St=new Y({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"L"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Pf,base:Iy,fromBase(t){let r=t.map((n,i)=>n/Pf[i]).map(n=>n>KD?Math.cbrt(n):(al*n+16)/116);return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(t){let e=[];return e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200,[e[0]>Kw?Math.pow(e[0],3):(116*e[0]-16)/al,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/al,e[2]>Kw?Math.pow(e[2],3):(116*e[2]-16)/al].map((n,i)=>n*Pf[i])},formats:{lab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function Wc(t){return(t%360+360)%360}function YD(t,e){if(t==="raw")return e;let[r,n]=e.map(Wc),i=n-r;return t==="increasing"?i<0&&(n+=360):t==="decreasing"?i>0&&(r+=360):t==="longer"?-1800?r+=360:n+=360):t==="shorter"&&(i>180?r+=360:i<-180&&(n+=360)),[r,n]}var ua=new Y({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:St,fromBase(t){let[e,r,n]=t,i;const s=.02;return Math.abs(r) | "," | "," | "]}}});const Yw=25**7,tc=Math.PI,Xw=180/tc,Si=tc/180;function Mm(t,e,{kL:r=1,kC:n=1,kH:i=1}={}){let[s,o,a]=St.from(t),l=ua.from(St,[s,o,a])[1],[u,c,h]=St.from(e),d=ua.from(St,[u,c,h])[1];l<0&&(l=0),d<0&&(d=0);let m=((l+d)/2)**7,_=.5*(1-Math.sqrt(m/(m+Yw))),w=(1+_)*o,v=(1+_)*c,g=Math.sqrt(w**2+a**2),y=Math.sqrt(v**2+h**2),x=w===0&&a===0?0:Math.atan2(a,w),C=v===0&&h===0?0:Math.atan2(h,v);x<0&&(x+=2*tc),C<0&&(C+=2*tc),x*=Xw,C*=Xw;let k=u-s,O=y-g,A=C-x,N=x+C,j=Math.abs(A),Q;g*y===0?Q=0:j<=180?Q=A:A>180?Q=A-360:A<-180?Q=A+360:console.log("the unthinkable has happened");let re=2*Math.sqrt(y*g)*Math.sin(Q*Si/2),Z=(s+u)/2,T=(g+y)/2,I=Math.pow(T,7),V;g*y===0?V=N:j<=180?V=N/2:N<360?V=(N+360)/2:V=(N-360)/2;let se=(Z-50)**2,L=1+.015*se/Math.sqrt(20+se),F=1+.045*T,z=1;z-=.17*Math.cos((V-30)*Si),z+=.24*Math.cos(2*V*Si),z+=.32*Math.cos((3*V+6)*Si),z-=.2*Math.cos((4*V-63)*Si);let H=1+.015*T*z,oe=30*Math.exp(-1*((V-275)/25)**2),Ht=2*Math.sqrt(I/(I+Yw)),Ye=-1*Math.sin(2*oe*Si)*Ht,yt=(k/(r*L))**2;return yt+=(O/(n*F))**2,yt+=(re/(i*H))**2,yt+=Ye*(O/(n*F))*(re/(i*H)),Math.sqrt(yt)}const XD=75e-6;function fo(t,e=t.space,{epsilon:r=XD}={}){t=fe(t),e=Y.get(e);let n=t.coords;return e!==t.space&&(n=e.from(t)),e.inGamut(n,{epsilon:r})}function ca(t){return{space:t.space,coords:t.coords.slice(),alpha:t.alpha}}function Pn(t,{method:e=gr.gamut_mapping,space:r=t.space}={}){if(Pa(arguments[1])&&(r=arguments[1]),r=Y.get(r),fo(t,r,{epsilon:0}))return fe(t);let n=Ot(t,r);if(e!=="clip"&&!fo(t,r)){let i=Pn(ca(n),{method:"clip",space:r});if(Mm(t,i)>2){let s=Y.resolveCoord(e),o=s.space,a=s.id,l=Ot(n,o),c=(s.range||s.refRange)[0],h=.01,d=c,p=Ut(l,a);for(;p-d>h;){let m=ca(l);m=Pn(m,{space:r,method:"clip"}),Mm(l,m)-2s.range||[]);n.coords=n.coords.map((s,o)=>{let[a,l]=i[o];return a!==void 0&&(s=Math.max(a,s)),l!==void 0&&(s=Math.min(s,l)),s})}return r!==t.space&&(n=Ot(n,t.space)),t.coords=n.coords,t}Pn.returns="color";function Ot(t,e,{inGamut:r}={}){t=fe(t),e=Y.get(e);let n=e.from(t),i={space:e,coords:n,alpha:t.alpha};return r&&(i=Pn(i)),i}Ot.returns="color";function rc(t,{precision:e=gr.precision,format:r="default",inGamut:n=!0,...i}={}){var l;let s;t=fe(t);let o=r;r=t.space.getFormat(r)??t.space.getFormat("default")??Y.DEFAULT_FORMAT,n||(n=r.toGamut);let a=t.coords;if(a=a.map(u=>u||0),n&&!fo(t)&&(a=Pn(ca(t),n===!0?void 0:n).coords),r.type==="custom")if(i.precision=e,r.serialize)s=r.serialize(a,t.alpha,i);else throw new TypeError(`format ${o} can only be used to parse colors, not for serialization`);else{let u=r.name||"color";r.serializeCoords?a=r.serializeCoords(a,e):e!==null&&(a=a.map(p=>Ju(p,e)));let c=[...a];if(u==="color"){let p=r.id||((l=r.ids)==null?void 0:l[0])||t.space.id;c.unshift(p)}let h=t.alpha;e!==null&&(h=Ju(h,e));let d=t.alpha<1&&!r.noAlpha?`${r.commas?",":" /"} ${h}`:"";s=`${u}(${c.join(r.commas?", ":" ")}${d})`}return s}const JD=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],ZD=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var Qc=new gt({id:"rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:JD,fromXYZ_M:ZD,formats:{color:{}}});const ll=1.09929682680944,Jw=.018053968510807;var hE=new gt({id:"rec2020",name:"REC.2020",base:Qc,toBase(t){return t.map(function(e){return e=Jw?ll*Math.pow(e,.45)-(ll-1):4.5*e})},formats:{color:{}}});const eN=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],tN=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var fE=new gt({id:"p3-linear",name:"Linear P3",white:"D65",toXYZ_M:eN,fromXYZ_M:tN});const rN=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],nN=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var pE=new gt({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:rN,fromXYZ_M:nN,formats:{color:{}}}),Zw={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let e1=Array(3).fill(" | [0, 255]"),t1=Array(3).fill("[0, 255]");var da=new gt({id:"srgb",name:"sRGB",base:pE,fromBase:t=>t.map(e=>{let r=e<0?-1:1,n=e*r;return n>.0031308?r*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:t=>t.map(e=>{let r=e<0?-1:1,n=e*r;return n<.04045?e/12.92:r*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:e1},rgb_number:{name:"rgb",commas:!0,coords:t1,noAlpha:!0},color:{},rgba:{coords:e1,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:t1},hex:{type:"custom",toGamut:!0,test:t=>/^#([a-f0-9]{3,4}){1,2}$/i.test(t),parse(t){t.length<=5&&(t=t.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return t.replace(/[a-f0-9]{2}/gi,r=>{e.push(parseInt(r,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(t,e,{collapse:r=!0}={})=>{e<1&&t.push(e),t=t.map(s=>Math.round(s*255));let n=r&&t.every(s=>s%17===0);return"#"+t.map(s=>n?(s/17).toString(16):s.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:t=>/^[a-z]+$/i.test(t),parse(t){t=t.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(t==="transparent"?(e.coords=Zw.black,e.alpha=0):e.coords=Zw[t],e.coords)return e}}}}),mE=new gt({id:"p3",name:"P3",base:fE,fromBase:da.fromBase,toBase:da.toBase,formats:{color:{id:"display-p3"}}});gr.display_space=da;if(typeof CSS<"u"&&CSS.supports)for(let t of[St,hE,mE]){let e=t.getMinCoords(),n=rc({space:t,coords:e,alpha:1});if(CSS.supports("color",n)){gr.display_space=t;break}}function iN(t,{space:e=gr.display_space,...r}={}){let n=rc(t,r);if(typeof CSS>"u"||CSS.supports("color",n)||!gr.display_space)n=new String(n),n.color=t;else{let i=Ot(t,e);n=new String(rc(i,r)),n.color=i}return n}function gE(t,e,r="lab"){r=Y.get(r);let n=r.from(t),i=r.from(e);return Math.sqrt(n.reduce((s,o,a)=>{let l=i[a];return isNaN(o)||isNaN(l)?s:s+(l-o)**2},0))}function sN(t,e){return t=fe(t),e=fe(e),t.space===e.space&&t.alpha===e.alpha&&t.coords.every((r,n)=>r===e.coords[n])}function An(t){return Ut(t,[Ft,"y"])}function yE(t,e){En(t,[Ft,"y"],e)}function oN(t){Object.defineProperty(t.prototype,"luminance",{get(){return An(this)},set(e){yE(this,e)}})}var aN=Object.freeze({__proto__:null,getLuminance:An,register:oN,setLuminance:yE});function lN(t,e){t=fe(t),e=fe(e);let r=Math.max(An(t),0),n=Math.max(An(e),0);return n>r&&([r,n]=[n,r]),(r+.05)/(n+.05)}const uN=.56,cN=.57,dN=.62,hN=.65,r1=.022,fN=1.414,pN=.1,mN=5e-4,gN=1.14,n1=.027,yN=1.14;function i1(t){return t>=r1?t:t+(r1-t)**fN}function bi(t){let e=t<0?-1:1,r=Math.abs(t);return e*Math.pow(r,2.4)}function vN(t,e){e=fe(e),t=fe(t);let r,n,i,s,o,a;e=Ot(e,"srgb"),[s,o,a]=e.coords;let l=bi(s)*.2126729+bi(o)*.7151522+bi(a)*.072175;t=Ot(t,"srgb"),[s,o,a]=t.coords;let u=bi(s)*.2126729+bi(o)*.7151522+bi(a)*.072175,c=i1(l),h=i1(u),d=h>c;return Math.abs(h-c)0?i=n-n1:i=n+n1,i*100}function _N(t,e){t=fe(t),e=fe(e);let r=Math.max(An(t),0),n=Math.max(An(e),0);n>r&&([r,n]=[n,r]);let i=r+n;return i===0?0:(r-n)/i}const wN=5e4;function xN(t,e){t=fe(t),e=fe(e);let r=Math.max(An(t),0),n=Math.max(An(e),0);return n>r&&([r,n]=[n,r]),n===0?wN:(r-n)/n}function SN(t,e){t=fe(t),e=fe(e);let r=Ut(t,[St,"l"]),n=Ut(e,[St,"l"]);return Math.abs(r-n)}const bN=216/24389,s1=24/116,ul=24389/27;let Af=Jt.D65;var Om=new Y({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"L"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Af,base:Ft,fromBase(t){let r=t.map((n,i)=>n/Af[i]).map(n=>n>bN?Math.cbrt(n):(ul*n+16)/116);return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(t){let e=[];return e[1]=(t[0]+16)/116,e[0]=t[1]/500+e[1],e[2]=e[1]-t[2]/200,[e[0]>s1?Math.pow(e[0],3):(116*e[0]-16)/ul,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/ul,e[2]>s1?Math.pow(e[2],3):(116*e[2]-16)/ul].map((n,i)=>n*Af[i])},formats:{"lab-d65":{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});const If=Math.pow(5,.5)*.5+.5;function CN(t,e){t=fe(t),e=fe(e);let r=Ut(t,[Om,"l"]),n=Ut(e,[Om,"l"]),i=Math.abs(Math.pow(r,If)-Math.pow(n,If)),s=Math.pow(i,1/If)*Math.SQRT2-40;return s<7.5?0:s}var ql=Object.freeze({__proto__:null,contrastAPCA:vN,contrastDeltaPhi:CN,contrastLstar:SN,contrastMichelson:_N,contrastWCAG21:lN,contrastWeber:xN});function TN(t,e,r={}){Pa(r)&&(r={algorithm:r});let{algorithm:n,...i}=r;if(!n){let s=Object.keys(ql).map(o=>o.replace(/^contrast/,"")).join(", ");throw new TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${s}`)}t=fe(t),e=fe(e);for(let s in ql)if("contrast"+n.toLowerCase()===s.toLowerCase())return ql[s](t,e,i);throw new TypeError(`Unknown contrast algorithm: ${n}`)}function vE(t){let[e,r,n]=Aa(t,Ft),i=e+15*r+3*n;return[4*e/i,9*r/i]}function _E(t){let[e,r,n]=Aa(t,Ft),i=e+r+n;return[e/i,r/i]}function EN(t){Object.defineProperty(t.prototype,"uv",{get(){return vE(this)}}),Object.defineProperty(t.prototype,"xy",{get(){return _E(this)}})}var PN=Object.freeze({__proto__:null,register:EN,uv:vE,xy:_E});function AN(t,e){return gE(t,e,"lab")}const IN=Math.PI,o1=IN/180;function kN(t,e,{l:r=2,c:n=1}={}){let[i,s,o]=St.from(t),[,a,l]=ua.from(St,[i,s,o]),[u,c,h]=St.from(e),d=ua.from(St,[u,c,h])[1];a<0&&(a=0),d<0&&(d=0);let p=i-u,m=a-d,_=s-c,w=o-h,v=_**2+w**2-m**2,g=.511;i>=16&&(g=.040975*i/(1+.01765*i));let y=.0638*a/(1+.0131*a)+.638,x;Number.isNaN(l)&&(l=0),l>=164&&l<=345?x=.56+Math.abs(.2*Math.cos((l+168)*o1)):x=.36+Math.abs(.4*Math.cos((l+35)*o1));let C=Math.pow(a,4),k=Math.sqrt(C/(C+1900)),O=y*(k*x+1-k),A=(p/(r*g))**2;return A+=(m/(n*y))**2,A+=v/O**2,Math.sqrt(A)}const a1=203;var ky=new Y({id:"xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Ft,fromBase(t){return t.map(e=>Math.max(e*a1,0))},toBase(t){return t.map(e=>Math.max(e/a1,0))}});const cl=1.15,dl=.66,l1=2610/2**14,RN=2**14/2610,u1=3424/2**12,c1=2413/2**7,d1=2392/2**7,MN=1.7*2523/2**5,h1=2**5/(1.7*2523),hl=-.56,kf=16295499532821565e-27,ON=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],DN=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],NN=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],BN=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var wE=new Y({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:ky,fromBase(t){let[e,r,n]=t,i=cl*e-(cl-1)*n,s=dl*r-(dl-1)*e,a=Le(ON,[i,s,n]).map(function(d){let p=u1+c1*(d/1e4)**l1,m=1+d1*(d/1e4)**l1;return(p/m)**MN}),[l,u,c]=Le(NN,a);return[(1+hl)*l/(1+hl*l)-kf,u,c]},toBase(t){let[e,r,n]=t,i=(e+kf)/(1+hl-hl*(e+kf)),o=Le(BN,[i,r,n]).map(function(d){let p=u1-d**h1,m=d1*d**h1-c1;return 1e4*(p/m)**RN}),[a,l,u]=Le(DN,o),c=(a+(cl-1)*u)/cl,h=(l+(dl-1)*c)/dl;return[c,h,u]},formats:{color:{}}}),Dm=new Y({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:wE,fromBase(t){let[e,r,n]=t,i;const s=2e-4;return Math.abs(r)Math.cbrt(n));return Le(KN,r)},toBase(t){let r=Le(YN,t).map(n=>n**3);return Le(QN,r)},formats:{oklab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function XN(t,e){let[r,n,i]=nc.from(t),[s,o,a]=nc.from(e),l=r-s,u=n-o,c=i-a;return Math.sqrt(l**2+u**2+c**2)}var ic={deltaE76:AN,deltaECMC:kN,deltaE2000:Mm,deltaEJz:LN,deltaEITP:GN,deltaEOK:XN};function Ys(t,e,r={}){Pa(r)&&(r={method:r});let{method:n=gr.deltaE,...i}=r;t=fe(t),e=fe(e);for(let s in ic)if("deltae"+n.toLowerCase()===s.toLowerCase())return ic[s](t,e,i);throw new TypeError(`Unknown deltaE method: ${n}`)}function JN(t,e=.25){let n=[Y.get("oklch","lch"),"l"];return En(t,n,i=>i*(1+e))}function ZN(t,e=.25){let n=[Y.get("oklch","lch"),"l"];return En(t,n,i=>i*(1-e))}var e4=Object.freeze({__proto__:null,darken:ZN,lighten:JN});function CE(t,e,r=.5,n={}){[t,e]=[fe(t),fe(e)],gn(r)==="object"&&([r,n]=[.5,r]);let{space:i,outputSpace:s,premultiplied:o}=n;return Ia(t,e,{space:i,outputSpace:s,premultiplied:o})(r)}function TE(t,e,r={}){let n;Ry(t)&&([n,r]=[t,e],[t,e]=n.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:s,steps:o=2,maxSteps:a=1e3,...l}=r;n||([t,e]=[fe(t),fe(e)],n=Ia(t,e,l));let u=Ys(t,e),c=i>0?Math.max(o,Math.ceil(u/i)+1):o,h=[];if(a!==void 0&&(c=Math.min(c,a)),c===1)h=[{p:.5,color:n(.5)}];else{let d=1/(c-1);h=Array.from({length:c},(p,m)=>{let _=m*d;return{p:_,color:n(_)}})}if(i>0){let d=h.reduce((p,m,_)=>{if(_===0)return 0;let w=Ys(m.color,h[_-1].color,s);return Math.max(p,w)},0);for(;d>i;){d=0;for(let p=1;pd.color),h}function Ia(t,e,r={}){if(Ry(t)){let[l,u]=[t,e];return Ia(...l.rangeArgs.colors,{...l.rangeArgs.options,...u})}let{space:n,outputSpace:i,progression:s,premultiplied:o}=r;t=fe(t),e=fe(e),t=ca(t),e=ca(e);let a={colors:[t,e],options:r};if(n?n=Y.get(n):n=Y.registry[gr.interpolationSpace]||t.space,i=i?Y.get(i):n,t=Ot(t,n),e=Ot(e,n),t=Pn(t),e=Pn(e),n.coords.h&&n.coords.h.type==="angle"){let l=r.hue=r.hue||"shorter",u=[n,"h"],[c,h]=[Ut(t,u),Ut(e,u)];[c,h]=YD(l,[c,h]),En(t,u,c),En(e,u,h)}return o&&(t.coords=t.coords.map(l=>l*t.alpha),e.coords=e.coords.map(l=>l*e.alpha)),Object.assign(l=>{l=s?s(l):l;let u=t.coords.map((d,p)=>{let m=e.coords[p];return Zu(d,m,l)}),c=Zu(t.alpha,e.alpha,l),h={space:n,coords:u,alpha:c};return o&&(h.coords=h.coords.map(d=>d/c)),i!==n&&(h=Ot(h,i)),h},{rangeArgs:a})}function Ry(t){return gn(t)==="function"&&!!t.rangeArgs}gr.interpolationSpace="lab";function t4(t){t.defineFunction("mix",CE,{returns:"color"}),t.defineFunction("range",Ia,{returns:"function"}),t.defineFunction("steps",TE,{returns:"array"})}var r4=Object.freeze({__proto__:null,isRange:Ry,mix:CE,range:Ia,register:t4,steps:TE}),EE=new Y({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:da,fromBase:t=>{let e=Math.max(...t),r=Math.min(...t),[n,i,s]=t,[o,a,l]=[NaN,0,(r+e)/2],u=e-r;if(u!==0){switch(a=l===0||l===1?0:(e-l)/Math.min(l,1-l),e){case n:o=(i-s)/u+(i{let[e,r,n]=t;e=e%360,e<0&&(e+=360),r/=100,n/=100;function i(s){let o=(s+e/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(o-3,9-o,1))}return[i(0),i(8),i(4)]},formats:{hsl:{toGamut:!0,coords:[" | ","",""]},hsla:{coords:[" | ","",""],commas:!0,lastAlpha:!0}}}),PE=new Y({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:EE,fromBase(t){let[e,r,n]=t;r/=100,n/=100;let i=n+r*Math.min(n,1-n);return[e,i===0?0:200*(1-n/i),100*i]},toBase(t){let[e,r,n]=t;r/=100,n/=100;let i=n*(1-r/2);return[e,i===0||i===1?0:(n-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{toGamut:!0}}}),n4=new Y({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:PE,fromBase(t){let[e,r,n]=t;return[e,n*(100-r)/100,100-n]},toBase(t){let[e,r,n]=t;r/=100,n/=100;let i=r+n;if(i>=1){let a=r/i;return[e,0,a*100]}let s=1-n,o=s===0?0:1-r/s;return[e,o*100,s*100]},formats:{hwb:{toGamut:!0,coords:[" | ","",""]}}});const i4=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],s4=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var AE=new gt({id:"a98rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:i4,fromXYZ_M:s4}),o4=new gt({id:"a98rgb",name:"Adobe® 98 RGB compatible",base:AE,toBase:t=>t.map(e=>Math.pow(Math.abs(e),563/256)*Math.sign(e)),fromBase:t=>t.map(e=>Math.pow(Math.abs(e),256/563)*Math.sign(e)),formats:{color:{id:"a98-rgb"}}});const a4=[[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],l4=[[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]];var IE=new gt({id:"prophoto-linear",name:"Linear ProPhoto",white:"D50",base:Iy,toXYZ_M:a4,fromXYZ_M:l4});const u4=1/512,c4=16/512;var d4=new gt({id:"prophoto",name:"ProPhoto",base:IE,toBase(t){return t.map(e=>ee>=u4?e**(1/1.8):16*e)},formats:{color:{id:"prophoto-rgb"}}}),h4=new Y({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:nc,fromBase(t){let[e,r,n]=t,i;const s=2e-4;return Math.abs(r) | "," | [0,1]"," | "]}}});const m1=203,g1=2610/2**14,f4=2**14/2610,p4=2523/2**5,y1=2**5/2523,v1=3424/2**12,_1=2413/2**7,w1=2392/2**7;var m4=new gt({id:"rec2100pq",name:"REC.2100-PQ",base:Qc,toBase(t){return t.map(function(e){return(Math.max(e**y1-v1,0)/(_1-w1*e**y1))**f4*1e4/m1})},fromBase(t){return t.map(function(e){let r=Math.max(e*m1/1e4,0),n=v1+_1*r**g1,i=1+w1*r**g1;return(n/i)**p4})},formats:{color:{id:"rec2100-pq"}}});const x1=.17883277,S1=.28466892,b1=.55991073,Rf=3.7743;var g4=new gt({id:"rec2100hlg",cssid:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:Qc,toBase(t){return t.map(function(e){return e<=.5?e**2/3*Rf:(Math.exp((e-b1)/x1)+S1)/12*Rf})},fromBase(t){return t.map(function(e){return e/=Rf,e<=1/12?Math.sqrt(3*e):x1*Math.log(12*e-S1)+b1})},formats:{color:{id:"rec2100-hlg"}}});const kE={};Tn.add("chromatic-adaptation-start",t=>{t.options.method&&(t.M=RE(t.W1,t.W2,t.options.method))});Tn.add("chromatic-adaptation-end",t=>{t.M||(t.M=RE(t.W1,t.W2,t.options.method))});function Kc({id:t,toCone_M:e,fromCone_M:r}){kE[t]=arguments[0]}function RE(t,e,r="Bradford"){let n=kE[r],[i,s,o]=Le(n.toCone_M,t),[a,l,u]=Le(n.toCone_M,e),c=[[a/i,0,0],[0,l/s,0],[0,0,u/o]],h=Le(c,n.toCone_M);return Le(n.fromCone_M,h)}Kc({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599364,-1.1293816,.2198974],[.3611914,.6388125,-64e-7],[0,0,1.0890636]]});Kc({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929,-.1470543,.1599627],[.4323053,.5183603,.0492912],[-.0085287,.0400428,.9684867]]});Kc({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238,-.278869,.1827452],[.454369,.4735332,.0720978],[-.0096276,-.005698,1.0153256]]});Kc({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.011254630531685,.1491867754444518],[.3875265432361372,.6214474419314753,-.008973985167612518],[-.01584149884933386,-.03412293802851557,1.04996443687785]]});Object.assign(Jt,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]});Jt.ACES=[.32168/.33767,1,(1-.32168-.33767)/.33767];const y4=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],v4=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var ME=new gt({id:"acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:Jt.ACES,toXYZ_M:y4,fromXYZ_M:v4,formats:{color:{}}});const fl=2**-16,Mf=-.35828683,pl=(Math.log2(65504)+9.72)/17.52;var _4=new gt({id:"acescc",name:"ACEScc",coords:{r:{range:[Mf,pl],name:"Red"},g:{range:[Mf,pl],name:"Green"},b:{range:[Mf,pl],name:"Blue"}},referred:"scene",base:ME,toBase(t){const e=-.3013698630136986;return t.map(function(r){return r<=e?(2**(r*17.52-9.72)-fl)*2:rthis.get(o),set:a=>this.set(o,a)})}get spaceId(){return this.space.id}clone(){return new pe(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...e){let r=iN(this,...e);return r.color=new pe(r.color),r}static get(e,...r){return e instanceof pe?e:new pe(e,...r)}static defineFunction(e,r,n=r){let{instance:i=!0,returns:s}=n,o=function(...a){let l=r(...a);if(s==="color")l=pe.get(l);else if(s==="function"){let u=l;l=function(...c){let h=u(...c);return pe.get(h)},Object.assign(l,u)}else s==="array"&&(l=l.map(u=>pe.get(u)));return l};e in pe||(pe[e]=o),i&&(pe.prototype[e]=function(...a){return o(this,...a)})}static defineFunctions(e){for(let r in e)pe.defineFunction(r,e[r],e[r])}static extend(e){if(e.register)e.register(pe);else for(let r in e)pe.defineFunction(r,e[r])}}pe.defineFunctions({get:Ut,getAll:Aa,set:En,setAll:dE,to:Ot,equals:sN,inGamut:fo,toGamut:Pn,distance:gE,toString:rc});Object.assign(pe,{util:zD,hooks:Tn,WHITES:Jt,Space:Y,spaces:Y.registry,parse:cE,defaults:gr});for(let t of Object.keys(C1))Y.register(C1[t]);for(let t in Y.registry)Bm(t,Y.registry[t]);Tn.add("colorspace-init-end",t=>{var e;Bm(t.id,t),(e=t.aliases)==null||e.forEach(r=>{Bm(r,t)})});function Bm(t,e){Object.keys(e.coords),Object.values(e.coords).map(n=>n.name);let r=t.replace(/-/g,"_");Object.defineProperty(pe.prototype,r,{get(){let n=this.getAll(t);return typeof Proxy>"u"?n:new Proxy(n,{has:(i,s)=>{try{return Y.resolveCoord([e,s]),!0}catch{}return Reflect.has(i,s)},get:(i,s,o)=>{if(s&&typeof s!="symbol"&&!(s in i)){let{index:a}=Y.resolveCoord([e,s]);if(a>=0)return i[a]}return Reflect.get(i,s,o)},set:(i,s,o,a)=>{if(s&&typeof s!="symbol"&&!(s in i)||s>=0){let{index:l}=Y.resolveCoord([e,s]);if(l>=0)return i[l]=o,this.setAll(t,i),!0}return Reflect.set(i,s,o,a)}})},set(n){this.setAll(t,n)},configurable:!0,enumerable:!0})}pe.extend(ic);pe.extend({deltaE:Ys});Object.assign(pe,{deltaEMethods:ic});pe.extend(e4);pe.extend({contrast:TN});pe.extend(PN);pe.extend(aN);pe.extend(r4);pe.extend(ql);const T1=new Map,w4=1e3*60*60,x4=new pe("black"),S4=new pe("white");function b4(){const{getPronouns:t}=nE(),{broadcaster:e}=Nn(),{transformBadges:r}=sE();async function n(s){const{userId:o,userName:a,displayName:l,badges:u,color:c,isBroadcaster:h,isMod:d,isArtist:p,isVip:m,isFounder:_,isSubscriber:w}=s;return{id:o,userName:a,displayName:l,pronouns:await t(a),badges:r(u),color:c,colorBrightness:c?C4(c):void 0,roles:{broadcaster:h,moderator:d,artist:p,vip:m,founder:_,subscriber:w,followDate:await i(o)}}}async function i(s){if(s===e.id)return new Date(0);let o=T1.get(s);if(!o||o.expiren?"dark":"light"}const OE=new Map;let E1=!1;function T4(){function t(e){return OE.get(e)}return{getReward:t}}function E4(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){E1||(await ms.channelPoints.getCustomRewards(r.id).catch(s=>[])).forEach(s=>{OE.set(s.id,s)}),e(!1),E1=!0}n()},[r]),{loading:t}}function P4(){const{getReward:t}=T4(),{transformText:e}=FD(),{transformUser:r}=b4();async function n(i,s,o){if(s instanceof $c&&(o=s.text),!o)return;const{type:a}=i,l={id:s.id,first:s.tags.get("first-msg")==="1",date:s.date,text:o,parts:e(o,s.emoteOffsets,a==="cheer"),user:await r(s.userInfo),tags:s.tags,...i};if(a!=="basic")return l;if(s.tags.get("msg-id")==="highlighted-message")return{...l,type:"highlight"};const u=s.tags.get("custom-reward-id");if(u){const d=t(u);if(d){const p={id:d.id,name:d.title,cost:d.cost,image:d.getImageUrl(4),color:d.backgroundColor};return{...l,type:"redeem",redeem:p}}}const c=d=>s.tags.get(`reply-parent-${d}`)||"",h=c("msg-id");if(h){const d={id:h,text:c("msg-body"),user:{id:c("user-id"),userName:c("user-login"),displayName:c("display-name")}};return{...l,type:"reply",reply:d}}return l}return{transformMessage:n}}function A4(){const t=sy(),{broadcaster:e}=Nn(),{transformMessage:r}=P4(),i=U.useRef(new Yu({authProvider:JC,channels:[e.userName]})).current;i.isConnected||i.connect();function s(l){l&&t({type:"add",payload:l})}slime2Chat.ready({test:s});function o(l=null){t({type:"clear",payload:l})}function a(l){t({type:"remove",payload:l,moderator:!0})}return U.useEffect(()=>{const l=[];return l.push(i.onMessage(async(u,c,h,d)=>{const{bits:p}=d,_=await r(p?{type:"cheer",cheer:{amount:p}}:{type:"basic"},d,h);s(_)}),i.onAction(async(u,c,h,d)=>{const p=await r({type:"action"},d,h);s(p)}),i.onResub(async(u,c,h,d)=>{const p={type:"resub",resub:{months:h.months,tier:h.plan}},m=await r(p,d);s(m)}),i.onAnnouncement(async(u,c,h,d)=>{const p={type:"announcement",announcement:{color:h.color}},m=await r(p,d);s(m)}),i.onChatClear(()=>{o()}),i.onTimeout((u,c,h,d)=>{o(d.targetUserId)}),i.onBan((u,c,h)=>{o(h.targetUserId)}),i.onMessageRemove((u,c)=>{a(c)})),()=>{l.forEach(u=>{u&&i.removeListener(u)})}}),de.jsx(uO,{})}const DE=U.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Yc=U.createContext({}),My=U.createContext(null),Xc=typeof document<"u",I4=Xc?U.useLayoutEffect:U.useEffect,NE=U.createContext({strict:!1});function k4(t,e,r,n){const{visualElement:i}=U.useContext(Yc),s=U.useContext(NE),o=U.useContext(My),a=U.useContext(DE).reducedMotion,l=U.useRef();n=n||s.renderer,!l.current&&n&&(l.current=n(t,{visualState:e,parent:i,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;U.useInsertionEffect(()=>{u&&u.update(r,o)});const c=U.useRef(!!window.HandoffAppearAnimations);return I4(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),U.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function $i(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function R4(t,e,r){return U.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):$i(r)&&(r.current=n))},[e])}function ha(t){return typeof t=="string"||Array.isArray(t)}function Jc(t){return typeof t=="object"&&typeof t.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Dy=["initial",...Oy];function Zc(t){return Jc(t.animate)||Dy.some(e=>ha(t[e]))}function BE(t){return!!(Zc(t)||t.variants)}function M4(t,e){if(Zc(t)){const{initial:r,animate:n}=t;return{initial:r===!1||ha(r)?r:void 0,animate:ha(n)?n:void 0}}return t.inherit!==!1?e:{}}function O4(t){const{initial:e,animate:r}=M4(t,U.useContext(Yc));return U.useMemo(()=>({initial:e,animate:r}),[P1(e),P1(r)])}function P1(t){return Array.isArray(t)?t.join(" "):t}const A1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},fa={};for(const t in A1)fa[t]={isEnabled:e=>A1[t].some(r=>!!e[r])};function D4(t){for(const e in t)fa[e]={...fa[e],...t[e]}}const LE=U.createContext({}),FE=U.createContext({}),N4=Symbol.for("motionComponentSymbol");function B4({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){t&&D4(t);function s(a,l){let u;const c={...U.useContext(DE),...a,layoutId:L4(a)},{isStatic:h}=c,d=O4(a),p=n(a,h);if(!h&&Xc){d.visualElement=k4(i,p,c,e);const m=U.useContext(FE),_=U.useContext(NE).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,_,t,m))}return U.createElement(Yc.Provider,{value:d},u&&d.visualElement?U.createElement(u,{visualElement:d.visualElement,...c}):null,r(i,a,R4(p,d.visualElement,l),p,h,d.visualElement))}const o=U.forwardRef(s);return o[N4]=i,o}function L4({layoutId:t}){const e=U.useContext(LE).id;return e&&t!==void 0?e+"-"+t:t}function F4(t){function e(n,i={}){return B4(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const U4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(t){return typeof t!="string"||t.includes("-")?!1:!!(U4.indexOf(t)>-1||/[A-Z]/.test(t))}const sc={};function j4(t){Object.assign(sc,t)}const ka=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mi=new Set(ka);function UE(t,{layout:e,layoutId:r}){return mi.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!sc[t]||t==="opacity")}const mt=t=>!!(t&&t.getVelocity),$4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},q4=ka.length;function V4(t,{enableHardwareAcceleration:e=!0,allowTransformNone:r=!0},n,i){let s="";for(let o=0;oe=>typeof e=="string"&&e.startsWith(t),$E=jE("--"),Lm=jE("var(--"),H4=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,z4=(t,e)=>e&&typeof t=="number"?e.transform(t):t,In=(t,e,r)=>Math.min(Math.max(r,t),e),gi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},po={...gi,transform:t=>In(0,1,t)},ml={...gi,default:1},mo=t=>Math.round(t*1e5)/1e5,ed=/(-)?([\d]*\.?[\d])+/g,qE=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,G4=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ra(t){return typeof t=="string"}const Ma=t=>({test:e=>Ra(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Qr=Ma("deg"),pr=Ma("%"),K=Ma("px"),W4=Ma("vh"),Q4=Ma("vw"),I1={...pr,parse:t=>pr.parse(t)/100,transform:t=>pr.transform(t*100)},k1={...gi,transform:Math.round},VE={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,radius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,size:K,top:K,right:K,bottom:K,left:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,rotate:Qr,rotateX:Qr,rotateY:Qr,rotateZ:Qr,scale:ml,scaleX:ml,scaleY:ml,scaleZ:ml,skew:Qr,skewX:Qr,skewY:Qr,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:po,originX:I1,originY:I1,originZ:K,zIndex:k1,fillOpacity:po,strokeOpacity:po,numOctaves:k1};function By(t,e,r,n){const{style:i,vars:s,transform:o,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const h in e){const d=e[h];if($E(h)){s[h]=d;continue}const p=VE[h],m=z4(d,p);if(mi.has(h)){if(l=!0,o[h]=m,!c)continue;d!==(p.default||0)&&(c=!1)}else h.startsWith("origin")?(u=!0,a[h]=m):i[h]=m}if(e.transform||(l||n?i.transform=V4(t.transform,r,c,n):i.transform&&(i.transform="none")),u){const{originX:h="50%",originY:d="50%",originZ:p=0}=a;i.transformOrigin=`${h} ${d} ${p}`}}const Ly=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HE(t,e,r){for(const n in e)!mt(e[n])&&!UE(n,r)&&(t[n]=e[n])}function K4({transformTemplate:t},e,r){return U.useMemo(()=>{const n=Ly();return By(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function Y4(t,e,r){const n=t.style||{},i={};return HE(i,n,t),Object.assign(i,K4(t,e,r)),t.transformValues?t.transformValues(i):i}function X4(t,e,r){const n={},i=Y4(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const J4=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function oc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||J4.has(t)}let zE=t=>!oc(t);function Z4(t){t&&(zE=e=>e.startsWith("on")?!oc(e):t(e))}try{Z4(require("@emotion/is-prop-valid").default)}catch{}function eB(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(zE(i)||r===!0&&oc(i)||!e&&!oc(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function R1(t,e,r){return typeof t=="string"?t:K.transform(e+r*t)}function tB(t,e,r){const n=R1(e,t.x,t.width),i=R1(r,t.y,t.height);return`${n} ${i}`}const rB={offset:"stroke-dashoffset",array:"stroke-dasharray"},nB={offset:"strokeDashoffset",array:"strokeDasharray"};function iB(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?rB:nB;t[s.offset]=K.transform(-n);const o=K.transform(e),a=K.transform(r);t[s.array]=`${o} ${a}`}function Fy(t,{attrX:e,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h,d){if(By(t,u,c,d),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:_}=t;p.transform&&(_&&(m.transform=p.transform),delete p.transform),_&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=tB(_,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(p.x=e),r!==void 0&&(p.y=r),n!==void 0&&(p.scale=n),o!==void 0&&iB(p,o,a,l,!1)}const GE=()=>({...Ly(),attrs:{}}),Uy=t=>typeof t=="string"&&t.toLowerCase()==="svg";function sB(t,e,r,n){const i=U.useMemo(()=>{const s=GE();return Fy(s,e,{enableHardwareAcceleration:!1},Uy(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};HE(s,t.style,t),i.style={...s,...i.style}}return i}function oB(t=!1){return(r,n,i,{latestValues:s},o)=>{const l=(Ny(r)?sB:X4)(n,s,o,r),c={...eB(n,typeof r=="string",t),...l,ref:i},{children:h}=n,d=U.useMemo(()=>mt(h)?h.get():h,[h]);return U.createElement(r,{...c,children:d})}}const jy=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function WE(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const QE=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function KE(t,e,r,n){WE(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(QE.has(i)?i:jy(i),e.attrs[i])}function $y(t,e){const{style:r}=t,n={};for(const i in r)(mt(r[i])||e.style&&mt(e.style[i])||UE(i,t))&&(n[i]=r[i]);return n}function YE(t,e){const r=$y(t,e);for(const n in t)if(mt(t[n])||mt(e[n])){const i=ka.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;r[i]=t[n]}return r}function qy(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}function aB(t){const e=U.useRef(null);return e.current===null&&(e.current=t()),e.current}const ac=t=>Array.isArray(t),lB=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),uB=t=>ac(t)?t[t.length-1]||0:t;function Vl(t){const e=mt(t)?t.get():t;return lB(e)?e.toValue():e}function cB({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:dB(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const XE=t=>(e,r)=>{const n=U.useContext(Yc),i=U.useContext(My),s=()=>cB(t,e,n,i);return r?s():aB(s)};function dB(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=Vl(s[d]);let{initial:o,animate:a}=t;const l=Zc(t),u=BE(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=r?r.initial===!1:!1;c=c||o===!1;const h=c?a:o;return h&&typeof h!="boolean"&&!Jc(h)&&(Array.isArray(h)?h:[h]).forEach(p=>{const m=qy(t,p);if(!m)return;const{transitionEnd:_,transition:w,...v}=m;for(const g in v){let y=v[g];if(Array.isArray(y)){const x=c?y.length-1:0;y=y[x]}y!==null&&(i[g]=y)}for(const g in _)i[g]=_[g]}),i}const Re=t=>t;class M1{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const r=this.order.indexOf(e);r!==-1&&(this.order.splice(r,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function hB(t){let e=new M1,r=new M1,n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const h=c&&i,d=h?e:r;return u&&o.add(l),d.add(l)&&h&&i&&(n=e.order.length),l},cancel:l=>{r.remove(l),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.clear(),n=e.order.length,n)for(let u=0;u(h[d]=hB(()=>r=!0),h),{}),o=h=>s[h].process(i),a=()=>{const h=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(h-i.timestamp,fB),1),i.timestamp=h,i.isProcessing=!0,gl.forEach(o),i.isProcessing=!1,r&&e&&(n=!1,t(a))},l=()=>{r=!0,n=!0,i.isProcessing||t(a)};return{schedule:gl.reduce((h,d)=>{const p=s[d];return h[d]=(m,_=!1,w=!1)=>(r||l(),p.schedule(m,_,w)),h},{}),cancel:h=>gl.forEach(d=>s[d].cancel(h)),state:i,steps:s}}const{schedule:be,cancel:Nr,state:He,steps:Of}=pB(typeof requestAnimationFrame<"u"?requestAnimationFrame:Re,!0),mB={useVisualState:XE({scrapeMotionValuesFromProps:YE,createRenderState:GE,onMount:(t,e,{renderState:r,latestValues:n})=>{be.read(()=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),be.render(()=>{Fy(r,n,{enableHardwareAcceleration:!1},Uy(e.tagName),t.transformTemplate),KE(e,r)})}})},gB={useVisualState:XE({scrapeMotionValuesFromProps:$y,createRenderState:Ly})};function yB(t,{forwardMotionProps:e=!1},r,n){return{...Ny(t)?mB:gB,preloadedFeatures:r,useRender:oB(e),createVisualElement:n,Component:t}}function Er(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}const JE=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function td(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const vB=t=>e=>JE(e)&&t(e,td(e));function Ir(t,e,r,n){return Er(t,e,vB(r),n)}const _B=(t,e)=>r=>e(t(r)),yn=(...t)=>t.reduce(_B);function ZE(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const O1=ZE("dragHorizontal"),D1=ZE("dragVertical");function e5(t){let e=!1;if(t==="y")e=D1();else if(t==="x")e=O1();else{const r=O1(),n=D1();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function t5(){const t=e5(!0);return t?(t(),!1):!0}class Bn{constructor(e){this.isMounted=!1,this.node=e}update(){}}function N1(t,e){const r="pointer"+(e?"enter":"leave"),n="onHover"+(e?"Start":"End"),i=(s,o)=>{if(s.type==="touch"||t5())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e),a[n]&&be.update(()=>a[n](s,o))};return Ir(t.current,r,i,{passive:!t.getProps()[n]})}class wB extends Bn{mount(){this.unmount=yn(N1(this.node,!0),N1(this.node,!1))}unmount(){}}class xB extends Bn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yn(Er(this.node.current,"focus",()=>this.onFocus()),Er(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const r5=(t,e)=>e?t===e?!0:r5(t,e.parentElement):!1;function Df(t,e){if(!e)return;const r=new PointerEvent("pointer"+t);e(r,td(r))}class SB extends Bn{constructor(){super(...arguments),this.removeStartListeners=Re,this.removeEndListeners=Re,this.removeAccessibleListeners=Re,this.startPointerPress=(e,r)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=Ir(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();be.update(()=>{r5(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(n.onTap||n.onPointerUp)}),o=Ir(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=yn(s,o),this.startPress(e,r)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Df("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&be.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Er(this.node.current,"keyup",o),Df("down",(a,l)=>{this.startPress(a,l)})},r=Er(this.node.current,"keydown",e),n=()=>{this.isPressing&&Df("cancel",(s,o)=>this.cancelPress(s,o))},i=Er(this.node.current,"blur",n);this.removeAccessibleListeners=yn(r,i)}}startPress(e,r){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&be.update(()=>n(e,r))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!t5()}cancelPress(e,r){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&be.update(()=>n(e,r))}mount(){const e=this.node.getProps(),r=Ir(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Er(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=yn(r,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Fm=new WeakMap,Nf=new WeakMap,bB=t=>{const e=Fm.get(t.target);e&&e(t)},CB=t=>{t.forEach(bB)};function TB({root:t,...e}){const r=t||document;Nf.has(r)||Nf.set(r,{});const n=Nf.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(CB,{root:t,...e})),n[i]}function EB(t,e,r){const n=TB(e);return Fm.set(t,r),n.observe(t),()=>{Fm.delete(t),n.unobserve(t)}}const PB={some:0,all:1};class AB extends Bn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=e,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:PB[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),d=u?c:h;d&&d(l)};return EB(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(IB(e,r))&&this.startObserver()}unmount(){}}function IB({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const kB={inView:{Feature:AB},tap:{Feature:SB},focus:{Feature:xB},hover:{Feature:wB}};function n5(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;ne[n]=r.get()),e}function MB(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function rd(t,e,r){const n=t.getProps();return qy(n,e,r!==void 0?r:n.custom,RB(t),MB(t))}const OB="framerAppearId",DB="data-"+jy(OB);let NB=Re,Vy=Re;const vn=t=>t*1e3,kr=t=>t/1e3,BB={current:!1},i5=t=>Array.isArray(t)&&typeof t[0]=="number";function s5(t){return!!(!t||typeof t=="string"&&o5[t]||i5(t)||Array.isArray(t)&&t.every(s5))}const Xs=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,o5={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xs([0,.65,.55,1]),circOut:Xs([.55,0,1,.45]),backIn:Xs([.31,.01,.66,-.59]),backOut:Xs([.33,1.53,.69,.99])};function a5(t){if(t)return i5(t)?Xs(t):Array.isArray(t)?t.map(a5):o5[t]}function LB(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:r};l&&(u.offset=l);const c=a5(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function FB(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const l5=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,UB=1e-7,jB=12;function $B(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=l5(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>UB&&++a$B(s,0,1,t,r);return s=>s===0||s===1?s:l5(i(s),e,n)}const qB=Oa(.42,0,1,1),VB=Oa(0,0,.58,1),u5=Oa(.42,0,.58,1),HB=t=>Array.isArray(t)&&typeof t[0]!="number",c5=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,d5=t=>e=>1-t(1-e),h5=t=>1-Math.sin(Math.acos(t)),Hy=d5(h5),zB=c5(Hy),f5=Oa(.33,1.53,.69,.99),zy=d5(f5),GB=c5(zy),WB=t=>(t*=2)<1?.5*zy(t):.5*(2-Math.pow(2,-10*(t-1))),QB={linear:Re,easeIn:qB,easeInOut:u5,easeOut:VB,circIn:h5,circInOut:zB,circOut:Hy,backIn:zy,backInOut:GB,backOut:f5,anticipate:WB},B1=t=>{if(Array.isArray(t)){Vy(t.length===4);const[e,r,n,i]=t;return Oa(e,r,n,i)}else if(typeof t=="string")return QB[t];return t},Gy=(t,e)=>r=>!!(Ra(r)&&G4.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),p5=(t,e,r)=>n=>{if(!Ra(n))return n;const[i,s,o,a]=n.match(ed);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},KB=t=>In(0,255,t),Bf={...gi,transform:t=>Math.round(KB(t))},Kn={test:Gy("rgb","red"),parse:p5("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Bf.transform(t)+", "+Bf.transform(e)+", "+Bf.transform(r)+", "+mo(po.transform(n))+")"};function YB(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Um={test:Gy("#"),parse:YB,transform:Kn.transform},qi={test:Gy("hsl","hue"),parse:p5("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+pr.transform(mo(e))+", "+pr.transform(mo(r))+", "+mo(po.transform(n))+")"},nt={test:t=>Kn.test(t)||Um.test(t)||qi.test(t),parse:t=>Kn.test(t)?Kn.parse(t):qi.test(t)?qi.parse(t):Um.parse(t),transform:t=>Ra(t)?t:t.hasOwnProperty("red")?Kn.transform(t):qi.transform(t)},Pe=(t,e,r)=>-r*t+r*e+t;function Lf(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function XB({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=Lf(l,a,t+1/3),s=Lf(l,a,t),o=Lf(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const Ff=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},JB=[Um,Kn,qi],ZB=t=>JB.find(e=>e.test(t));function L1(t){const e=ZB(t);let r=e.parse(t);return e===qi&&(r=XB(r)),r}const m5=(t,e)=>{const r=L1(t),n=L1(e),i={...r};return s=>(i.red=Ff(r.red,n.red,s),i.green=Ff(r.green,n.green,s),i.blue=Ff(r.blue,n.blue,s),i.alpha=Pe(r.alpha,n.alpha,s),Kn.transform(i))};function eL(t){var e,r;return isNaN(t)&&Ra(t)&&(((e=t.match(ed))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(qE))===null||r===void 0?void 0:r.length)||0)>0}const g5={regex:H4,countKey:"Vars",token:"${v}",parse:Re},y5={regex:qE,countKey:"Colors",token:"${c}",parse:nt.parse},v5={regex:ed,countKey:"Numbers",token:"${n}",parse:gi.parse};function Uf(t,{regex:e,countKey:r,token:n,parse:i}){const s=t.tokenised.match(e);s&&(t["num"+r]=s.length,t.tokenised=t.tokenised.replace(e,n),t.values.push(...s.map(i)))}function lc(t){const e=t.toString(),r={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return r.value.includes("var(--")&&Uf(r,g5),Uf(r,y5),Uf(r,v5),r}function _5(t){return lc(t).values}function w5(t){const{values:e,numColors:r,numVars:n,tokenised:i}=lc(t),s=e.length;return o=>{let a=i;for(let l=0;ltypeof t=="number"?0:t;function rL(t){const e=_5(t);return w5(t)(e.map(tL))}const kn={test:eL,parse:_5,createTransformer:w5,getAnimatableNone:rL},x5=(t,e)=>r=>`${r>0?e:t}`;function S5(t,e){return typeof t=="number"?r=>Pe(t,e,r):nt.test(t)?m5(t,e):t.startsWith("var(")?x5(t,e):C5(t,e)}const b5=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>S5(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=S5(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},C5=(t,e)=>{const r=kn.createTransformer(e),n=lc(t),i=lc(e);return n.numVars===i.numVars&&n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?yn(b5(n.values,i.values),r):x5(t,e)},pa=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},F1=(t,e)=>r=>Pe(t,e,r);function iL(t){return typeof t=="number"?F1:typeof t=="string"?nt.test(t)?m5:C5:Array.isArray(t)?b5:typeof t=="object"?nL:F1}function sL(t,e,r){const n=[],i=r||iL(t[0]),s=t.length-1;for(let o=0;oe[0];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=sL(e,n,i),a=o.length,l=u=>{let c=0;if(a>1)for(;cl(In(t[0],t[s-1],u)):l}function oL(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=pa(0,e,n);t.push(Pe(r,1,i))}}function aL(t){const e=[0];return oL(e,t.length-1),e}function lL(t,e){return t.map(r=>r*e)}function uL(t,e){return t.map(()=>e||u5).splice(0,t.length-1)}function uc({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=HB(n)?n.map(B1):B1(n),s={done:!1,value:e[0]},o=lL(r&&r.length===e.length?r:aL(e),t),a=T5(o,e,{ease:Array.isArray(i)?i:uL(e,i)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}function E5(t,e){return e?t*(1e3/e):0}const cL=5;function P5(t,e,r){const n=Math.max(e-cL,0);return E5(r-t(n),e-n)}const jf=.001,dL=.01,U1=10,hL=.05,fL=1;function pL({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;NB(t<=vn(U1));let o=1-e;o=In(hL,fL,o),t=In(dL,U1,kr(t)),o<1?(i=u=>{const c=u*o,h=c*t,d=c-r,p=jm(u,o),m=Math.exp(-h);return jf-d/p*m},s=u=>{const h=u*o*t,d=h*r+r,p=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-h),_=jm(Math.pow(u,2),o);return(-i(u)+jf>0?-1:1)*((d-p)*m)/_}):(i=u=>{const c=Math.exp(-u*t),h=(u-r)*t+1;return-jf+c*h},s=u=>{const c=Math.exp(-u*t),h=(r-u)*(t*t);return c*h});const a=5/t,l=gL(i,s,a);if(t=vn(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const mL=12;function gL(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function _L(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!j1(t,vL)&&j1(t,yL)){const r=pL(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}function A5({keyframes:t,restDelta:e,restSpeed:r,...n}){const i=t[0],s=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=_L(n),p=c?-kr(c):0,m=l/(2*Math.sqrt(a*u)),_=s-i,w=kr(Math.sqrt(a/u)),v=Math.abs(_)<5;r||(r=v?.01:2),e||(e=v?.005:.5);let g;if(m<1){const y=jm(w,m);g=x=>{const C=Math.exp(-m*w*x);return s-C*((p+m*w*_)/y*Math.sin(y*x)+_*Math.cos(y*x))}}else if(m===1)g=y=>s-Math.exp(-w*y)*(_+(p+w*_)*y);else{const y=w*Math.sqrt(m*m-1);g=x=>{const C=Math.exp(-m*w*x),k=Math.min(y*x,300);return s-C*((p+m*w*_)*Math.sinh(k)+y*_*Math.cosh(k))/y}}return{calculatedDuration:d&&h||null,next:y=>{const x=g(y);if(d)o.done=y>=h;else{let C=p;y!==0&&(m<1?C=P5(g,y,x):C=0);const k=Math.abs(C)<=r,O=Math.abs(s-x)<=e;o.done=k&&O}return o.value=o.done?s:x,o}}}function $1({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=A=>a!==void 0&&Al,m=A=>a===void 0?l:l===void 0||Math.abs(a-A)-_*Math.exp(-A/n),y=A=>v+g(A),x=A=>{const N=g(A),j=y(A);d.done=Math.abs(N)<=u,d.value=d.done?v:j};let C,k;const O=A=>{p(d.value)&&(C=A,k=A5({keyframes:[d.value,m(d.value)],velocity:P5(y,A,d.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return O(0),{calculatedDuration:null,next:A=>{let N=!1;return!k&&C===void 0&&(N=!0,x(A),O(A)),C!==void 0&&A>C?k.next(A-C):(!N&&x(A),d)}}}const wL=t=>{const e=({timestamp:r})=>t(r);return{start:()=>be.update(e,!0),stop:()=>Nr(e),now:()=>He.isProcessing?He.timestamp:performance.now()}},q1=2e4;function V1(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=q1?1/0:e}const xL={decay:$1,inertia:$1,tween:uc,keyframes:uc,spring:A5};function cc({autoplay:t=!0,delay:e=0,driver:r=wL,keyframes:n,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:h,...d}){let p=1,m=!1,_,w;const v=()=>{w=new Promise(H=>{_=H})};v();let g;const y=xL[i]||uc;let x;y!==uc&&typeof n[0]!="number"&&(x=T5([0,100],n,{clamp:!1}),n=[0,100]);const C=y({...d,keyframes:n});let k;a==="mirror"&&(k=y({...d,keyframes:[...n].reverse(),velocity:-(d.velocity||0)}));let O="idle",A=null,N=null,j=null;C.calculatedDuration===null&&s&&(C.calculatedDuration=V1(C));const{calculatedDuration:Q}=C;let re=1/0,Z=1/0;Q!==null&&(re=Q+o,Z=re*(s+1)-o);let T=0;const I=H=>{if(N===null)return;p>0&&(N=Math.min(N,H)),p<0&&(N=Math.min(H-Z/p,N)),A!==null?T=A:T=Math.round(H-N)*p;const oe=T-e*(p>=0?1:-1),Ht=p>=0?oe<0:oe>Z;T=Math.max(oe,0),O==="finished"&&A===null&&(T=Z);let Ye=T,yt=C;if(s){const As=T/re;let yi=Math.floor(As),nr=As%1;!nr&&As>=1&&(nr=1),nr===1&&yi--,yi=Math.min(yi,s+1);const Da=!!(yi%2);Da&&(a==="reverse"?(nr=1-nr,o&&(nr-=o/re)):a==="mirror"&&(yt=k));let Na=In(0,1,nr);T>Z&&(Na=a==="reverse"&&Da?1:0),Ye=Na*re}const Xe=Ht?{done:!1,value:n[0]}:yt.next(Ye);x&&(Xe.value=x(Xe.value));let{done:wr}=Xe;!Ht&&Q!==null&&(wr=p>=0?T>=Z:T<=0);const nd=A===null&&(O==="finished"||O==="running"&&wr);return h&&h(Xe.value),nd&&L(),Xe},V=()=>{g&&g.stop(),g=void 0},se=()=>{O="idle",V(),_(),v(),N=j=null},L=()=>{O="finished",c&&c(),V(),_()},F=()=>{if(m)return;g||(g=r(I));const H=g.now();l&&l(),A!==null?N=H-A:(!N||O==="finished")&&(N=H),O==="finished"&&v(),j=N,A=null,O="running",g.start()};t&&F();const z={then(H,oe){return w.then(H,oe)},get time(){return kr(T)},set time(H){H=vn(H),T=H,A!==null||!g||p===0?A=H:N=g.now()-H/p},get duration(){const H=C.calculatedDuration===null?V1(C):C.calculatedDuration;return kr(H)},get speed(){return p},set speed(H){H===p||!g||(p=H,z.time=kr(T))},get state(){return O},play:F,pause:()=>{O="paused",A=T},stop:()=>{m=!0,O!=="idle"&&(O="idle",u&&u(),se())},cancel:()=>{j!==null&&I(j),se()},complete:()=>{O="finished"},sample:H=>(N=0,I(H))};return z}function SL(t){let e;return()=>(e===void 0&&(e=t()),e)}const bL=SL(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),CL=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),yl=10,TL=2e4,EL=(t,e)=>e.type==="spring"||t==="backgroundColor"||!s5(e.ease);function PL(t,e,{onUpdate:r,onComplete:n,...i}){if(!(bL()&&CL.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let o=!1,a,l;const u=()=>{l=new Promise(g=>{a=g})};u();let{keyframes:c,duration:h=300,ease:d,times:p}=i;if(EL(e,i)){const g=cc({...i,repeat:0,delay:0});let y={done:!1,value:c[0]};const x=[];let C=0;for(;!y.done&&Cm.cancel(),w=()=>{be.update(_),a(),u()};return m.onfinish=()=>{t.set(FB(c,i)),n&&n(),w()},{then(g,y){return l.then(g,y)},attachTimeline(g){return m.timeline=g,m.onfinish=null,Re},get time(){return kr(m.currentTime||0)},set time(g){m.currentTime=vn(g)},get speed(){return m.playbackRate},set speed(g){m.playbackRate=g},get duration(){return kr(h)},play:()=>{o||(m.play(),Nr(_))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:g}=m;if(g){const y=cc({...i,autoplay:!1});t.setWithVelocity(y.sample(g-yl).value,y.sample(g).value,yl)}w()},complete:()=>m.finish(),cancel:w}}function AL({keyframes:t,delay:e,onUpdate:r,onComplete:n}){const i=()=>(r&&r(t[t.length-1]),n&&n(),{time:0,speed:1,duration:0,play:Re,pause:Re,stop:Re,then:s=>(s(),Promise.resolve()),cancel:Re,complete:Re});return e?cc({keyframes:[0,1],duration:0,delay:e,onComplete:i}):i()}const IL={type:"spring",stiffness:500,damping:25,restSpeed:10},kL=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),RL={type:"keyframes",duration:.8},ML={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},OL=(t,{keyframes:e})=>e.length>2?RL:mi.has(t)?t.startsWith("scale")?kL(e[1]):IL:ML,$m=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(kn.test(e)||e==="0")&&!e.startsWith("url(")),DL=new Set(["brightness","contrast","saturate","opacity"]);function NL(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(ed)||[];if(!n)return t;const i=r.replace(n,"");let s=DL.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const BL=/([a-z-]*)\(.*?\)/g,qm={...kn,getAnimatableNone:t=>{const e=t.match(BL);return e?e.map(NL).join(" "):t}},LL={...VE,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:qm,WebkitFilter:qm},Wy=t=>LL[t];function I5(t,e){let r=Wy(t);return r!==qm&&(r=kn),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const k5=t=>/^0[^.\s]+$/.test(t);function FL(t){if(typeof t=="number")return t===0;if(t!==null)return t==="none"||t==="0"||k5(t)}function UL(t,e,r,n){const i=$m(e,r);let s;Array.isArray(r)?s=[...r]:s=[null,r];const o=n.from!==void 0?n.from:t.get();let a;const l=[];for(let u=0;ui=>{const s=R5(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-vn(o);const l=UL(e,t,r,s),u=l[0],c=l[l.length-1],h=$m(t,u),d=$m(t,c);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:m=>{e.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(jL(s)||(p={...p,...OL(t,p)}),p.duration&&(p.duration=vn(p.duration)),p.repeatDelay&&(p.repeatDelay=vn(p.repeatDelay)),!h||!d||BB.current||s.type===!1)return AL(p);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const m=PL(e,t,p);if(m)return m}return cc(p)};function dc(t){return!!(mt(t)&&t.add)}const M5=t=>/^\-?\d*\.?\d+$/.test(t);function Ky(t,e){t.indexOf(e)===-1&&t.push(e)}function Yy(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class Xy{constructor(){this.subscriptions=[]}add(e){return Ky(this.subscriptions,e),()=>Yy(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class qL{constructor(e,r={}){this.version="10.16.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=He;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,be.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>be.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=$L(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new Xy);const n=this.events[e].add(r);return e==="change"?()=>{n(),be.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?E5(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ys(t,e){return new qL(t,e)}const O5=t=>e=>e.test(t),VL={test:t=>t==="auto",parse:t=>t},D5=[gi,K,pr,Qr,Q4,W4,VL],Vs=t=>D5.find(O5(t)),HL=[...D5,nt,kn],zL=t=>HL.find(O5(t));function GL(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,ys(r))}function WL(t,e){const r=rd(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=uB(s[o]);GL(t,o,a)}}function QL(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(h))),u.push(_)}return o&&Promise.all(u).then(()=>{o&&WL(t,o)}),u}function Vm(t,e,r={}){const n=rd(t,e,r.custom);let{transition:i=t.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const s=n?()=>Promise.all(N5(t,n,r)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=i;return JL(t,e,u+l,c,h,r)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(r.delay)])}function JL(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,l=i===1?(u=0)=>u*n:(u=0)=>a-u*n;return Array.from(t.variantChildren).sort(ZL).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Vm(u,e,{...s,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function ZL(t,e){return t.sortNodePosition(e)}function e6(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>Vm(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=Vm(t,e,r);else{const i=typeof e=="function"?rd(t,e,r.custom):e;n=Promise.all(N5(t,i,r))}return n.then(()=>t.notify("AnimationComplete",e))}const t6=[...Oy].reverse(),r6=Oy.length;function n6(t){return e=>Promise.all(e.map(({animation:r,options:n})=>e6(t,r,n)))}function i6(t){let e=n6(t);const r=o6();let n=!0;const i=(l,u)=>{const c=rd(t,u);if(c){const{transition:h,transitionEnd:d,...p}=c;l={...l,...p,...d}}return l};function s(l){e=l(t)}function o(l,u){const c=t.getProps(),h=t.getVariantContext(!0)||{},d=[],p=new Set;let m={},_=1/0;for(let v=0;v_&&C;const j=Array.isArray(x)?x:[x];let Q=j.reduce(i,{});k===!1&&(Q={});const{prevResolvedValues:re={}}=y,Z={...re,...Q},T=I=>{N=!0,p.delete(I),y.needsAnimating[I]=!0};for(const I in Z){const V=Q[I],se=re[I];m.hasOwnProperty(I)||(V!==se?ac(V)&&ac(se)?!n5(V,se)||A?T(I):y.protectedKeys[I]=!0:V!==void 0?T(I):p.add(I):V!==void 0&&p.has(I)?T(I):y.protectedKeys[I]=!0)}y.prevProp=x,y.prevResolvedValues=Q,y.isActive&&(m={...m,...Q}),n&&t.blockInitialAnimation&&(N=!1),N&&!O&&d.push(...j.map(I=>({animation:I,options:{type:g,...l}})))}if(p.size){const v={};p.forEach(g=>{const y=t.getBaseTarget(g);y!==void 0&&(v[g]=y)}),d.push({animation:v})}let w=!!d.length;return n&&c.initial===!1&&!t.manuallyAnimateOnMount&&(w=!1),n=!1,w?e(d):Promise.resolve()}function a(l,u,c){var h;if(r[l].isActive===u)return Promise.resolve();(h=t.variantChildren)===null||h===void 0||h.forEach(p=>{var m;return(m=p.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),r[l].isActive=u;const d=o(c,l);for(const p in r)r[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function s6(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!n5(e,t):!1}function Fn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function o6(){return{animate:Fn(!0),whileInView:Fn(),whileHover:Fn(),whileTap:Fn(),whileDrag:Fn(),whileFocus:Fn(),exit:Fn()}}class a6 extends Bn{constructor(e){super(e),e.animationState||(e.animationState=i6(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Jc(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){}}let l6=0;class u6 extends Bn{constructor(){super(...arguments),this.id=l6++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r,custom:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const s=this.node.animationState.setActive("exit",!e,{custom:n??this.node.getProps().custom});r&&!e&&s.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const c6={animation:{Feature:a6},exit:{Feature:u6}},H1=(t,e)=>Math.abs(t-e);function d6(t,e){const r=H1(t.x,e.x),n=H1(t.y,e.y);return Math.sqrt(r**2+n**2)}class B5{constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=qf(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,h=d6(u.offset,{x:0,y:0})>=3;if(!c&&!h)return;const{point:d}=u,{timestamp:p}=He;this.history.push({...d,timestamp:p});const{onStart:m,onMove:_}=this.handlers;c||(m&&m(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=$f(c,this.transformPagePoint),be.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:h,onSessionEnd:d}=this.handlers,p=qf(u.type==="pointercancel"?this.lastMoveEventInfo:$f(c,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,p),d&&d(u,p)},!JE(e))return;this.handlers=r,this.transformPagePoint=n;const i=td(e),s=$f(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=He;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=r;l&&l(e,qf(s,this.history)),this.removeListeners=yn(Ir(window,"pointermove",this.handlePointerMove),Ir(window,"pointerup",this.handlePointerUp),Ir(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Nr(this.updatePoint)}}function $f(t,e){return e?{point:e(t.point)}:t}function z1(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qf({point:t},e){return{point:t,delta:z1(t,L5(e)),offset:z1(t,h6(e)),velocity:f6(e,.1)}}function h6(t){return t[0]}function L5(t){return t[t.length-1]}function f6(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=L5(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>vn(e)));)r--;if(!n)return{x:0,y:0};const s=kr(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Tt(t){return t.max-t.min}function Hm(t,e=0,r=.01){return Math.abs(t-e)<=r}function G1(t,e,r,n=.5){t.origin=n,t.originPoint=Pe(e.min,e.max,t.origin),t.scale=Tt(r)/Tt(e),(Hm(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Pe(r.min,r.max,t.origin)-t.originPoint,(Hm(t.translate)||isNaN(t.translate))&&(t.translate=0)}function go(t,e,r,n){G1(t.x,e.x,r.x,n?n.originX:void 0),G1(t.y,e.y,r.y,n?n.originY:void 0)}function W1(t,e,r){t.min=r.min+e.min,t.max=t.min+Tt(e)}function p6(t,e,r){W1(t.x,e.x,r.x),W1(t.y,e.y,r.y)}function Q1(t,e,r){t.min=e.min-r.min,t.max=t.min+Tt(e)}function yo(t,e,r){Q1(t.x,e.x,r.x),Q1(t.y,e.y,r.y)}function m6(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?Pe(r,t,n.max):Math.min(t,r)),t}function K1(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function g6(t,{top:e,left:r,bottom:n,right:i}){return{x:K1(t.x,r,i),y:K1(t.y,e,n)}}function Y1(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=pa(e.min,e.max-n,t.min):n>i&&(r=pa(t.min,t.max-i,e.min)),In(0,1,r)}function _6(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const zm=.35;function w6(t=zm){return t===!1?t=0:t===!0&&(t=zm),{x:X1(t,"left","right"),y:X1(t,"top","bottom")}}function X1(t,e,r){return{min:J1(t,e),max:J1(t,r)}}function J1(t,e){return typeof t=="number"?t:t[e]||0}const Z1=()=>({translate:0,scale:1,origin:0,originPoint:0}),Vi=()=>({x:Z1(),y:Z1()}),ex=()=>({min:0,max:0}),De=()=>({x:ex(),y:ex()});function lr(t){return[t("x"),t("y")]}function F5({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function x6({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function S6(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Vf(t){return t===void 0||t===1}function Gm({scale:t,scaleX:e,scaleY:r}){return!Vf(t)||!Vf(e)||!Vf(r)}function $n(t){return Gm(t)||U5(t)||t.z||t.rotate||t.rotateX||t.rotateY}function U5(t){return tx(t.x)||tx(t.y)}function tx(t){return t&&t!=="0%"}function hc(t,e,r){const n=t-r,i=e*n;return r+i}function rx(t,e,r,n,i){return i!==void 0&&(t=hc(t,i,n)),hc(t,r,n)+e}function Wm(t,e=0,r=1,n,i){t.min=rx(t.min,e,r,n,i),t.max=rx(t.max,e,r,n,i)}function j5(t,{x:e,y:r}){Wm(t.x,e.translate,e.scale,e.originPoint),Wm(t.y,r.translate,r.scale,r.originPoint)}function b6(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a1.0000000000001||t<.999999999999?t:1}function Xr(t,e){t.min=t.min+e,t.max=t.max+e}function ix(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=Pe(t.min,t.max,s);Wm(t,e[r],e[n],o,e.scale)}const C6=["x","scaleX","originX"],T6=["y","scaleY","originY"];function Hi(t,e){ix(t.x,e,C6),ix(t.y,e,T6)}function $5(t,e){return F5(S6(t.getBoundingClientRect(),e))}function E6(t,e,r){const n=$5(t,r),{scroll:i}=e;return i&&(Xr(n.x,i.offset.x),Xr(n.y,i.offset.y)),n}const P6=new WeakMap;class A6{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=De(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=l=>{this.stopAnimation(),r&&this.snapToCursor(td(l,"page").point)},s=(l,u)=>{const{drag:c,dragPropagation:h,onDragStart:d}=this.getProps();if(c&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=e5(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),lr(m=>{let _=this.getAxisMotionValue(m).get()||0;if(pr.test(_)){const{projection:w}=this.visualElement;if(w&&w.layout){const v=w.layout.layoutBox[m];v&&(_=Tt(v)*(parseFloat(_)/100))}}this.originPoint[m]=_}),d&&be.update(()=>d(l,u),!1,!0);const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},o=(l,u)=>{const{dragPropagation:c,dragDirectionLock:h,onDirectionLock:d,onDrag:p}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:m}=u;if(h&&this.currentDirection===null){this.currentDirection=I6(m),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,m),this.updateAxis("y",u.point,m),this.visualElement.render(),p&&p(l,u)},a=(l,u)=>this.stop(l,u);this.panSession=new B5(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&be.update(()=>s(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!vl(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=m6(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&$i(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=g6(n.layoutBox,e):this.constraints=!1,this.elastic=w6(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&lr(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=_6(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!$i(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=E6(n,i.root,this.visualElement.getTransformPagePoint());let o=y6(i.layout.layoutBox,s);if(r){const a=r(x6(o));this.hasMutatedConstraints=!!a,a&&(o=F5(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=lr(c=>{if(!vl(c,r,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const d=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:n?e[c]:0,bounceStiffness:d,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(Qy(e,n,0,r))}stopAnimation(){lr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const r="_drag"+e.toUpperCase(),n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){lr(r=>{const{drag:n}=this.getProps();if(!vl(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-Pe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!$i(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};lr(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();i[o]=v6({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),lr(o=>{if(!vl(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Pe(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;P6.set(this.visualElement,this);const e=this.visualElement.current,r=Ir(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();$i(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),n();const o=Er(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(lr(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=zm,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function vl(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function I6(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class k6 extends Bn{constructor(e){super(e),this.removeGroupControls=Re,this.removeListeners=Re,this.controls=new A6(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Re}unmount(){this.removeGroupControls(),this.removeListeners()}}const sx=t=>(e,r)=>{t&&be.update(()=>t(e,r))};class R6 extends Bn{constructor(){super(...arguments),this.removePointerDownListener=Re}onPointerDown(e){this.session=new B5(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:sx(e),onStart:sx(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&be.update(()=>i(s,o))}}}mount(){this.removePointerDownListener=Ir(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function M6(){const t=U.useContext(My);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=U.useId();return U.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}const Hl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ox(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Hs={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(K.test(t))t=parseFloat(t);else return t;const r=ox(t,e.target.x),n=ox(t,e.target.y);return`${r}% ${n}%`}},O6={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=kn.parse(t);if(i.length>5)return n;const s=kn.createTransformer(t),o=typeof i[0]!="number"?1:0,a=r.x.scale*e.x,l=r.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=Pe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class D6 extends tg.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;j4(N6),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Hl.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||be.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function q5(t){const[e,r]=M6(),n=U.useContext(LE);return tg.createElement(D6,{...t,layoutGroup:n,switchLayoutGroup:U.useContext(FE),isPresent:e,safeToRemove:r})}const N6={borderRadius:{...Hs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Hs,borderTopRightRadius:Hs,borderBottomLeftRadius:Hs,borderBottomRightRadius:Hs,boxShadow:O6},V5=["TopLeft","TopRight","BottomLeft","BottomRight"],B6=V5.length,ax=t=>typeof t=="string"?parseFloat(t):t,lx=t=>typeof t=="number"||K.test(t);function L6(t,e,r,n,i,s){i?(t.opacity=Pe(0,r.opacity!==void 0?r.opacity:1,F6(n)),t.opacityExit=Pe(e.opacity!==void 0?e.opacity:1,0,U6(n))):s&&(t.opacity=Pe(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(pa(t,e,n))}function cx(t,e){t.min=e.min,t.max=e.max}function At(t,e){cx(t.x,e.x),cx(t.y,e.y)}function dx(t,e,r,n,i){return t-=e,t=hc(t,1/r,n),i!==void 0&&(t=hc(t,1/i,n)),t}function j6(t,e=0,r=1,n=.5,i,s=t,o=t){if(pr.test(e)&&(e=parseFloat(e),e=Pe(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Pe(s.min,s.max,n);t===s&&(a-=e),t.min=dx(t.min,e,r,a,i),t.max=dx(t.max,e,r,a,i)}function hx(t,e,[r,n,i],s,o){j6(t,e[r],e[n],e[i],e.scale,s,o)}const $6=["x","scaleX","originX"],q6=["y","scaleY","originY"];function fx(t,e,r,n){hx(t.x,e,$6,r?r.x:void 0,n?n.x:void 0),hx(t.y,e,q6,r?r.y:void 0,n?n.y:void 0)}function px(t){return t.translate===0&&t.scale===1}function z5(t){return px(t.x)&&px(t.y)}function V6(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function G5(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function mx(t){return Tt(t.x)/Tt(t.y)}class H6{constructor(){this.members=[]}add(e){Ky(this.members,e),e.scheduleRender()}remove(e){if(Yy(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gx(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:l,rotateX:u,rotateY:c}=r;l&&(n+=`rotate(${l}deg) `),u&&(n+=`rotateX(${u}deg) `),c&&(n+=`rotateY(${c}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const z6=(t,e)=>t.depth-e.depth;class G6{constructor(){this.children=[],this.isDirty=!1}add(e){Ky(this.children,e),this.isDirty=!0}remove(e){Yy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(z6),this.isDirty=!1,this.children.forEach(e)}}function W6(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(Nr(n),t(s-e))};return be.read(n,!0),()=>Nr(n)}function Q6(t){window.MotionDebug&&window.MotionDebug.record(t)}function K6(t){return t instanceof SVGElement&&t.tagName!=="svg"}function Y6(t,e,r){const n=mt(t)?t:ys(t);return n.start(Qy("",n,e,r)),n.animation}const yx=["","X","Y","Z"],vx=1e3;let X6=0;const qn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function W5({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=X6++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{qn.totalNodes=qn.resolvedTargetDeltas=qn.recalculatedProjection=0,this.nodes.forEach(e8),this.nodes.forEach(s8),this.nodes.forEach(o8),this.nodes.forEach(t8),Q6(qn)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=W6(d,250),Hl.hasAnimatedSinceResize&&(Hl.hasAnimatedSinceResize=!1,this.nodes.forEach(wx))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||c.getDefaultTransition()||d8,{onLayoutAnimationStart:w,onLayoutAnimationComplete:v}=c.getProps(),g=!this.targetLayout||!G5(this.targetLayout,m)||p,y=!d&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,y);const x={...R5(_,"layout"),onPlay:w,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x)}else d||wx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Nr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(a8),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(r8),this.sharedNodes.forEach(l8)}scheduleUpdateProjection(){be.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){be.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const C=x/1e3;xx(h.x,o.x,C),xx(h.y,o.y,C),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yo(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),u8(this.relativeTarget,this.relativeTargetOrigin,d,C),y&&V6(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=De()),At(y,this.relativeTarget)),_&&(this.animationValues=c,L6(c,u,this.latestValues,C,g,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Nr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=be.update(()=>{Hl.hasAnimatedSinceResize=!0,this.currentAnimation=Y6(0,vx,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Q5(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||De();const h=Tt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=Tt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}At(a,l),Hi(a,c),go(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new H6),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let c=0;c{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(_x),this.root.sharedNodes.clear()}}}function J6(t){t.updateLayout()}function Z6(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=r.source!==t.layout.source;s==="size"?lr(h=>{const d=o?r.measuredBox[h]:r.layoutBox[h],p=Tt(d);d.min=n[h].min,d.max=d.min+p}):Q5(s,r.layoutBox,n)&&lr(h=>{const d=o?r.measuredBox[h]:r.layoutBox[h],p=Tt(n[h]);d.max=d.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+p)});const a=Vi();go(a,n,r.layoutBox);const l=Vi();o?go(l,t.applyTransform(i,!0),r.measuredBox):go(l,n,r.layoutBox);const u=!z5(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:p}=h;if(d&&p){const m=De();yo(m,r.layoutBox,d.layoutBox);const _=De();yo(_,n,p.layoutBox),G5(m,_)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=_,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function e8(t){qn.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function t8(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function r8(t){t.clearSnapshot()}function _x(t){t.clearMeasurements()}function n8(t){t.isLayoutDirty=!1}function i8(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function wx(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function s8(t){t.resolveTargetDelta()}function o8(t){t.calcProjection()}function a8(t){t.resetRotation()}function l8(t){t.removeLeadSnapshot()}function xx(t,e,r){t.translate=Pe(e.translate,0,r),t.scale=Pe(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function Sx(t,e,r,n){t.min=Pe(e.min,r.min,n),t.max=Pe(e.max,r.max,n)}function u8(t,e,r,n){Sx(t.x,e.x,r.x,n),Sx(t.y,e.y,r.y,n)}function c8(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const d8={duration:.45,ease:[.4,0,.1,1]},bx=t=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(t),Cx=bx("applewebkit/")&&!bx("chrome/")?Math.round:Re;function Tx(t){t.min=Cx(t.min),t.max=Cx(t.max)}function h8(t){Tx(t.x),Tx(t.y)}function Q5(t,e,r){return t==="position"||t==="preserve-aspect"&&!Hm(mx(e),mx(r),.2)}const f8=W5({attachResizeListener:(t,e)=>Er(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hf={current:void 0},K5=W5({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Hf.current){const t=new f8({});t.mount(window),t.setOptions({layoutScroll:!0}),Hf.current=t}return Hf.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),p8={pan:{Feature:R6},drag:{Feature:k6,ProjectionNode:K5,MeasureLayout:q5}},m8=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function g8(t){const e=m8.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function Qm(t,e,r=1){const[n,i]=g8(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);if(s){const o=s.trim();return M5(o)?parseFloat(o):o}else return Lm(i)?Qm(i,e,r+1):i}function y8(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!Lm(s))return;const o=Qm(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!Lm(s))continue;const o=Qm(s,n);o&&(e[i]=o,r||(r={}),r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const v8=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Y5=t=>v8.has(t),_8=t=>Object.keys(t).some(Y5),Ex=t=>t===gi||t===K,Px=(t,e)=>parseFloat(t.split(", ")[e]),Ax=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return Px(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?Px(s[1],t):0}},w8=new Set(["x","y","z"]),x8=ka.filter(t=>!w8.has(t));function S8(t){const e=[];return x8.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const vs={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Ax(4,13),y:Ax(5,14)};vs.translateX=vs.x;vs.translateY=vs.y;const b8=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(u=>{a[u]=vs[u](n,s)}),e.render();const l=e.measureViewportBox();return r.forEach(u=>{const c=e.getValue(u);c&&c.jump(a[u]),t[u]=vs[u](l,s)}),t},C8=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(Y5);let s=[],o=!1;const a=[];if(i.forEach(l=>{const u=t.getValue(l);if(!t.hasValue(l))return;let c=r[l],h=Vs(c);const d=e[l];let p;if(ac(d)){const m=d.length,_=d[0]===null?1:0;c=d[_],h=Vs(c);for(let w=_;w=0?window.pageYOffset:null,u=b8(e,t,a);return s.length&&s.forEach(([c,h])=>{t.getValue(c).set(h)}),t.render(),Xc&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:n}}else return{target:e,transitionEnd:n}};function T8(t,e,r,n){return _8(e)?C8(t,e,r,n):{target:e,transitionEnd:n}}const E8=(t,e,r,n)=>{const i=y8(t,e,n);return e=i.target,n=i.transitionEnd,T8(t,e,r,n)},Km={current:null},X5={current:!1};function P8(){if(X5.current=!0,!!Xc)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Km.current=t.matches;t.addListener(e),e()}else Km.current=!1}function A8(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(mt(s))t.addValue(i,s),dc(n)&&n.add(i);else if(mt(o))t.addValue(i,ys(s,{owner:t})),dc(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,ys(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const Ix=new WeakMap,J5=Object.keys(fa),I8=J5.length,kx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],k8=Dy.length;class R8{constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>be.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=r.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=Zc(r),this.isVariantNode=BE(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(r,{});for(const h in c){const d=c[h];a[h]!==void 0&&mt(d)&&(d.set(a[h],!1),dc(u)&&u.add(h))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){this.current=e,Ix.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,n)=>this.bindToMotionValue(n,r)),X5.current||P8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Km.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ix.delete(this.current),this.projection&&this.projection.unmount(),Nr(this.notifyUpdate),Nr(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,r){const n=mi.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&be.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,layoutScroll:d,layoutRoot:p})}return a}updateFeatures(){for(const e in this.features){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):De()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=ys(r,{owner:this}),this.addValue(e,n)),n}readValue(e){var r;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=qy(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!mt(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new Xy),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class Z5 extends R8{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=YL(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){QL(this,n,o);const a=E8(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function M8(t){return window.getComputedStyle(t)}class O8 extends Z5{readValueFromInstance(e,r){if(mi.has(r)){const n=Wy(r);return n&&n.default||0}else{const n=M8(e),i=($E(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return $5(e,r)}build(e,r,n,i){By(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return $y(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;mt(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){WE(e,r,n,i)}}class D8 extends Z5{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(mi.has(r)){const n=Wy(r);return n&&n.default||0}return r=QE.has(r)?r:jy(r),e.getAttribute(r)}measureInstanceViewportBox(){return De()}scrapeMotionValuesFromProps(e,r){return YE(e,r)}build(e,r,n,i){Fy(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){KE(e,r,n,i)}mount(e){this.isSVGTag=Uy(e.tagName),super.mount(e)}}const N8=(t,e)=>Ny(t)?new D8(e,{enableHardwareAcceleration:!1}):new O8(e,{enableHardwareAcceleration:!0}),B8={layout:{ProjectionNode:K5,MeasureLayout:q5}},L8={...c6,...kB,...p8,...B8},F8=F4((t,e)=>yB(t,e,L8,N8));function U8(){const[t,e]=U.useState(!1),{broadcaster:r}=Nn();return U.useEffect(()=>{setTimeout(()=>{e(!0)},2e3)},[]),t?null:de.jsx(F8.div,{initial:{opacity:1},animate:{opacity:0},transition:{duration:.3,delay:1},className:"bg-emerald-800 absolute top-3 inset-x-3 rounded-xl p-3 flex items-center justify-center",children:de.jsxs("span",{className:"text-lime-100 text-md mx-3 font-grandstander",children:["Connected to [",de.jsx("strong",{className:"text-lime-200",children:r.userName}),"]"]})})}const eP=new Map;let Rx=!1;function j8(){const[t,e]=U.useState(!0),{broadcaster:r}=Nn();return U.useEffect(()=>{async function n(){Rx||(await ms.chat.getChannelEmotes(r)).forEach(s=>{eP.set(s.name,{id:s.id,name:s.name,images:{default:Mx(s),static:Mx(s,!0)},source:"twitch"})}),e(!1),Rx=!0}n()},[r]),{loading:t}}function $8(){function t(){return Array.from(eP.values())}return{getAllChannelEmotes:t}}function Mx(t,e=!1){function r(n="3.0"){const i=e?"static":"default",s="light";return DT(t.id,{animationSettings:i,backgroundType:s,size:n})}return{x1:r("1.0"),x2:r("2.0"),x4:r("3.0")}}const Ox=["broadcaster","moderator","artist","vip","founder","subscriber"],Dx=["action","highlight","cheer","reply","redeem","resub","announcement"],Nx=["1000","2000","3000","Prime"],Bx=["PRIMARY","BLUE","GREEN","ORANGE","PURPLE"],Lx=[1,5,10,50,100,500,1e3,5e3,1e4];function q8(){const t=sy(),{getAllOtherEmotes:e}=rE(),{getAllChannelEmotes:r}=$8(),{getCheerColor:n,getCheermoteUrls:i}=wy(),{getBadge:s}=sE(),{getAllPronouns:o}=nE();function a(){const l=o(),u=[...r(),...e()],c=new Date,h=!ut(0,4);let d="test message",p=d;h&&(d=`${d} (first time chat)`);const m=[],_={id:`test-user-${c.getTime()}`,userName:"testuser",displayName:"testUser",pronouns:ut(0,1)?void 0:l[ut(0,l.length-1)],badges:[],roles:{broadcaster:!1,moderator:!1,artist:!1,vip:!1,founder:!1,subscriber:!1,followDate:new Date(0)}},w=ut(0,1)?"user":Ox[ut(0,Ox.length-1)],v=s(w==="artist"?"artist-badge":w);w!=="user"&&v&&(_.badges=[v],_.roles[w]=!0,w==="founder"&&(_.roles.subscriber=!0),_.userName=`test${w}`,_.displayName=`test${w.charAt(0).toUpperCase()}${w.slice(1)}`);let g={type:"basic"};if(ut(0,1)){const x=Dx[ut(0,Dx.length-1)];switch(x){case"action":d=`${d} (/me action message)`,p=d;break;case"highlight":d=`${d} (highlighted message)`,p=d;break;case"cheer":const C=Lx[ut(0,Lx.length-1)],k="Cheer";g={type:x,cheer:{amount:C}};const O=`${k}${C}`;p=`${d} (cheer message)`,d=`${O} ${p}`,m.unshift({type:"text",text:" "}),m.unshift({type:"cheer",text:O,cheer:{name:k,amount:C,color:n(k,C),images:{default:i(k,C),static:i(k,C,!0)}}});break;case"reply":g={type:x,reply:{id:`test-reply-${c.getTime()}`,text:"test message being replied to",user:{id:`test-user-reply-${c.getTime()}`,userName:"testreplyuser",displayName:"testReplyUser"}}},d=`${d} (reply message)`,p=d;break;case"redeem":g={type:x,redeem:{id:`test-redeem-${c.getTime()}`,name:"Test Redeem",image:"https://static-cdn.jtvnw.net/custom-reward-images/default-4.png",color:"#FFC6FF",cost:ut(1,1e3)}},d=`${d} (channel point redemption requiring text)`,p=d;break;case"resub":g={type:x,resub:{months:ut(1,24),tier:Nx[ut(0,Nx.length-1)]}},d=`${d} (resub message)`,p=d;break;case"announcement":(w==="broadcaster"||w==="moderator")&&(g={type:x,announcement:{color:Bx[ut(0,Bx.length-1)]}},d=`${d} (announcement message)`,p=d);break}}if(ut(0,1)&&u.length){const x=u[ut(0,u.length-1)];m.unshift({type:"text",text:" "}),m.unshift({type:"emote",emote:x,text:x.name}),d=`${x.name} ${d}`}m.push({type:"text",text:p});const y={...g,id:`test-message-${c.getTime()}`,first:h,date:c,user:_,text:d,parts:m,tags:new Map([["test","1"]])};t({type:"add",payload:y})}return{sendTestMessage:a}}function ut(t,e){return Math.floor(Math.random()*(e-t+1))+t}const or=20;function V8(){const[t,e]=U.useState({bottom:or,right:or}),[r,n]=U.useState(!1),{sendTestMessage:i}=q8();return U.useEffect(()=>{function s(l){const u=window.innerWidth,c=window.innerHeight,h=l.clientX,d=l.clientY;h>u*.3&&hc*.3&&d{window.removeEventListener("mousemove",s),document.removeEventListener("mouseenter",o),document.removeEventListener("mouseleave",a)}},[i]),r?de.jsx("button",{onClick:i,className:"btn-shadow-i !fixed z-[999] flex justify-center gap-2 overflow-hidden rounded-2xl border-2 border-emerald-800 bg-gradient-to-b from-lime-600 to-emerald-700 px-3 py-1 text-center hover:from-lime-500 hover:to-emerald-600 focus:outline-offset-8",style:{...t},children:de.jsx("span",{className:"font-grandstander font-semibold text-lime-100 text-shadow text-shadow-c-black/75 text-shadow-y-px",children:"Send Test Message"})}):null}function H8(){const{loading:t}=$D(),{loading:e}=E4(),{loading:r}=cO(),{loading:n}=DD(),{loading:i}=HD(),{loading:s}=j8();return t||e||r||n||i||s?de.jsx(ZC,{message:"Connecting to Chat..."}):de.jsx(de.Fragment,{children:de.jsxs(S3,{children:[de.jsx(U8,{}),de.jsx(A4,{}),de.jsx(V8,{})]})})}function z8(){const{loading:t,tokenInfo:e}=p3();return t?de.jsx(ZC,{message:"Checking Token..."}):e?de.jsx(H8,{}):de.jsx(x3,{})}function G8(){return de.jsx(z8,{})}function ns(){}slime2Chat||(slime2Chat={onMessage:ns,onModDelete:ns,ready:ns});slime2Chat.onMessage||(slime2Chat.onMessage=ns);slime2Chat.onModDelete||(slime2Chat.onModDelete=ns);slime2Chat.ready||(slime2Chat.ready=ns);slime2Tokens||(slime2Tokens={});const W8=zf.createRoot(document.getElementById("slime2-root"));W8.render(de.jsx(tg.StrictMode,{children:de.jsx(G8,{})}));