diff --git a/assets/index-8066344d.js b/assets/index-8066344d.js new file mode 100644 index 0000000..06a418e --- /dev/null +++ b/assets/index-8066344d.js @@ -0,0 +1,435 @@ +function BR(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cS={exports:{}},sf={},uS={exports:{}},de={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ql=Symbol.for("react.element"),zR=Symbol.for("react.portal"),FR=Symbol.for("react.fragment"),NR=Symbol.for("react.strict_mode"),DR=Symbol.for("react.profiler"),VR=Symbol.for("react.provider"),UR=Symbol.for("react.context"),WR=Symbol.for("react.forward_ref"),HR=Symbol.for("react.suspense"),GR=Symbol.for("react.memo"),qR=Symbol.for("react.lazy"),P0=Symbol.iterator;function KR(e){return e===null||typeof e!="object"?null:(e=P0&&e[P0]||e["@@iterator"],typeof e=="function"?e:null)}var dS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fS=Object.assign,hS={};function Js(e,t,n){this.props=e,this.context=t,this.refs=hS,this.updater=n||dS}Js.prototype.isReactComponent={};Js.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Js.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function pS(){}pS.prototype=Js.prototype;function Dg(e,t,n){this.props=e,this.context=t,this.refs=hS,this.updater=n||dS}var Vg=Dg.prototype=new pS;Vg.constructor=Dg;fS(Vg,Js.prototype);Vg.isPureReactComponent=!0;var _0=Array.isArray,mS=Object.prototype.hasOwnProperty,Ug={current:null},gS={key:!0,ref:!0,__self:!0,__source:!0};function vS(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)mS.call(t,r)&&!gS.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(10?vt(ea,--Jt):0,Os--,et===10&&(Os=1,lf--),et}function an(){return et=Jt2||ul(et)>3?"":" "}function yA(e,t){for(;--t&&an()&&!(et<48||et>102||et>57&&et<65||et>70&&et<97););return Kl(e,su()+(t<6&&lr()==32&&an()==32))}function qp(e){for(;an();)switch(et){case e:return Jt;case 34:case 39:e!==34&&e!==39&&qp(et);break;case 40:e===41&&qp(e);break;case 92:an();break}return Jt}function bA(e,t){for(;an()&&e+et!==47+10;)if(e+et===42+42&&lr()===47)break;return"/*"+Kl(t,Jt-1)+"*"+af(e===47?e:an())}function wA(e){for(;!ul(lr());)an();return Kl(e,Jt)}function xA(e){return CS(lu("",null,null,null,[""],e=kS(e),0,[0],e))}function lu(e,t,n,r,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,g=0,m=1,w=1,b=1,y=0,x="",S=o,T=i,E=r,C=x;w;)switch(g=y,y=an()){case 40:if(g!=108&&vt(C,d-1)==58){Gp(C+=Ce(au(y),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:C+=au(y);break;case 9:case 10:case 13:case 32:C+=vA(g);break;case 92:C+=yA(su()-1,7);continue;case 47:switch(lr()){case 42:case 47:Sc(SA(bA(an(),su()),t,n),l);break;default:C+="/"}break;case 123*m:a[c++]=tr(C)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:w=0;case 59+u:b==-1&&(C=Ce(C,/\f/g,"")),p>0&&tr(C)-d&&Sc(p>32?$0(C+";",r,n,d-1):$0(Ce(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(Sc(E=A0(C,t,n,c,u,o,a,x,S=[],T=[],d),i),y===123)if(u===0)lu(C,t,E,E,S,i,d,a,T);else switch(f===99&&vt(C,3)===110?100:f){case 100:case 108:case 109:case 115:lu(e,E,E,r&&Sc(A0(e,E,E,0,0,o,a,x,o,S=[],d),T),o,T,d,a,r?S:T);break;default:lu(C,E,E,E,[""],T,0,a,T)}}c=u=p=0,m=b=1,x=C="",d=s;break;case 58:d=1+tr(C),p=g;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&gA()==125)continue}switch(C+=af(y),y*m){case 38:b=u>0?1:(C+="\f",-1);break;case 44:a[c++]=(tr(C)-1)*b,b=1;break;case 64:lr()===45&&(C+=au(an())),f=lr(),u=d=tr(x=C+=wA(su())),y++;break;case 45:g===45&&tr(C)==2&&(m=0)}}return i}function A0(e,t,n,r,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=qg(f),g=0,m=0,w=0;g0?f[b]+" "+y:Ce(y,/&\f/g,f[b])))&&(l[w++]=x);return cf(e,t,n,o===0?Hg:a,l,c,u)}function SA(e,t,n){return cf(e,t,n,bS,af(mA()),cl(e,2,-2),0)}function $0(e,t,n,r){return cf(e,t,n,Gg,cl(e,0,r),cl(e,r+1,-1),r)}function vs(e,t){for(var n="",r=qg(e),o=0;o6)switch(vt(e,t+1)){case 109:if(vt(e,t+4)!==45)break;case 102:return Ce(e,/(.+:)(.+)-([^]+)/,"$1"+Se+"$2-$3$1"+Mu+(vt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Gp(e,"stretch")?TS(Ce(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(vt(e,t+1)!==115)break;case 6444:switch(vt(e,tr(e)-3-(~Gp(e,"!important")&&10))){case 107:return Ce(e,":",":"+Se)+e;case 101:return Ce(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Se+(vt(e,14)===45?"inline-":"")+"box$3$1"+Se+"$2$3$1"+Tt+"$2box$3")+e}break;case 5936:switch(vt(e,t+11)){case 114:return Se+e+Tt+Ce(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Se+e+Tt+Ce(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Se+e+Tt+Ce(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Se+e+Tt+e+e}return e}var $A=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case Gg:t.return=TS(t.value,t.length);break;case wS:return vs([pa(t,{value:Ce(t.value,"@","@"+Se)})],o);case Hg:if(t.length)return pA(t.props,function(i){switch(hA(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vs([pa(t,{props:[Ce(i,/:(read-\w+)/,":"+Mu+"$1")]})],o);case"::placeholder":return vs([pa(t,{props:[Ce(i,/:(plac\w+)/,":"+Se+"input-$1")]}),pa(t,{props:[Ce(i,/:(plac\w+)/,":"+Mu+"$1")]}),pa(t,{props:[Ce(i,/:(plac\w+)/,Tt+"input-$1")]})],o)}return""})}},jA=[$A],OA=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var w=m.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||jA,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var w=m.getAttribute("data-emotion").split(" "),b=1;b=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var HA={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},GA=/[A-Z]|^ms/g,qA=/_EMO_([^_]+?)_([^]*?)_EMO_/g,OS=function(t){return t.charCodeAt(1)===45},I0=function(t){return t!=null&&typeof t!="boolean"},yh=ES(function(e){return OS(e)?e:e.replace(GA,"-$&").toLowerCase()}),L0=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(qA,function(r,o,i){return nr={name:o,styles:i,next:nr},o})}return HA[t]!==1&&!OS(t)&&typeof n=="number"&&n!==0?n+"px":n};function dl(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return nr={name:n.name,styles:n.styles,next:nr},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)nr={name:r.name,styles:r.styles,next:nr},r=r.next;var o=n.styles+";";return o}return KA(e,t,n)}case"function":{if(e!==void 0){var i=nr,s=n(e);return nr=i,dl(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function KA(e,t,n){var r="";if(Array.isArray(n))for(var o=0;oh.jsx(wf,{styles:zS}),r$=({scope:e=""})=>h.jsx(wf,{styles:BS` + html { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + font-family: system-ui, sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + touch-action: manipulation; + } + + body { + position: relative; + min-height: 100%; + margin: 0; + font-feature-settings: "kern"; + } + + ${e} :where(*, *::before, *::after) { + border-width: 0; + border-style: solid; + box-sizing: border-box; + word-wrap: break-word; + } + + main { + display: block; + } + + ${e} hr { + border-top-width: 1px; + box-sizing: content-box; + height: 0; + overflow: visible; + } + + ${e} :where(pre, code, kbd,samp) { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 1em; + } + + ${e} a { + background-color: transparent; + color: inherit; + text-decoration: inherit; + } + + ${e} abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + + ${e} :where(b, strong) { + font-weight: bold; + } + + ${e} small { + font-size: 80%; + } + + ${e} :where(sub,sup) { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + ${e} sub { + bottom: -0.25em; + } + + ${e} sup { + top: -0.5em; + } + + ${e} img { + border-style: none; + } + + ${e} :where(button, input, optgroup, select, textarea) { + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; + } + + ${e} :where(button, input) { + overflow: visible; + } + + ${e} :where(button, select) { + text-transform: none; + } + + ${e} :where( + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner + ) { + border-style: none; + padding: 0; + } + + ${e} fieldset { + padding: 0.35em 0.75em 0.625em; + } + + ${e} legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; + } + + ${e} progress { + vertical-align: baseline; + } + + ${e} textarea { + overflow: auto; + } + + ${e} :where([type="checkbox"], [type="radio"]) { + box-sizing: border-box; + padding: 0; + } + + ${e} input[type="number"]::-webkit-inner-spin-button, + ${e} input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none !important; + } + + ${e} input[type="number"] { + -moz-appearance: textfield; + } + + ${e} input[type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; + } + + ${e} input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none !important; + } + + ${e} ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; + } + + ${e} details { + display: block; + } + + ${e} summary { + display: list-item; + } + + template { + display: none; + } + + [hidden] { + display: none !important; + } + + ${e} :where( + blockquote, + dl, + dd, + h1, + h2, + h3, + h4, + h5, + h6, + hr, + figure, + p, + pre + ) { + margin: 0; + } + + ${e} button { + background: transparent; + padding: 0; + } + + ${e} fieldset { + margin: 0; + padding: 0; + } + + ${e} :where(ol, ul) { + margin: 0; + padding: 0; + } + + ${e} textarea { + resize: vertical; + } + + ${e} :where(button, [role="button"]) { + cursor: pointer; + } + + ${e} button::-moz-focus-inner { + border: 0 !important; + } + + ${e} table { + border-collapse: collapse; + } + + ${e} :where(h1, h2, h3, h4, h5, h6) { + font-size: inherit; + font-weight: inherit; + } + + ${e} :where(button, input, optgroup, select, textarea) { + padding: 0; + line-height: inherit; + color: inherit; + } + + ${e} :where(img, svg, video, canvas, audio, iframe, embed, object) { + display: block; + } + + ${e} :where(img, video) { + max-width: 100%; + height: auto; + } + + [data-js-focus-visible] + :focus:not([data-focus-visible-added]):not( + [data-focus-visible-disabled] + ) { + outline: none; + box-shadow: none; + } + + ${e} select::-ms-expand { + display: none; + } + + ${zS} + `});function o$(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function nn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:s}=e,a=v.createContext(s);a.displayName=t;function l(){var c;const u=v.useContext(a);if(!u&&n){const d=new Error(i??o$(r,o));throw d.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,d,l),d}return u}return[a.Provider,l,a]}var[i$,s$]=nn({strict:!1,name:"PortalManagerContext"});function FS(e){const{children:t,zIndex:n}=e;return h.jsx(i$,{value:{zIndex:n},children:t})}FS.displayName="PortalManager";var _r=globalThis!=null&&globalThis.document?v.useLayoutEffect:v.useEffect,NS={exports:{}},pn={},DS={exports:{}},VS={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(z,D){var G=z.length;z.push(D);e:for(;0>>1,q=z[V];if(0>>1;Vo(Q,G))teo(ne,Q)?(z[V]=ne,z[te]=G,V=te):(z[V]=Q,z[H]=G,V=H);else if(teo(ne,G))z[V]=ne,z[te]=G,V=te;else break e}}return D}function o(z,D){var G=z.sortIndex-D.sortIndex;return G!==0?G:z.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,g=!1,m=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(z){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=z)r(c),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(c)}}function S(z){if(m=!1,x(z),!g)if(n(l)!==null)g=!0,j(T);else{var D=n(c);D!==null&&F(S,D.startTime-z)}}function T(z,D){g=!1,m&&(m=!1,b(_),_=-1),p=!0;var G=f;try{for(x(D),d=n(l);d!==null&&(!(d.expirationTime>D)||z&&!P());){var V=d.callback;if(typeof V=="function"){d.callback=null,f=d.priorityLevel;var q=V(d.expirationTime<=D);D=e.unstable_now(),typeof q=="function"?d.callback=q:d===n(l)&&r(l),x(D)}else r(l);d=n(l)}if(d!==null)var N=!0;else{var H=n(c);H!==null&&F(S,H.startTime-D),N=!1}return N}finally{d=null,f=G,p=!1}}var E=!1,C=null,_=-1,B=5,L=-1;function P(){return!(e.unstable_now()-Lz||125V?(z.sortIndex=G,t(c,z),n(l)===null&&z===n(c)&&(m?(b(_),_=-1):m=!0,F(S,G-V))):(z.sortIndex=q,t(l,z),g||p||(g=!0,j(T))),z},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(z){var D=f;return function(){var G=f;f=D;try{return z.apply(this,arguments)}finally{f=G}}}})(VS);DS.exports=VS;var a$=DS.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var US=v,un=a$;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kp=Object.prototype.hasOwnProperty,l$=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,z0={},F0={};function c$(e){return Kp.call(F0,e)?!0:Kp.call(z0,e)?!1:l$.test(e)?F0[e]=!0:(z0[e]=!0,!1)}function u$(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function d$(e,t,n,r){if(t===null||typeof t>"u"||u$(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Vt(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var xt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xt[e]=new Vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xt[t]=new Vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xt[e]=new Vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xt[e]=new Vt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){xt[e]=new Vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xt[e]=new Vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xt[e]=new Vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xt[e]=new Vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xt[e]=new Vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xg=/[\-:]([a-z])/g;function Jg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Xg,Jg);xt[t]=new Vt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Xg,Jg);xt[t]=new Vt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Xg,Jg);xt[t]=new Vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!1,!1)});xt.xlinkHref=new Vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ev(e,t,n,r){var o=xt.hasOwnProperty(t)?xt[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` +`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{wh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ra(e):""}function f$(e){switch(e.tag){case 5:return Ra(e.type);case 16:return Ra("Lazy");case 13:return Ra("Suspense");case 19:return Ra("SuspenseList");case 0:case 2:case 15:return e=xh(e.type,!1),e;case 11:return e=xh(e.type.render,!1),e;case 1:return e=xh(e.type,!0),e;default:return""}}function Xp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ki:return"Fragment";case qi:return"Portal";case Zp:return"Profiler";case tv:return"StrictMode";case Yp:return"Suspense";case Qp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case GS:return(e.displayName||"Context")+".Consumer";case HS:return(e._context.displayName||"Context")+".Provider";case nv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rv:return t=e.displayName||null,t!==null?t:Xp(e.type)||"Memo";case Xr:t=e._payload,e=e._init;try{return Xp(e(t))}catch{}}return null}function h$(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Xp(t);case 8:return t===tv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function wo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p$(e){var t=KS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cc(e){e._valueTracker||(e._valueTracker=p$(e))}function ZS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=KS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Jp(e,t){var n=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function D0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=wo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function YS(e,t){t=t.checked,t!=null&&ev(e,"checked",t,!1)}function em(e,t){YS(e,t);var n=wo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?tm(e,t.type,n):t.hasOwnProperty("defaultValue")&&tm(e,t.type,wo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function V0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function tm(e,t,n){(t!=="number"||Bu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Aa=Array.isArray;function ys(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ec.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Na={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},m$=["Webkit","ms","Moz","O"];Object.keys(Na).forEach(function(e){m$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Na[t]=Na[e]})});function ek(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Na.hasOwnProperty(e)&&Na[e]?(""+t).trim():t+"px"}function tk(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=ek(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var g$=Ge({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function om(e,t){if(t){if(g$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function im(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sm=null;function ov(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var am=null,bs=null,ws=null;function H0(e){if(e=Ql(e)){if(typeof am!="function")throw Error(W(280));var t=e.stateNode;t&&(t=Ef(t),am(e.stateNode,e.type,t))}}function nk(e){bs?ws?ws.push(e):ws=[e]:bs=e}function rk(){if(bs){var e=bs,t=ws;if(ws=bs=null,H0(e),t)for(e=0;e>>=0,e===0?32:31-(P$(e)/_$|0)|0}var Tc=64,Pc=4194304;function $a(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Du(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=$a(a):(i&=s,i!==0&&(r=$a(i)))}else s=n&~o,s!==0?r=$a(s):i!==0&&(r=$a(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Zl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Un(t),e[t]=n}function j$(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Va),e1=String.fromCharCode(32),t1=!1;function kk(e,t){switch(e){case"keyup":return s5.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ck(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zi=!1;function l5(e,t){switch(e){case"compositionend":return Ck(t);case"keypress":return t.which!==32?null:(t1=!0,e1);case"textInput":return e=t.data,e===e1&&t1?null:e;default:return null}}function c5(e,t){if(Zi)return e==="compositionend"||!fv&&kk(e,t)?(e=xk(),uu=cv=oo=null,Zi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=i1(n)}}function _k(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_k(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rk(){for(var e=window,t=Bu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bu(e.document)}return t}function hv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function y5(e){var t=Rk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_k(n.ownerDocument.documentElement,n)){if(r!==null&&hv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=s1(n,i);var s=s1(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yi=null,hm=null,Wa=null,pm=!1;function a1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pm||Yi==null||Yi!==Bu(r)||(r=Yi,"selectionStart"in r&&hv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Wa&&wl(Wa,r)||(Wa=r,r=Wu(hm,"onSelect"),0Ji||(e.current=wm[Ji],wm[Ji]=null,Ji--)}function Oe(e,t){Ji++,wm[Ji]=e.current,e.current=t}var xo={},Ot=Po(xo),qt=Po(!1),ui=xo;function Ls(e,t){var n=e.type.contextTypes;if(!n)return xo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Kt(e){return e=e.childContextTypes,e!=null}function Gu(){Be(qt),Be(Ot)}function p1(e,t,n){if(Ot.current!==xo)throw Error(W(168));Oe(Ot,t),Oe(qt,n)}function zk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(W(108,h$(e)||"Unknown",o));return Ge({},n,r)}function qu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xo,ui=Ot.current,Oe(Ot,e),Oe(qt,qt.current),!0}function m1(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=zk(e,t,ui),r.__reactInternalMemoizedMergedChildContext=e,Be(qt),Be(Ot),Oe(Ot,e)):Be(qt),Oe(qt,n)}var wr=null,Tf=!1,Lh=!1;function Fk(e){wr===null?wr=[e]:wr.push(e)}function A5(e){Tf=!0,Fk(e)}function _o(){if(!Lh&&wr!==null){Lh=!0;var e=0,t=_e;try{var n=wr;for(_e=1;e>=s,o-=s,Cr=1<<32-Un(t)+o|n<_?(B=C,C=null):B=C.sibling;var L=f(b,C,x[_],S);if(L===null){C===null&&(C=B);break}e&&C&&L.alternate===null&&t(b,C),y=i(L,y,_),E===null?T=L:E.sibling=L,E=L,C=B}if(_===x.length)return n(b,C),De&&Bo(b,_),T;if(C===null){for(;__?(B=C,C=null):B=C.sibling;var P=f(b,C,L.value,S);if(P===null){C===null&&(C=B);break}e&&C&&P.alternate===null&&t(b,C),y=i(P,y,_),E===null?T=P:E.sibling=P,E=P,C=B}if(L.done)return n(b,C),De&&Bo(b,_),T;if(C===null){for(;!L.done;_++,L=x.next())L=d(b,L.value,S),L!==null&&(y=i(L,y,_),E===null?T=L:E.sibling=L,E=L);return De&&Bo(b,_),T}for(C=r(b,C);!L.done;_++,L=x.next())L=p(C,b,_,L.value,S),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?_:L.key),y=i(L,y,_),E===null?T=L:E.sibling=L,E=L);return e&&C.forEach(function(O){return t(b,O)}),De&&Bo(b,_),T}function w(b,y,x,S){if(typeof x=="object"&&x!==null&&x.type===Ki&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case kc:e:{for(var T=x.key,E=y;E!==null;){if(E.key===T){if(T=x.type,T===Ki){if(E.tag===7){n(b,E.sibling),y=o(E,x.props.children),y.return=b,b=y;break e}}else if(E.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Xr&&S1(T)===E.type){n(b,E.sibling),y=o(E,x.props),y.ref=wa(b,E,x),y.return=b,b=y;break e}n(b,E);break}else t(b,E);E=E.sibling}x.type===Ki?(y=ei(x.props.children,b.mode,S,x.key),y.return=b,b=y):(S=yu(x.type,x.key,x.props,null,b.mode,S),S.ref=wa(b,y,x),S.return=b,b=S)}return s(b);case qi:e:{for(E=x.key;y!==null;){if(y.key===E)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(b,y.sibling),y=o(y,x.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=Uh(x,b.mode,S),y.return=b,b=y}return s(b);case Xr:return E=x._init,w(b,y,E(x._payload),S)}if(Aa(x))return g(b,y,x,S);if(ma(x))return m(b,y,x,S);Ic(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(b,y.sibling),y=o(y,x),y.return=b,b=y):(n(b,y),y=Vh(x,b.mode,S),y.return=b,b=y),s(b)):n(b,y)}return w}var Bs=qk(!0),Kk=qk(!1),Xl={},ur=Po(Xl),Cl=Po(Xl),El=Po(Xl);function Ko(e){if(e===Xl)throw Error(W(174));return e}function Sv(e,t){switch(Oe(El,t),Oe(Cl,e),Oe(ur,Xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:rm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=rm(t,e)}Be(ur),Oe(ur,t)}function zs(){Be(ur),Be(Cl),Be(El)}function Zk(e){Ko(El.current);var t=Ko(ur.current),n=rm(t,e.type);t!==n&&(Oe(Cl,e),Oe(ur,n))}function kv(e){Cl.current===e&&(Be(ur),Be(Cl))}var Ue=Po(0);function Ju(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mh=[];function Cv(){for(var e=0;en?n:4,e(!0);var r=Bh.transition;Bh.transition={};try{e(!1),t()}finally{_e=n,Bh.transition=r}}function dC(){return $n().memoizedState}function I5(e,t,n){var r=po(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fC(e))hC(t,n);else if(n=Uk(e,t,n,r),n!==null){var o=zt();Wn(n,e,r,o),pC(n,t,r)}}function L5(e,t,n){var r=po(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fC(e))hC(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Gn(a,s)){var l=t.interleaved;l===null?(o.next=o,wv(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Uk(e,t,o,r),n!==null&&(o=zt(),Wn(n,e,r,o),pC(n,t,r))}}function fC(e){var t=e.alternate;return e===He||t!==null&&t===He}function hC(e,t){Ha=ed=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,sv(e,n)}}var td={readContext:An,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},M5={readContext:An,useCallback:function(e,t){return Xn().memoizedState=[e,t===void 0?null:t],e},useContext:An,useEffect:C1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pu(4194308,4,sC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pu(4194308,4,e,t)},useInsertionEffect:function(e,t){return pu(4,2,e,t)},useMemo:function(e,t){var n=Xn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=I5.bind(null,He,e),[r.memoizedState,e]},useRef:function(e){var t=Xn();return e={current:e},t.memoizedState=e},useState:k1,useDebugValue:Rv,useDeferredValue:function(e){return Xn().memoizedState=e},useTransition:function(){var e=k1(!1),t=e[0];return e=O5.bind(null,e[1]),Xn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=He,o=Xn();if(De){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),ut===null)throw Error(W(349));fi&30||Xk(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,C1(eC.bind(null,r,i,e),[e]),r.flags|=2048,_l(9,Jk.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Xn(),t=ut.identifierPrefix;if(De){var n=Er,r=Cr;n=(r&~(1<<32-Un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Tl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[or]=t,e[kl]=r,kC(e,t,!1,!1),t.stateNode=e;e:{switch(s=im(n,r),n){case"dialog":Le("cancel",e),Le("close",e),o=r;break;case"iframe":case"object":case"embed":Le("load",e),o=r;break;case"video":case"audio":for(o=0;oNs&&(t.flags|=128,r=!0,xa(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ju(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!De)return Et(t),null}else 2*Ye()-i.renderingStartTime>Ns&&n!==1073741824&&(t.flags|=128,r=!0,xa(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ye(),t.sibling=null,n=Ue.current,Oe(Ue,r?n&1|2:n&1),t):(Et(t),null);case 22:case 23:return Lv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(Et(t),t.subtreeFlags&6&&(t.flags|=8192)):Et(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function W5(e,t){switch(mv(t),t.tag){case 1:return Kt(t.type)&&Gu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zs(),Be(qt),Be(Ot),Cv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kv(t),null;case 13:if(Be(Ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Be(Ue),null;case 4:return zs(),null;case 10:return bv(t.type._context),null;case 22:case 23:return Lv(),null;case 24:return null;default:return null}}var Mc=!1,At=!1,H5=typeof WeakSet=="function"?WeakSet:Set,J=null;function rs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){qe(e,t,r)}else n.current=null}function jm(e,t,n){try{n()}catch(r){qe(e,t,r)}}var O1=!1;function G5(e,t){if(mm=Vu,e=Rk(),hv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===o&&(a=s),f===i&&++u===r&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(gm={focusedElem:e,selectionRange:n},Vu=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,w=g.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Mn(t.type,m),w);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(S){qe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return g=O1,O1=!1,g}function Ga(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&jm(t,n,i)}o=o.next}while(o!==r)}}function Rf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Om(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function TC(e){var t=e.alternate;t!==null&&(e.alternate=null,TC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[or],delete t[kl],delete t[bm],delete t[_5],delete t[R5])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function PC(e){return e.tag===5||e.tag===3||e.tag===4}function I1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||PC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Im(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Hu));else if(r!==4&&(e=e.child,e!==null))for(Im(e,t,n),e=e.sibling;e!==null;)Im(e,t,n),e=e.sibling}function Lm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Lm(e,t,n),e=e.sibling;e!==null;)Lm(e,t,n),e=e.sibling}var pt=null,Bn=!1;function Hr(e,t,n){for(n=n.child;n!==null;)_C(e,t,n),n=n.sibling}function _C(e,t,n){if(cr&&typeof cr.onCommitFiberUnmount=="function")try{cr.onCommitFiberUnmount(xf,n)}catch{}switch(n.tag){case 5:At||rs(n,t);case 6:var r=pt,o=Bn;pt=null,Hr(e,t,n),pt=r,Bn=o,pt!==null&&(Bn?(e=pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pt.removeChild(n.stateNode));break;case 18:pt!==null&&(Bn?(e=pt,n=n.stateNode,e.nodeType===8?Ih(e.parentNode,n):e.nodeType===1&&Ih(e,n),yl(e)):Ih(pt,n.stateNode));break;case 4:r=pt,o=Bn,pt=n.stateNode.containerInfo,Bn=!0,Hr(e,t,n),pt=r,Bn=o;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&jm(n,t,s),o=o.next}while(o!==r)}Hr(e,t,n);break;case 1:if(!At&&(rs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){qe(n,t,a)}Hr(e,t,n);break;case 21:Hr(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,Hr(e,t,n),At=r):Hr(e,t,n);break;default:Hr(e,t,n)}}function L1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new H5),t.forEach(function(r){var o=tj.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function In(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*K5(r/1960))-r,10e?16:e,io===null)var r=!1;else{if(e=io,io=null,od=0,ge&6)throw Error(W(331));var o=ge;for(ge|=4,J=e.current;J!==null;){var i=J,s=i.child;if(J.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lYe()-Ov?Jo(e,0):jv|=n),Zt(e,t)}function MC(e,t){t===0&&(e.mode&1?(t=Pc,Pc<<=1,!(Pc&130023424)&&(Pc=4194304)):t=1);var n=zt();e=Lr(e,t),e!==null&&(Zl(e,t,n),Zt(e,n))}function ej(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),MC(e,n)}function tj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(t),MC(e,n)}var BC;BC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||qt.current)Gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gt=!1,V5(e,t,n);Gt=!!(e.flags&131072)}else Gt=!1,De&&t.flags&1048576&&Nk(t,Zu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;mu(e,t),e=t.pendingProps;var o=Ls(t,Ot.current);Ss(t,n),o=Tv(null,t,r,e,o,n);var i=Pv();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Kt(r)?(i=!0,qu(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,xv(t),o.updater=Pf,t.stateNode=o,o._reactInternals=t,Em(t,r,e,n),t=_m(null,t,r,!0,i,n)):(t.tag=0,De&&i&&pv(t),Lt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(mu(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=rj(r),e=Mn(r,e),o){case 0:t=Pm(null,t,r,e,n);break e;case 1:t=A1(null,t,r,e,n);break e;case 11:t=_1(null,t,r,e,n);break e;case 14:t=R1(null,t,r,Mn(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mn(r,o),Pm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mn(r,o),A1(e,t,r,o,n);case 3:e:{if(wC(t),e===null)throw Error(W(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Wk(e,t),Xu(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fs(Error(W(423)),t),t=$1(e,t,r,n,o);break e}else if(r!==o){o=Fs(Error(W(424)),t),t=$1(e,t,r,n,o);break e}else for(sn=uo(t.stateNode.containerInfo.firstChild),ln=t,De=!0,zn=null,n=Kk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ms(),r===o){t=Mr(e,t,n);break e}Lt(e,t,r,n)}t=t.child}return t;case 5:return Zk(t),e===null&&Sm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,vm(r,o)?s=null:i!==null&&vm(r,i)&&(t.flags|=32),bC(e,t),Lt(e,t,s,n),t.child;case 6:return e===null&&Sm(t),null;case 13:return xC(e,t,n);case 4:return Sv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Bs(t,null,r,n):Lt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mn(r,o),_1(e,t,r,o,n);case 7:return Lt(e,t,t.pendingProps,n),t.child;case 8:return Lt(e,t,t.pendingProps.children,n),t.child;case 12:return Lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Oe(Yu,r._currentValue),r._currentValue=s,i!==null)if(Gn(i.value,s)){if(i.children===o.children&&!qt.current){t=Mr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Rr(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),km(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(W(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),km(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Lt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ss(t,n),o=An(o),r=r(o),t.flags|=1,Lt(e,t,r,n),t.child;case 14:return r=t.type,o=Mn(r,t.pendingProps),o=Mn(r.type,o),R1(e,t,r,o,n);case 15:return vC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mn(r,o),mu(e,t),t.tag=1,Kt(r)?(e=!0,qu(t)):e=!1,Ss(t,n),Gk(t,r,o),Em(t,r,o,n),_m(null,t,r,!0,e,n);case 19:return SC(e,t,n);case 22:return yC(e,t,n)}throw Error(W(156,t.tag))};function zC(e,t){return uk(e,t)}function nj(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,t,n,r){return new nj(e,t,n,r)}function Bv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rj(e){if(typeof e=="function")return Bv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nv)return 11;if(e===rv)return 14}return 2}function mo(e,t){var n=e.alternate;return n===null?(n=Tn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function yu(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Bv(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ki:return ei(n.children,o,i,t);case tv:s=8,o|=8;break;case Zp:return e=Tn(12,n,t,o|2),e.elementType=Zp,e.lanes=i,e;case Yp:return e=Tn(13,n,t,o),e.elementType=Yp,e.lanes=i,e;case Qp:return e=Tn(19,n,t,o),e.elementType=Qp,e.lanes=i,e;case qS:return $f(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case HS:s=10;break e;case GS:s=9;break e;case nv:s=11;break e;case rv:s=14;break e;case Xr:s=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=Tn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ei(e,t,n,r){return e=Tn(7,e,r,t),e.lanes=n,e}function $f(e,t,n,r){return e=Tn(22,e,r,t),e.elementType=qS,e.lanes=n,e.stateNode={isHidden:!1},e}function Vh(e,t,n){return e=Tn(6,e,null,t),e.lanes=n,e}function Uh(e,t,n){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oj(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kh(0),this.expirationTimes=kh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function zv(e,t,n,r,o,i,s,a,l){return e=new oj(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Tn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xv(i),e}function ij(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VC)}catch(e){console.error(e)}}VC(),NS.exports=pn;var Vv=NS.exports,[UC,uj]=nn({strict:!1,name:"PortalContext"}),Uv="chakra-portal",dj=".chakra-portal",fj=e=>h.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),hj=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=v.useState(null),i=v.useRef(null),[,s]=v.useState({});v.useEffect(()=>s({}),[]);const a=uj(),l=s$();_r(()=>{if(!r)return;const u=r.ownerDocument,d=t?a??u.body:u.body;if(!d)return;i.current=u.createElement("div"),i.current.className=Uv,d.appendChild(i.current),s({});const f=i.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const c=l!=null&&l.zIndex?h.jsx(fj,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return i.current?Vv.createPortal(h.jsx(UC,{value:i.current,children:c}),i.current):h.jsx("span",{ref:u=>{u&&o(u)}})},pj=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),s=v.useMemo(()=>{const l=o==null?void 0:o.ownerDocument.createElement("div");return l&&(l.className=Uv),l},[o]),[,a]=v.useState({});return _r(()=>a({}),[]),_r(()=>{if(!(!s||!i))return i.appendChild(s),()=>{i.removeChild(s)}},[s,i]),i&&s?Vv.createPortal(h.jsx(UC,{value:r?s:null,children:t}),s):null};function ra(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?h.jsx(pj,{containerRef:n,...r}):h.jsx(hj,{...r})}ra.className=Uv;ra.selector=dj;ra.displayName="Portal";function Wv(){const e=v.useContext(fl);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var Hv=v.createContext({});Hv.displayName="ColorModeContext";function Gv(){const e=v.useContext(Hv);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var Fc={light:"chakra-ui-light",dark:"chakra-ui-dark"};function mj(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const o=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,o==null||o()},setClassName(r){document.body.classList.add(r?Fc.dark:Fc.light),document.body.classList.remove(r?Fc.light:Fc.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const o=n.query(),i=s=>{r(s.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(i):o.addEventListener("change",i),()=>{typeof o.removeListener=="function"?o.removeListener(i):o.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var gj="chakra-ui-color-mode";function vj(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var yj=vj(gj),U1=()=>{};function W1(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function WC(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:o,disableTransitionOnChange:i}={},colorModeManager:s=yj}=e,a=o==="dark"?"dark":"light",[l,c]=v.useState(()=>W1(s,a)),[u,d]=v.useState(()=>W1(s)),{getSystemTheme:f,setClassName:p,setDataset:g,addListener:m}=v.useMemo(()=>mj({preventTransition:i}),[i]),w=o==="system"&&!l?u:l,b=v.useCallback(S=>{const T=S==="system"?f():S;c(T),p(T==="dark"),g(T),s.set(T)},[s,f,p,g]);_r(()=>{o==="system"&&d(f())},[]),v.useEffect(()=>{const S=s.get();if(S){b(S);return}if(o==="system"){b("system");return}b(a)},[s,a,o,b]);const y=v.useCallback(()=>{b(w==="dark"?"light":"dark")},[w,b]);v.useEffect(()=>{if(r)return m(b)},[r,m,b]);const x=v.useMemo(()=>({colorMode:t??w,toggleColorMode:t?U1:y,setColorMode:t?U1:b,forced:t!==void 0}),[w,y,b,t]);return h.jsx(Hv.Provider,{value:x,children:n})}WC.displayName="ColorModeProvider";function HC(){const e=Gv(),t=Wv();return{...e,theme:t}}var ae=(...e)=>e.filter(Boolean).join(" ");function Hn(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Dn(e,...t){return bj(e)?e(...t):e}var bj=e=>typeof e=="function",ke=e=>e?"":void 0,Wh=e=>e?!0:void 0;function me(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function wj(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var ad={exports:{}};ad.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",g="[object GeneratorFunction]",m="[object Map]",w="[object Number]",b="[object Null]",y="[object Object]",x="[object Proxy]",S="[object RegExp]",T="[object Set]",E="[object String]",C="[object Undefined]",_="[object WeakMap]",B="[object ArrayBuffer]",L="[object DataView]",P="[object Float32Array]",O="[object Float64Array]",I="[object Int8Array]",U="[object Int16Array]",$="[object Int32Array]",j="[object Uint8Array]",F="[object Uint8ClampedArray]",z="[object Uint16Array]",D="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,V=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,N={};N[P]=N[O]=N[I]=N[U]=N[$]=N[j]=N[F]=N[z]=N[D]=!0,N[a]=N[l]=N[B]=N[u]=N[L]=N[d]=N[f]=N[p]=N[m]=N[w]=N[y]=N[S]=N[T]=N[E]=N[_]=!1;var H=typeof wc=="object"&&wc&&wc.Object===Object&&wc,Q=typeof self=="object"&&self&&self.Object===Object&&self,te=H||Q||Function("return this")(),ne=t&&!t.nodeType&&t,ue=ne&&!0&&e&&!e.nodeType&&e,he=ue&&ue.exports===ne,Ae=he&&H.process,ze=function(){try{var k=ue&&ue.require&&ue.require("util").types;return k||Ae&&Ae.binding&&Ae.binding("util")}catch{}}(),ce=ze&&ze.isTypedArray;function ve(k,R,M){switch(M.length){case 0:return k.call(R);case 1:return k.call(R,M[0]);case 2:return k.call(R,M[0],M[1]);case 3:return k.call(R,M[0],M[1],M[2])}return k.apply(R,M)}function St(k,R){for(var M=-1,X=Array(k);++M-1}function q_(k,R){var M=this.__data__,X=gc(M,k);return X<0?(++this.size,M.push([k,R])):M[X][1]=R,this}vr.prototype.clear=U_,vr.prototype.delete=W_,vr.prototype.get=H_,vr.prototype.has=G_,vr.prototype.set=q_;function Oi(k){var R=-1,M=k==null?0:k.length;for(this.clear();++R1?M[pe-1]:void 0,Fe=pe>2?M[2]:void 0;for($e=k.length>3&&typeof $e=="function"?(pe--,$e):void 0,Fe&&SR(M[0],M[1],Fe)&&($e=pe<3?void 0:$e,pe=1),R=Object(R);++X-1&&k%1==0&&k0){if(++R>=o)return arguments[0]}else R=0;return k.apply(void 0,arguments)}}function AR(k){if(k!=null){try{return Wr.call(k)}catch{}try{return k+""}catch{}}return""}function bc(k,R){return k===R||k!==k&&R!==R}var dh=v0(function(){return arguments}())?v0:function(k){return fa(k)&&gn.call(k,"callee")&&!O_.call(k,"callee")},fh=Array.isArray;function hh(k){return k!=null&&S0(k.length)&&!ph(k)}function $R(k){return fa(k)&&hh(k)}var x0=L_||MR;function ph(k){if(!Lo(k))return!1;var R=vc(k);return R==p||R==g||R==c||R==x}function S0(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=s}function Lo(k){var R=typeof k;return k!=null&&(R=="object"||R=="function")}function fa(k){return k!=null&&typeof k=="object"}function jR(k){if(!fa(k)||vc(k)!=y)return!1;var R=h0(k);if(R===null)return!0;var M=gn.call(R,"constructor")&&R.constructor;return typeof M=="function"&&M instanceof M&&Wr.call(M)==hc}var k0=ce?Z(ce):lR;function OR(k){return vR(k,C0(k))}function C0(k){return hh(k)?oR(k,!0):cR(k)}var IR=yR(function(k,R,M,X){y0(k,R,M,X)});function LR(k){return function(){return k}}function E0(k){return k}function MR(){return!1}e.exports=IR})(ad,ad.exports);var xj=ad.exports;const ar=Ze(xj);var Sj=e=>/!(important)?$/.test(e),H1=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,kj=(e,t)=>n=>{const r=String(t),o=Sj(r),i=H1(r),s=e?`${e}.${i}`:i;let a=Hn(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=H1(a),o?`${a} !important`:a};function qv(e){const{scale:t,transform:n,compose:r}=e;return(i,s)=>{var a;const l=kj(t,i)(s);let c=(a=n==null?void 0:n(l,s))!=null?a:l;return r&&(c=r(c,s)),c}}var Nc=(...e)=>t=>e.reduce((n,r)=>r(n),t);function yn(e,t){return n=>{const r={property:n,scale:e};return r.transform=qv({scale:e,transform:t}),r}}var Cj=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function Ej(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Cj(t),transform:n?qv({scale:n,compose:r}):r}}var GC=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Tj(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...GC].join(" ")}function Pj(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...GC].join(" ")}var _j={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Rj={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Aj(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var $j={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},Nm={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},jj=new Set(Object.values(Nm)),Dm=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Oj=e=>e.trim();function Ij(e,t){if(e==null||Dm.has(e))return e;if(!(Vm(e)||Dm.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o==null?void 0:o[1],s=o==null?void 0:o[2];if(!i||!s)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[l,...c]=s.split(",").map(Oj).filter(Boolean);if((c==null?void 0:c.length)===0)return e;const u=l in Nm?Nm[l]:l;c.unshift(u);const d=c.map(f=>{if(jj.has(f))return f;const p=f.indexOf(" "),[g,m]=p!==-1?[f.substr(0,p),f.substr(p+1)]:[f],w=Vm(m)?m:m&&m.split(" "),b=`colors.${g}`,y=b in t.__cssMap?t.__cssMap[b].varRef:g;return w?[y,...Array.isArray(w)?w:[w]].join(" "):y});return`${a}(${d.join(", ")})`}var Vm=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Lj=(e,t)=>Ij(e,t??{});function Mj(e){return/^var\(--.+\)$/.test(e)}var Bj=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Yn=e=>t=>`${e}(${t})`,we={filter(e){return e!=="auto"?e:_j},backdropFilter(e){return e!=="auto"?e:Rj},ring(e){return Aj(we.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Tj():e==="auto-gpu"?Pj():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=Bj(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(Mj(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:Lj,blur:Yn("blur"),opacity:Yn("opacity"),brightness:Yn("brightness"),contrast:Yn("contrast"),dropShadow:Yn("drop-shadow"),grayscale:Yn("grayscale"),hueRotate:Yn("hue-rotate"),invert:Yn("invert"),saturate:Yn("saturate"),sepia:Yn("sepia"),bgImage(e){return e==null||Vm(e)||Dm.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=$j[e])!=null?t:{},o={flexDirection:e};return n&&(o[n]=1),r&&(o[r]=1),o}},A={borderWidths:yn("borderWidths"),borderStyles:yn("borderStyles"),colors:yn("colors"),borders:yn("borders"),gradients:yn("gradients",we.gradient),radii:yn("radii",we.px),space:yn("space",Nc(we.vh,we.px)),spaceT:yn("space",Nc(we.vh,we.px)),degreeT(e){return{property:e,transform:we.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:qv({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:yn("sizes",Nc(we.vh,we.px)),sizesT:yn("sizes",Nc(we.vh,we.fraction)),shadows:yn("shadows"),logical:Ej,blur:yn("blur",we.blur)},bu={background:A.colors("background"),backgroundColor:A.colors("backgroundColor"),backgroundImage:A.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:we.bgClip},bgSize:A.prop("backgroundSize"),bgPosition:A.prop("backgroundPosition"),bg:A.colors("background"),bgColor:A.colors("backgroundColor"),bgPos:A.prop("backgroundPosition"),bgRepeat:A.prop("backgroundRepeat"),bgAttachment:A.prop("backgroundAttachment"),bgGradient:A.gradients("backgroundImage"),bgClip:{transform:we.bgClip}};Object.assign(bu,{bgImage:bu.backgroundImage,bgImg:bu.backgroundImage});var xe={border:A.borders("border"),borderWidth:A.borderWidths("borderWidth"),borderStyle:A.borderStyles("borderStyle"),borderColor:A.colors("borderColor"),borderRadius:A.radii("borderRadius"),borderTop:A.borders("borderTop"),borderBlockStart:A.borders("borderBlockStart"),borderTopLeftRadius:A.radii("borderTopLeftRadius"),borderStartStartRadius:A.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:A.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:A.radii("borderTopRightRadius"),borderStartEndRadius:A.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:A.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:A.borders("borderRight"),borderInlineEnd:A.borders("borderInlineEnd"),borderBottom:A.borders("borderBottom"),borderBlockEnd:A.borders("borderBlockEnd"),borderBottomLeftRadius:A.radii("borderBottomLeftRadius"),borderBottomRightRadius:A.radii("borderBottomRightRadius"),borderLeft:A.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:A.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:A.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:A.borders(["borderLeft","borderRight"]),borderInline:A.borders("borderInline"),borderY:A.borders(["borderTop","borderBottom"]),borderBlock:A.borders("borderBlock"),borderTopWidth:A.borderWidths("borderTopWidth"),borderBlockStartWidth:A.borderWidths("borderBlockStartWidth"),borderTopColor:A.colors("borderTopColor"),borderBlockStartColor:A.colors("borderBlockStartColor"),borderTopStyle:A.borderStyles("borderTopStyle"),borderBlockStartStyle:A.borderStyles("borderBlockStartStyle"),borderBottomWidth:A.borderWidths("borderBottomWidth"),borderBlockEndWidth:A.borderWidths("borderBlockEndWidth"),borderBottomColor:A.colors("borderBottomColor"),borderBlockEndColor:A.colors("borderBlockEndColor"),borderBottomStyle:A.borderStyles("borderBottomStyle"),borderBlockEndStyle:A.borderStyles("borderBlockEndStyle"),borderLeftWidth:A.borderWidths("borderLeftWidth"),borderInlineStartWidth:A.borderWidths("borderInlineStartWidth"),borderLeftColor:A.colors("borderLeftColor"),borderInlineStartColor:A.colors("borderInlineStartColor"),borderLeftStyle:A.borderStyles("borderLeftStyle"),borderInlineStartStyle:A.borderStyles("borderInlineStartStyle"),borderRightWidth:A.borderWidths("borderRightWidth"),borderInlineEndWidth:A.borderWidths("borderInlineEndWidth"),borderRightColor:A.colors("borderRightColor"),borderInlineEndColor:A.colors("borderInlineEndColor"),borderRightStyle:A.borderStyles("borderRightStyle"),borderInlineEndStyle:A.borderStyles("borderInlineEndStyle"),borderTopRadius:A.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:A.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:A.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:A.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(xe,{rounded:xe.borderRadius,roundedTop:xe.borderTopRadius,roundedTopLeft:xe.borderTopLeftRadius,roundedTopRight:xe.borderTopRightRadius,roundedTopStart:xe.borderStartStartRadius,roundedTopEnd:xe.borderStartEndRadius,roundedBottom:xe.borderBottomRadius,roundedBottomLeft:xe.borderBottomLeftRadius,roundedBottomRight:xe.borderBottomRightRadius,roundedBottomStart:xe.borderEndStartRadius,roundedBottomEnd:xe.borderEndEndRadius,roundedLeft:xe.borderLeftRadius,roundedRight:xe.borderRightRadius,roundedStart:xe.borderInlineStartRadius,roundedEnd:xe.borderInlineEndRadius,borderStart:xe.borderInlineStart,borderEnd:xe.borderInlineEnd,borderTopStartRadius:xe.borderStartStartRadius,borderTopEndRadius:xe.borderStartEndRadius,borderBottomStartRadius:xe.borderEndStartRadius,borderBottomEndRadius:xe.borderEndEndRadius,borderStartRadius:xe.borderInlineStartRadius,borderEndRadius:xe.borderInlineEndRadius,borderStartWidth:xe.borderInlineStartWidth,borderEndWidth:xe.borderInlineEndWidth,borderStartColor:xe.borderInlineStartColor,borderEndColor:xe.borderInlineEndColor,borderStartStyle:xe.borderInlineStartStyle,borderEndStyle:xe.borderInlineEndStyle});var zj={color:A.colors("color"),textColor:A.colors("color"),fill:A.colors("fill"),stroke:A.colors("stroke")},Um={boxShadow:A.shadows("boxShadow"),mixBlendMode:!0,blendMode:A.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:A.prop("backgroundBlendMode"),opacity:!0};Object.assign(Um,{shadow:Um.boxShadow});var Fj={filter:{transform:we.filter},blur:A.blur("--chakra-blur"),brightness:A.propT("--chakra-brightness",we.brightness),contrast:A.propT("--chakra-contrast",we.contrast),hueRotate:A.degreeT("--chakra-hue-rotate"),invert:A.propT("--chakra-invert",we.invert),saturate:A.propT("--chakra-saturate",we.saturate),dropShadow:A.propT("--chakra-drop-shadow",we.dropShadow),backdropFilter:{transform:we.backdropFilter},backdropBlur:A.blur("--chakra-backdrop-blur"),backdropBrightness:A.propT("--chakra-backdrop-brightness",we.brightness),backdropContrast:A.propT("--chakra-backdrop-contrast",we.contrast),backdropHueRotate:A.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:A.propT("--chakra-backdrop-invert",we.invert),backdropSaturate:A.propT("--chakra-backdrop-saturate",we.saturate)},ld={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:we.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:A.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:A.space("gap"),rowGap:A.space("rowGap"),columnGap:A.space("columnGap")};Object.assign(ld,{flexDir:ld.flexDirection});var qC={gridGap:A.space("gridGap"),gridColumnGap:A.space("gridColumnGap"),gridRowGap:A.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},Nj={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:we.outline},outlineOffset:!0,outlineColor:A.colors("outlineColor")},Sn={width:A.sizesT("width"),inlineSize:A.sizesT("inlineSize"),height:A.sizes("height"),blockSize:A.sizes("blockSize"),boxSize:A.sizes(["width","height"]),minWidth:A.sizes("minWidth"),minInlineSize:A.sizes("minInlineSize"),minHeight:A.sizes("minHeight"),minBlockSize:A.sizes("minBlockSize"),maxWidth:A.sizes("maxWidth"),maxInlineSize:A.sizes("maxInlineSize"),maxHeight:A.sizes("maxHeight"),maxBlockSize:A.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (min-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?o:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (max-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?o:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:A.propT("float",we.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Sn,{w:Sn.width,h:Sn.height,minW:Sn.minWidth,maxW:Sn.maxWidth,minH:Sn.minHeight,maxH:Sn.maxHeight,overscroll:Sn.overscrollBehavior,overscrollX:Sn.overscrollBehaviorX,overscrollY:Sn.overscrollBehaviorY});var Dj={listStyleType:!0,listStylePosition:!0,listStylePos:A.prop("listStylePosition"),listStyleImage:!0,listStyleImg:A.prop("listStyleImage")};function Vj(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},Wj=Uj(Vj),Hj={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Gj={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Hh=(e,t,n)=>{const r={},o=Wj(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},qj={srOnly:{transform(e){return e===!0?Hj:e==="focusable"?Gj:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Hh(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Hh(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Hh(t,e,n)}},Za={position:!0,pos:A.prop("position"),zIndex:A.prop("zIndex","zIndices"),inset:A.spaceT("inset"),insetX:A.spaceT(["left","right"]),insetInline:A.spaceT("insetInline"),insetY:A.spaceT(["top","bottom"]),insetBlock:A.spaceT("insetBlock"),top:A.spaceT("top"),insetBlockStart:A.spaceT("insetBlockStart"),bottom:A.spaceT("bottom"),insetBlockEnd:A.spaceT("insetBlockEnd"),left:A.spaceT("left"),insetInlineStart:A.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:A.spaceT("right"),insetInlineEnd:A.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Za,{insetStart:Za.insetInlineStart,insetEnd:Za.insetInlineEnd});var Kj={ring:{transform:we.ring},ringColor:A.colors("--chakra-ring-color"),ringOffset:A.prop("--chakra-ring-offset-width"),ringOffsetColor:A.colors("--chakra-ring-offset-color"),ringInset:A.prop("--chakra-ring-inset")},Me={margin:A.spaceT("margin"),marginTop:A.spaceT("marginTop"),marginBlockStart:A.spaceT("marginBlockStart"),marginRight:A.spaceT("marginRight"),marginInlineEnd:A.spaceT("marginInlineEnd"),marginBottom:A.spaceT("marginBottom"),marginBlockEnd:A.spaceT("marginBlockEnd"),marginLeft:A.spaceT("marginLeft"),marginInlineStart:A.spaceT("marginInlineStart"),marginX:A.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:A.spaceT("marginInline"),marginY:A.spaceT(["marginTop","marginBottom"]),marginBlock:A.spaceT("marginBlock"),padding:A.space("padding"),paddingTop:A.space("paddingTop"),paddingBlockStart:A.space("paddingBlockStart"),paddingRight:A.space("paddingRight"),paddingBottom:A.space("paddingBottom"),paddingBlockEnd:A.space("paddingBlockEnd"),paddingLeft:A.space("paddingLeft"),paddingInlineStart:A.space("paddingInlineStart"),paddingInlineEnd:A.space("paddingInlineEnd"),paddingX:A.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:A.space("paddingInline"),paddingY:A.space(["paddingTop","paddingBottom"]),paddingBlock:A.space("paddingBlock")};Object.assign(Me,{m:Me.margin,mt:Me.marginTop,mr:Me.marginRight,me:Me.marginInlineEnd,marginEnd:Me.marginInlineEnd,mb:Me.marginBottom,ml:Me.marginLeft,ms:Me.marginInlineStart,marginStart:Me.marginInlineStart,mx:Me.marginX,my:Me.marginY,p:Me.padding,pt:Me.paddingTop,py:Me.paddingY,px:Me.paddingX,pb:Me.paddingBottom,pl:Me.paddingLeft,ps:Me.paddingInlineStart,paddingStart:Me.paddingInlineStart,pr:Me.paddingRight,pe:Me.paddingInlineEnd,paddingEnd:Me.paddingInlineEnd});var Zj={textDecorationColor:A.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:A.shadows("textShadow")},Yj={clipPath:!0,transform:A.propT("transform",we.transform),transformOrigin:!0,translateX:A.spaceT("--chakra-translate-x"),translateY:A.spaceT("--chakra-translate-y"),skewX:A.degreeT("--chakra-skew-x"),skewY:A.degreeT("--chakra-skew-y"),scaleX:A.prop("--chakra-scale-x"),scaleY:A.prop("--chakra-scale-y"),scale:A.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:A.degreeT("--chakra-rotate")},Qj={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:A.prop("transitionDuration","transition.duration"),transitionProperty:A.prop("transitionProperty","transition.property"),transitionTimingFunction:A.prop("transitionTimingFunction","transition.easing")},Xj={fontFamily:A.prop("fontFamily","fonts"),fontSize:A.prop("fontSize","fontSizes",we.px),fontWeight:A.prop("fontWeight","fontWeights"),lineHeight:A.prop("lineHeight","lineHeights"),letterSpacing:A.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Jj={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:A.spaceT("scrollMargin"),scrollMarginTop:A.spaceT("scrollMarginTop"),scrollMarginBottom:A.spaceT("scrollMarginBottom"),scrollMarginLeft:A.spaceT("scrollMarginLeft"),scrollMarginRight:A.spaceT("scrollMarginRight"),scrollMarginX:A.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:A.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:A.spaceT("scrollPadding"),scrollPaddingTop:A.spaceT("scrollPaddingTop"),scrollPaddingBottom:A.spaceT("scrollPaddingBottom"),scrollPaddingLeft:A.spaceT("scrollPaddingLeft"),scrollPaddingRight:A.spaceT("scrollPaddingRight"),scrollPaddingX:A.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:A.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function KC(e){return Hn(e)&&e.reference?e.reference:String(e)}var Mf=(e,...t)=>t.map(KC).join(` ${e} `).replace(/calc/g,""),G1=(...e)=>`calc(${Mf("+",...e)})`,q1=(...e)=>`calc(${Mf("-",...e)})`,Wm=(...e)=>`calc(${Mf("*",...e)})`,K1=(...e)=>`calc(${Mf("/",...e)})`,Z1=e=>{const t=KC(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Wm(t,-1)},Vo=Object.assign(e=>({add:(...t)=>Vo(G1(e,...t)),subtract:(...t)=>Vo(q1(e,...t)),multiply:(...t)=>Vo(Wm(e,...t)),divide:(...t)=>Vo(K1(e,...t)),negate:()=>Vo(Z1(e)),toString:()=>e.toString()}),{add:G1,subtract:q1,multiply:Wm,divide:K1,negate:Z1});function eO(e,t="-"){return e.replace(/\s+/g,t)}function tO(e){const t=eO(e.toString());return rO(nO(t))}function nO(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function rO(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function oO(e,t=""){return[t,e].filter(Boolean).join("-")}function iO(e,t){return`var(${e}${t?`, ${t}`:""})`}function sO(e,t=""){return tO(`--${oO(e,t)}`)}function oe(e,t,n){const r=sO(e,n);return{variable:r,reference:iO(r,t)}}function aO(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=oe(`${e}-${o}`,i);continue}n[r]=oe(`${e}-${r}`)}return n}function lO(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function cO(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function Hm(e){if(e==null)return e;const{unitless:t}=cO(e);return t||typeof e=="number"?`${e}px`:e}var ZC=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Kv=e=>Object.fromEntries(Object.entries(e).sort(ZC));function Y1(e){const t=Kv(e);return Object.assign(Object.values(t),t)}function uO(e){const t=Object.keys(Kv(e));return new Set(t)}function Q1(e){var t;if(!e)return e;e=(t=Hm(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function Oa(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${Hm(e)})`),t&&n.push("and",`(max-width: ${Hm(t)})`),n.join(" ")}function dO(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=Y1(e),r=Object.entries(e).sort(ZC).map(([s,a],l,c)=>{var u;let[,d]=(u=c[l+1])!=null?u:[];return d=parseFloat(d)>0?Q1(d):void 0,{_minW:Q1(a),breakpoint:s,minW:a,maxW:d,maxWQuery:Oa(null,d),minWQuery:Oa(a),minMaxQuery:Oa(a,d)}}),o=uO(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive(s){const a=Object.keys(s);return a.length>0&&a.every(l=>o.has(l))},asObject:Kv(e),asArray:Y1(e),details:r,get(s){return r.find(a=>a.breakpoint===s)},media:[null,...n.map(s=>Oa(s)).slice(1)],toArrayValue(s){if(!Hn(s))throw new Error("toArrayValue: value must be an object");const a=i.map(l=>{var c;return(c=s[l])!=null?c:null});for(;lO(a)===null;)a.pop();return a},toObjectValue(s){if(!Array.isArray(s))throw new Error("toObjectValue: value must be an array");return s.reduce((a,l,c)=>{const u=i[c];return u!=null&&l!=null&&(a[u]=l),a},{})}}}var ht={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Gr=e=>YC(t=>e(t,"&"),"[role=group]","[data-group]",".group"),yr=e=>YC(t=>e(t,"~ &"),"[data-peer]",".peer"),YC=(e,...t)=>t.map(e).join(", "),Bf={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:Gr(ht.hover),_peerHover:yr(ht.hover),_groupFocus:Gr(ht.focus),_peerFocus:yr(ht.focus),_groupFocusVisible:Gr(ht.focusVisible),_peerFocusVisible:yr(ht.focusVisible),_groupActive:Gr(ht.active),_peerActive:yr(ht.active),_groupDisabled:Gr(ht.disabled),_peerDisabled:yr(ht.disabled),_groupInvalid:Gr(ht.invalid),_peerInvalid:yr(ht.invalid),_groupChecked:Gr(ht.checked),_peerChecked:yr(ht.checked),_groupFocusWithin:Gr(ht.focusWithin),_peerFocusWithin:yr(ht.focusWithin),_peerPlaceholderShown:yr(ht.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},QC=Object.keys(Bf);function X1(e,t){return oe(String(e).replace(/\./g,"-"),void 0,t)}function fO(e,t){let n={};const r={};for(const[o,i]of Object.entries(e)){const{isSemantic:s,value:a}=i,{variable:l,reference:c}=X1(o,t==null?void 0:t.cssVarPrefix);if(!s){if(o.startsWith("space")){const f=o.split("."),[p,...g]=f,m=`${p}.-${g.join(".")}`,w=Vo.negate(a),b=Vo.negate(c);r[m]={value:w,var:l,varRef:b}}n[l]=a,r[o]={value:a,var:l,varRef:c};continue}const u=f=>{const g=[String(o).split(".")[0],f].join(".");if(!e[g])return f;const{reference:w}=X1(g,t==null?void 0:t.cssVarPrefix);return w},d=Hn(a)?a:{default:a};n=ar(n,Object.entries(d).reduce((f,[p,g])=>{var m,w;if(!g)return f;const b=u(`${g}`);if(p==="default")return f[l]=b,f;const y=(w=(m=Bf)==null?void 0:m[p])!=null?w:p;return f[y]={[l]:b},f},{})),r[o]={value:c,var:l,varRef:c}}return{cssVars:n,cssMap:r}}function hO(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function pO(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function mO(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function J1(e,t,n={}){const{stop:r,getKey:o}=n;function i(s,a=[]){var l;if(mO(s)||Array.isArray(s)){const c={};for(const[u,d]of Object.entries(s)){const f=(l=o==null?void 0:o(u))!=null?l:u,p=[...a,f];if(r!=null&&r(s,p))return t(s,a);c[f]=i(d,p)}return c}return t(s,a)}return i(e)}var gO=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function vO(e){return pO(e,gO)}function yO(e){return e.semanticTokens}function bO(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}var wO=e=>QC.includes(e)||e==="default";function xO({tokens:e,semanticTokens:t}){const n={};return J1(e,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!1,value:r})}),J1(t,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(wO)}),n}function SO(e){var t;const n=bO(e),r=vO(n),o=yO(n),i=xO({tokens:r,semanticTokens:o}),s=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:a,cssVars:l}=fO(i,{cssVarPrefix:s});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:a,__breakpoints:dO(n.breakpoints)}),n}var Zv=ar({},bu,xe,zj,ld,Sn,Fj,Kj,Nj,qC,qj,Za,Um,Me,Jj,Xj,Zj,Yj,Dj,Qj);Object.assign({},Me,Sn,ld,qC,Za);var kO=[...Object.keys(Zv),...QC],CO={...Zv,...Bf},EO=e=>e in CO,TO=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const s in e){let a=Dn(e[s],t);if(a==null)continue;if(a=Hn(a)&&n(a)?r(a):a,!Array.isArray(a)){i[s]=a;continue}const l=a.slice(0,o.length).length;for(let c=0;ce.startsWith("--")&&typeof t=="string"&&!_O(t),AO=(e,t)=>{var n,r;if(t==null)return t;const o=l=>{var c,u;return(u=(c=e.__cssMap)==null?void 0:c[l])==null?void 0:u.varRef},i=l=>{var c;return(c=o(l))!=null?c:l},[s,a]=PO(t);return t=(r=(n=o(s))!=null?n:i(a))!=null?r:i(t),t};function $O(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,s=!1)=>{var a,l,c;const u=Dn(i,r),d=TO(u)(r);let f={};for(let p in d){const g=d[p];let m=Dn(g,r);p in n&&(p=n[p]),RO(p,m)&&(m=AO(r,m));let w=t[p];if(w===!0&&(w={property:p}),Hn(m)){f[p]=(a=f[p])!=null?a:{},f[p]=ar({},f[p],o(m,!0));continue}let b=(c=(l=w==null?void 0:w.transform)==null?void 0:l.call(w,m,r,u))!=null?c:m;b=w!=null&&w.processResult?o(b,!0):b;const y=Dn(w==null?void 0:w.property,r);if(!s&&(w!=null&&w.static)){const x=Dn(w.static,r);f=ar({},f,x)}if(y&&Array.isArray(y)){for(const x of y)f[x]=b;continue}if(y){y==="&"&&Hn(b)?f=ar({},f,b):f[y]=b;continue}if(Hn(b)){f=ar({},f,b);continue}f[p]=b}return f};return o}var XC=e=>t=>$O({theme:t,pseudos:Bf,configs:Zv})(e);function Ie(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function jO(e,t){if(Array.isArray(e))return e;if(Hn(e))return t(e);if(e!=null)return[e]}function OO(e,t){for(let n=t+1;n{ar(c,{[x]:f?y[x]:{[b]:y[x]}})});continue}if(!p){f?ar(c,y):c[b]=y;continue}c[b]=y}}return c}}function LO(e){return t=>{var n;const{variant:r,size:o,theme:i}=t,s=IO(i);return ar({},Dn((n=e.baseStyle)!=null?n:{},t),s(e,"sizes",o,t),s(e,"variants",r,t))}}function MO(e,t,n){var r,o,i;return(i=(o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)!=null?i:n}function ft(e){return hO(e,["styleConfig","size","variant","colorScheme"])}var BO={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},zO={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},FO={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},NO={property:BO,easing:zO,duration:FO},DO=NO,VO={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},UO=VO,WO={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},HO=WO,GO={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},qO=GO,KO={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},ZO=KO,YO={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},QO=YO,XO={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},JO=XO,e3={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},t3=e3,n3={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},JC=n3,e2={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},r3={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},o3={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},i3={...e2,...r3,container:o3},t2=i3,s3={breakpoints:qO,zIndices:UO,radii:QO,blur:t3,colors:ZO,...JC,sizes:t2,shadows:JO,space:e2,borders:HO,transition:DO},{defineMultiStyleConfig:a3,definePartsStyle:Ia}=Ie(["stepper","step","title","description","indicator","separator","icon","number"]),xr=oe("stepper-indicator-size"),is=oe("stepper-icon-size"),ss=oe("stepper-title-font-size"),La=oe("stepper-description-font-size"),ka=oe("stepper-accent-color"),l3=Ia(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[ka.variable]:`colors.${e}.500`,_dark:{[ka.variable]:`colors.${e}.200`}},title:{fontSize:ss.reference,fontWeight:"medium"},description:{fontSize:La.reference,color:"chakra-subtle-text"},number:{fontSize:ss.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:is.reference,height:is.reference},indicator:{flexShrink:0,borderRadius:"full",width:xr.reference,height:xr.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:ka.reference},"&[data-status=complete]":{bg:ka.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:ka.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${xr.reference} - 8px)`,top:`calc(${xr.reference} + 4px)`,insetStart:`calc(${xr.reference} / 2 - 1px)`}}})),c3=a3({baseStyle:l3,sizes:{xs:Ia({stepper:{[xr.variable]:"sizes.4",[is.variable]:"sizes.3",[ss.variable]:"fontSizes.xs",[La.variable]:"fontSizes.xs"}}),sm:Ia({stepper:{[xr.variable]:"sizes.6",[is.variable]:"sizes.4",[ss.variable]:"fontSizes.sm",[La.variable]:"fontSizes.xs"}}),md:Ia({stepper:{[xr.variable]:"sizes.8",[is.variable]:"sizes.5",[ss.variable]:"fontSizes.md",[La.variable]:"fontSizes.sm"}}),lg:Ia({stepper:{[xr.variable]:"sizes.10",[is.variable]:"sizes.6",[ss.variable]:"fontSizes.lg",[La.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function Pe(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...u){r();for(const d of u)t[d]=l(d);return Pe(e,t)}function i(...u){for(const d of u)d in t||(t[d]=l(d));return Pe(e,t)}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(u){const p=`chakra-${(["container","root"].includes(u??"")?[e]:[e,u]).filter(Boolean).join("__")}`;return{className:p,selector:`.${p}`,toString:()=>u}}return{parts:o,toPart:l,extend:i,selectors:s,classnames:a,get keys(){return Object.keys(t)},__type:{}}}var u3=Pe("accordion").parts("root","container","button","panel").extend("icon"),d3=Pe("alert").parts("title","description","container").extend("icon","spinner"),f3=Pe("avatar").parts("label","badge","container").extend("excessLabel","group"),h3=Pe("breadcrumb").parts("link","item","container").extend("separator");Pe("button").parts();var p3=Pe("checkbox").parts("control","icon","container").extend("label");Pe("progress").parts("track","filledTrack").extend("label");var m3=Pe("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),g3=Pe("editable").parts("preview","input","textarea"),v3=Pe("form").parts("container","requiredIndicator","helperText"),y3=Pe("formError").parts("text","icon"),b3=Pe("input").parts("addon","field","element","group"),w3=Pe("list").parts("container","item","icon"),x3=Pe("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),S3=Pe("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),k3=Pe("numberinput").parts("root","field","stepperGroup","stepper");Pe("pininput").parts("field");var C3=Pe("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),E3=Pe("progress").parts("label","filledTrack","track"),T3=Pe("radio").parts("container","control","label"),P3=Pe("select").parts("field","icon"),_3=Pe("slider").parts("container","track","thumb","filledTrack","mark"),R3=Pe("stat").parts("container","label","helpText","number","icon"),A3=Pe("switch").parts("container","track","thumb"),$3=Pe("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),j3=Pe("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),O3=Pe("tag").parts("container","label","closeButton"),I3=Pe("card").parts("container","header","body","footer");function Zo(e,t,n){return Math.min(Math.max(e,n),t)}class L3 extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Ma=L3;function Yv(e){if(typeof e!="string")throw new Ma(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=U3.test(e)?z3(e):e;const n=F3.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(Al(a,2),16)),parseInt(Al(s[3]||"f",2),16)/255]}const r=N3.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=D3.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=V3.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Zo(0,100,a)!==a)throw new Ma(e);if(Zo(0,100,l)!==l)throw new Ma(e);return[...W3(s,a,l),Number.isNaN(c)?1:c]}throw new Ma(e)}function M3(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const eb=e=>parseInt(e.replace(/_/g,""),36),B3="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=eb(t.substring(0,3)),r=eb(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function z3(e){const t=e.toLowerCase().trim(),n=B3[M3(t)];if(!n)throw new Ma(e);return`#${n}`}const Al=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),F3=new RegExp(`^#${Al("([a-f0-9])",3)}([a-f0-9])?$`,"i"),N3=new RegExp(`^#${Al("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),D3=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Al(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),V3=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,U3=/^[a-z]+$/i,tb=e=>Math.round(e*255),W3=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(tb);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(tb)};function H3(e,t,n,r){return`rgba(${Zo(0,255,e).toFixed()}, ${Zo(0,255,t).toFixed()}, ${Zo(0,255,n).toFixed()}, ${parseFloat(Zo(0,1,r).toFixed(3))})`}function G3(e,t){const[n,r,o,i]=Yv(e);return H3(n,r,o,i-t)}function q3(e){const[t,n,r,o]=Yv(e);let i=s=>{const a=Zo(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}function K3(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,Bt=(e,t,n)=>{const r=K3(e,`colors.${t}`,t);try{return q3(r),r}catch{return n??"#000000"}},Y3=e=>{const[t,n,r]=Yv(e);return(t*299+n*587+r*114)/1e3},Q3=e=>t=>{const n=Bt(t,e);return Y3(n)<128?"dark":"light"},X3=e=>t=>Q3(e)(t)==="dark",Ds=(e,t)=>n=>{const r=Bt(n,e);return G3(r,1-t)};function nb(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + 45deg, + ${t} 25%, + transparent 25%, + transparent 50%, + ${t} 50%, + ${t} 75%, + transparent 75%, + transparent + )`,backgroundSize:`${e} ${e}`}}var J3=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function e4(e){const t=J3();return!e||Z3(e)?t:e.string&&e.colors?n4(e.string,e.colors):e.string&&!e.colors?t4(e.string):e.colors&&!e.string?r4(e.colors):t}function t4(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${o.toString(16)}`.substr(-2)}return n}function n4(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Qv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function n2(e){return Hn(e)&&e.reference?e.reference:String(e)}var zf=(e,...t)=>t.map(n2).join(` ${e} `).replace(/calc/g,""),rb=(...e)=>`calc(${zf("+",...e)})`,ob=(...e)=>`calc(${zf("-",...e)})`,Gm=(...e)=>`calc(${zf("*",...e)})`,ib=(...e)=>`calc(${zf("/",...e)})`,sb=e=>{const t=n2(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Gm(t,-1)},Sr=Object.assign(e=>({add:(...t)=>Sr(rb(e,...t)),subtract:(...t)=>Sr(ob(e,...t)),multiply:(...t)=>Sr(Gm(e,...t)),divide:(...t)=>Sr(ib(e,...t)),negate:()=>Sr(sb(e)),toString:()=>e.toString()}),{add:rb,subtract:ob,multiply:Gm,divide:ib,negate:sb});function o4(e){return!Number.isInteger(parseFloat(e.toString()))}function i4(e,t="-"){return e.replace(/\s+/g,t)}function r2(e){const t=i4(e.toString());return t.includes("\\.")?e:o4(e)?t.replace(".","\\."):e}function s4(e,t=""){return[t,r2(e)].filter(Boolean).join("-")}function a4(e,t){return`var(${r2(e)}${t?`, ${t}`:""})`}function l4(e,t=""){return`--${s4(e,t)}`}function st(e,t){const n=l4(e,t==null?void 0:t.prefix);return{variable:n,reference:a4(n,c4(t==null?void 0:t.fallback))}}function c4(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:u4,definePartsStyle:wu}=Ie(A3.keys),Ya=st("switch-track-width"),ti=st("switch-track-height"),Gh=st("switch-track-diff"),d4=Sr.subtract(Ya,ti),qm=st("switch-thumb-x"),Ca=st("switch-bg"),f4=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Ya.reference],height:[ti.reference],transitionProperty:"common",transitionDuration:"fast",[Ca.variable]:"colors.gray.300",_dark:{[Ca.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Ca.variable]:`colors.${t}.500`,_dark:{[Ca.variable]:`colors.${t}.200`}},bg:Ca.reference}},h4={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[ti.reference],height:[ti.reference],_checked:{transform:`translateX(${qm.reference})`}},p4=wu(e=>({container:{[Gh.variable]:d4,[qm.variable]:Gh.reference,_rtl:{[qm.variable]:Sr(Gh).negate().toString()}},track:f4(e),thumb:h4})),m4={sm:wu({container:{[Ya.variable]:"1.375rem",[ti.variable]:"sizes.3"}}),md:wu({container:{[Ya.variable]:"1.875rem",[ti.variable]:"sizes.4"}}),lg:wu({container:{[Ya.variable]:"2.875rem",[ti.variable]:"sizes.6"}})},g4=u4({baseStyle:p4,sizes:m4,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:v4,definePartsStyle:Cs}=Ie($3.keys),y4=Cs({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),cd={"&[data-is-numeric=true]":{textAlign:"end"}},b4=Cs(e=>{const{colorScheme:t}=e;return{th:{color:re("gray.600","gray.400")(e),borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},td:{borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},caption:{color:re("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),w4=Cs(e=>{const{colorScheme:t}=e;return{th:{color:re("gray.600","gray.400")(e),borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},td:{borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},caption:{color:re("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e)},td:{background:re(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),x4={simple:b4,striped:w4,unstyled:{}},S4={sm:Cs({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Cs({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Cs({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},k4=v4({baseStyle:y4,variants:x4,sizes:S4,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Wt=oe("tabs-color"),Fn=oe("tabs-bg"),Dc=oe("tabs-border-color"),{defineMultiStyleConfig:C4,definePartsStyle:dr}=Ie(j3.keys),E4=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},T4=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},P4=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},_4={p:4},R4=dr(e=>({root:E4(e),tab:T4(e),tablist:P4(e),tabpanel:_4})),A4={sm:dr({tab:{py:1,px:4,fontSize:"sm"}}),md:dr({tab:{fontSize:"md",py:2,px:4}}),lg:dr({tab:{fontSize:"lg",py:3,px:4}})},$4=dr(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",o=r?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{[Wt.variable]:`colors.${t}.600`,_dark:{[Wt.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Fn.variable]:"colors.gray.200",_dark:{[Fn.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Wt.reference,bg:Fn.reference}}}),j4=dr(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Dc.variable]:"transparent",_selected:{[Wt.variable]:`colors.${t}.600`,[Dc.variable]:"colors.white",_dark:{[Wt.variable]:`colors.${t}.300`,[Dc.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Dc.reference},color:Wt.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),O4=dr(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Fn.variable]:"colors.gray.50",_dark:{[Fn.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Fn.variable]:"colors.white",[Wt.variable]:`colors.${t}.600`,_dark:{[Fn.variable]:"colors.gray.800",[Wt.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Wt.reference,bg:Fn.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),I4=dr(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Bt(n,`${t}.700`),bg:Bt(n,`${t}.100`)}}}}),L4=dr(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Wt.variable]:"colors.gray.600",_dark:{[Wt.variable]:"inherit"},_selected:{[Wt.variable]:"colors.white",[Fn.variable]:`colors.${t}.600`,_dark:{[Wt.variable]:"colors.gray.800",[Fn.variable]:`colors.${t}.300`}},color:Wt.reference,bg:Fn.reference}}}),M4=dr({}),B4={line:$4,enclosed:j4,"enclosed-colored":O4,"soft-rounded":I4,"solid-rounded":L4,unstyled:M4},z4=C4({baseStyle:R4,sizes:A4,variants:B4,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Xe=aO("badge",["bg","color","shadow"]),F4={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Xe.bg.reference,color:Xe.color.reference,boxShadow:Xe.shadow.reference},N4=e=>{const{colorScheme:t,theme:n}=e,r=Ds(`${t}.500`,.6)(n);return{[Xe.bg.variable]:`colors.${t}.500`,[Xe.color.variable]:"colors.white",_dark:{[Xe.bg.variable]:r,[Xe.color.variable]:"colors.whiteAlpha.800"}}},D4=e=>{const{colorScheme:t,theme:n}=e,r=Ds(`${t}.200`,.16)(n);return{[Xe.bg.variable]:`colors.${t}.100`,[Xe.color.variable]:`colors.${t}.800`,_dark:{[Xe.bg.variable]:r,[Xe.color.variable]:`colors.${t}.200`}}},V4=e=>{const{colorScheme:t,theme:n}=e,r=Ds(`${t}.200`,.8)(n);return{[Xe.color.variable]:`colors.${t}.500`,_dark:{[Xe.color.variable]:r},[Xe.shadow.variable]:`inset 0 0 0px 1px ${Xe.color.reference}`}},U4={solid:N4,subtle:D4,outline:V4},Qa={baseStyle:F4,variants:U4,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:W4,definePartsStyle:ni}=Ie(O3.keys),ab=oe("tag-bg"),lb=oe("tag-color"),qh=oe("tag-shadow"),xu=oe("tag-min-height"),Su=oe("tag-min-width"),ku=oe("tag-font-size"),Cu=oe("tag-padding-inline"),H4={fontWeight:"medium",lineHeight:1.2,outline:0,[lb.variable]:Xe.color.reference,[ab.variable]:Xe.bg.reference,[qh.variable]:Xe.shadow.reference,color:lb.reference,bg:ab.reference,boxShadow:qh.reference,borderRadius:"md",minH:xu.reference,minW:Su.reference,fontSize:ku.reference,px:Cu.reference,_focusVisible:{[qh.variable]:"shadows.outline"}},G4={lineHeight:1.2,overflow:"visible"},q4={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},K4=ni({container:H4,label:G4,closeButton:q4}),Z4={sm:ni({container:{[xu.variable]:"sizes.5",[Su.variable]:"sizes.5",[ku.variable]:"fontSizes.xs",[Cu.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:ni({container:{[xu.variable]:"sizes.6",[Su.variable]:"sizes.6",[ku.variable]:"fontSizes.sm",[Cu.variable]:"space.2"}}),lg:ni({container:{[xu.variable]:"sizes.8",[Su.variable]:"sizes.8",[ku.variable]:"fontSizes.md",[Cu.variable]:"space.3"}})},Y4={subtle:ni(e=>{var t;return{container:(t=Qa.variants)==null?void 0:t.subtle(e)}}),solid:ni(e=>{var t;return{container:(t=Qa.variants)==null?void 0:t.solid(e)}}),outline:ni(e=>{var t;return{container:(t=Qa.variants)==null?void 0:t.outline(e)}})},Q4=W4({variants:Y4,baseStyle:K4,sizes:Z4,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Tr,defineMultiStyleConfig:X4}=Ie(b3.keys),as=oe("input-height"),ls=oe("input-font-size"),cs=oe("input-padding"),us=oe("input-border-radius"),J4=Tr({addon:{height:as.reference,fontSize:ls.reference,px:cs.reference,borderRadius:us.reference},field:{width:"100%",height:as.reference,fontSize:ls.reference,px:cs.reference,borderRadius:us.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),qr={lg:{[ls.variable]:"fontSizes.lg",[cs.variable]:"space.4",[us.variable]:"radii.md",[as.variable]:"sizes.12"},md:{[ls.variable]:"fontSizes.md",[cs.variable]:"space.4",[us.variable]:"radii.md",[as.variable]:"sizes.10"},sm:{[ls.variable]:"fontSizes.sm",[cs.variable]:"space.3",[us.variable]:"radii.sm",[as.variable]:"sizes.8"},xs:{[ls.variable]:"fontSizes.xs",[cs.variable]:"space.2",[us.variable]:"radii.sm",[as.variable]:"sizes.6"}},eI={lg:Tr({field:qr.lg,group:qr.lg}),md:Tr({field:qr.md,group:qr.md}),sm:Tr({field:qr.sm,group:qr.sm}),xs:Tr({field:qr.xs,group:qr.xs})};function Xv(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||re("blue.500","blue.300")(e),errorBorderColor:n||re("red.500","red.300")(e)}}var tI=Tr(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Xv(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:re("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Bt(t,r),boxShadow:`0 0 0 1px ${Bt(t,r)}`},_focusVisible:{zIndex:1,borderColor:Bt(t,n),boxShadow:`0 0 0 1px ${Bt(t,n)}`}},addon:{border:"1px solid",borderColor:re("inherit","whiteAlpha.50")(e),bg:re("gray.100","whiteAlpha.300")(e)}}}),nI=Tr(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Xv(e);return{field:{border:"2px solid",borderColor:"transparent",bg:re("gray.100","whiteAlpha.50")(e),_hover:{bg:re("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Bt(t,r)},_focusVisible:{bg:"transparent",borderColor:Bt(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:re("gray.100","whiteAlpha.50")(e)}}}),rI=Tr(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Xv(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Bt(t,r),boxShadow:`0px 1px 0px 0px ${Bt(t,r)}`},_focusVisible:{borderColor:Bt(t,n),boxShadow:`0px 1px 0px 0px ${Bt(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),oI=Tr({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),iI={outline:tI,filled:nI,flushed:rI,unstyled:oI},Ee=X4({baseStyle:J4,sizes:eI,variants:iI,defaultProps:{size:"md",variant:"outline"}}),cb,sI={...(cb=Ee.baseStyle)==null?void 0:cb.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},ub,db,aI={outline:e=>{var t,n;return(n=(t=Ee.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=Ee.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=Ee.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(db=(ub=Ee.variants)==null?void 0:ub.unstyled.field)!=null?db:{}},fb,hb,pb,mb,gb,vb,yb,bb,lI={xs:(hb=(fb=Ee.sizes)==null?void 0:fb.xs.field)!=null?hb:{},sm:(mb=(pb=Ee.sizes)==null?void 0:pb.sm.field)!=null?mb:{},md:(vb=(gb=Ee.sizes)==null?void 0:gb.md.field)!=null?vb:{},lg:(bb=(yb=Ee.sizes)==null?void 0:yb.lg.field)!=null?bb:{}},cI={baseStyle:sI,sizes:lI,variants:aI,defaultProps:{size:"md",variant:"outline"}},Vc=st("tooltip-bg"),Kh=st("tooltip-fg"),uI=st("popper-arrow-bg"),dI={bg:Vc.reference,color:Kh.reference,[Vc.variable]:"colors.gray.700",[Kh.variable]:"colors.whiteAlpha.900",_dark:{[Vc.variable]:"colors.gray.300",[Kh.variable]:"colors.gray.900"},[uI.variable]:Vc.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},fI={baseStyle:dI},{defineMultiStyleConfig:hI,definePartsStyle:Ba}=Ie(E3.keys),pI=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=re(nb(),nb("1rem","rgba(0,0,0,0.1)"))(e),s=re(`${t}.500`,`${t}.200`)(e),a=`linear-gradient( + to right, + transparent 0%, + ${Bt(n,s)} 50%, + transparent 100% + )`;return{...!r&&o&&i,...r?{bgImage:a}:{bgColor:s}}},mI={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},gI=e=>({bg:re("gray.100","whiteAlpha.300")(e)}),vI=e=>({transitionProperty:"common",transitionDuration:"slow",...pI(e)}),yI=Ba(e=>({label:mI,filledTrack:vI(e),track:gI(e)})),bI={xs:Ba({track:{h:"1"}}),sm:Ba({track:{h:"2"}}),md:Ba({track:{h:"3"}}),lg:Ba({track:{h:"4"}})},wI=hI({sizes:bI,baseStyle:yI,defaultProps:{size:"md",colorScheme:"blue"}}),xI=e=>typeof e=="function";function Ft(e,...t){return xI(e)?e(...t):e}var{definePartsStyle:Eu,defineMultiStyleConfig:SI}=Ie(p3.keys),Xa=oe("checkbox-size"),kI=e=>{const{colorScheme:t}=e;return{w:Xa.reference,h:Xa.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:re(`${t}.500`,`${t}.200`)(e),borderColor:re(`${t}.500`,`${t}.200`)(e),color:re("white","gray.900")(e),_hover:{bg:re(`${t}.600`,`${t}.300`)(e),borderColor:re(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:re("gray.200","transparent")(e),bg:re("gray.200","whiteAlpha.300")(e),color:re("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:re(`${t}.500`,`${t}.200`)(e),borderColor:re(`${t}.500`,`${t}.200`)(e),color:re("white","gray.900")(e)},_disabled:{bg:re("gray.100","whiteAlpha.100")(e),borderColor:re("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:re("red.500","red.300")(e)}}},CI={_disabled:{cursor:"not-allowed"}},EI={userSelect:"none",_disabled:{opacity:.4}},TI={transitionProperty:"transform",transitionDuration:"normal"},PI=Eu(e=>({icon:TI,container:CI,control:Ft(kI,e),label:EI})),_I={sm:Eu({control:{[Xa.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:Eu({control:{[Xa.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:Eu({control:{[Xa.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},ud=SI({baseStyle:PI,sizes:_I,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:RI,definePartsStyle:Tu}=Ie(T3.keys),AI=e=>{var t;const n=(t=Ft(ud.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},$I=Tu(e=>{var t,n,r,o;return{label:(n=(t=ud).baseStyle)==null?void 0:n.call(t,e).label,container:(o=(r=ud).baseStyle)==null?void 0:o.call(r,e).container,control:AI(e)}}),jI={md:Tu({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Tu({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Tu({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},OI=RI({baseStyle:$I,sizes:jI,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:II,definePartsStyle:LI}=Ie(P3.keys),Uc=oe("select-bg"),wb,MI={...(wb=Ee.baseStyle)==null?void 0:wb.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Uc.reference,[Uc.variable]:"colors.white",_dark:{[Uc.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Uc.reference}},BI={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},zI=LI({field:MI,icon:BI}),Wc={paddingInlineEnd:"8"},xb,Sb,kb,Cb,Eb,Tb,Pb,_b,FI={lg:{...(xb=Ee.sizes)==null?void 0:xb.lg,field:{...(Sb=Ee.sizes)==null?void 0:Sb.lg.field,...Wc}},md:{...(kb=Ee.sizes)==null?void 0:kb.md,field:{...(Cb=Ee.sizes)==null?void 0:Cb.md.field,...Wc}},sm:{...(Eb=Ee.sizes)==null?void 0:Eb.sm,field:{...(Tb=Ee.sizes)==null?void 0:Tb.sm.field,...Wc}},xs:{...(Pb=Ee.sizes)==null?void 0:Pb.xs,field:{...(_b=Ee.sizes)==null?void 0:_b.xs.field,...Wc},icon:{insetEnd:"1"}}},NI=II({baseStyle:zI,sizes:FI,variants:Ee.variants,defaultProps:Ee.defaultProps}),Zh=oe("skeleton-start-color"),Yh=oe("skeleton-end-color"),DI={[Zh.variable]:"colors.gray.100",[Yh.variable]:"colors.gray.400",_dark:{[Zh.variable]:"colors.gray.800",[Yh.variable]:"colors.gray.600"},background:Zh.reference,borderColor:Yh.reference,opacity:.7,borderRadius:"sm"},VI={baseStyle:DI},Qh=oe("skip-link-bg"),UI={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Qh.variable]:"colors.white",_dark:{[Qh.variable]:"colors.gray.700"},bg:Qh.reference}},WI={baseStyle:UI},{defineMultiStyleConfig:HI,definePartsStyle:Ff}=Ie(_3.keys),$l=oe("slider-thumb-size"),jl=oe("slider-track-size"),ro=oe("slider-bg"),GI=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Qv({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},qI=e=>({...Qv({orientation:e.orientation,horizontal:{h:jl.reference},vertical:{w:jl.reference}}),overflow:"hidden",borderRadius:"sm",[ro.variable]:"colors.gray.200",_dark:{[ro.variable]:"colors.whiteAlpha.200"},_disabled:{[ro.variable]:"colors.gray.300",_dark:{[ro.variable]:"colors.whiteAlpha.300"}},bg:ro.reference}),KI=e=>{const{orientation:t}=e;return{...Qv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:$l.reference,h:$l.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},ZI=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[ro.variable]:`colors.${t}.500`,_dark:{[ro.variable]:`colors.${t}.200`},bg:ro.reference}},YI=Ff(e=>({container:GI(e),track:qI(e),thumb:KI(e),filledTrack:ZI(e)})),QI=Ff({container:{[$l.variable]:"sizes.4",[jl.variable]:"sizes.1"}}),XI=Ff({container:{[$l.variable]:"sizes.3.5",[jl.variable]:"sizes.1"}}),JI=Ff({container:{[$l.variable]:"sizes.2.5",[jl.variable]:"sizes.0.5"}}),eL={lg:QI,md:XI,sm:JI},tL=HI({baseStyle:YI,sizes:eL,defaultProps:{size:"md",colorScheme:"blue"}}),Uo=st("spinner-size"),nL={width:[Uo.reference],height:[Uo.reference]},rL={xs:{[Uo.variable]:"sizes.3"},sm:{[Uo.variable]:"sizes.4"},md:{[Uo.variable]:"sizes.6"},lg:{[Uo.variable]:"sizes.8"},xl:{[Uo.variable]:"sizes.12"}},oL={baseStyle:nL,sizes:rL,defaultProps:{size:"md"}},{defineMultiStyleConfig:iL,definePartsStyle:o2}=Ie(R3.keys),sL={fontWeight:"medium"},aL={opacity:.8,marginBottom:"2"},lL={verticalAlign:"baseline",fontWeight:"semibold"},cL={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},uL=o2({container:{},label:sL,helpText:aL,number:lL,icon:cL}),dL={md:o2({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},fL=iL({baseStyle:uL,sizes:dL,defaultProps:{size:"md"}}),Xh=oe("kbd-bg"),hL={[Xh.variable]:"colors.gray.100",_dark:{[Xh.variable]:"colors.whiteAlpha.100"},bg:Xh.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},pL={baseStyle:hL},mL={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},gL={baseStyle:mL},{defineMultiStyleConfig:vL,definePartsStyle:yL}=Ie(w3.keys),bL={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},wL=yL({icon:bL}),xL=vL({baseStyle:wL}),{defineMultiStyleConfig:SL,definePartsStyle:kL}=Ie(x3.keys),er=oe("menu-bg"),Jh=oe("menu-shadow"),CL={[er.variable]:"#fff",[Jh.variable]:"shadows.sm",_dark:{[er.variable]:"colors.gray.700",[Jh.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:er.reference,boxShadow:Jh.reference},EL={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[er.variable]:"colors.gray.100",_dark:{[er.variable]:"colors.whiteAlpha.100"}},_active:{[er.variable]:"colors.gray.200",_dark:{[er.variable]:"colors.whiteAlpha.200"}},_expanded:{[er.variable]:"colors.gray.100",_dark:{[er.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:er.reference},TL={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},PL={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},_L={opacity:.6},RL={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},AL={transitionProperty:"common",transitionDuration:"normal"},$L=kL({button:AL,list:CL,item:EL,groupTitle:TL,icon:PL,command:_L,divider:RL}),jL=SL({baseStyle:$L}),{defineMultiStyleConfig:OL,definePartsStyle:Km}=Ie(S3.keys),ep=oe("modal-bg"),tp=oe("modal-shadow"),IL={bg:"blackAlpha.600",zIndex:"modal"},LL=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},ML=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[ep.variable]:"colors.white",[tp.variable]:"shadows.lg",_dark:{[ep.variable]:"colors.gray.700",[tp.variable]:"shadows.dark-lg"},bg:ep.reference,boxShadow:tp.reference}},BL={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},zL={position:"absolute",top:"2",insetEnd:"3"},FL=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},NL={px:"6",py:"4"},DL=Km(e=>({overlay:IL,dialogContainer:Ft(LL,e),dialog:Ft(ML,e),header:BL,closeButton:zL,body:Ft(FL,e),footer:NL}));function Ln(e){return Km(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var VL={xs:Ln("xs"),sm:Ln("sm"),md:Ln("md"),lg:Ln("lg"),xl:Ln("xl"),"2xl":Ln("2xl"),"3xl":Ln("3xl"),"4xl":Ln("4xl"),"5xl":Ln("5xl"),"6xl":Ln("6xl"),full:Ln("full")},UL=OL({baseStyle:DL,sizes:VL,defaultProps:{size:"md"}}),{defineMultiStyleConfig:WL,definePartsStyle:i2}=Ie(k3.keys),Jv=st("number-input-stepper-width"),s2=st("number-input-input-padding"),HL=Sr(Jv).add("0.5rem").toString(),np=st("number-input-bg"),rp=st("number-input-color"),op=st("number-input-border-color"),GL={[Jv.variable]:"sizes.6",[s2.variable]:HL},qL=e=>{var t,n;return(n=(t=Ft(Ee.baseStyle,e))==null?void 0:t.field)!=null?n:{}},KL={width:Jv.reference},ZL={borderStart:"1px solid",borderStartColor:op.reference,color:rp.reference,bg:np.reference,[rp.variable]:"colors.chakra-body-text",[op.variable]:"colors.chakra-border-color",_dark:{[rp.variable]:"colors.whiteAlpha.800",[op.variable]:"colors.whiteAlpha.300"},_active:{[np.variable]:"colors.gray.200",_dark:{[np.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},YL=i2(e=>{var t;return{root:GL,field:(t=Ft(qL,e))!=null?t:{},stepperGroup:KL,stepper:ZL}});function Hc(e){var t,n,r;const o=(t=Ee.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},s=(r=(n=o.field)==null?void 0:n.fontSize)!=null?r:"md",a=JC.fontSizes[s];return i2({field:{...o.field,paddingInlineEnd:s2.reference,verticalAlign:"top"},stepper:{fontSize:Sr(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var QL={xs:Hc("xs"),sm:Hc("sm"),md:Hc("md"),lg:Hc("lg")},XL=WL({baseStyle:YL,sizes:QL,variants:Ee.variants,defaultProps:Ee.defaultProps}),Rb,JL={...(Rb=Ee.baseStyle)==null?void 0:Rb.field,textAlign:"center"},eM={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},Ab,$b,tM={outline:e=>{var t,n,r;return(r=(n=Ft((t=Ee.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=Ft((t=Ee.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=Ft((t=Ee.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:($b=(Ab=Ee.variants)==null?void 0:Ab.unstyled.field)!=null?$b:{}},nM={baseStyle:JL,sizes:eM,variants:tM,defaultProps:Ee.defaultProps},{defineMultiStyleConfig:rM,definePartsStyle:oM}=Ie(C3.keys),Gc=st("popper-bg"),iM=st("popper-arrow-bg"),jb=st("popper-arrow-shadow-color"),sM={zIndex:10},aM={[Gc.variable]:"colors.white",bg:Gc.reference,[iM.variable]:Gc.reference,[jb.variable]:"colors.gray.200",_dark:{[Gc.variable]:"colors.gray.700",[jb.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},lM={px:3,py:2,borderBottomWidth:"1px"},cM={px:3,py:2},uM={px:3,py:2,borderTopWidth:"1px"},dM={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},fM=oM({popper:sM,content:aM,header:lM,body:cM,footer:uM,closeButton:dM}),hM=rM({baseStyle:fM}),{definePartsStyle:Zm,defineMultiStyleConfig:pM}=Ie(m3.keys),ip=oe("drawer-bg"),sp=oe("drawer-box-shadow");function Mi(e){return Zm(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var mM={bg:"blackAlpha.600",zIndex:"overlay"},gM={display:"flex",zIndex:"modal",justifyContent:"center"},vM=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[ip.variable]:"colors.white",[sp.variable]:"shadows.lg",_dark:{[ip.variable]:"colors.gray.700",[sp.variable]:"shadows.dark-lg"},bg:ip.reference,boxShadow:sp.reference}},yM={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},bM={position:"absolute",top:"2",insetEnd:"3"},wM={px:"6",py:"2",flex:"1",overflow:"auto"},xM={px:"6",py:"4"},SM=Zm(e=>({overlay:mM,dialogContainer:gM,dialog:Ft(vM,e),header:yM,closeButton:bM,body:wM,footer:xM})),kM={xs:Mi("xs"),sm:Mi("md"),md:Mi("lg"),lg:Mi("2xl"),xl:Mi("4xl"),full:Mi("full")},CM=pM({baseStyle:SM,sizes:kM,defaultProps:{size:"xs"}}),{definePartsStyle:EM,defineMultiStyleConfig:TM}=Ie(g3.keys),PM={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},_M={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},RM={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},AM=EM({preview:PM,input:_M,textarea:RM}),$M=TM({baseStyle:AM}),{definePartsStyle:jM,defineMultiStyleConfig:OM}=Ie(v3.keys),Es=oe("form-control-color"),IM={marginStart:"1",[Es.variable]:"colors.red.500",_dark:{[Es.variable]:"colors.red.300"},color:Es.reference},LM={mt:"2",[Es.variable]:"colors.gray.600",_dark:{[Es.variable]:"colors.whiteAlpha.600"},color:Es.reference,lineHeight:"normal",fontSize:"sm"},MM=jM({container:{width:"100%",position:"relative"},requiredIndicator:IM,helperText:LM}),BM=OM({baseStyle:MM}),{definePartsStyle:zM,defineMultiStyleConfig:FM}=Ie(y3.keys),Ts=oe("form-error-color"),NM={[Ts.variable]:"colors.red.500",_dark:{[Ts.variable]:"colors.red.300"},color:Ts.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},DM={marginEnd:"0.5em",[Ts.variable]:"colors.red.500",_dark:{[Ts.variable]:"colors.red.300"},color:Ts.reference},VM=zM({text:NM,icon:DM}),UM=FM({baseStyle:VM}),WM={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},HM={baseStyle:WM},GM={fontFamily:"heading",fontWeight:"bold"},qM={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},KM={baseStyle:GM,sizes:qM,defaultProps:{size:"xl"}},{defineMultiStyleConfig:ZM,definePartsStyle:YM}=Ie(h3.keys),ap=oe("breadcrumb-link-decor"),QM={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:ap.reference,[ap.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[ap.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},XM=YM({link:QM}),JM=ZM({baseStyle:XM}),eB={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},a2=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:re("gray.800","whiteAlpha.900")(e),_hover:{bg:re("gray.100","whiteAlpha.200")(e)},_active:{bg:re("gray.200","whiteAlpha.300")(e)}};const r=Ds(`${t}.200`,.12)(n),o=Ds(`${t}.200`,.24)(n);return{color:re(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:re(`${t}.50`,r)(e)},_active:{bg:re(`${t}.100`,o)(e)}}},tB=e=>{const{colorScheme:t}=e,n=re("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Ft(a2,e)}},nB={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},rB=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=re("gray.100","whiteAlpha.200")(e);return{bg:l,color:re("gray.800","whiteAlpha.900")(e),_hover:{bg:re("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:re("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:o="white",hoverBg:i=`${n}.600`,activeBg:s=`${n}.700`}=(t=nB[n])!=null?t:{},a=re(r,`${n}.200`)(e);return{bg:a,color:re(o,"gray.800")(e),_hover:{bg:re(i,`${n}.300`)(e),_disabled:{bg:a}},_active:{bg:re(s,`${n}.400`)(e)}}},oB=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:re(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:re(`${t}.700`,`${t}.500`)(e)}}},iB={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},sB={ghost:a2,outline:tB,solid:rB,link:oB,unstyled:iB},aB={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},lB={baseStyle:eB,variants:sB,sizes:aB,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:ri,defineMultiStyleConfig:cB}=Ie(I3.keys),dd=oe("card-bg"),Ar=oe("card-padding"),l2=oe("card-shadow"),Pu=oe("card-radius"),c2=oe("card-border-width","0"),u2=oe("card-border-color"),uB=ri({container:{[dd.variable]:"colors.chakra-body-bg",backgroundColor:dd.reference,boxShadow:l2.reference,borderRadius:Pu.reference,color:"chakra-body-text",borderWidth:c2.reference,borderColor:u2.reference},body:{padding:Ar.reference,flex:"1 1 0%"},header:{padding:Ar.reference},footer:{padding:Ar.reference}}),dB={sm:ri({container:{[Pu.variable]:"radii.base",[Ar.variable]:"space.3"}}),md:ri({container:{[Pu.variable]:"radii.md",[Ar.variable]:"space.5"}}),lg:ri({container:{[Pu.variable]:"radii.xl",[Ar.variable]:"space.7"}})},fB={elevated:ri({container:{[l2.variable]:"shadows.base",_dark:{[dd.variable]:"colors.gray.700"}}}),outline:ri({container:{[c2.variable]:"1px",[u2.variable]:"colors.chakra-border-color"}}),filled:ri({container:{[dd.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Ar.variable]:0},header:{[Ar.variable]:0},footer:{[Ar.variable]:0}}},hB=cB({baseStyle:uB,variants:fB,sizes:dB,defaultProps:{variant:"elevated",size:"md"}}),Ja=st("close-button-size"),Ea=st("close-button-bg"),pB={w:[Ja.reference],h:[Ja.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[Ea.variable]:"colors.blackAlpha.100",_dark:{[Ea.variable]:"colors.whiteAlpha.100"}},_active:{[Ea.variable]:"colors.blackAlpha.200",_dark:{[Ea.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:Ea.reference},mB={lg:{[Ja.variable]:"sizes.10",fontSize:"md"},md:{[Ja.variable]:"sizes.8",fontSize:"xs"},sm:{[Ja.variable]:"sizes.6",fontSize:"2xs"}},gB={baseStyle:pB,sizes:mB,defaultProps:{size:"md"}},{variants:vB,defaultProps:yB}=Qa,bB={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Xe.bg.reference,color:Xe.color.reference,boxShadow:Xe.shadow.reference},wB={baseStyle:bB,variants:vB,defaultProps:yB},xB={w:"100%",mx:"auto",maxW:"prose",px:"4"},SB={baseStyle:xB},kB={opacity:.6,borderColor:"inherit"},CB={borderStyle:"solid"},EB={borderStyle:"dashed"},TB={solid:CB,dashed:EB},PB={baseStyle:kB,variants:TB,defaultProps:{variant:"solid"}},{definePartsStyle:_B,defineMultiStyleConfig:RB}=Ie(u3.keys),AB={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},$B={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},jB={pt:"2",px:"4",pb:"5"},OB={fontSize:"1.25em"},IB=_B({container:AB,button:$B,panel:jB,icon:OB}),LB=RB({baseStyle:IB}),{definePartsStyle:Jl,defineMultiStyleConfig:MB}=Ie(d3.keys),cn=oe("alert-fg"),Br=oe("alert-bg"),BB=Jl({container:{bg:Br.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:cn.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:cn.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function ey(e){const{theme:t,colorScheme:n}=e,r=Ds(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var zB=Jl(e=>{const{colorScheme:t}=e,n=ey(e);return{container:{[cn.variable]:`colors.${t}.500`,[Br.variable]:n.light,_dark:{[cn.variable]:`colors.${t}.200`,[Br.variable]:n.dark}}}}),FB=Jl(e=>{const{colorScheme:t}=e,n=ey(e);return{container:{[cn.variable]:`colors.${t}.500`,[Br.variable]:n.light,_dark:{[cn.variable]:`colors.${t}.200`,[Br.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:cn.reference}}}),NB=Jl(e=>{const{colorScheme:t}=e,n=ey(e);return{container:{[cn.variable]:`colors.${t}.500`,[Br.variable]:n.light,_dark:{[cn.variable]:`colors.${t}.200`,[Br.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:cn.reference}}}),DB=Jl(e=>{const{colorScheme:t}=e;return{container:{[cn.variable]:"colors.white",[Br.variable]:`colors.${t}.500`,_dark:{[cn.variable]:"colors.gray.900",[Br.variable]:`colors.${t}.200`},color:cn.reference}}}),VB={subtle:zB,"left-accent":FB,"top-accent":NB,solid:DB},UB=MB({baseStyle:BB,variants:VB,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:d2,defineMultiStyleConfig:WB}=Ie(f3.keys),Ps=oe("avatar-border-color"),el=oe("avatar-bg"),Ol=oe("avatar-font-size"),Vs=oe("avatar-size"),HB={borderRadius:"full",border:"0.2em solid",borderColor:Ps.reference,[Ps.variable]:"white",_dark:{[Ps.variable]:"colors.gray.800"}},GB={bg:el.reference,fontSize:Ol.reference,width:Vs.reference,height:Vs.reference,lineHeight:"1",[el.variable]:"colors.gray.200",_dark:{[el.variable]:"colors.whiteAlpha.400"}},qB=e=>{const{name:t,theme:n}=e,r=t?e4({string:t}):"colors.gray.400",o=X3(r)(n);let i="white";return o||(i="gray.800"),{bg:el.reference,fontSize:Ol.reference,color:i,borderColor:Ps.reference,verticalAlign:"top",width:Vs.reference,height:Vs.reference,"&:not([data-loaded])":{[el.variable]:r},[Ps.variable]:"colors.white",_dark:{[Ps.variable]:"colors.gray.800"}}},KB={fontSize:Ol.reference,lineHeight:"1"},ZB=d2(e=>({badge:Ft(HB,e),excessLabel:Ft(GB,e),container:Ft(qB,e),label:KB}));function Kr(e){const t=e!=="100%"?t2[e]:void 0;return d2({container:{[Vs.variable]:t??e,[Ol.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[Vs.variable]:t??e,[Ol.variable]:`calc(${t??e} / 2.5)`}})}var YB={"2xs":Kr(4),xs:Kr(6),sm:Kr(8),md:Kr(12),lg:Kr(16),xl:Kr(24),"2xl":Kr(32),full:Kr("100%")},QB=WB({baseStyle:ZB,sizes:YB,defaultProps:{size:"md"}}),XB={Accordion:LB,Alert:UB,Avatar:QB,Badge:Qa,Breadcrumb:JM,Button:lB,Checkbox:ud,CloseButton:gB,Code:wB,Container:SB,Divider:PB,Drawer:CM,Editable:$M,Form:BM,FormError:UM,FormLabel:HM,Heading:KM,Input:Ee,Kbd:pL,Link:gL,List:xL,Menu:jL,Modal:UL,NumberInput:XL,PinInput:nM,Popover:hM,Progress:wI,Radio:OI,Select:NI,Skeleton:VI,SkipLink:WI,Slider:tL,Spinner:oL,Stat:fL,Switch:g4,Table:k4,Tabs:z4,Tag:Q4,Textarea:cI,Tooltip:fI,Card:hB,Stepper:c3},JB={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},ez={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},tz="ltr",nz={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},rz={semanticTokens:JB,direction:tz,...s3,components:XB,styles:ez,config:nz};function oz(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var iz=oz();function sz(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function az(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},f2=lz(az);function h2(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];t(o,r,e)&&(n[r]=o)}),n}var p2=e=>h2(e,t=>t!=null);function cz(e){return typeof e=="function"}function m2(e,...t){return cz(e)?e(...t):e}function uz(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var dz=typeof Element<"u",fz=typeof Map=="function",hz=typeof Set=="function",pz=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function _u(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!_u(e[r],t[r]))return!1;return!0}var i;if(fz&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!_u(r.value[1],t.get(r.value[0])))return!1;return!0}if(hz&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(pz&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(dz&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!_u(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var mz=function(t,n){try{return _u(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const gz=Ze(mz);function g2(e,t={}){var n;const{styleConfig:r,...o}=t,{theme:i,colorMode:s}=HC(),a=e?f2(i,`components.${e}`):void 0,l=r||a,c=ar({theme:i,colorMode:s},(n=l==null?void 0:l.defaultProps)!=null?n:{},p2(sz(o,["children"]))),u=v.useRef({});if(l){const f=LO(l)(c);gz(u.current,f)||(u.current=f)}return u.current}function qn(e,t={}){return g2(e,t)}function Dr(e,t={}){return g2(e,t)}var vz=new Set([...kO,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),yz=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function bz(e){return yz.has(e)||!vz.has(e)}function wz(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}function xz(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var Sz=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,kz=ES(function(e){return Sz.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Cz=kz,Ez=function(t){return t!=="theme"},Ob=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Cz:Ez},Ib=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},Tz=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return $S(n,r,o),YA(function(){return jS(n,r,o)}),null},Pz=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,s;n!==void 0&&(i=n.label,s=n.target);var a=Ib(t,n,r),l=a||Ob(o),c=!l("as");return function(){var u=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;pt=>{const{theme:n,css:r,__css:o,sx:i,...s}=t,a=h2(s,(d,f)=>EO(f)),l=m2(e,t),c=wz({},o,l,p2(a),i),u=XC(c)(t.theme);return r?[u,r]:u};function lp(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=bz);const o=Az({baseStyle:n}),i=Rz(e,r)(o);return li.forwardRef(function(l,c){const{colorMode:u,forced:d}=Gv();return li.createElement(i,{ref:c,"data-theme":d?u:void 0,...l})})}function $z(){const e=new Map;return new Proxy(lp,{apply(t,n,r){return lp(...r)},get(t,n){return e.has(n)||e.set(n,lp(n)),e.get(n)}})}var Y=$z();function ee(e){return v.forwardRef(e)}function v2(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=v.createContext(void 0);o.displayName=r;function i(){var s;const a=v.useContext(o);if(!a&&t){const l=new Error(n);throw l.name="ContextError",(s=Error.captureStackTrace)==null||s.call(Error,l,i),l}return a}return[o.Provider,i,o]}function jz(e){const{cssVarsRoot:t,theme:n,children:r}=e,o=v.useMemo(()=>SO(n),[n]);return h.jsxs(JA,{theme:o,children:[h.jsx(Oz,{root:t}),r]})}function Oz({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return h.jsx(wf,{styles:n=>({[t]:n.__cssVars})})}v2({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function Iz(e){return v2({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function Lz(){const{colorMode:e}=Gv();return h.jsx(wf,{styles:t=>{const n=f2(t,"styles.global"),r=m2(n,{theme:t,colorMode:e});return r?XC(r)(t):void 0}})}var y2=v.createContext({getDocument(){return document},getWindow(){return window}});y2.displayName="EnvironmentContext";function b2(e){const{children:t,environment:n,disabled:r}=e,o=v.useRef(null),i=v.useMemo(()=>n||{getDocument:()=>{var a,l;return(l=(a=o.current)==null?void 0:a.ownerDocument)!=null?l:document},getWindow:()=>{var a,l;return(l=(a=o.current)==null?void 0:a.ownerDocument.defaultView)!=null?l:window}},[n]),s=!r||!n;return h.jsxs(y2.Provider,{value:i,children:[t,s&&h.jsx("span",{id:"__chakra_env",hidden:!0,ref:o})]})}b2.displayName="EnvironmentProvider";var Mz=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:o,resetCSS:i=!0,theme:s={},environment:a,cssVarsRoot:l,disableEnvironment:c,disableGlobalStyle:u}=e,d=h.jsx(b2,{environment:a,disabled:c,children:t});return h.jsx(jz,{theme:s,cssVarsRoot:l,children:h.jsxs(WC,{colorModeManager:n,options:s.config,children:[i?h.jsx(r$,{scope:o}):h.jsx(n$,{}),!u&&h.jsx(Lz,{}),r?h.jsx(FS,{zIndex:r,children:d}):d]})})},Bz=(e,t)=>e.find(n=>n.id===t);function Mb(e,t){const n=w2(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function w2(e,t){for(const[n,r]of Object.entries(e))if(Bz(r,t))return n}function zz(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Fz(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,o=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,i=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",s=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:o,right:i,left:s}}function oi(e,t=[]){const n=v.useRef(e);return v.useEffect(()=>{n.current=e}),v.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function Nz(e,t){const n=oi(e);v.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function Il(e,t){const n=v.useRef(!1),r=v.useRef(!1);v.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),v.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const x2=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Nf=v.createContext({}),ec=v.createContext(null),Df=typeof document<"u",hd=Df?v.useLayoutEffect:v.useEffect,S2=v.createContext({strict:!1});function Dz(e,t,n,r){const{visualElement:o}=v.useContext(Nf),i=v.useContext(S2),s=v.useContext(ec),a=v.useContext(x2).reducedMotion,l=v.useRef();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;return v.useInsertionEffect(()=>{c&&c.update(n,s)}),hd(()=>{c&&c.render()}),v.useEffect(()=>{c&&c.updateFeatures()}),(window.HandoffAppearAnimations?hd:v.useEffect)(()=>{c&&c.animationState&&c.animationState.animateChanges()}),c}function ds(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vz(e,t,n){return v.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ds(n)&&(n.current=r))},[t])}function Ll(e){return typeof e=="string"||Array.isArray(e)}function Vf(e){return typeof e=="object"&&typeof e.start=="function"}const ty=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ny=["initial",...ty];function Uf(e){return Vf(e.animate)||ny.some(t=>Ll(e[t]))}function k2(e){return!!(Uf(e)||e.variants)}function Uz(e,t){if(Uf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ll(n)?n:void 0,animate:Ll(r)?r:void 0}}return e.inherit!==!1?t:{}}function Wz(e){const{initial:t,animate:n}=Uz(e,v.useContext(Nf));return v.useMemo(()=>({initial:t,animate:n}),[Bb(t),Bb(n)])}function Bb(e){return Array.isArray(e)?e.join(" "):e}const zb={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"]},Ml={};for(const e in zb)Ml[e]={isEnabled:t=>zb[e].some(n=>!!t[n])};function Hz(e){for(const t in e)Ml[t]={...Ml[t],...e[t]}}const ry=v.createContext({}),C2=v.createContext({}),Gz=Symbol.for("motionComponentSymbol");function qz({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&Hz(e);function i(a,l){let c;const u={...v.useContext(x2),...a,layoutId:Kz(a)},{isStatic:d}=u,f=Wz(a),p=r(a,d);if(!d&&Df){f.visualElement=Dz(o,p,u,t);const g=v.useContext(C2),m=v.useContext(S2).strict;f.visualElement&&(c=f.visualElement.loadFeatures(u,m,e,g))}return v.createElement(Nf.Provider,{value:f},c&&f.visualElement?v.createElement(c,{visualElement:f.visualElement,...u}):null,n(o,a,Vz(p,f.visualElement,l),p,d,f.visualElement))}const s=v.forwardRef(i);return s[Gz]=o,s}function Kz({layoutId:e}){const t=v.useContext(ry).id;return t&&e!==void 0?t+"-"+e:e}function Zz(e){function t(r,o={}){return qz(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const Yz=["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 oy(e){return typeof e!="string"||e.includes("-")?!1:!!(Yz.indexOf(e)>-1||/[A-Z]/.test(e))}const pd={};function Qz(e){Object.assign(pd,e)}const tc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pi=new Set(tc);function E2(e,{layout:t,layoutId:n}){return Pi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!pd[e]||e==="opacity")}const en=e=>!!(e&&e.getVelocity),Xz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jz=tc.length;function eF(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let s=0;st=>typeof t=="string"&&t.startsWith(e),P2=T2("--"),Ym=T2("var(--"),tF=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,nF=(e,t)=>t&&typeof e=="number"?t.transform(e):e,So=(e,t,n)=>Math.min(Math.max(n,e),t),_i={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},tl={..._i,transform:e=>So(0,1,e)},qc={..._i,default:1},nl=e=>Math.round(e*1e5)/1e5,Wf=/(-)?([\d]*\.?[\d])+/g,_2=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,rF=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function nc(e){return typeof e=="string"}const rc=e=>({test:t=>nc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Qr=rc("deg"),fr=rc("%"),ie=rc("px"),oF=rc("vh"),iF=rc("vw"),Fb={...fr,parse:e=>fr.parse(e)/100,transform:e=>fr.transform(e*100)},Nb={..._i,transform:Math.round},R2={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,radius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,size:ie,top:ie,right:ie,bottom:ie,left:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,rotate:Qr,rotateX:Qr,rotateY:Qr,rotateZ:Qr,scale:qc,scaleX:qc,scaleY:qc,scaleZ:qc,skew:Qr,skewX:Qr,skewY:Qr,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:tl,originX:Fb,originY:Fb,originZ:ie,zIndex:Nb,fillOpacity:tl,strokeOpacity:tl,numOctaves:Nb};function iy(e,t,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const f=t[d];if(P2(d)){i[d]=f;continue}const p=R2[d],g=nF(f,p);if(Pi.has(d)){if(l=!0,s[d]=g,!u)continue;f!==(p.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=g):o[d]=g}if(t.transform||(l||r?o.transform=eF(e.transform,n,u,r):o.transform&&(o.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:p=0}=a;o.transformOrigin=`${d} ${f} ${p}`}}const sy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function A2(e,t,n){for(const r in t)!en(t[r])&&!E2(r,n)&&(e[r]=t[r])}function sF({transformTemplate:e},t,n){return v.useMemo(()=>{const r=sy();return iy(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function aF(e,t,n){const r=e.style||{},o={};return A2(o,r,e),Object.assign(o,sF(e,t,n)),e.transformValues?e.transformValues(o):o}function lF(e,t,n){const r={},o=aF(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const cF=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 md(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||cF.has(e)}let $2=e=>!md(e);function uF(e){e&&($2=t=>t.startsWith("on")?!md(t):e(t))}try{uF(require("@emotion/is-prop-valid").default)}catch{}function dF(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||($2(o)||n===!0&&md(o)||!t&&!md(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function Db(e,t,n){return typeof e=="string"?e:ie.transform(t+n*e)}function fF(e,t,n){const r=Db(t,e.x,e.width),o=Db(n,e.y,e.height);return`${r} ${o}`}const hF={offset:"stroke-dashoffset",array:"stroke-dasharray"},pF={offset:"strokeDashoffset",array:"strokeDasharray"};function mF(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?hF:pF;e[i.offset]=ie.transform(-r);const s=ie.transform(t),a=ie.transform(n);e[i.array]=`${s} ${a}`}function ay(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d,f){if(iy(e,c,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:g,dimensions:m}=e;p.transform&&(m&&(g.transform=p.transform),delete p.transform),m&&(o!==void 0||i!==void 0||g.transform)&&(g.transformOrigin=fF(m,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&mF(p,s,a,l,!1)}const j2=()=>({...sy(),attrs:{}}),ly=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gF(e,t,n,r){const o=v.useMemo(()=>{const i=j2();return ay(i,t,{enableHardwareAcceleration:!1},ly(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};A2(i,e.style,e),o.style={...i,...o.style}}return o}function vF(e=!1){return(n,r,o,{latestValues:i},s)=>{const l=(oy(n)?gF:lF)(r,i,s,n),u={...dF(r,typeof n=="string",e),...l,ref:o},{children:d}=r,f=v.useMemo(()=>en(d)?d.get():d,[d]);return v.createElement(n,{...u,children:f})}}const cy=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function O2(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const I2=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 L2(e,t,n,r){O2(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(I2.has(o)?o:cy(o),t.attrs[o])}function uy(e,t){const{style:n}=e,r={};for(const o in n)(en(n[o])||t.style&&en(t.style[o])||E2(o,e))&&(r[o]=n[o]);return r}function M2(e,t){const n=uy(e,t);for(const r in e)if(en(e[r])||en(t[r])){const o=tc.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function dy(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function B2(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const gd=e=>Array.isArray(e),yF=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),bF=e=>gd(e)?e[e.length-1]||0:e;function Ru(e){const t=en(e)?e.get():e;return yF(t)?t.toValue():t}function wF({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const s={latestValues:xF(r,o,i,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const z2=e=>(t,n)=>{const r=v.useContext(Nf),o=v.useContext(ec),i=()=>wF(e,t,r,o);return n?i():B2(i)};function xF(e,t,n,r){const o={},i=r(e,{});for(const f in i)o[f]=Ru(i[f]);let{initial:s,animate:a}=e;const l=Uf(e),c=k2(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;return d&&typeof d!="boolean"&&!Vf(d)&&(Array.isArray(d)?d:[d]).forEach(p=>{const g=dy(e,p);if(!g)return;const{transitionEnd:m,transition:w,...b}=g;for(const y in b){let x=b[y];if(Array.isArray(x)){const S=u?x.length-1:0;x=x[S]}x!==null&&(o[y]=x)}for(const y in m)o[y]=m[y]}),o}const SF={useVisualState:z2({scrapeMotionValuesFromProps:M2,createRenderState:j2,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}ay(n,r,{enableHardwareAcceleration:!1},ly(t.tagName),e.transformTemplate),L2(t,n)}})},kF={useVisualState:z2({scrapeMotionValuesFromProps:uy,createRenderState:sy})};function CF(e,{forwardMotionProps:t=!1},n,r){return{...oy(e)?SF:kF,preloadedFeatures:n,useRender:vF(t),createVisualElement:r,Component:e}}function Pr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const F2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Hf(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const EF=e=>t=>F2(t)&&e(t,Hf(t));function $r(e,t,n,r){return Pr(e,t,EF(n),r)}const TF=(e,t)=>n=>t(e(n)),go=(...e)=>e.reduce(TF);function N2(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Vb=N2("dragHorizontal"),Ub=N2("dragVertical");function D2(e){let t=!1;if(e==="y")t=Ub();else if(e==="x")t=Vb();else{const n=Vb(),r=Ub();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function V2(){const e=D2(!0);return e?(e(),!1):!0}class Ro{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Ke=e=>e;function PF(e){let t=[],n=[],r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&o,f=d?t:n;return c&&s.add(l),f.indexOf(l)===-1&&(f.push(l),d&&o&&(r=t.length)),l},cancel:l=>{const c=n.indexOf(l);c!==-1&&n.splice(c,1),s.delete(l)},process:l=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let c=0;c(d[f]=PF(()=>n=!0),d),{}),s=d=>i[d].process(o),a=d=>{n=!1,o.delta=r?1e3/60:Math.max(Math.min(d-o.timestamp,_F),1),o.timestamp=d,o.isProcessing=!0,Kc.forEach(s),o.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,o.isProcessing||e(a)};return{schedule:Kc.reduce((d,f)=>{const p=i[f];return d[f]=(g,m=!1,w=!1)=>(n||l(),p.schedule(g,m,w)),d},{}),cancel:d=>Kc.forEach(f=>i[f].cancel(d)),state:o,steps:i}}const{schedule:Ve,cancel:zr,state:Pt,steps:cp}=RF(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ke,!0);function Wb(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(i,s)=>{if(i.type==="touch"||V2())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&Ve.update(()=>a[r](i,s))};return $r(e.current,n,o,{passive:!e.getProps()[r]})}class AF extends Ro{mount(){this.unmount=go(Wb(this.node,!0),Wb(this.node,!1))}unmount(){}}class $F extends Ro{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=go(Pr(this.node.current,"focus",()=>this.onFocus()),Pr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const U2=(e,t)=>t?e===t?!0:U2(e,t.parentElement):!1;function up(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Hf(n))}class jF extends Ro{constructor(){super(...arguments),this.removeStartListeners=Ke,this.removeEndListeners=Ke,this.removeAccessibleListeners=Ke,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),i=$r(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u}=this.node.getProps();Ve.update(()=>{U2(this.node.current,a.target)?c&&c(a,l):u&&u(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),s=$r(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=go(i,s),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const s=a=>{a.key!=="Enter"||!this.checkPressEnd()||up("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&Ve.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Pr(this.node.current,"keyup",s),up("down",(a,l)=>{this.startPress(a,l)})},n=Pr(this.node.current,"keydown",t),r=()=>{this.isPressing&&up("cancel",(i,s)=>this.cancelPress(i,s))},o=Pr(this.node.current,"blur",r);this.removeAccessibleListeners=go(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Ve.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!V2()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Ve.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=$r(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Pr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=go(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Qm=new WeakMap,dp=new WeakMap,OF=e=>{const t=Qm.get(e.target);t&&t(e)},IF=e=>{e.forEach(OF)};function LF({root:e,...t}){const n=e||document;dp.has(n)||dp.set(n,{});const r=dp.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(IF,{root:e,...t})),r[o]}function MF(e,t,n){const r=LF(t);return Qm.set(e,n),r.observe(e),()=>{Qm.delete(e),r.unobserve(e)}}const BF={some:0,all:1};class zF extends Ro{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:BF[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return MF(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(FF(t,n))&&this.startObserver()}unmount(){}}function FF({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const NF={inView:{Feature:zF},tap:{Feature:jF},focus:{Feature:$F},hover:{Feature:AF}};function W2(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function VF(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Gf(e,t,n){const r=e.getProps();return dy(r,t,n!==void 0?n:r.custom,DF(e),VF(e))}const UF="framerAppearId",WF="data-"+cy(UF);let HF=Ke,fy=Ke;const vo=e=>e*1e3,jr=e=>e/1e3,GF={current:!1},H2=e=>Array.isArray(e)&&typeof e[0]=="number";function G2(e){return!!(!e||typeof e=="string"&&q2[e]||H2(e)||Array.isArray(e)&&e.every(G2))}const za=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,q2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:za([0,.65,.55,1]),circOut:za([.55,0,1,.45]),backIn:za([.31,.01,.66,-.59]),backOut:za([.33,1.53,.69,.99])};function K2(e){if(e)return H2(e)?za(e):Array.isArray(e)?e.map(K2):q2[e]}function qF(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=K2(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"})}function KF(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const Z2=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ZF=1e-7,YF=12;function QF(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=Z2(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>ZF&&++aQF(i,0,1,e,n);return i=>i===0||i===1?i:Z2(o(i),t,r)}const XF=oc(.42,0,1,1),JF=oc(0,0,.58,1),Y2=oc(.42,0,.58,1),e6=e=>Array.isArray(e)&&typeof e[0]!="number",Q2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,X2=e=>t=>1-e(1-t),J2=e=>1-Math.sin(Math.acos(e)),hy=X2(J2),t6=Q2(hy),eE=oc(.33,1.53,.69,.99),py=X2(eE),n6=Q2(py),r6=e=>(e*=2)<1?.5*py(e):.5*(2-Math.pow(2,-10*(e-1))),o6={linear:Ke,easeIn:XF,easeInOut:Y2,easeOut:JF,circIn:J2,circInOut:t6,circOut:hy,backIn:py,backInOut:n6,backOut:eE,anticipate:r6},Hb=e=>{if(Array.isArray(e)){fy(e.length===4);const[t,n,r,o]=e;return oc(t,n,r,o)}else if(typeof e=="string")return o6[e];return e},my=(e,t)=>n=>!!(nc(n)&&rF.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),tE=(e,t,n)=>r=>{if(!nc(r))return r;const[o,i,s,a]=r.match(Wf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},i6=e=>So(0,255,e),fp={..._i,transform:e=>Math.round(i6(e))},Yo={test:my("rgb","red"),parse:tE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+fp.transform(e)+", "+fp.transform(t)+", "+fp.transform(n)+", "+nl(tl.transform(r))+")"};function s6(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Xm={test:my("#"),parse:s6,transform:Yo.transform},fs={test:my("hsl","hue"),parse:tE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+fr.transform(nl(t))+", "+fr.transform(nl(n))+", "+nl(tl.transform(r))+")"},It={test:e=>Yo.test(e)||Xm.test(e)||fs.test(e),parse:e=>Yo.test(e)?Yo.parse(e):fs.test(e)?fs.parse(e):Xm.parse(e),transform:e=>nc(e)?e:e.hasOwnProperty("red")?Yo.transform(e):fs.transform(e)},We=(e,t,n)=>-n*e+n*t+e;function hp(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function a6({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=hp(l,a,e+1/3),i=hp(l,a,e),s=hp(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}const pp=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},l6=[Xm,Yo,fs],c6=e=>l6.find(t=>t.test(e));function Gb(e){const t=c6(e);let n=t.parse(e);return t===fs&&(n=a6(n)),n}const nE=(e,t)=>{const n=Gb(e),r=Gb(t),o={...n};return i=>(o.red=pp(n.red,r.red,i),o.green=pp(n.green,r.green,i),o.blue=pp(n.blue,r.blue,i),o.alpha=We(n.alpha,r.alpha,i),Yo.transform(o))};function u6(e){var t,n;return isNaN(e)&&nc(e)&&(((t=e.match(Wf))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(_2))===null||n===void 0?void 0:n.length)||0)>0}const rE={regex:tF,countKey:"Vars",token:"${v}",parse:Ke},oE={regex:_2,countKey:"Colors",token:"${c}",parse:It.parse},iE={regex:Wf,countKey:"Numbers",token:"${n}",parse:_i.parse};function mp(e,{regex:t,countKey:n,token:r,parse:o}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(o)))}function vd(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&mp(n,rE),mp(n,oE),mp(n,iE),n}function sE(e){return vd(e).values}function aE(e){const{values:t,numColors:n,numVars:r,tokenised:o}=vd(e),i=t.length;return s=>{let a=o;for(let l=0;ltypeof e=="number"?0:e;function f6(e){const t=sE(e);return aE(e)(t.map(d6))}const ko={test:u6,parse:sE,createTransformer:aE,getAnimatableNone:f6},lE=(e,t)=>n=>`${n>0?t:e}`;function cE(e,t){return typeof e=="number"?n=>We(e,t,n):It.test(e)?nE(e,t):e.startsWith("var(")?lE(e,t):dE(e,t)}const uE=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,s)=>cE(i,t[s]));return i=>{for(let s=0;s{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=cE(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}},dE=(e,t)=>{const n=ko.createTransformer(t),r=vd(e),o=vd(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?go(uE(r.values,o.values),n):lE(e,t)},Bl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},qb=(e,t)=>n=>We(e,t,n);function p6(e){return typeof e=="number"?qb:typeof e=="string"?It.test(e)?nE:dE:Array.isArray(e)?uE:typeof e=="object"?h6:qb}function m6(e,t,n){const r=[],o=n||p6(e[0]),i=e.length-1;for(let s=0;st[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=m6(t,r,o),a=s.length,l=c=>{let u=0;if(a>1)for(;ul(So(e[0],e[i-1],c)):l}function g6(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Bl(0,t,r);e.push(We(n,1,o))}}function v6(e){const t=[0];return g6(t,e.length-1),t}function y6(e,t){return e.map(n=>n*t)}function b6(e,t){return e.map(()=>t||Y2).splice(0,e.length-1)}function yd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=e6(r)?r.map(Hb):Hb(r),i={done:!1,value:t[0]},s=y6(n&&n.length===t.length?n:v6(t),e),a=fE(s,t,{ease:Array.isArray(o)?o:b6(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}function hE(e,t){return t?e*(1e3/t):0}const w6=5;function pE(e,t,n){const r=Math.max(t-w6,0);return hE(n-e(r),t-r)}const gp=.001,x6=.01,Kb=10,S6=.05,k6=1;function C6({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;HF(e<=vo(Kb));let s=1-t;s=So(S6,k6,s),e=So(x6,Kb,jr(e)),s<1?(o=c=>{const u=c*s,d=u*e,f=u-n,p=Jm(c,s),g=Math.exp(-d);return gp-f/p*g},i=c=>{const d=c*s*e,f=d*n+n,p=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-d),m=Jm(Math.pow(c,2),s);return(-o(c)+gp>0?-1:1)*((f-p)*g)/m}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-gp+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=T6(o,i,a);if(e=vo(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const E6=12;function T6(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function R6(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Zb(e,_6)&&Zb(e,P6)){const n=C6(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function mE({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,velocity:u,duration:d,isResolvedFromDuration:f}=R6(r),p=u?-jr(u):0,g=l/(2*Math.sqrt(a*c)),m=i-o,w=jr(Math.sqrt(a/c)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let y;if(g<1){const x=Jm(w,g);y=S=>{const T=Math.exp(-g*w*S);return i-T*((p+g*w*m)/x*Math.sin(x*S)+m*Math.cos(x*S))}}else if(g===1)y=x=>i-Math.exp(-w*x)*(m+(p+w*m)*x);else{const x=w*Math.sqrt(g*g-1);y=S=>{const T=Math.exp(-g*w*S),E=Math.min(x*S,300);return i-T*((p+g*w*m)*Math.sinh(E)+x*m*Math.cosh(E))/x}}return{calculatedDuration:f&&d||null,next:x=>{const S=y(x);if(f)s.done=x>=d;else{let T=p;x!==0&&(g<1?T=pE(y,x,S):T=0);const E=Math.abs(T)<=n,C=Math.abs(i-S)<=t;s.done=E&&C}return s.value=s.done?i:S,s}}}function Yb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=_=>a!==void 0&&_l,g=_=>a===void 0?l:l===void 0||Math.abs(a-_)-m*Math.exp(-_/r),x=_=>b+y(_),S=_=>{const B=y(_),L=x(_);f.done=Math.abs(B)<=c,f.value=f.done?b:L};let T,E;const C=_=>{p(f.value)&&(T=_,E=mE({keyframes:[f.value,g(f.value)],velocity:pE(x,_,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:_=>{let B=!1;return!E&&T===void 0&&(B=!0,S(_),C(_)),T!==void 0&&_>T?E.next(_-T):(!B&&S(_),f)}}}const A6=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ve.update(t,!0),stop:()=>zr(t),now:()=>Pt.isProcessing?Pt.timestamp:performance.now()}},Qb=2e4;function Xb(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=Qb?1/0:t}const $6={decay:Yb,inertia:Yb,tween:yd,keyframes:yd,spring:mE};function bd({autoplay:e=!0,delay:t=0,driver:n=A6,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...f}){let p=1,g=!1,m,w;const b=()=>{w=new Promise(V=>{m=V})};b();let y;const x=$6[o]||yd;let S;x!==yd&&typeof r[0]!="number"&&(S=fE([0,100],r,{clamp:!1}),r=[0,100]);const T=x({...f,keyframes:r});let E;a==="mirror"&&(E=x({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let C="idle",_=null,B=null,L=null;T.calculatedDuration===null&&i&&(T.calculatedDuration=Xb(T));const{calculatedDuration:P}=T;let O=1/0,I=1/0;P!==null&&(O=P+s,I=O*(i+1)-s);let U=0;const $=V=>{if(B===null)return;p>0&&(B=Math.min(B,V)),p<0&&(B=Math.min(V-I/p,B)),_!==null?U=_:U=Math.round(V-B)*p;const q=U-t*(p>=0?1:-1),N=p>=0?q<0:q>I;U=Math.max(q,0),C==="finished"&&_===null&&(U=I);let H=U,Q=T;if(i){const he=U/O;let Ae=Math.floor(he),ze=he%1;!ze&&he>=1&&(ze=1),ze===1&&Ae--,Ae=Math.min(Ae,i+1);const ce=!!(Ae%2);ce&&(a==="reverse"?(ze=1-ze,s&&(ze-=s/O)):a==="mirror"&&(Q=E));let ve=So(0,1,ze);U>I&&(ve=a==="reverse"&&ce?1:0),H=ve*O}const te=N?{done:!1,value:r[0]}:Q.next(H);S&&(te.value=S(te.value));let{done:ne}=te;!N&&P!==null&&(ne=p>=0?U>=I:U<=0);const ue=_===null&&(C==="finished"||C==="running"&&ne);return d&&d(te.value),ue&&z(),te},j=()=>{y&&y.stop(),y=void 0},F=()=>{C="idle",j(),m(),b(),B=L=null},z=()=>{C="finished",u&&u(),j(),m()},D=()=>{if(g)return;y||(y=n($));const V=y.now();l&&l(),_!==null?B=V-_:(!B||C==="finished")&&(B=V),C==="finished"&&b(),L=B,_=null,C="running",y.start()};e&&D();const G={then(V,q){return w.then(V,q)},get time(){return jr(U)},set time(V){V=vo(V),U=V,_!==null||!y||p===0?_=V:B=y.now()-V/p},get duration(){const V=T.calculatedDuration===null?Xb(T):T.calculatedDuration;return jr(V)},get speed(){return p},set speed(V){V===p||!y||(p=V,G.time=jr(U))},get state(){return C},play:D,pause:()=>{C="paused",_=U},stop:()=>{g=!0,C!=="idle"&&(C="idle",c&&c(),F())},cancel:()=>{L!==null&&$(L),F()},complete:()=>{C="finished"},sample:V=>(B=0,$(V))};return G}function j6(e){let t;return()=>(t===void 0&&(t=e()),t)}const O6=j6(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),I6=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Zc=10,L6=2e4,M6=(e,t)=>t.type==="spring"||e==="backgroundColor"||!G2(t.ease);function B6(e,t,{onUpdate:n,onComplete:r,...o}){if(!(O6()&&I6.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let s=!1,a,l;const c=()=>{l=new Promise(y=>{a=y})};c();let{keyframes:u,duration:d=300,ease:f,times:p}=o;if(M6(t,o)){const y=bd({...o,repeat:0,delay:0});let x={done:!1,value:u[0]};const S=[];let T=0;for(;!x.done&&Tg.cancel(),w=()=>{Ve.update(m),a(),c()};return g.onfinish=()=>{e.set(KF(u,o)),r&&r(),w()},{then(y,x){return l.then(y,x)},attachTimeline(y){return g.timeline=y,g.onfinish=null,Ke},get time(){return jr(g.currentTime||0)},set time(y){g.currentTime=vo(y)},get speed(){return g.playbackRate},set speed(y){g.playbackRate=y},get duration(){return jr(d)},play:()=>{s||(g.play(),zr(m))},pause:()=>g.pause(),stop:()=>{if(s=!0,g.playState==="idle")return;const{currentTime:y}=g;if(y){const x=bd({...o,autoplay:!1});e.setWithVelocity(x.sample(y-Zc).value,x.sample(y).value,Zc)}w()},complete:()=>g.finish(),cancel:w}}function z6({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Ke,pause:Ke,stop:Ke,then:i=>(i(),Promise.resolve()),cancel:Ke,complete:Ke});return t?bd({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const F6={type:"spring",stiffness:500,damping:25,restSpeed:10},N6=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),D6={type:"keyframes",duration:.8},V6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},U6=(e,{keyframes:t})=>t.length>2?D6:Pi.has(e)?e.startsWith("scale")?N6(t[1]):F6:V6,eg=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ko.test(t)||t==="0")&&!t.startsWith("url(")),W6=new Set(["brightness","contrast","saturate","opacity"]);function H6(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Wf)||[];if(!r)return e;const o=n.replace(r,"");let i=W6.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const G6=/([a-z-]*)\(.*?\)/g,tg={...ko,getAnimatableNone:e=>{const t=e.match(G6);return t?t.map(H6).join(" "):e}},q6={...R2,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:tg,WebkitFilter:tg},gy=e=>q6[e];function gE(e,t){let n=gy(e);return n!==tg&&(n=ko),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const vE=e=>/^0[^.\s]+$/.test(e);function K6(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||vE(e)}function Z6(e,t,n,r){const o=eg(t,n);let i;Array.isArray(n)?i=[...n]:i=[null,n];const s=r.from!==void 0?r.from:e.get();let a;const l=[];for(let c=0;co=>{const i=yE(r,e)||{},s=i.delay||r.delay||0;let{elapsed:a=0}=r;a=a-vo(s);const l=Z6(t,e,n,i),c=l[0],u=l[l.length-1],d=eg(e,c),f=eg(e,u);let p={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-a,onUpdate:g=>{t.set(g),i.onUpdate&&i.onUpdate(g)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(Y6(i)||(p={...p,...U6(e,p)}),p.duration&&(p.duration=vo(p.duration)),p.repeatDelay&&(p.repeatDelay=vo(p.repeatDelay)),!d||!f||GF.current||i.type===!1)return z6(p);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const g=B6(t,e,p);if(g)return g}return bd(p)};function wd(e){return!!(en(e)&&e.add)}const Q6=e=>/^\-?\d*\.?\d+$/.test(e);function yy(e,t){e.indexOf(t)===-1&&e.push(t)}function by(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class wy{constructor(){this.subscriptions=[]}add(t){return yy(this.subscriptions,t),()=>by(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class J6{constructor(t,n={}){this.version="10.15.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:i,timestamp:s}=Pt;this.lastUpdated!==s&&(this.timeDelta=i,this.lastUpdated=s,Ve.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()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Ve.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=X6(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new wy);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ve.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?hE(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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 Us(e,t){return new J6(e,t)}const bE=e=>t=>t.test(e),eN={test:e=>e==="auto",parse:e=>e},wE=[_i,ie,fr,Qr,iF,oF,eN],Ta=e=>wE.find(bE(e)),tN=[...wE,It,ko],nN=e=>tN.find(bE(e));function rN(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Us(n))}function oN(e,t){const n=Gf(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const s in i){const a=bF(i[s]);rN(e,s,a)}}function iN(e,t,n){var r,o;const i=Object.keys(t).filter(a=>!e.hasValue(a)),s=i.length;if(s)for(let a=0;al.remove(d))),c.push(m)}return s&&Promise.all(c).then(()=>{s&&oN(e,s)}),c}function ng(e,t,n={}){const r=Gf(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(xE(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=o;return cN(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function cN(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(uN).forEach((c,u)=>{c.notify("AnimationStart",t),s.push(ng(c,t,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(s)}function uN(e,t){return e.sortNodePosition(t)}function dN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>ng(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=ng(e,t,n);else{const o=typeof t=="function"?Gf(e,t,n.custom):t;r=Promise.all(xE(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const fN=[...ty].reverse(),hN=ty.length;function pN(e){return t=>Promise.all(t.map(({animation:n,options:r})=>dN(e,n,r)))}function mN(e){let t=pN(e);const n=vN();let r=!0;const o=(l,c)=>{const u=Gf(e,c);if(u){const{transition:d,transitionEnd:f,...p}=u;l={...l,...p,...f}}return l};function i(l){t=l(e)}function s(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},f=[],p=new Set;let g={},m=1/0;for(let b=0;bm&&T;const L=Array.isArray(S)?S:[S];let P=L.reduce(o,{});E===!1&&(P={});const{prevResolvedValues:O={}}=x,I={...O,...P},U=$=>{B=!0,p.delete($),x.needsAnimating[$]=!0};for(const $ in I){const j=P[$],F=O[$];g.hasOwnProperty($)||(j!==F?gd(j)&&gd(F)?!W2(j,F)||_?U($):x.protectedKeys[$]=!0:j!==void 0?U($):p.add($):j!==void 0&&p.has($)?U($):x.protectedKeys[$]=!0)}x.prevProp=S,x.prevResolvedValues=P,x.isActive&&(g={...g,...P}),r&&e.blockInitialAnimation&&(B=!1),B&&!C&&f.push(...L.map($=>({animation:$,options:{type:y,...l}})))}if(p.size){const b={};p.forEach(y=>{const x=e.getBaseTarget(y);x!==void 0&&(b[y]=x)}),f.push({animation:b})}let w=!!f.length;return r&&u.initial===!1&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(l,c)}),n[l].isActive=c;const f=s(u,l);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n}}function gN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!W2(t,e):!1}function Mo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vN(){return{animate:Mo(!0),whileInView:Mo(),whileHover:Mo(),whileTap:Mo(),whileDrag:Mo(),whileFocus:Mo(),exit:Mo()}}class yN extends Ro{constructor(t){super(t),t.animationState||(t.animationState=mN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Vf(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let bN=0;class wN extends Ro{constructor(){super(...arguments),this.id=bN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const i=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xN={animation:{Feature:yN},exit:{Feature:wN}},Jb=(e,t)=>Math.abs(e-t);function SN(e,t){const n=Jb(e.x,t.x),r=Jb(e.y,t.y);return Math.sqrt(n**2+r**2)}class SE{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=yp(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,d=SN(c.offset,{x:0,y:0})>=3;if(!u&&!d)return;const{point:f}=c,{timestamp:p}=Pt;this.history.push({...f,timestamp:p});const{onStart:g,onMove:m}=this.handlers;u||(g&&g(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,u)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=vp(u,this.transformPagePoint),Ve.update(this.updatePoint,!0)},this.handlePointerUp=(c,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,p=yp(c.type==="pointercancel"?this.lastMoveEventInfo:vp(u,this.transformPagePoint),this.history);this.startEvent&&d&&d(c,p),f&&f(c,p)},!F2(t))return;this.handlers=n,this.transformPagePoint=r;const o=Hf(t),i=vp(o,this.transformPagePoint),{point:s}=i,{timestamp:a}=Pt;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=n;l&&l(t,yp(i,this.history)),this.removeListeners=go($r(window,"pointermove",this.handlePointerMove),$r(window,"pointerup",this.handlePointerUp),$r(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zr(this.updatePoint)}}function vp(e,t){return t?{point:t(e.point)}:e}function ew(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yp({point:e},t){return{point:e,delta:ew(e,kE(t)),offset:ew(e,kN(t)),velocity:CN(t,.1)}}function kN(e){return e[0]}function kE(e){return e[e.length-1]}function CN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=kE(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>vo(t)));)n--;if(!r)return{x:0,y:0};const i=jr(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function dn(e){return e.max-e.min}function rg(e,t=0,n=.01){return Math.abs(e-t)<=n}function tw(e,t,n,r=.5){e.origin=r,e.originPoint=We(t.min,t.max,e.origin),e.scale=dn(n)/dn(t),(rg(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=We(n.min,n.max,e.origin)-e.originPoint,(rg(e.translate)||isNaN(e.translate))&&(e.translate=0)}function rl(e,t,n,r){tw(e.x,t.x,n.x,r?r.originX:void 0),tw(e.y,t.y,n.y,r?r.originY:void 0)}function nw(e,t,n){e.min=n.min+t.min,e.max=e.min+dn(t)}function EN(e,t,n){nw(e.x,t.x,n.x),nw(e.y,t.y,n.y)}function rw(e,t,n){e.min=t.min-n.min,e.max=e.min+dn(t)}function ol(e,t,n){rw(e.x,t.x,n.x),rw(e.y,t.y,n.y)}function TN(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?We(n,e,r.max):Math.min(e,n)),e}function ow(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function PN(e,{top:t,left:n,bottom:r,right:o}){return{x:ow(e.x,n,o),y:ow(e.y,t,r)}}function iw(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Bl(t.min,t.max-r,e.min):r>o&&(n=Bl(e.min,e.max-o,t.min)),So(0,1,n)}function AN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const og=.35;function $N(e=og){return e===!1?e=0:e===!0&&(e=og),{x:sw(e,"left","right"),y:sw(e,"top","bottom")}}function sw(e,t,n){return{min:aw(e,t),max:aw(e,n)}}function aw(e,t){return typeof e=="number"?e:e[t]||0}const lw=()=>({translate:0,scale:1,origin:0,originPoint:0}),hs=()=>({x:lw(),y:lw()}),cw=()=>({min:0,max:0}),Je=()=>({x:cw(),y:cw()});function Jn(e){return[e("x"),e("y")]}function CE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function jN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ON(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function bp(e){return e===void 0||e===1}function ig({scale:e,scaleX:t,scaleY:n}){return!bp(e)||!bp(t)||!bp(n)}function Fo(e){return ig(e)||EE(e)||e.z||e.rotate||e.rotateX||e.rotateY}function EE(e){return uw(e.x)||uw(e.y)}function uw(e){return e&&e!=="0%"}function xd(e,t,n){const r=e-n,o=t*r;return n+o}function dw(e,t,n,r,o){return o!==void 0&&(e=xd(e,o,r)),xd(e,n,r)+t}function sg(e,t=0,n=1,r,o){e.min=dw(e.min,t,n,r,o),e.max=dw(e.max,t,n,r,o)}function TE(e,{x:t,y:n}){sg(e.x,t.translate,t.scale,t.originPoint),sg(e.y,n.translate,n.scale,n.originPoint)}function IN(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function eo(e,t){e.min=e.min+t,e.max=e.max+t}function hw(e,t,[n,r,o]){const i=t[o]!==void 0?t[o]:.5,s=We(e.min,e.max,i);sg(e,t[n],t[r],s,t.scale)}const LN=["x","scaleX","originX"],MN=["y","scaleY","originY"];function ps(e,t){hw(e.x,t,LN),hw(e.y,t,MN)}function PE(e,t){return CE(ON(e.getBoundingClientRect(),t))}function BN(e,t,n){const r=PE(e,n),{scroll:o}=t;return o&&(eo(r.x,o.offset.x),eo(r.y,o.offset.y)),r}const zN=new WeakMap;class FN{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Je(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=l=>{this.stopAnimation(),n&&this.snapToCursor(Hf(l,"page").point)},i=(l,c)=>{const{drag:u,dragPropagation:d,onDragStart:f}=this.getProps();if(u&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=D2(u),!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),Jn(g=>{let m=this.getAxisMotionValue(g).get()||0;if(fr.test(m)){const{projection:w}=this.visualElement;if(w&&w.layout){const b=w.layout.layoutBox[g];b&&(m=dn(b)*(parseFloat(m)/100))}}this.originPoint[g]=m}),f&&Ve.update(()=>f(l,c),!1,!0);const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},s=(l,c)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:f,onDrag:p}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:g}=c;if(d&&this.currentDirection===null){this.currentDirection=NN(g),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",c.point,g),this.updateAxis("y",c.point,g),this.visualElement.render(),p&&p(l,c)},a=(l,c)=>this.stop(l,c);this.panSession=new SE(t,{onSessionStart:o,onStart:i,onMove:s,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Ve.update(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Yc(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=TN(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&ds(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=PN(r.layoutBox,t):this.constraints=!1,this.elastic=$N(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Jn(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=AN(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ds(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=BN(r,o.root,this.visualElement.getTransformPagePoint());let s=_N(o.layout.layoutBox,i);if(n){const a=n(jN(s));this.hasMutatedConstraints=!!a,a&&(s=CE(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Jn(u=>{if(!Yc(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=o?200:1e6,p=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(vy(t,r,0,n))}stopAnimation(){Jn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Jn(n=>{const{drag:r}=this.getProps();if(!Yc(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-We(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ds(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Jn(s=>{const a=this.getAxisMotionValue(s);if(a){const l=a.get();o[s]=RN({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Jn(s=>{if(!Yc(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(We(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;zN.set(this.visualElement,this);const t=this.visualElement.current,n=$r(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();ds(l)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const s=Pr(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Jn(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=og,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Yc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function NN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class DN extends Ro{constructor(t){super(t),this.removeGroupControls=Ke,this.removeListeners=Ke,this.controls=new FN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ke}unmount(){this.removeGroupControls(),this.removeListeners()}}const pw=e=>(t,n)=>{e&&Ve.update(()=>e(t,n))};class VN extends Ro{constructor(){super(...arguments),this.removePointerDownListener=Ke}onPointerDown(t){this.session=new SE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:pw(t),onStart:pw(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ve.update(()=>o(i,s))}}}mount(){this.removePointerDownListener=$r(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function _E(){const e=v.useContext(ec);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=v.useId();return v.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}function UN(){return WN(v.useContext(ec))}function WN(e){return e===null?!0:e.isPresent}const Au={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function mw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Pa={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ie.test(e))e=parseFloat(e);else return e;const n=mw(e,t.target.x),r=mw(e,t.target.y);return`${n}% ${r}%`}},HN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=ko.parse(e);if(o.length>5)return r;const i=ko.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=We(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}};class GN extends li.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;Qz(qN),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Au.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,s=r.projection;return s&&(s.isPresent=i,o||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ve.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function RE(e){const[t,n]=_E(),r=v.useContext(ry);return li.createElement(GN,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(C2),isPresent:t,safeToRemove:n})}const qN={borderRadius:{...Pa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pa,borderTopRightRadius:Pa,borderBottomLeftRadius:Pa,borderBottomRightRadius:Pa,boxShadow:HN},AE=["TopLeft","TopRight","BottomLeft","BottomRight"],KN=AE.length,gw=e=>typeof e=="string"?parseFloat(e):e,vw=e=>typeof e=="number"||ie.test(e);function ZN(e,t,n,r,o,i){o?(e.opacity=We(0,n.opacity!==void 0?n.opacity:1,YN(r)),e.opacityExit=We(t.opacity!==void 0?t.opacity:1,0,QN(r))):i&&(e.opacity=We(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;srt?1:n(Bl(e,t,r))}function bw(e,t){e.min=t.min,e.max=t.max}function bn(e,t){bw(e.x,t.x),bw(e.y,t.y)}function ww(e,t,n,r,o){return e-=t,e=xd(e,1/n,r),o!==void 0&&(e=xd(e,1/o,r)),e}function XN(e,t=0,n=1,r=.5,o,i=e,s=e){if(fr.test(t)&&(t=parseFloat(t),t=We(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=We(i.min,i.max,r);e===i&&(a-=t),e.min=ww(e.min,t,n,a,o),e.max=ww(e.max,t,n,a,o)}function xw(e,t,[n,r,o],i,s){XN(e,t[n],t[r],t[o],t.scale,i,s)}const JN=["x","scaleX","originX"],e8=["y","scaleY","originY"];function Sw(e,t,n,r){xw(e.x,t,JN,n?n.x:void 0,r?r.x:void 0),xw(e.y,t,e8,n?n.y:void 0,r?r.y:void 0)}function kw(e){return e.translate===0&&e.scale===1}function jE(e){return kw(e.x)&&kw(e.y)}function t8(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function OE(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Cw(e){return dn(e.x)/dn(e.y)}class n8{constructor(){this.members=[]}add(t){yy(this.members,t),t.scheduleRender()}remove(t){if(by(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ew(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(r+=`rotate(${l}deg) `),c&&(r+=`rotateX(${c}deg) `),u&&(r+=`rotateY(${u}deg) `)}const s=e.x.scale*t.x,a=e.y.scale*t.y;return(s!==1||a!==1)&&(r+=`scale(${s}, ${a})`),r||"none"}const r8=(e,t)=>e.depth-t.depth;class o8{constructor(){this.children=[],this.isDirty=!1}add(t){yy(this.children,t),this.isDirty=!0}remove(t){by(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(r8),this.isDirty=!1,this.children.forEach(t)}}function i8(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(zr(r),e(i-t))};return Ve.read(r,!0),()=>zr(r)}function s8(e){window.MotionDebug&&window.MotionDebug.record(e)}function a8(e){return e instanceof SVGElement&&e.tagName!=="svg"}function l8(e,t,n){const r=en(e)?e:Us(e);return r.start(vy("",r,t,n)),r.animation}const Tw=["","X","Y","Z"],Pw=1e3;let c8=0;const No={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function IE({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t==null?void 0:t()){this.id=c8++,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=()=>{No.totalNodes=No.resolvedTargetDeltas=No.recalculatedProjection=0,this.nodes.forEach(f8),this.nodes.forEach(v8),this.nodes.forEach(y8),this.nodes.forEach(h8),s8(No)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=i8(f,250),Au.hasAnimatedSinceResize&&(Au.hasAnimatedSinceResize=!1,this.nodes.forEach(Rw))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||k8,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=u.getProps(),y=!this.targetLayout||!OE(this.targetLayout,g)||p,x=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const S={...yE(m,"layout"),onPlay:w,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else f||Rw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,zr(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(b8),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!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 u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(p8),this.sharedNodes.forEach(w8)}scheduleUpdateProjection(){Ve.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ve.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 T=S/1e3;Aw(d.x,s.x,T),Aw(d.y,s.y,T),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ol(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),x8(this.relativeTarget,this.relativeTargetOrigin,f,T),x&&t8(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Je()),bn(x,this.relativeTarget)),m&&(this.animationValues=u,ZN(u,c,this.latestValues,T,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(zr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ve.update(()=>{Au.hasAnimatedSinceResize=!0,this.currentAnimation=l8(0,Pw,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Pw),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&LE(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Je();const d=dn(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=dn(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}bn(a,l),ps(a,u),rl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new n8),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(_w),this.root.sharedNodes.clear()}}}function u8(e){e.updateLayout()}function d8(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,s=n.source!==e.layout.source;i==="size"?Jn(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=dn(f);f.min=r[d].min,f.max=f.min+p}):LE(i,n.layoutBox,r)&&Jn(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=dn(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=hs();rl(a,r,n.layoutBox);const l=hs();s?rl(l,e.applyTransform(o,!0),n.measuredBox):rl(l,r,n.layoutBox);const c=!jE(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=Je();ol(g,n.layoutBox,f.layoutBox);const m=Je();ol(m,r,p.layoutBox),OE(g,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function f8(e){No.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function h8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function p8(e){e.clearSnapshot()}function _w(e){e.clearMeasurements()}function m8(e){e.isLayoutDirty=!1}function g8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Rw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function v8(e){e.resolveTargetDelta()}function y8(e){e.calcProjection()}function b8(e){e.resetRotation()}function w8(e){e.removeLeadSnapshot()}function Aw(e,t,n){e.translate=We(t.translate,0,n),e.scale=We(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function $w(e,t,n,r){e.min=We(t.min,n.min,r),e.max=We(t.max,n.max,r)}function x8(e,t,n,r){$w(e.x,t.x,n.x,r),$w(e.y,t.y,n.y,r)}function S8(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const k8={duration:.45,ease:[.4,0,.1,1]},jw=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),Ow=jw("applewebkit/")&&!jw("chrome/")?Math.round:Ke;function Iw(e){e.min=Ow(e.min),e.max=Ow(e.max)}function C8(e){Iw(e.x),Iw(e.y)}function LE(e,t,n){return e==="position"||e==="preserve-aspect"&&!rg(Cw(t),Cw(n),.2)}const E8=IE({attachResizeListener:(e,t)=>Pr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),wp={current:void 0},ME=IE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!wp.current){const e=new E8({});e.mount(window),e.setOptions({layoutScroll:!0}),wp.current=e}return wp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),T8={pan:{Feature:VN},drag:{Feature:DN,ProjectionNode:ME,MeasureLayout:RE}},P8=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function _8(e){const t=P8.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function ag(e,t,n=1){const[r,o]=_8(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():Ym(o)?ag(o,t,n+1):o}function R8(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const i=o.get();if(!Ym(i))return;const s=ag(i,r);s&&o.set(s)});for(const o in t){const i=t[o];if(!Ym(i))continue;const s=ag(i,r);s&&(t[o]=s,n||(n={}),n[o]===void 0&&(n[o]=i))}return{target:t,transitionEnd:n}}const A8=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),BE=e=>A8.has(e),$8=e=>Object.keys(e).some(BE),Lw=e=>e===_i||e===ie,Mw=(e,t)=>parseFloat(e.split(", ")[t]),Bw=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return Mw(o[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?Mw(i[1],e):0}},j8=new Set(["x","y","z"]),O8=tc.filter(e=>!j8.has(e));function I8(e){const t=[];return O8.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Ws={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Bw(4,13),y:Bw(5,14)};Ws.translateX=Ws.x;Ws.translateY=Ws.y;const L8=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:s}=i,a={};s==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Ws[c](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Ws[c](l,i)}),e},M8=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(BE);let i=[],s=!1;const a=[];if(o.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ta(u);const f=t[l];let p;if(gd(f)){const g=f.length,m=f[0]===null?1:0;u=f[m],d=Ta(u);for(let w=m;w=0?window.pageYOffset:null,c=L8(t,e,a);return i.length&&i.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Df&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:r}}else return{target:t,transitionEnd:r}};function B8(e,t,n,r){return $8(t)?M8(e,t,n,r):{target:t,transitionEnd:r}}const z8=(e,t,n,r)=>{const o=R8(e,t,r);return t=o.target,r=o.transitionEnd,B8(e,t,n,r)},lg={current:null},zE={current:!1};function F8(){if(zE.current=!0,!!Df)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lg.current=e.matches;e.addListener(t),t()}else lg.current=!1}function N8(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],s=n[o];if(en(i))e.addValue(o,i),wd(r)&&r.add(o);else if(en(s))e.addValue(o,Us(i,{owner:e})),wd(r)&&r.remove(o);else if(s!==i)if(e.hasValue(o)){const a=e.getValue(o);!a.hasAnimated&&a.set(i)}else{const a=e.getStaticValue(o);e.addValue(o,Us(a!==void 0?a:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const zw=new WeakMap,FE=Object.keys(Ml),D8=FE.length,Fw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],V8=ny.length;class U8{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:i},s={}){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=()=>Ve.render(this.render,!1,!0);const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=s,this.isControllingVariants=Uf(n),this.isVariantNode=k2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const f=u[d];a[d]!==void 0&&en(f)&&(f.set(a[d],!1),wd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,zw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),zE.current||F8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:lg.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){zw.delete(this.current),this.projection&&this.projection.unmount(),zr(this.notifyUpdate),zr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Pi.has(t),o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ve.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,i){let s,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:i,layoutScroll:f,layoutRoot:p})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Je()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Us(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=dy(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!en(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new wy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class NE extends U8{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},i){let s=aN(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),s&&(s=o(s))),i){iN(this,r,s);const a=z8(this,r,s,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function W8(e){return window.getComputedStyle(e)}class H8 extends NE{readValueFromInstance(t,n){if(Pi.has(n)){const r=gy(n);return r&&r.default||0}else{const r=W8(t),o=(P2(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return PE(t,n)}build(t,n,r,o){iy(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return uy(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;en(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){O2(t,n,r,o)}}class G8 extends NE{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Pi.has(n)){const r=gy(n);return r&&r.default||0}return n=I2.has(n)?n:cy(n),t.getAttribute(n)}measureInstanceViewportBox(){return Je()}scrapeMotionValuesFromProps(t,n){return M2(t,n)}build(t,n,r,o){ay(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){L2(t,n,r,o)}mount(t){this.isSVGTag=ly(t.tagName),super.mount(t)}}const q8=(e,t)=>oy(e)?new G8(t,{enableHardwareAcceleration:!1}):new H8(t,{enableHardwareAcceleration:!0}),K8={layout:{ProjectionNode:ME,MeasureLayout:RE}},Z8={...xN,...NF,...T8,...K8},Ao=Zz((e,t)=>CF(e,t,Z8,q8));function DE(){const e=v.useRef(!1);return hd(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Y8(){const e=DE(),[t,n]=v.useState(0),r=v.useCallback(()=>{e.current&&n(t+1)},[t]);return[v.useCallback(()=>Ve.postRender(r),[r]),t]}class Q8 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function X8({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),o=v.useRef({width:0,height:0,top:0,left:0});return v.useInsertionEffect(()=>{const{width:i,height:s,top:a,left:l}=o.current;if(t||!r.current||!i||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` + [data-motion-pop-id="${n}"] { + position: absolute !important; + width: ${i}px !important; + height: ${s}px !important; + top: ${a}px !important; + left: ${l}px !important; + } + `),()=>{document.head.removeChild(c)}},[t]),v.createElement(Q8,{isPresent:t,childRef:r,sizeRef:o},v.cloneElement(e,{ref:r}))}const xp=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=B2(J8),l=v.useId(),c=v.useMemo(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;r&&r()},register:u=>(a.set(u,!1),()=>a.delete(u))}),i?void 0:[n]);return v.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),v.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=v.createElement(X8,{isPresent:n},e)),v.createElement(ec.Provider,{value:c},e)};function J8(){return new Map}function eD(e){return v.useEffect(()=>()=>e(),[])}const Wi=e=>e.key||"";function tD(e,t){e.forEach(n=>{const r=Wi(n);t.set(r,n)})}function nD(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const oa=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:s="sync"})=>{const a=v.useContext(ry).forceRender||Y8()[0],l=DE(),c=nD(e);let u=c;const d=v.useRef(new Map).current,f=v.useRef(u),p=v.useRef(new Map).current,g=v.useRef(!0);if(hd(()=>{g.current=!1,tD(c,p),f.current=u}),eD(()=>{g.current=!0,p.clear(),d.clear()}),g.current)return v.createElement(v.Fragment,null,u.map(y=>v.createElement(xp,{key:Wi(y),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:s},y)));u=[...u];const m=f.current.map(Wi),w=c.map(Wi),b=m.length;for(let y=0;y{if(w.indexOf(x)!==-1)return;const S=p.get(x);if(!S)return;const T=m.indexOf(x);let E=y;if(!E){const C=()=>{p.delete(x),d.delete(x);const _=f.current.findIndex(B=>B.key===x);if(f.current.splice(_,1),!d.size){if(f.current=c,l.current===!1)return;a(),r&&r()}};E=v.createElement(xp,{key:Wi(S),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:i,mode:s},S),d.set(x,E)}u.splice(T,0,E)}),u=u.map(y=>{const x=y.key;return d.has(x)?y:v.createElement(xp,{key:Wi(y),isPresent:!0,presenceAffectsLayout:i,mode:s},y)}),v.createElement(v.Fragment,null,d.size?u:u.map(y=>v.cloneElement(y)))};var rD={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},VE=v.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:o,requestClose:i=!1,position:s="bottom",duration:a=5e3,containerStyle:l,motionVariants:c=rD,toastSpacing:u="0.5rem"}=e,[d,f]=v.useState(a),p=UN();Il(()=>{p||r==null||r()},[p]),Il(()=>{f(a)},[a]);const g=()=>f(null),m=()=>f(a),w=()=>{p&&o()};v.useEffect(()=>{p&&i&&o()},[p,i,o]),Nz(w,d);const b=v.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:u,...l}),[l,u]),y=v.useMemo(()=>zz(s),[s]);return h.jsx(Ao.div,{layout:!0,className:"chakra-toast",variants:c,initial:"initial",animate:"animate",exit:"exit",onHoverStart:g,onHoverEnd:m,custom:{position:s},style:y,children:h.jsx(Y.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Dn(n,{id:t,onClose:w})})})});VE.displayName="ToastComponent";function oD(e,t){var n;const r=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=i==null?void 0:i[t])!=null?n:r}var Nw={path:h.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[h.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),h.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),h.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},je=ee((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:s,className:a,__css:l,...c}=e,u=ae("chakra-icon",a),d=qn("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...l,...d},p={ref:t,focusable:i,className:u,__css:f},g=r??Nw.viewBox;if(n&&typeof n!="string")return h.jsx(Y.svg,{as:n,...p,...c});const m=s??Nw.path;return h.jsx(Y.svg,{verticalAlign:"middle",viewBox:g,...p,...c,children:m})});je.displayName="Icon";function iD(e){return h.jsx(je,{viewBox:"0 0 24 24",...e,children:h.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function sD(e){return h.jsx(je,{viewBox:"0 0 24 24",...e,children:h.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function Dw(e){return h.jsx(je,{viewBox:"0 0 24 24",...e,children:h.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var aD=t$({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),xy=ee((e,t)=>{const n=qn("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:s="transparent",className:a,...l}=ft(e),c=ae("chakra-spinner",a),u={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:s,borderLeftColor:s,animation:`${aD} ${i} linear infinite`,...n};return h.jsx(Y.div,{ref:t,__css:u,className:c,...l,children:r&&h.jsx(Y.span,{srOnly:!0,children:r})})});xy.displayName="Spinner";var[lD,Sy]=nn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[cD,ky]=nn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),UE={info:{icon:sD,colorScheme:"blue"},warning:{icon:Dw,colorScheme:"orange"},success:{icon:iD,colorScheme:"green"},error:{icon:Dw,colorScheme:"red"},loading:{icon:xy,colorScheme:"blue"}};function uD(e){return UE[e].colorScheme}function dD(e){return UE[e].icon}var WE=ee(function(t,n){const r=ky(),{status:o}=Sy(),i={display:"inline",...r.description};return h.jsx(Y.div,{ref:n,"data-status":o,...t,className:ae("chakra-alert__desc",t.className),__css:i})});WE.displayName="AlertDescription";function HE(e){const{status:t}=Sy(),n=dD(t),r=ky(),o=t==="loading"?r.spinner:r.icon;return h.jsx(Y.span,{display:"inherit","data-status":t,...e,className:ae("chakra-alert__icon",e.className),__css:o,children:e.children||h.jsx(n,{h:"100%",w:"100%"})})}HE.displayName="AlertIcon";var GE=ee(function(t,n){const r=ky(),{status:o}=Sy();return h.jsx(Y.div,{ref:n,"data-status":o,...t,className:ae("chakra-alert__title",t.className),__css:r.title})});GE.displayName="AlertTitle";var qE=ee(function(t,n){var r;const{status:o="info",addRole:i=!0,...s}=ft(t),a=(r=t.colorScheme)!=null?r:uD(o),l=Dr("Alert",{...t,colorScheme:a}),c={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return h.jsx(lD,{value:{status:o},children:h.jsx(cD,{value:l,children:h.jsx(Y.div,{"data-status":o,role:i?"alert":void 0,ref:n,...s,className:ae("chakra-alert",t.className),__css:c})})})});qE.displayName="Alert";function fD(e){return h.jsx(je,{focusable:"false","aria-hidden":!0,...e,children:h.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var qf=ee(function(t,n){const r=qn("CloseButton",t),{children:o,isDisabled:i,__css:s,...a}=ft(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return h.jsx(Y.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...l,...r,...s},...a,children:o||h.jsx(fD,{width:"1em",height:"1em"})})});qf.displayName="CloseButton";var hD={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},ir=pD(hD);function pD(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(s=>({...s,[i]:s[i].filter(a=>a.id!=o)}))},notify:(o,i)=>{const s=mD(o,i),{position:a,id:l}=s;return r(c=>{var u,d;const p=a.includes("top")?[s,...(u=c[a])!=null?u:[]]:[...(d=c[a])!=null?d:[],s];return{...c,[a]:p}}),l},update:(o,i)=>{o&&r(s=>{const a={...s},{position:l,index:c}=Mb(a,o);return l&&c!==-1&&(a[l][c]={...a[l][c],...i,message:KE(i)}),a})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,c)=>(l[c]=i[c].map(u=>({...u,requestClose:!0})),l),{...i}))},close:o=>{r(i=>{const s=w2(i,o);return s?{...i,[s]:i[s].map(a=>a.id==o?{...a,requestClose:!0}:a)}:i})},isActive:o=>!!Mb(ir.getState(),o).position}}var Vw=0;function mD(e,t={}){var n,r;Vw+=1;const o=(n=t.id)!=null?n:Vw,i=(r=t.position)!=null?r:"bottom";return{id:o,message:e,position:i,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>ir.removeToast(String(o),i),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var gD=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:s,description:a,colorScheme:l,icon:c}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return h.jsxs(qE,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[h.jsx(HE,{children:c}),h.jsxs(Y.div,{flex:"1",maxWidth:"100%",children:[o&&h.jsx(GE,{id:u==null?void 0:u.title,children:o}),a&&h.jsx(WE,{id:u==null?void 0:u.description,display:"block",children:a})]}),i&&h.jsx(qf,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function KE(e={}){const{render:t,toastComponent:n=gD}=e;return o=>typeof t=="function"?t({...o,...e}):h.jsx(n,{...o,...e})}function vD(e,t){const n=o=>{var i;return{...t,...o,position:oD((i=o==null?void 0:o.position)!=null?i:t==null?void 0:t.position,e)}},r=o=>{const i=n(o),s=KE(i);return ir.notify(s,i)};return r.update=(o,i)=>{ir.update(o,n(i))},r.promise=(o,i)=>{const s=r({...i.loading,status:"loading",duration:null});o.then(a=>r.update(s,{status:"success",duration:5e3,...Dn(i.success,a)})).catch(a=>r.update(s,{status:"error",duration:5e3,...Dn(i.error,a)}))},r.closeAll=ir.closeAll,r.close=ir.close,r.isActive=ir.isActive,r}var[yD,bD]=nn({name:"ToastOptionsContext",strict:!1}),wD=e=>{const t=v.useSyncExternalStore(ir.subscribe,ir.getState,ir.getState),{motionVariants:n,component:r=VE,portalProps:o}=e,s=Object.keys(t).map(a=>{const l=t[a];return h.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${a}`,style:Fz(a),children:h.jsx(oa,{initial:!1,children:l.map(c=>h.jsx(r,{motionVariants:n,...c},c.id))})},a)});return h.jsx(ra,{...o,children:s})};function Ri(e){const{theme:t}=HC(),n=bD();return v.useMemo(()=>vD(t.direction,{...n,...e}),[e,t.direction,n])}var xD=e=>function({children:n,theme:r=e,toastOptions:o,...i}){return h.jsxs(Mz,{theme:r,...i,children:[h.jsx(yD,{value:o==null?void 0:o.defaultOptions,children:n}),h.jsx(wD,{...o})]})},SD=xD(rz);function kD(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Mt(...e){return t=>{e.forEach(n=>{kD(n,t)})}}function CD(...e){return v.useMemo(()=>Mt(...e),e)}var Uw={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},ii={enter:{duration:.2,ease:Uw.easeOut},exit:{duration:.1,ease:Uw.easeIn}},si={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},ED={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:si.enter(ii.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:si.exit(ii.exit,n),transitionEnd:t==null?void 0:t.exit}}},ZE={initial:"exit",animate:"enter",exit:"exit",variants:ED},TD=v.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:s,transitionEnd:a,delay:l,...c}=t,u=o||r?"enter":"exit",d=r?o&&r:!0,f={transition:s,transitionEnd:a,delay:l};return h.jsx(oa,{custom:f,children:d&&h.jsx(Ao.div,{ref:n,className:ae("chakra-fade",i),custom:f,...ZE,animate:u,...c})})});TD.displayName="Fade";var PD={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(i=n==null?void 0:n.exit)!=null?i:si.exit(ii.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:si.enter(ii.enter,n),transitionEnd:e==null?void 0:e.enter}}},YE={initial:"exit",animate:"enter",exit:"exit",variants:PD},_D=v.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:s=.95,className:a,transition:l,transitionEnd:c,delay:u,...d}=t,f=r?o&&r:!0,p=o||r?"enter":"exit",g={initialScale:s,reverse:i,transition:l,transitionEnd:c,delay:u};return h.jsx(oa,{custom:g,children:f&&h.jsx(Ao.div,{ref:n,className:ae("chakra-offset-slide",a),...YE,animate:p,custom:g,...d})})});_D.displayName="ScaleFade";var RD={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,x:e,y:t,transition:(i=n==null?void 0:n.exit)!=null?i:si.exit(ii.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:si.enter(ii.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{var s;const a={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:si.exit(ii.exit,i),...o?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},cg={initial:"initial",animate:"enter",exit:"exit",variants:RD},AD=v.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:s,offsetX:a=0,offsetY:l=8,transition:c,transitionEnd:u,delay:d,...f}=t,p=r?o&&r:!0,g=o||r?"enter":"exit",m={offsetX:a,offsetY:l,reverse:i,transition:c,transitionEnd:u,delay:d};return h.jsx(oa,{custom:m,children:p&&h.jsx(Ao.div,{ref:n,className:ae("chakra-offset-slide",s),custom:m,...cg,animate:g,...f})})});AD.displayName="SlideFade";var[$D,jD]=nn({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function OD(e){var t;const n=e.split(" "),r=(t=n[0])!=null?t:"",o=n.length>1?n[n.length-1]:"";return r&&o?`${r.charAt(0)}${o.charAt(0)}`:r.charAt(0)}function QE(e){const{name:t,getInitials:n,...r}=e,o=jD();return h.jsx(Y.div,{role:"img","aria-label":t,...r,__css:o.label,children:t?n==null?void 0:n(t):null})}QE.displayName="AvatarName";var XE=e=>h.jsxs(Y.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...e,children:[h.jsx("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),h.jsx("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),ug=ee(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:i,...s}=t;return h.jsx("img",{width:r,height:o,ref:n,alt:i,...s})});ug.displayName="NativeImage";function JE(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:i,crossOrigin:s,sizes:a,ignoreFallback:l}=e,[c,u]=v.useState("pending");v.useEffect(()=>{u(n?"loading":"pending")},[n]);const d=v.useRef(),f=v.useCallback(()=>{if(!n)return;p();const g=new Image;g.src=n,s&&(g.crossOrigin=s),r&&(g.srcset=r),a&&(g.sizes=a),t&&(g.loading=t),g.onload=m=>{p(),u("loaded"),o==null||o(m)},g.onerror=m=>{p(),u("failed"),i==null||i(m)},d.current=g},[n,s,r,a,o,i,t]),p=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return _r(()=>{if(!l)return c==="loading"&&f(),()=>{p()}},[c,f,l]),l?"loaded":c}var ID=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function LD(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var ms=ee(function(t,n){const{fallbackSrc:r,fallback:o,src:i,srcSet:s,align:a,fit:l,loading:c,ignoreFallback:u,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:p,...g}=t,m=r!==void 0||o!==void 0,w=c!=null||u||!m,b=JE({...t,crossOrigin:d,ignoreFallback:w}),y=ID(b,f),x={ref:n,objectFit:l,objectPosition:a,...w?g:LD(g,["onError","onLoad"])};return y?o||h.jsx(Y.img,{as:ug,className:"chakra-image__placeholder",src:r,...x}):h.jsx(Y.img,{as:ug,src:i,srcSet:s,crossOrigin:d,loading:c,referrerPolicy:p,className:"chakra-image",...x})});ms.displayName="Image";function eT(e){const{src:t,srcSet:n,onError:r,onLoad:o,getInitials:i,name:s,borderRadius:a,loading:l,iconLabel:c,icon:u=h.jsx(XE,{}),ignoreFallback:d,referrerPolicy:f,crossOrigin:p}=e,m=JE({src:t,onError:r,crossOrigin:p,ignoreFallback:d})==="loaded";return!t||!m?s?h.jsx(QE,{className:"chakra-avatar__initials",getInitials:i,name:s}):v.cloneElement(u,{role:"img","aria-label":c}):h.jsx(Y.img,{src:t,srcSet:n,alt:s,onLoad:o,referrerPolicy:f,crossOrigin:p??void 0,className:"chakra-avatar__img",loading:l,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:a}})}eT.displayName="AvatarImage";var MD={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},Sd=ee((e,t)=>{const n=Dr("Avatar",e),[r,o]=v.useState(!1),{src:i,srcSet:s,name:a,showBorder:l,borderRadius:c="full",onError:u,onLoad:d,getInitials:f=OD,icon:p=h.jsx(XE,{}),iconLabel:g=" avatar",loading:m,children:w,borderColor:b,ignoreFallback:y,crossOrigin:x,referrerPolicy:S,...T}=ft(e),E={borderRadius:c,borderWidth:l?"2px":void 0,...MD,...n.container};return b&&(E.borderColor=b),h.jsx(Y.span,{ref:t,...T,className:ae("chakra-avatar",e.className),"data-loaded":ke(r),__css:E,children:h.jsxs($D,{value:n,children:[h.jsx(eT,{src:i,srcSet:s,loading:m,onLoad:me(d,()=>{o(!0)}),onError:u,getInitials:f,name:a,borderRadius:c,icon:p,iconLabel:g,ignoreFallback:y,crossOrigin:x,referrerPolicy:S}),w]})})});Sd.displayName="Avatar";function BD(e){return v.Children.toArray(e).filter(t=>v.isValidElement(t))}var[zD,FD]=nn({strict:!1,name:"ButtonGroupContext"}),ND={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},DD={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},tT=ee(function(t,n){const{size:r,colorScheme:o,variant:i,className:s,spacing:a="0.5rem",isAttached:l,isDisabled:c,orientation:u="horizontal",...d}=t,f=ae("chakra-button__group",s),p=v.useMemo(()=>({size:r,colorScheme:o,variant:i,isDisabled:c}),[r,o,i,c]);let g={display:"inline-flex",...l?ND[u]:DD[u](a)};const m=u==="vertical";return h.jsx(zD,{value:p,children:h.jsx(Y.div,{ref:n,role:"group",__css:g,className:f,"data-attached":l?"":void 0,"data-orientation":u,flexDir:m?"column":void 0,...d})})});tT.displayName="ButtonGroup";function VD(e){const[t,n]=v.useState(!e);return{ref:v.useCallback(i=>{i&&n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}function dg(e){const{children:t,className:n,...r}=e,o=v.isValidElement(t)?v.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=ae("chakra-button__icon",n);return h.jsx(Y.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i,children:o})}dg.displayName="ButtonIcon";function fg(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=h.jsx(xy,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:s,...a}=e,l=ae("chakra-button__spinner",i),c=n==="start"?"marginEnd":"marginStart",u=v.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[c]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,c,r]);return h.jsx(Y.div,{className:l,...a,__css:u,children:o})}fg.displayName="ButtonSpinner";var Te=ee((e,t)=>{const n=FD(),r=qn("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:i,isActive:s,children:a,leftIcon:l,rightIcon:c,loadingText:u,iconSpacing:d="0.5rem",type:f,spinner:p,spinnerPlacement:g="start",className:m,as:w,...b}=ft(e),y=v.useMemo(()=>{const E={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:E}}},[r,n]),{ref:x,type:S}=VD(w),T={rightIcon:c,leftIcon:l,iconSpacing:d,children:a};return h.jsxs(Y.button,{ref:CD(t,x),as:w,type:f??S,"data-active":ke(s),"data-loading":ke(i),__css:y,className:ae("chakra-button",m),...b,disabled:o||i,children:[i&&g==="start"&&h.jsx(fg,{className:"chakra-button__spinner--start",label:u,placement:"start",spacing:d,children:p}),i?u||h.jsx(Y.span,{opacity:0,children:h.jsx(Ww,{...T})}):h.jsx(Ww,{...T}),i&&g==="end"&&h.jsx(fg,{className:"chakra-button__spinner--end",label:u,placement:"end",spacing:d,children:p})]})});Te.displayName="Button";function Ww(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return h.jsxs(h.Fragment,{children:[t&&h.jsx(dg,{marginEnd:o,children:t}),r,n&&h.jsx(dg,{marginStart:o,children:n})]})}var Hi=ee((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...s}=e,a=n||r,l=v.isValidElement(a)?v.cloneElement(a,{"aria-hidden":!0,focusable:!1}):null;return h.jsx(Te,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...s,children:l})});Hi.displayName="IconButton";var[UD,Cy]=Iz("Card"),WD=ee(function(t,n){const{className:r,...o}=t,i=Cy();return h.jsx(Y.div,{ref:n,className:ae("chakra-card__body",r),__css:i.body,...o})}),HD=ee(function(t,n){const{className:r,justify:o,...i}=t,s=Cy();return h.jsx(Y.div,{ref:n,className:ae("chakra-card__footer",r),__css:{display:"flex",justifyContent:o,...s.footer},...i})}),GD=ee(function(t,n){const{className:r,...o}=t,i=Cy();return h.jsx(Y.div,{ref:n,className:ae("chakra-card__header",r),__css:i.header,...o})}),qD=ee(function(t,n){const{className:r,children:o,direction:i="column",justify:s,align:a,...l}=ft(t),c=Dr("Card",t);return h.jsx(Y.div,{ref:n,className:ae("chakra-card",r),__css:{display:"flex",flexDirection:i,justifyContent:s,alignItems:a,position:"relative",minWidth:0,wordWrap:"break-word",...c.container},...l,children:h.jsx(UD,{value:c,children:o})})}),[KD,nT]=nn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[ZD,Kf]=nn({strict:!1,name:"FormControlContext"});function YD(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...s}=e,a=v.useId(),l=t||`field-${a}`,c=`${l}-label`,u=`${l}-feedback`,d=`${l}-helptext`,[f,p]=v.useState(!1),[g,m]=v.useState(!1),[w,b]=v.useState(!1),y=v.useCallback((C={},_=null)=>({id:d,...C,ref:Mt(_,B=>{B&&m(!0)})}),[d]),x=v.useCallback((C={},_=null)=>({...C,ref:_,"data-focus":ke(w),"data-disabled":ke(o),"data-invalid":ke(r),"data-readonly":ke(i),id:C.id!==void 0?C.id:c,htmlFor:C.htmlFor!==void 0?C.htmlFor:l}),[l,o,w,r,i,c]),S=v.useCallback((C={},_=null)=>({id:u,...C,ref:Mt(_,B=>{B&&p(!0)}),"aria-live":"polite"}),[u]),T=v.useCallback((C={},_=null)=>({...C,...s,ref:_,role:"group"}),[s]),E=v.useCallback((C={},_=null)=>({...C,ref:_,role:"presentation","aria-hidden":!0,children:C.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!w,onFocus:()=>b(!0),onBlur:()=>b(!1),hasFeedbackText:f,setHasFeedbackText:p,hasHelpText:g,setHasHelpText:m,id:l,labelId:c,feedbackId:u,helpTextId:d,htmlProps:s,getHelpTextProps:y,getErrorMessageProps:S,getRootProps:T,getLabelProps:x,getRequiredIndicatorProps:E}}var _t=ee(function(t,n){const r=Dr("Form",t),o=ft(t),{getRootProps:i,htmlProps:s,...a}=YD(o),l=ae("chakra-form-control",t.className);return h.jsx(ZD,{value:a,children:h.jsx(KD,{value:r,children:h.jsx(Y.div,{...i({},n),className:l,__css:r.container})})})});_t.displayName="FormControl";var Do=ee(function(t,n){const r=Kf(),o=nT(),i=ae("chakra-form__helper-text",t.className);return h.jsx(Y.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:i})});Do.displayName="FormHelperText";var Rt=ee(function(t,n){var r;const o=qn("FormLabel",t),i=ft(t),{className:s,children:a,requiredIndicator:l=h.jsx(rT,{}),optionalIndicator:c=null,...u}=i,d=Kf(),f=(r=d==null?void 0:d.getLabelProps(u,n))!=null?r:{ref:n,...u};return h.jsxs(Y.label,{...f,className:ae("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...o},children:[a,d!=null&&d.isRequired?l:c]})});Rt.displayName="FormLabel";var rT=ee(function(t,n){const r=Kf(),o=nT();if(!(r!=null&&r.isRequired))return null;const i=ae("chakra-form__required-indicator",t.className);return h.jsx(Y.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:i})});rT.displayName="RequiredIndicator";function oT(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=iT(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":Wh(n),"aria-required":Wh(o),"aria-readonly":Wh(r)}}function iT(e){var t,n,r;const o=Kf(),{id:i,disabled:s,readOnly:a,required:l,isRequired:c,isInvalid:u,isReadOnly:d,isDisabled:f,onFocus:p,onBlur:g,...m}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...m,"aria-describedby":w.join(" ")||void 0,id:i??(o==null?void 0:o.id),isDisabled:(t=s??f)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=a??d)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=l??c)!=null?r:o==null?void 0:o.isRequired,isInvalid:u??(o==null?void 0:o.isInvalid),onFocus:me(o==null?void 0:o.onFocus,p),onBlur:me(o==null?void 0:o.onBlur,g)}}var QD={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};const XD=()=>typeof document<"u";let Hw=!1,ic=null,mi=!1,hg=!1;const pg=new Set;function Ey(e,t){pg.forEach(n=>n(e,t))}const JD=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function e9(e){return!(e.metaKey||!JD&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Gw(e){mi=!0,e9(e)&&(ic="keyboard",Ey("keyboard",e))}function Bi(e){if(ic="pointer",e.type==="mousedown"||e.type==="pointerdown"){mi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;Ey("pointer",e)}}function t9(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function n9(e){t9(e)&&(mi=!0,ic="virtual")}function r9(e){e.target===window||e.target===document||(!mi&&!hg&&(ic="virtual",Ey("virtual",e)),mi=!1,hg=!1)}function o9(){mi=!1,hg=!0}function qw(){return ic!=="pointer"}function i9(){if(!XD()||Hw)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){mi=!0,e.apply(this,n)},document.addEventListener("keydown",Gw,!0),document.addEventListener("keyup",Gw,!0),document.addEventListener("click",n9,!0),window.addEventListener("focus",r9,!0),window.addEventListener("blur",o9,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Bi,!0),document.addEventListener("pointermove",Bi,!0),document.addEventListener("pointerup",Bi,!0)):(document.addEventListener("mousedown",Bi,!0),document.addEventListener("mousemove",Bi,!0),document.addEventListener("mouseup",Bi,!0)),Hw=!0}function s9(e){i9(),e(qw());const t=()=>e(qw());return pg.add(t),()=>{pg.delete(t)}}function a9(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function l9(e={}){const t=iT(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:i,id:s,onBlur:a,onFocus:l,"aria-describedby":c}=t,{defaultChecked:u,isChecked:d,isFocusable:f,onChange:p,isIndeterminate:g,name:m,value:w,tabIndex:b=void 0,"aria-label":y,"aria-labelledby":x,"aria-invalid":S,...T}=e,E=a9(T,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=oi(p),_=oi(a),B=oi(l),[L,P]=v.useState(!1),[O,I]=v.useState(!1),[U,$]=v.useState(!1),[j,F]=v.useState(!1);v.useEffect(()=>s9(P),[]);const z=v.useRef(null),[D,G]=v.useState(!0),[V,q]=v.useState(!!u),N=d!==void 0,H=N?d:V,Q=v.useCallback(Z=>{if(r||n){Z.preventDefault();return}N||q(H?Z.target.checked:g?!0:Z.target.checked),C==null||C(Z)},[r,n,H,N,g,C]);_r(()=>{z.current&&(z.current.indeterminate=!!g)},[g]),Il(()=>{n&&I(!1)},[n,I]),_r(()=>{const Z=z.current;if(!(Z!=null&&Z.form))return;const ye=()=>{q(!!u)};return Z.form.addEventListener("reset",ye),()=>{var be;return(be=Z.form)==null?void 0:be.removeEventListener("reset",ye)}},[]);const te=n&&!f,ne=v.useCallback(Z=>{Z.key===" "&&F(!0)},[F]),ue=v.useCallback(Z=>{Z.key===" "&&F(!1)},[F]);_r(()=>{if(!z.current)return;z.current.checked!==H&&q(z.current.checked)},[z.current]);const he=v.useCallback((Z={},ye=null)=>{const be=at=>{O&&at.preventDefault(),F(!0)};return{...Z,ref:ye,"data-active":ke(j),"data-hover":ke(U),"data-checked":ke(H),"data-focus":ke(O),"data-focus-visible":ke(O&&L),"data-indeterminate":ke(g),"data-disabled":ke(n),"data-invalid":ke(i),"data-readonly":ke(r),"aria-hidden":!0,onMouseDown:me(Z.onMouseDown,be),onMouseUp:me(Z.onMouseUp,()=>F(!1)),onMouseEnter:me(Z.onMouseEnter,()=>$(!0)),onMouseLeave:me(Z.onMouseLeave,()=>$(!1))}},[j,H,n,O,L,U,g,i,r]),Ae=v.useCallback((Z={},ye=null)=>({...Z,ref:ye,"data-active":ke(j),"data-hover":ke(U),"data-checked":ke(H),"data-focus":ke(O),"data-focus-visible":ke(O&&L),"data-indeterminate":ke(g),"data-disabled":ke(n),"data-invalid":ke(i),"data-readonly":ke(r)}),[j,H,n,O,L,U,g,i,r]),ze=v.useCallback((Z={},ye=null)=>({...E,...Z,ref:Mt(ye,be=>{be&&G(be.tagName==="LABEL")}),onClick:me(Z.onClick,()=>{var be;D||((be=z.current)==null||be.click(),requestAnimationFrame(()=>{var at;(at=z.current)==null||at.focus({preventScroll:!0})}))}),"data-disabled":ke(n),"data-checked":ke(H),"data-invalid":ke(i)}),[E,n,H,i,D]),ce=v.useCallback((Z={},ye=null)=>({...Z,ref:Mt(z,ye),type:"checkbox",name:m,value:w,id:s,tabIndex:b,onChange:me(Z.onChange,Q),onBlur:me(Z.onBlur,_,()=>I(!1)),onFocus:me(Z.onFocus,B,()=>I(!0)),onKeyDown:me(Z.onKeyDown,ne),onKeyUp:me(Z.onKeyUp,ue),required:o,checked:H,disabled:te,readOnly:r,"aria-label":y,"aria-labelledby":x,"aria-invalid":S?!!S:i,"aria-describedby":c,"aria-disabled":n,style:QD}),[m,w,s,Q,_,B,ne,ue,o,H,te,r,y,x,S,i,c,n,b]),ve=v.useCallback((Z={},ye=null)=>({...Z,ref:ye,onMouseDown:me(Z.onMouseDown,c9),"data-disabled":ke(n),"data-checked":ke(H),"data-invalid":ke(i)}),[H,n,i]);return{state:{isInvalid:i,isFocused:O,isChecked:H,isActive:j,isHovered:U,isIndeterminate:g,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:ze,getCheckboxProps:he,getIndicatorProps:Ae,getInputProps:ce,getLabelProps:ve,htmlProps:E}}function c9(e){e.preventDefault(),e.stopPropagation()}function _s(e,t,n,r){const o=oi(n);return v.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i==null||i.removeEventListener(t,o,r)}}function u9(e){return"current"in e}var sT=()=>typeof window<"u";function d9(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var f9=e=>sT()&&e.test(navigator.vendor),h9=e=>sT()&&e.test(d9()),p9=()=>h9(/mac|iphone|ipad|ipod/i),m9=()=>p9()&&f9(/apple/i);function g9(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var i,s;return(s=(i=t.current)==null?void 0:i.ownerDocument)!=null?s:document};_s(o,"pointerdown",i=>{if(!m9()||!r)return;const s=i.target,l=(n??[t]).some(c=>{const u=u9(c)?c.current:c;return(u==null?void 0:u.contains(s))||u===s});o().activeElement!==s&&l&&(i.preventDefault(),s.focus())})}function v9(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var mg="data-focus-lock",aT="data-focus-lock-disabled",y9="data-no-focus-lock",b9="data-autofocus-inside",w9="data-no-autofocus";function x9(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function S9(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function lT(e,t){return S9(t||null,function(n){return e.forEach(function(r){return x9(r,n)})})}var Sp={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},sr=function(){return sr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=0}).sort(N9)},D9=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ry=D9.join(","),V9="".concat(Ry,", [data-focus-guard]"),TT=function(e,t){return gr((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?V9:Ry)?[r]:[],TT(r))},[])},U9=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Zf([e.contentDocument.body],t):[e]},Zf=function(e,t){return e.reduce(function(n,r){var o,i=TT(r,t),s=(o=[]).concat.apply(o,i.map(function(a){return U9(a,t)}));return n.concat(s,r.parentNode?gr(r.parentNode.querySelectorAll(Ry)).filter(function(a){return a===r}):[])},[])},W9=function(e){var t=e.querySelectorAll("[".concat(b9,"]"));return gr(t).map(function(n){return Zf([n])}).reduce(function(n,r){return n.concat(r)},[])},Ay=function(e,t){return gr(e).filter(function(n){return wT(t,n)}).filter(function(n){return B9(n)})},Kw=function(e,t){return t===void 0&&(t=new Map),gr(e).filter(function(n){return xT(t,n)})},vg=function(e,t,n){return ET(Ay(Zf(e,n),t),!0,n)},Zw=function(e,t){return ET(Ay(Zf(e),t),!1)},H9=function(e,t){return Ay(W9(e),t)},Rs=function(e,t){return e.shadowRoot?Rs(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:gr(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?Rs(o,t):!1}return Rs(n,t)})},G9=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(s,a){return!t.has(a)})},PT=function(e){return e.parentNode?PT(e.parentNode):e},$y=function(e){var t=kd(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(mg);return n.push.apply(n,o?G9(gr(PT(r).querySelectorAll("[".concat(mg,'="').concat(o,'"]:not([').concat(aT,'="disabled"])')))):[r]),n},[])},q9=function(e){try{return e()}catch{return}},Fl=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Fl(t.shadowRoot):t instanceof HTMLIFrameElement&&q9(function(){return t.contentWindow.document})?Fl(t.contentWindow.document):t}},K9=function(e,t){return e===t},Z9=function(e,t){return!!gr(e.querySelectorAll("iframe")).some(function(n){return K9(n,t)})},_T=function(e,t){return t===void 0&&(t=Fl(vT(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:$y(e).some(function(n){return Rs(n,t)||Z9(n,t)})},Y9=function(e){e===void 0&&(e=document);var t=Fl(e);return t?gr(e.querySelectorAll("[".concat(y9,"]"))).some(function(n){return Rs(n,t)}):!1},Q9=function(e,t){return t.filter(CT).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},jy=function(e,t){return CT(e)&&e.name?Q9(e,t):e},X9=function(e){var t=new Set;return e.forEach(function(n){return t.add(jy(n,e))}),e.filter(function(n){return t.has(n)})},Yw=function(e){return e[0]&&e.length>1?jy(e[0],e):e[0]},Qw=function(e,t){return e.length>1?e.indexOf(jy(e[t],e)):t},RT="NEW_FOCUS",J9=function(e,t,n,r){var o=e.length,i=e[0],s=e[o-1],a=_y(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,c=r?t.indexOf(r):l,u=r?e.indexOf(r):-1,d=l-c,f=t.indexOf(i),p=t.indexOf(s),g=X9(t),m=n!==void 0?g.indexOf(n):-1,w=m-(r?g.indexOf(r):l),b=Qw(e,0),y=Qw(e,o-1);if(l===-1||u===-1)return RT;if(!d&&u>=0)return u;if(l<=f&&a&&Math.abs(d)>1)return y;if(l>=p&&a&&Math.abs(d)>1)return b;if(d&&Math.abs(w)>1)return u;if(l<=f)return y;if(l>p)return b;if(d)return Math.abs(d)>1?u:(o+u+d)%o}},eV=function(e){return function(t){var n,r=(n=ST(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},tV=function(e,t,n){var r=e.map(function(i){var s=i.node;return s}),o=Kw(r.filter(eV(n)));return o&&o.length?Yw(o):Yw(Kw(t))},yg=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&yg(e.parentNode.host||e.parentNode,t),t},kp=function(e,t){for(var n=yg(e),r=yg(t),o=0;o=0)return i}return!1},AT=function(e,t,n){var r=kd(e),o=kd(t),i=r[0],s=!1;return o.filter(Boolean).forEach(function(a){s=kp(s||a,a)||s,n.filter(Boolean).forEach(function(l){var c=kp(i,l);c&&(!s||Rs(c,s)?s=c:s=kp(c,s))})}),s},nV=function(e,t){return e.reduce(function(n,r){return n.concat(H9(r,t))},[])},rV=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(F9)},oV=function(e,t){var n=Fl(kd(e).length>0?document:vT(e).ownerDocument),r=$y(e).filter(Cd),o=AT(n||e,e,r),i=new Map,s=Zw(r,i),a=vg(r,i).filter(function(p){var g=p.node;return Cd(g)});if(!(!a[0]&&(a=s,!a[0]))){var l=Zw([o],i).map(function(p){var g=p.node;return g}),c=rV(l,a),u=c.map(function(p){var g=p.node;return g}),d=J9(u,l,n,t);if(d===RT){var f=tV(s,u,nV(r,i));if(f)return{node:f};console.warn("focus-lock: cannot find any node to move focus into");return}return d===void 0?d:c[d]}},iV=function(e){var t=$y(e).filter(Cd),n=AT(e,e,t),r=new Map,o=vg([n],r,!0),i=vg(t,r).filter(function(s){var a=s.node;return Cd(a)}).map(function(s){var a=s.node;return a});return o.map(function(s){var a=s.node,l=s.index;return{node:a,index:l,lockItem:i.indexOf(a)>=0,guard:_y(a)}})},sV=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},Cp=0,Ep=!1,$T=function(e,t,n){n===void 0&&(n={});var r=oV(e,t);if(!Ep&&r){if(Cp>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ep=!0,setTimeout(function(){Ep=!1},1);return}Cp++,sV(r.node,n.focusOptions),Cp--}};function Oy(e){setTimeout(e,1)}var aV=function(){return document&&document.activeElement===document.body},lV=function(){return aV()||Y9()},As=null,gs=null,$s=null,Nl=!1,cV=function(){return!0},uV=function(t){return(As.whiteList||cV)(t)},dV=function(t,n){$s={observerNode:t,portaledElement:n}},fV=function(t){return $s&&$s.portaledElement===t};function Xw(e,t,n,r){var o=null,i=e;do{var s=r[i];if(s.guard)s.node.dataset.focusAutoGuard&&(o=s);else if(s.lockItem){if(i!==e)return;o=null}else break}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var hV=function(t){return t&&"current"in t?t.current:t},pV=function(t){return t?!!Nl:Nl==="meanwhile"},mV=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},gV=function(t,n){return n.some(function(r){return mV(t,r,r)})},Ed=function(){var t=!1;if(As){var n=As,r=n.observed,o=n.persistentFocus,i=n.autoFocus,s=n.shards,a=n.crossFrame,l=n.focusOptions,c=r||$s&&$s.portaledElement,u=document&&document.activeElement;if(c){var d=[c].concat(s.map(hV).filter(Boolean));if((!u||uV(u))&&(o||pV(a)||!lV()||!gs&&i)&&(c&&!(_T(d)||u&&gV(u,d)||fV(u))&&(document&&!gs&&u&&!i?(u.blur&&u.blur(),document.body.focus()):(t=$T(d,gs,{focusOptions:l}),$s={})),Nl=!1,gs=document&&document.activeElement),document){var f=document&&document.activeElement,p=iV(d),g=p.map(function(m){var w=m.node;return w}).indexOf(f);g>-1&&(p.filter(function(m){var w=m.guard,b=m.node;return w&&b.dataset.focusAutoGuard}).forEach(function(m){var w=m.node;return w.removeAttribute("tabIndex")}),Xw(g,p.length,1,p),Xw(g,-1,-1,p))}}}return t},jT=function(t){Ed()&&t&&(t.stopPropagation(),t.preventDefault())},Iy=function(){return Oy(Ed)},vV=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||dV(r,n)},yV=function(){return null},OT=function(){Nl="just",Oy(function(){Nl="meanwhile"})},bV=function(){document.addEventListener("focusin",jT),document.addEventListener("focusout",Iy),window.addEventListener("blur",OT)},wV=function(){document.removeEventListener("focusin",jT),document.removeEventListener("focusout",Iy),window.removeEventListener("blur",OT)};function xV(e){return e.filter(function(t){var n=t.disabled;return!n})}function SV(e){var t=e.slice(-1)[0];t&&!As&&bV();var n=As,r=n&&t&&t.id===n.id;As=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(gs=null,(!r||n.observed!==t.observed)&&t.onActivation(),Ed(),Oy(Ed)):(wV(),gs=null)}pT.assignSyncMedium(vV);mT.assignMedium(Iy);E9.assignMedium(function(e){return e({moveFocusInside:$T,focusInside:_T})});const kV=j9(xV,SV)(yV);var IT=v.forwardRef(function(t,n){return v.createElement(gT,ci({sideCar:kV,ref:n},t))}),LT=gT.propTypes||{};LT.sideCar;v9(LT,["sideCar"]);IT.propTypes={};const Jw=IT;function MT(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ly(e){var t;if(!MT(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function CV(e){var t,n;return(n=(t=BT(e))==null?void 0:t.defaultView)!=null?n:window}function BT(e){return MT(e)?e.ownerDocument:document}function EV(e){return BT(e).activeElement}function TV(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function PV(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function zT(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Ly(e)&&TV(e)?e:zT(PV(e))}var FT=e=>e.hasAttribute("tabindex"),_V=e=>FT(e)&&e.tabIndex===-1;function RV(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function NT(e){return e.parentElement&&NT(e.parentElement)?!0:e.hidden}function AV(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function DT(e){if(!Ly(e)||NT(e)||RV(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():AV(e)?!0:FT(e)}function $V(e){return e?Ly(e)&&DT(e)&&!_V(e):!1}var jV=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],OV=jV.join(),IV=e=>e.offsetWidth>0&&e.offsetHeight>0;function VT(e){const t=Array.from(e.querySelectorAll(OV));return t.unshift(e),t.filter(n=>DT(n)&&IV(n))}var ex,LV=(ex=Jw.default)!=null?ex:Jw,UT=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:s,autoFocus:a,persistentFocus:l,lockFocusAcrossFrames:c}=e,u=v.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&VT(r.current).length===0&&requestAnimationFrame(()=>{var g;(g=r.current)==null||g.focus()})},[t,r]),d=v.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),f=o&&!n;return h.jsx(LV,{crossFrame:c,persistentFocus:l,autoFocus:a,disabled:s,onActivation:u,onDeactivation:d,returnFocus:f,children:i})};UT.displayName="FocusLock";var MV=iz?v.useLayoutEffect:v.useEffect;function tx(e,t=[]){const n=v.useRef(e);return MV(()=>{n.current=e}),v.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function BV(e,t){const n=v.useId();return v.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function zV(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Hs(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=tx(n),s=tx(t),[a,l]=v.useState(e.defaultIsOpen||!1),[c,u]=zV(r,a),d=BV(o,"disclosure"),f=v.useCallback(()=>{c||l(!1),s==null||s()},[c,s]),p=v.useCallback(()=>{c||l(!0),i==null||i()},[c,i]),g=v.useCallback(()=>{(u?f:p)()},[u,p,f]);return{isOpen:!!u,onOpen:p,onClose:f,onToggle:g,isControlled:c,getButtonProps:(m={})=>({...m,"aria-expanded":u,"aria-controls":d,onClick:uz(m.onClick,g)}),getDisclosureProps:(m={})=>({...m,hidden:!u,id:d})}}var mt=ee(function(t,n){const{htmlSize:r,...o}=t,i=Dr("Input",o),s=ft(o),a=oT(s),l=ae("chakra-input",t.className);return h.jsx(Y.input,{size:r,...a,__css:i.field,ref:n,className:l})});mt.displayName="Input";mt.id="Input";var Dl=ee(function(t,n){const r=qn("Link",t),{className:o,isExternal:i,...s}=ft(t);return h.jsx(Y.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:n,className:ae("chakra-link",o),...s,__css:r})});Dl.displayName="Link";var ia=ee(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:s,column:a,row:l,autoFlow:c,autoRows:u,templateRows:d,autoColumns:f,templateColumns:p,...g}=t,m={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:s,gridAutoColumns:f,gridColumn:a,gridRow:l,gridAutoFlow:c,gridAutoRows:u,gridTemplateRows:d,gridTemplateColumns:p};return h.jsx(Y.div,{ref:n,__css:m,...g})});ia.displayName="Grid";function FV(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Hn(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var My=Y("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});My.displayName="Spacer";var le=ee(function(t,n){const r=qn("Text",t),{className:o,align:i,decoration:s,casing:a,...l}=ft(t),c=xz({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return h.jsx(Y.p,{ref:n,className:ae("chakra-text",t.className),...c,...l,__css:r})});le.displayName="Text";var WT=e=>h.jsx(Y.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});WT.displayName="StackItem";function NV(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":FV(n,o=>r[o])}}var By=ee((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:s="0.5rem",wrap:a,children:l,divider:c,className:u,shouldWrapChildren:d,...f}=e,p=n?"row":r??"column",g=v.useMemo(()=>NV({spacing:s,direction:p}),[s,p]),m=!!c,w=!d&&!m,b=v.useMemo(()=>{const x=BD(l);return w?x:x.map((S,T)=>{const E=typeof S.key<"u"?S.key:T,C=T+1===x.length,B=d?h.jsx(WT,{children:S},E):S;if(!m)return B;const L=v.cloneElement(c,{__css:g}),P=C?null:L;return h.jsxs(v.Fragment,{children:[B,P]},E)})},[c,g,m,w,d,l]),y=ae("chakra-stack",u);return h.jsx(Y.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:p,flexWrap:a,gap:m?void 0:s,className:y,...f,children:b})});By.displayName="Stack";var il=ee((e,t)=>h.jsx(By,{align:"center",...e,direction:"column",ref:t}));il.displayName="VStack";var Ht=ee((e,t)=>h.jsx(By,{align:"center",...e,direction:"row",ref:t}));Ht.displayName="HStack";var wt=ee(function(t,n){const r=qn("Heading",t),{className:o,...i}=ft(t);return h.jsx(Y.h2,{ref:n,className:ae("chakra-heading",t.className),...i,__css:r})});wt.displayName="Heading";var se=Y("div");se.displayName="Box";var HT=ee(function(t,n){const{size:r,centerContent:o=!0,...i}=t,s=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return h.jsx(se,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...i})});HT.displayName="Square";var DV=ee(function(t,n){const{size:r,...o}=t;return h.jsx(HT,{size:r,ref:n,borderRadius:"9999px",...o})});DV.displayName="Circle";ee(function(t,n){const{isExternal:r,target:o,rel:i,className:s,...a}=t;return h.jsx(Y.a,{...a,ref:n,className:ae("chakra-linkbox__overlay",s),rel:r?"noopener noreferrer":i,target:r?"_blank":o,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});var VV=ee(function(t,n){const{className:r,...o}=t;return h.jsx(Y.div,{ref:n,position:"relative",...o,className:ae("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})}),GT=ee(function(t,n){const{className:r,centerContent:o,...i}=ft(t),s=qn("Container",t);return h.jsx(Y.div,{ref:n,className:ae("chakra-container",r),...i,__css:{...s,...o&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});GT.displayName="Container";var Td=ee(function(t,n){const{direction:r,align:o,justify:i,wrap:s,basis:a,grow:l,shrink:c,...u}=t,d={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:s,flexBasis:a,flexGrow:l,flexShrink:c};return h.jsx(Y.div,{ref:n,__css:d,...u})});Td.displayName="Flex";function UV(e){const t=e.current;if(!t)return!1;const n=EV(t);return!n||t.contains(n)?!1:!!$V(n)}function WV(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;Il(()=>{if(!i||UV(e))return;const s=(o==null?void 0:o.current)||e.current;let a;if(s)return a=requestAnimationFrame(()=>{s.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(a)}},[i,e,o])}var HV={preventScroll:!0,shouldFocus:!1};function GV(e,t=HV){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:i}=t,s=qV(e)?e.current:e,a=o&&i,l=v.useRef(a),c=v.useRef(i);_r(()=>{!c.current&&i&&(l.current=a),c.current=i},[i,a]);const u=v.useCallback(()=>{if(!(!i||!s||!l.current)&&(l.current=!1,!s.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var d;(d=n.current)==null||d.focus({preventScroll:r})});else{const d=VT(s);d.length>0&&requestAnimationFrame(()=>{d[0].focus({preventScroll:r})})}},[i,r,s,n]);Il(()=>{u()},[u]),_s(s,"transitionend",u)}function qV(e){return"current"in e}var zi=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),tt={arrowShadowColor:zi("--popper-arrow-shadow-color"),arrowSize:zi("--popper-arrow-size","8px"),arrowSizeHalf:zi("--popper-arrow-size-half"),arrowBg:zi("--popper-arrow-bg"),transformOrigin:zi("--popper-transform-origin"),arrowOffset:zi("--popper-arrow-offset")};function KV(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var ZV={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},YV=e=>ZV[e],nx={scroll:!0,resize:!0};function QV(e){let t;return typeof e=="object"?t={enabled:!0,options:{...nx,...e}}:t={enabled:e,options:nx},t}var XV={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},JV={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{rx(e)},effect:({state:e})=>()=>{rx(e)}},rx=e=>{e.elements.popper.style.setProperty(tt.transformOrigin.var,YV(e.placement))},eU={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{tU(e)}},tU=e=>{var t;if(!e.placement)return;const n=nU(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:tt.arrowSize.varRef,height:tt.arrowSize.varRef,zIndex:-1});const r={[tt.arrowSizeHalf.var]:`calc(${tt.arrowSize.varRef} / 2 - 1px)`,[tt.arrowOffset.var]:`calc(${tt.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},nU=e=>{if(e.startsWith("top"))return{property:"bottom",value:tt.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:tt.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:tt.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:tt.arrowOffset.varRef}},rU={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{ox(e)},effect:({state:e})=>()=>{ox(e)}},ox=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=KV(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:tt.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},oU={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},iU={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function sU(e,t="ltr"){var n,r;const o=((n=oU[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=iU[e])!=null?r:o}var Yt="top",jn="bottom",On="right",Qt="left",zy="auto",sc=[Yt,jn,On,Qt],Gs="start",Vl="end",aU="clippingParents",qT="viewport",_a="popper",lU="reference",ix=sc.reduce(function(e,t){return e.concat([t+"-"+Gs,t+"-"+Vl])},[]),KT=[].concat(sc,[zy]).reduce(function(e,t){return e.concat([t,t+"-"+Gs,t+"-"+Vl])},[]),cU="beforeRead",uU="read",dU="afterRead",fU="beforeMain",hU="main",pU="afterMain",mU="beforeWrite",gU="write",vU="afterWrite",yU=[cU,uU,dU,fU,hU,pU,mU,gU,vU];function pr(e){return e?(e.nodeName||"").toLowerCase():null}function fn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function gi(e){var t=fn(e).Element;return e instanceof t||e instanceof Element}function _n(e){var t=fn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Fy(e){if(typeof ShadowRoot>"u")return!1;var t=fn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function bU(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!_n(i)||!pr(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function wU(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!_n(o)||!pr(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const xU={name:"applyStyles",enabled:!0,phase:"write",fn:bU,effect:wU,requires:["computeStyles"]};function hr(e){return e.split("-")[0]}var ai=Math.max,Pd=Math.min,qs=Math.round;function bg(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ZT(){return!/^((?!chrome|android).)*safari/i.test(bg())}function Ks(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&_n(e)&&(o=e.offsetWidth>0&&qs(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&qs(r.height)/e.offsetHeight||1);var s=gi(e)?fn(e):window,a=s.visualViewport,l=!ZT()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,f=r.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Ny(e){var t=Ks(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function YT(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Fy(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fr(e){return fn(e).getComputedStyle(e)}function SU(e){return["table","td","th"].indexOf(pr(e))>=0}function $o(e){return((gi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Yf(e){return pr(e)==="html"?e:e.assignedSlot||e.parentNode||(Fy(e)?e.host:null)||$o(e)}function sx(e){return!_n(e)||Fr(e).position==="fixed"?null:e.offsetParent}function kU(e){var t=/firefox/i.test(bg()),n=/Trident/i.test(bg());if(n&&_n(e)){var r=Fr(e);if(r.position==="fixed")return null}var o=Yf(e);for(Fy(o)&&(o=o.host);_n(o)&&["html","body"].indexOf(pr(o))<0;){var i=Fr(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function ac(e){for(var t=fn(e),n=sx(e);n&&SU(n)&&Fr(n).position==="static";)n=sx(n);return n&&(pr(n)==="html"||pr(n)==="body"&&Fr(n).position==="static")?t:n||kU(e)||t}function Dy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function sl(e,t,n){return ai(e,Pd(t,n))}function CU(e,t,n){var r=sl(e,t,n);return r>n?n:r}function QT(){return{top:0,right:0,bottom:0,left:0}}function XT(e){return Object.assign({},QT(),e)}function JT(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var EU=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,XT(typeof t!="number"?t:JT(t,sc))};function TU(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=hr(n.placement),l=Dy(a),c=[Qt,On].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=EU(o.padding,n),f=Ny(i),p=l==="y"?Yt:Qt,g=l==="y"?jn:On,m=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],w=s[l]-n.rects.reference[l],b=ac(i),y=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-w/2,S=d[p],T=y-f[u]-d[g],E=y/2-f[u]/2+x,C=sl(S,E,T),_=l;n.modifiersData[r]=(t={},t[_]=C,t.centerOffset=C-E,t)}}function PU(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||YT(t.elements.popper,o)&&(t.elements.arrow=o))}const _U={name:"arrow",enabled:!0,phase:"main",fn:TU,effect:PU,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zs(e){return e.split("-")[1]}var RU={top:"auto",right:"auto",bottom:"auto",left:"auto"};function AU(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:qs(n*o)/o||0,y:qs(r*o)/o||0}}function ax(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,g=s.y,m=g===void 0?0:g,w=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=w.x,m=w.y;var b=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),x=Qt,S=Yt,T=window;if(c){var E=ac(n),C="clientHeight",_="clientWidth";if(E===fn(n)&&(E=$o(n),Fr(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",_="scrollWidth")),E=E,o===Yt||(o===Qt||o===On)&&i===Vl){S=jn;var B=d&&E===T&&T.visualViewport?T.visualViewport.height:E[C];m-=B-r.height,m*=l?1:-1}if(o===Qt||(o===Yt||o===jn)&&i===Vl){x=On;var L=d&&E===T&&T.visualViewport?T.visualViewport.width:E[_];p-=L-r.width,p*=l?1:-1}}var P=Object.assign({position:a},c&&RU),O=u===!0?AU({x:p,y:m},fn(n)):{x:p,y:m};if(p=O.x,m=O.y,l){var I;return Object.assign({},P,(I={},I[S]=y?"0":"",I[x]=b?"0":"",I.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},P,(t={},t[S]=y?m+"px":"",t[x]=b?p+"px":"",t.transform="",t))}function $U(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:hr(t.placement),variation:Zs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ax(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ax(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const jU={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$U,data:{}};var Qc={passive:!0};function OU(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=fn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Qc)}),a&&l.addEventListener("resize",n.update,Qc),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Qc)}),a&&l.removeEventListener("resize",n.update,Qc)}}const IU={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:OU,data:{}};var LU={left:"right",right:"left",bottom:"top",top:"bottom"};function $u(e){return e.replace(/left|right|bottom|top/g,function(t){return LU[t]})}var MU={start:"end",end:"start"};function lx(e){return e.replace(/start|end/g,function(t){return MU[t]})}function Vy(e){var t=fn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Uy(e){return Ks($o(e)).left+Vy(e).scrollLeft}function BU(e,t){var n=fn(e),r=$o(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=ZT();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Uy(e),y:l}}function zU(e){var t,n=$o(e),r=Vy(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ai(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ai(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Uy(e),l=-r.scrollTop;return Fr(o||n).direction==="rtl"&&(a+=ai(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Wy(e){var t=Fr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function eP(e){return["html","body","#document"].indexOf(pr(e))>=0?e.ownerDocument.body:_n(e)&&Wy(e)?e:eP(Yf(e))}function al(e,t){var n;t===void 0&&(t=[]);var r=eP(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=fn(r),s=o?[i].concat(i.visualViewport||[],Wy(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(al(Yf(s)))}function wg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function FU(e,t){var n=Ks(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function cx(e,t,n){return t===qT?wg(BU(e,n)):gi(t)?FU(t,n):wg(zU($o(e)))}function NU(e){var t=al(Yf(e)),n=["absolute","fixed"].indexOf(Fr(e).position)>=0,r=n&&_n(e)?ac(e):e;return gi(r)?t.filter(function(o){return gi(o)&&YT(o,r)&&pr(o)!=="body"}):[]}function DU(e,t,n,r){var o=t==="clippingParents"?NU(e):[].concat(t),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=cx(e,c,r);return l.top=ai(u.top,l.top),l.right=Pd(u.right,l.right),l.bottom=Pd(u.bottom,l.bottom),l.left=ai(u.left,l.left),l},cx(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function tP(e){var t=e.reference,n=e.element,r=e.placement,o=r?hr(r):null,i=r?Zs(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case Yt:l={x:s,y:t.y-n.height};break;case jn:l={x:s,y:t.y+t.height};break;case On:l={x:t.x+t.width,y:a};break;case Qt:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Dy(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Gs:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Vl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Ul(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?aU:a,c=n.rootBoundary,u=c===void 0?qT:c,d=n.elementContext,f=d===void 0?_a:d,p=n.altBoundary,g=p===void 0?!1:p,m=n.padding,w=m===void 0?0:m,b=XT(typeof w!="number"?w:JT(w,sc)),y=f===_a?lU:_a,x=e.rects.popper,S=e.elements[g?y:f],T=DU(gi(S)?S:S.contextElement||$o(e.elements.popper),l,u,s),E=Ks(e.elements.reference),C=tP({reference:E,element:x,strategy:"absolute",placement:o}),_=wg(Object.assign({},x,C)),B=f===_a?_:E,L={top:T.top-B.top+b.top,bottom:B.bottom-T.bottom+b.bottom,left:T.left-B.left+b.left,right:B.right-T.right+b.right},P=e.modifiersData.offset;if(f===_a&&P){var O=P[o];Object.keys(L).forEach(function(I){var U=[On,jn].indexOf(I)>=0?1:-1,$=[Yt,jn].indexOf(I)>=0?"y":"x";L[I]+=O[$]*U})}return L}function VU(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?KT:l,u=Zs(r),d=u?a?ix:ix.filter(function(g){return Zs(g)===u}):sc,f=d.filter(function(g){return c.indexOf(g)>=0});f.length===0&&(f=d);var p=f.reduce(function(g,m){return g[m]=Ul(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[hr(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function UU(e){if(hr(e)===zy)return[];var t=$u(e);return[lx(e),t,lx(t)]}function WU(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,g=p===void 0?!0:p,m=n.allowedAutoPlacements,w=t.options.placement,b=hr(w),y=b===w,x=l||(y||!g?[$u(w)]:UU(w)),S=[w].concat(x).reduce(function(H,Q){return H.concat(hr(Q)===zy?VU(t,{placement:Q,boundary:u,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:m}):Q)},[]),T=t.rects.reference,E=t.rects.popper,C=new Map,_=!0,B=S[0],L=0;L=0,$=U?"width":"height",j=Ul(t,{placement:P,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),F=U?I?On:Qt:I?jn:Yt;T[$]>E[$]&&(F=$u(F));var z=$u(F),D=[];if(i&&D.push(j[O]<=0),a&&D.push(j[F]<=0,j[z]<=0),D.every(function(H){return H})){B=P,_=!1;break}C.set(P,D)}if(_)for(var G=g?3:1,V=function(Q){var te=S.find(function(ne){var ue=C.get(ne);if(ue)return ue.slice(0,Q).every(function(he){return he})});if(te)return B=te,"break"},q=G;q>0;q--){var N=V(q);if(N==="break")break}t.placement!==B&&(t.modifiersData[r]._skip=!0,t.placement=B,t.reset=!0)}}const HU={name:"flip",enabled:!0,phase:"main",fn:WU,requiresIfExists:["offset"],data:{_skip:!1}};function ux(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function dx(e){return[Yt,On,jn,Qt].some(function(t){return e[t]>=0})}function GU(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=Ul(t,{elementContext:"reference"}),a=Ul(t,{altBoundary:!0}),l=ux(s,r),c=ux(a,o,i),u=dx(l),d=dx(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const qU={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:GU};function KU(e,t,n){var r=hr(e),o=[Qt,Yt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Qt,On].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function ZU(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=KT.reduce(function(u,d){return u[d]=KU(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const YU={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ZU};function QU(e){var t=e.state,n=e.name;t.modifiersData[n]=tP({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const XU={name:"popperOffsets",enabled:!0,phase:"read",fn:QU,data:{}};function JU(e){return e==="x"?"y":"x"}function e7(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,w=Ul(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),b=hr(t.placement),y=Zs(t.placement),x=!y,S=Dy(b),T=JU(S),E=t.modifiersData.popperOffsets,C=t.rects.reference,_=t.rects.popper,B=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,L=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(E){if(i){var I,U=S==="y"?Yt:Qt,$=S==="y"?jn:On,j=S==="y"?"height":"width",F=E[S],z=F+w[U],D=F-w[$],G=p?-_[j]/2:0,V=y===Gs?C[j]:_[j],q=y===Gs?-_[j]:-C[j],N=t.elements.arrow,H=p&&N?Ny(N):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:QT(),te=Q[U],ne=Q[$],ue=sl(0,C[j],H[j]),he=x?C[j]/2-G-ue-te-L.mainAxis:V-ue-te-L.mainAxis,Ae=x?-C[j]/2+G+ue+ne+L.mainAxis:q+ue+ne+L.mainAxis,ze=t.elements.arrow&&ac(t.elements.arrow),ce=ze?S==="y"?ze.clientTop||0:ze.clientLeft||0:0,ve=(I=P==null?void 0:P[S])!=null?I:0,St=F+he-ve-ce,Z=F+Ae-ve,ye=sl(p?Pd(z,St):z,F,p?ai(D,Z):D);E[S]=ye,O[S]=ye-F}if(a){var be,at=S==="x"?Yt:Qt,Ur=S==="x"?jn:On,kt=E[T],Kn=T==="y"?"height":"width",Wr=kt+w[at],gn=kt-w[Ur],ji=[Yt,Qt].indexOf(b)!==-1,ua=(be=P==null?void 0:P[T])!=null?be:0,hc=ji?Wr:kt-C[Kn]-_[Kn]-ua+L.altAxis,pc=ji?kt+C[Kn]+_[Kn]-ua-L.altAxis:gn,jo=p&&ji?CU(hc,kt,pc):sl(p?hc:Wr,kt,p?pc:gn);E[T]=jo,O[T]=jo-kt}t.modifiersData[r]=O}}const t7={name:"preventOverflow",enabled:!0,phase:"main",fn:e7,requiresIfExists:["offset"]};function n7(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function r7(e){return e===fn(e)||!_n(e)?Vy(e):n7(e)}function o7(e){var t=e.getBoundingClientRect(),n=qs(t.width)/e.offsetWidth||1,r=qs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function i7(e,t,n){n===void 0&&(n=!1);var r=_n(t),o=_n(t)&&o7(t),i=$o(t),s=Ks(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((pr(t)!=="body"||Wy(i))&&(a=r7(t)),_n(t)?(l=Ks(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Uy(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function s7(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function a7(e){var t=s7(e);return yU.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function l7(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function c7(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var fx={placement:"bottom",modifiers:[],strategy:"absolute"};function hx(){for(var e=arguments.length,t=new Array(e),n=0;n{}),x=v.useCallback(()=>{var L;!t||!g.current||!m.current||((L=y.current)==null||L.call(y),w.current=f7(g.current,m.current,{placement:b,modifiers:[rU,eU,JV,{...XV,enabled:!!f},{name:"eventListeners",...QV(s)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:a??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!d,options:{boundary:u}},...n??[]],strategy:o}),w.current.forceUpdate(),y.current=w.current.destroy)},[b,t,n,f,s,i,a,l,c,d,u,o]);v.useEffect(()=>()=>{var L;!g.current&&!m.current&&((L=w.current)==null||L.destroy(),w.current=null)},[]);const S=v.useCallback(L=>{g.current=L,x()},[x]),T=v.useCallback((L={},P=null)=>({...L,ref:Mt(S,P)}),[S]),E=v.useCallback(L=>{m.current=L,x()},[x]),C=v.useCallback((L={},P=null)=>({...L,ref:Mt(E,P),style:{...L.style,position:o,minWidth:f?void 0:"max-content",inset:"0 auto auto 0"}}),[o,E,f]),_=v.useCallback((L={},P=null)=>{const{size:O,shadowColor:I,bg:U,style:$,...j}=L;return{...j,ref:P,"data-popper-arrow":"",style:h7(L)}},[]),B=v.useCallback((L={},P=null)=>({...L,ref:P,"data-popper-arrow-inner":""}),[]);return{update(){var L;(L=w.current)==null||L.update()},forceUpdate(){var L;(L=w.current)==null||L.forceUpdate()},transformOrigin:tt.transformOrigin.varRef,referenceRef:S,popperRef:E,getPopperProps:C,getArrowProps:_,getArrowInnerProps:B,getReferenceProps:T}}function h7(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}function rP(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=oi(n),s=oi(t),[a,l]=v.useState(e.defaultIsOpen||!1),c=r!==void 0?r:a,u=r!==void 0,d=v.useId(),f=o??`disclosure-${d}`,p=v.useCallback(()=>{u||l(!1),s==null||s()},[u,s]),g=v.useCallback(()=>{u||l(!0),i==null||i()},[u,i]),m=v.useCallback(()=>{c?p():g()},[c,g,p]);function w(y={}){return{...y,"aria-expanded":c,"aria-controls":f,onClick(x){var S;(S=y.onClick)==null||S.call(y,x),m()}}}function b(y={}){return{...y,hidden:!c,id:f}}return{isOpen:c,onOpen:g,onClose:p,onToggle:m,isControlled:u,getButtonProps:w,getDisclosureProps:b}}function p7(e){const{isOpen:t,ref:n}=e,[r,o]=v.useState(t),[i,s]=v.useState(!1);return v.useEffect(()=>{i||(o(t),s(!0))},[t,i,r]),_s(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var l;const c=CV(n.current),u=new c.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(u)}}}function m7(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var g7={slideInBottom:{...cg,custom:{offsetY:16,reverse:!0}},slideInRight:{...cg,custom:{offsetX:16,reverse:!0}},scale:{...YE,custom:{initialScale:.95,reverse:!0}},none:{}},v7=Y(Ao.section),y7=e=>g7[e||"none"],oP=v.forwardRef((e,t)=>{const{preset:n,motionProps:r=y7(n),...o}=e;return h.jsx(v7,{ref:t,...r,...o})});oP.displayName="ModalTransition";var b7=Object.defineProperty,w7=(e,t,n)=>t in e?b7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x7=(e,t,n)=>(w7(e,typeof t!="symbol"?t+"":t,n),n),S7=class{constructor(){x7(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},xg=new S7;function iP(e,t){const[n,r]=v.useState(0);return v.useEffect(()=>{const o=e.current;if(o){if(t){const i=xg.add(o);r(i)}return()=>{xg.remove(o),r(0)}}},[t,e]),n}var k7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fi=new WeakMap,Xc=new WeakMap,Jc={},Tp=0,sP=function(e){return e&&(e.host||sP(e.parentNode))},C7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},E7=function(e,t,n,r){var o=C7(t,Array.isArray(e)?e:[e]);Jc[n]||(Jc[n]=new WeakMap);var i=Jc[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else{var p=f.getAttribute(r),g=p!==null&&p!=="false",m=(Fi.get(f)||0)+1,w=(i.get(f)||0)+1;Fi.set(f,m),i.set(f,w),s.push(f),m===1&&g&&Xc.set(f,!0),w===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}})};return u(t),a.clear(),Tp++,function(){s.forEach(function(d){var f=Fi.get(d)-1,p=i.get(d)-1;Fi.set(d,f),i.set(d,p),f||(Xc.has(d)||d.removeAttribute(r),Xc.delete(d)),p||d.removeAttribute(n)}),Tp--,Tp||(Fi=new WeakMap,Fi=new WeakMap,Xc=new WeakMap,Jc={})}},T7=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||k7(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),E7(r,o,n,"aria-hidden")):function(){return null}};function P7(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:s=!0,onOverlayClick:a,onEsc:l}=e,c=v.useRef(null),u=v.useRef(null),[d,f,p]=R7(r,"chakra-modal","chakra-modal--header","chakra-modal--body");_7(c,t&&s);const g=iP(c,t),m=v.useRef(null),w=v.useCallback(B=>{m.current=B.target},[]),b=v.useCallback(B=>{B.key==="Escape"&&(B.stopPropagation(),i&&(n==null||n()),l==null||l())},[i,n,l]),[y,x]=v.useState(!1),[S,T]=v.useState(!1),E=v.useCallback((B={},L=null)=>({role:"dialog",...B,ref:Mt(L,c),id:d,tabIndex:-1,"aria-modal":!0,"aria-labelledby":y?f:void 0,"aria-describedby":S?p:void 0,onClick:me(B.onClick,P=>P.stopPropagation())}),[p,S,d,f,y]),C=v.useCallback(B=>{B.stopPropagation(),m.current===B.target&&xg.isTopModal(c.current)&&(o&&(n==null||n()),a==null||a())},[n,o,a]),_=v.useCallback((B={},L=null)=>({...B,ref:Mt(L,u),onClick:me(B.onClick,C),onKeyDown:me(B.onKeyDown,b),onMouseDown:me(B.onMouseDown,w)}),[b,w,C]);return{isOpen:t,onClose:n,headerId:f,bodyId:p,setBodyMounted:T,setHeaderMounted:x,dialogRef:c,overlayRef:u,getDialogProps:E,getDialogContainerProps:_,index:g}}function _7(e,t){const n=e.current;v.useEffect(()=>{if(!(!e.current||!t))return T7(e.current)},[t,e,n])}function R7(e,...t){const n=v.useId(),r=e||n;return v.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[A7,sa]=nn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[$7,vi]=nn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),yi=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:i,initialFocusRef:s,finalFocusRef:a,returnFocusOnClose:l,blockScrollOnMount:c,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:f,lockFocusAcrossFrames:p,onCloseComplete:g}=t,m=Dr("Modal",t),b={...P7(t),autoFocus:o,trapFocus:i,initialFocusRef:s,finalFocusRef:a,returnFocusOnClose:l,blockScrollOnMount:c,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:f,lockFocusAcrossFrames:p};return h.jsx($7,{value:b,children:h.jsx(A7,{value:m,children:h.jsx(oa,{onExitComplete:g,children:b.isOpen&&h.jsx(ra,{...n,children:r})})})})};yi.displayName="Modal";var ju="right-scroll-bar-position",Ou="width-before-scroll-bar",j7="with-scroll-bars-hidden",O7="--removed-body-scroll-bar-size",aP=fT(),Pp=function(){},Qf=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Pp,onWheelCapture:Pp,onTouchMoveCapture:Pp}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,g=e.inert,m=e.allowPinchZoom,w=e.as,b=w===void 0?"div":w,y=e.gapMode,x=cT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,T=lT([n,t]),E=sr(sr({},x),o);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:aP,removeScrollBar:c,shards:d,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:y}),s?v.cloneElement(v.Children.only(a),sr(sr({},E),{ref:T})):v.createElement(b,sr({},E,{className:l,ref:T}),a))});Qf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qf.classNames={fullWidth:Ou,zeroRight:ju};var px,I7=function(){if(px)return px;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function L7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=I7();return t&&e.setAttribute("nonce",t),e}function M7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function B7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var z7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=L7())&&(M7(t,n),B7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},F7=function(){var e=z7();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lP=function(){var e=F7(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},N7={left:0,top:0,right:0,gap:0},_p=function(e){return parseInt(e||"",10)||0},D7=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[_p(n),_p(r),_p(o)]},V7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return N7;var t=D7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},U7=lP(),W7=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(j7,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(ju,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Ou,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(ju," .").concat(ju,` { + right: 0 `).concat(r,`; + } + + .`).concat(Ou," .").concat(Ou,` { + margin-right: 0 `).concat(r,`; + } + + body { + `).concat(O7,": ").concat(a,`px; + } +`)},H7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=v.useMemo(function(){return V7(o)},[o]);return v.createElement(U7,{styles:W7(i,!t,o,n?"":"!important")})},Sg=!1;if(typeof window<"u")try{var eu=Object.defineProperty({},"passive",{get:function(){return Sg=!0,!0}});window.addEventListener("test",eu,eu),window.removeEventListener("test",eu,eu)}catch{Sg=!1}var Ni=Sg?{passive:!1}:!1,G7=function(e){return e.tagName==="TEXTAREA"},cP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!G7(e)&&n[t]==="visible")},q7=function(e){return cP(e,"overflowY")},K7=function(e){return cP(e,"overflowX")},mx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=uP(e,r);if(o){var i=dP(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Z7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Y7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uP=function(e,t){return e==="v"?q7(t):K7(t)},dP=function(e,t){return e==="v"?Z7(t):Y7(t)},Q7=function(e,t){return e==="h"&&t==="rtl"?-1:1},X7=function(e,t,n,r,o){var i=Q7(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=dP(e,a),g=p[0],m=p[1],w=p[2],b=m-w-i*g;(g||b)&&uP(e,a)&&(d+=b,f+=g),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&d===0||!o&&s>d)||!u&&(o&&f===0||!o&&-s>f))&&(c=!0),c},tu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gx=function(e){return[e.deltaX,e.deltaY]},vx=function(e){return e&&"current"in e?e.current:e},J7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eW=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},tW=0,Di=[];function nW(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(tW++)[0],i=v.useState(lP)[0],s=v.useRef(e);v.useEffect(function(){s.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=k9([e.lockRef.current],(e.shards||[]).map(vx),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,w){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var b=tu(m),y=n.current,x="deltaX"in m?m.deltaX:y[0]-b[0],S="deltaY"in m?m.deltaY:y[1]-b[1],T,E=m.target,C=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&C==="h"&&E.type==="range")return!1;var _=mx(C,E);if(!_)return!0;if(_?T=C:(T=C==="v"?"h":"v",_=mx(C,E)),!_)return!1;if(!r.current&&"changedTouches"in m&&(x||S)&&(r.current=T),!T)return!0;var B=r.current||T;return X7(B,w,m,B==="h"?x:S,!0)},[]),l=v.useCallback(function(m){var w=m;if(!(!Di.length||Di[Di.length-1]!==i)){var b="deltaY"in w?gx(w):tu(w),y=t.current.filter(function(T){return T.name===w.type&&T.target===w.target&&J7(T.delta,b)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(vx).filter(Boolean).filter(function(T){return T.contains(w.target)}),S=x.length>0?a(w,x[0]):!s.current.noIsolation;S&&w.cancelable&&w.preventDefault()}}},[]),c=v.useCallback(function(m,w,b,y){var x={name:m,delta:w,target:b,should:y};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=v.useCallback(function(m){n.current=tu(m),r.current=void 0},[]),d=v.useCallback(function(m){c(m.type,gx(m),m.target,a(m,e.lockRef.current))},[]),f=v.useCallback(function(m){c(m.type,tu(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return Di.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ni),document.addEventListener("touchmove",l,Ni),document.addEventListener("touchstart",u,Ni),function(){Di=Di.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Ni),document.removeEventListener("touchmove",l,Ni),document.removeEventListener("touchstart",u,Ni)}},[]);var p=e.removeScrollBar,g=e.inert;return v.createElement(v.Fragment,null,g?v.createElement(i,{styles:eW(o)}):null,p?v.createElement(H7,{gapMode:e.gapMode}):null)}const rW=C9(aP,nW);var fP=v.forwardRef(function(e,t){return v.createElement(Qf,sr({},e,{ref:t,sideCar:rW}))});fP.classNames=Qf.classNames;const oW=fP;function iW(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:s,finalFocusRef:a,returnFocusOnClose:l,preserveScrollBarGap:c,lockFocusAcrossFrames:u,isOpen:d}=vi(),[f,p]=_E();v.useEffect(()=>{!f&&p&&setTimeout(p)},[f,p]);const g=iP(r,d);return h.jsx(UT,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:a,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:u,children:h.jsx(oW,{removeScrollBar:!c,allowPinchZoom:s,enabled:g===1&&i,forwardProps:!0,children:e.children})})}var bi=ee((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:i,...s}=e,{getDialogProps:a,getDialogContainerProps:l}=vi(),c=a(s,t),u=l(o),d=ae("chakra-modal__content",n),f=sa(),p={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...f.dialog},g={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...f.dialogContainer},{motionPreset:m}=vi();return h.jsx(iW,{children:h.jsx(Y.div,{...u,className:"chakra-modal__content-container",tabIndex:-1,__css:g,children:h.jsx(oP,{preset:m,motionProps:i,className:d,...c,__css:p,children:r})})})});bi.displayName="ModalContent";var Hy=ee((e,t)=>{const{className:n,...r}=e,o=ae("chakra-modal__footer",n),s={display:"flex",alignItems:"center",justifyContent:"flex-end",...sa().footer};return h.jsx(Y.footer,{ref:t,...r,__css:s,className:o})});Hy.displayName="ModalFooter";var wi=ee((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=vi();v.useEffect(()=>(i(!0),()=>i(!1)),[i]);const s=ae("chakra-modal__header",n),l={flex:0,...sa().header};return h.jsx(Y.header,{ref:t,className:s,id:o,...r,__css:l})});wi.displayName="ModalHeader";var sW=Y(Ao.div),xi=ee((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,s=ae("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...sa().overlay},{motionPreset:c}=vi(),d=o||(c==="none"?{}:ZE);return h.jsx(sW,{...d,__css:l,ref:t,className:s,...i})});xi.displayName="ModalOverlay";var Si=ee((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=vi();v.useEffect(()=>(i(!0),()=>i(!1)),[i]);const s=ae("chakra-modal__body",n),a=sa();return h.jsx(Y.div,{ref:t,className:s,id:o,...r,__css:a.body})});Si.displayName="ModalBody";var aa=ee((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=vi(),s=ae("chakra-modal__close-btn",r),a=sa();return h.jsx(qf,{ref:t,__css:a.closeButton,className:s,onClick:me(n,l=>{l.stopPropagation(),i()}),...o})});aa.displayName="ModalCloseButton";var[aW,Ai]=nn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[lW,lc]=nn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),hP=ee(function(t,n){const{getHeaderProps:r}=Ai(),o=lc();return h.jsx(Y.header,{...r(t,n),className:ae("chakra-popover__header",t.className),__css:o.header})});hP.displayName="PopoverHeader";function pP(e){const t=v.Children.only(e.children),{getTriggerProps:n}=Ai();return v.cloneElement(t,n(t.props,t.ref))}pP.displayName="PopoverTrigger";var Vi={click:"click",hover:"hover"};function cW(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:i=!0,autoFocus:s=!0,arrowSize:a,arrowShadowColor:l,trigger:c=Vi.click,openDelay:u=200,closeDelay:d=200,isLazy:f,lazyBehavior:p="unmount",computePositionOnMount:g,...m}=e,{isOpen:w,onClose:b,onOpen:y,onToggle:x}=rP(e),S=v.useRef(null),T=v.useRef(null),E=v.useRef(null),C=v.useRef(!1),_=v.useRef(!1);w&&(_.current=!0);const[B,L]=v.useState(!1),[P,O]=v.useState(!1),I=v.useId(),U=o??I,[$,j,F,z]=["popover-trigger","popover-content","popover-header","popover-body"].map(Z=>`${Z}-${U}`),{referenceRef:D,getArrowProps:G,getPopperProps:V,getArrowInnerProps:q,forceUpdate:N}=nP({...m,enabled:w||!!g}),H=p7({isOpen:w,ref:E});g9({enabled:w,ref:T}),WV(E,{focusRef:T,visible:w,shouldFocus:i&&c===Vi.click}),GV(E,{focusRef:r,visible:w,shouldFocus:s&&c===Vi.click});const Q=m7({wasSelected:_.current,enabled:f,mode:p,isSelected:H.present}),te=v.useCallback((Z={},ye=null)=>{const be={...Z,style:{...Z.style,transformOrigin:tt.transformOrigin.varRef,[tt.arrowSize.var]:a?`${a}px`:void 0,[tt.arrowShadowColor.var]:l},ref:Mt(E,ye),children:Q?Z.children:null,id:j,tabIndex:-1,role:"dialog",onKeyDown:me(Z.onKeyDown,at=>{n&&at.key==="Escape"&&b()}),onBlur:me(Z.onBlur,at=>{const Ur=yx(at),kt=Rp(E.current,Ur),Kn=Rp(T.current,Ur);w&&t&&(!kt&&!Kn)&&b()}),"aria-labelledby":B?F:void 0,"aria-describedby":P?z:void 0};return c===Vi.hover&&(be.role="tooltip",be.onMouseEnter=me(Z.onMouseEnter,()=>{C.current=!0}),be.onMouseLeave=me(Z.onMouseLeave,at=>{at.nativeEvent.relatedTarget!==null&&(C.current=!1,setTimeout(()=>b(),d))})),be},[Q,j,B,F,P,z,c,n,b,w,t,d,l,a]),ne=v.useCallback((Z={},ye=null)=>V({...Z,style:{visibility:w?"visible":"hidden",...Z.style}},ye),[w,V]),ue=v.useCallback((Z,ye=null)=>({...Z,ref:Mt(ye,S,D)}),[S,D]),he=v.useRef(),Ae=v.useRef(),ze=v.useCallback(Z=>{S.current==null&&D(Z)},[D]),ce=v.useCallback((Z={},ye=null)=>{const be={...Z,ref:Mt(T,ye,ze),id:$,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":j};return c===Vi.click&&(be.onClick=me(Z.onClick,x)),c===Vi.hover&&(be.onFocus=me(Z.onFocus,()=>{he.current===void 0&&y()}),be.onBlur=me(Z.onBlur,at=>{const Ur=yx(at),kt=!Rp(E.current,Ur);w&&t&&kt&&b()}),be.onKeyDown=me(Z.onKeyDown,at=>{at.key==="Escape"&&b()}),be.onMouseEnter=me(Z.onMouseEnter,()=>{C.current=!0,he.current=window.setTimeout(()=>y(),u)}),be.onMouseLeave=me(Z.onMouseLeave,()=>{C.current=!1,he.current&&(clearTimeout(he.current),he.current=void 0),Ae.current=window.setTimeout(()=>{C.current===!1&&b()},d)})),be},[$,w,j,c,ze,x,y,t,b,u,d]);v.useEffect(()=>()=>{he.current&&clearTimeout(he.current),Ae.current&&clearTimeout(Ae.current)},[]);const ve=v.useCallback((Z={},ye=null)=>({...Z,id:F,ref:Mt(ye,be=>{L(!!be)})}),[F]),St=v.useCallback((Z={},ye=null)=>({...Z,id:z,ref:Mt(ye,be=>{O(!!be)})}),[z]);return{forceUpdate:N,isOpen:w,onAnimationComplete:H.onComplete,onClose:b,getAnchorProps:ue,getArrowProps:G,getArrowInnerProps:q,getPopoverPositionerProps:ne,getPopoverProps:te,getTriggerProps:ce,getHeaderProps:ve,getBodyProps:St}}function Rp(e,t){return e===t||(e==null?void 0:e.contains(t))}function yx(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function mP(e){const t=Dr("Popover",e),{children:n,...r}=ft(e),o=Wv(),i=cW({...r,direction:o.direction});return h.jsx(aW,{value:i,children:h.jsx(lW,{value:t,children:Dn(n,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}mP.displayName="Popover";var Ap=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function gP(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:i,boxShadow:s,shadowColor:a}=e,{getArrowProps:l,getArrowInnerProps:c}=Ai(),u=lc(),d=(t=n??r)!=null?t:o,f=i??s;return h.jsx(Y.div,{...l(),className:"chakra-popover__arrow-positioner",children:h.jsx(Y.div,{className:ae("chakra-popover__arrow",e.className),...c(e),__css:{"--popper-arrow-shadow-color":Ap("colors",a),"--popper-arrow-bg":Ap("colors",d),"--popper-arrow-shadow":Ap("shadows",f),...u.arrow}})})}gP.displayName="PopoverArrow";var vP=ee(function(t,n){const{getBodyProps:r}=Ai(),o=lc();return h.jsx(Y.div,{...r(t,n),className:ae("chakra-popover__body",t.className),__css:o.body})});vP.displayName="PopoverBody";var yP=ee(function(t,n){const{onClose:r}=Ai(),o=lc();return h.jsx(qf,{size:"sm",onClick:r,className:ae("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});yP.displayName="PopoverCloseButton";function uW(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var dW={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},fW=Y(Ao.section),bP=ee(function(t,n){const{variants:r=dW,...o}=t,{isOpen:i}=Ai();return h.jsx(fW,{ref:n,variants:uW(r),initial:!1,animate:i?"enter":"exit",...o})});bP.displayName="PopoverTransition";var wP=ee(function(t,n){const{rootProps:r,motionProps:o,...i}=t,{getPopoverProps:s,getPopoverPositionerProps:a,onAnimationComplete:l}=Ai(),c=lc(),u={position:"relative",display:"flex",flexDirection:"column",...c.content};return h.jsx(Y.div,{...a(r),__css:c.popper,className:"chakra-popover__popper",children:h.jsx(bP,{...o,...s(i,n),onAnimationComplete:wj(l,i.onAnimationComplete),className:ae("chakra-popover__content",t.className),__css:u})})});wP.displayName="PopoverContent";var kg=ee(function(t,n){const r=Dr("Switch",t),{spacing:o="0.5rem",children:i,...s}=ft(t),{getIndicatorProps:a,getInputProps:l,getCheckboxProps:c,getRootProps:u,getLabelProps:d}=l9(s),f=v.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),p=v.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),g=v.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return h.jsxs(Y.label,{...u(),className:ae("chakra-switch",t.className),__css:f,children:[h.jsx("input",{className:"chakra-switch__input",...l({},n)}),h.jsx(Y.span,{...c(),className:"chakra-switch__track",__css:p,children:h.jsx(Y.span,{__css:r.thumb,className:"chakra-switch__thumb",...a()})}),i&&h.jsx(Y.span,{className:"chakra-switch__label",...d(),__css:g,children:i})]})});kg.displayName="Switch";var[hW,cc]=nn({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Xf=ee((e,t)=>{const n=Dr("Table",e),{className:r,layout:o,...i}=ft(e);return h.jsx(hW,{value:n,children:h.jsx(Y.table,{ref:t,__css:{tableLayout:o,...n.table},className:ae("chakra-table",r),...i})})});Xf.displayName="Table";var Gy=ee((e,t)=>{const n=cc();return h.jsx(Y.thead,{...e,ref:t,__css:n.thead})}),Ys=ee((e,t)=>{const n=cc();return h.jsx(Y.tr,{...e,ref:t,__css:n.tr})}),qy=ee((e,t)=>{const n=cc();return h.jsx(Y.tbody,{...e,ref:t,__css:n.tbody})}),$t=ee(({isNumeric:e,...t},n)=>{const r=cc();return h.jsx(Y.td,{...t,ref:n,__css:r.td,"data-is-numeric":e})}),jt=ee(({isNumeric:e,...t},n)=>{const r=cc();return h.jsx(Y.th,{...t,ref:n,__css:r.th,"data-is-numeric":e})});function pW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var mW=["h","minH","height","minHeight"],Ky=ee((e,t)=>{const n=qn("Textarea",e),{className:r,rows:o,...i}=ft(e),s=oT(i),a=o?pW(n,mW):n;return h.jsx(Y.textarea,{ref:t,rows:o,...s,className:ae("chakra-textarea",r),__css:a})});Ky.displayName="Textarea";var gW={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},Cg=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Iu=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function vW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:i,closeOnPointerDown:s=o,closeOnEsc:a=!0,onOpen:l,onClose:c,placement:u,id:d,isOpen:f,defaultIsOpen:p,arrowSize:g=10,arrowShadowColor:m,arrowPadding:w,modifiers:b,isDisabled:y,gutter:x,offset:S,direction:T,...E}=e,{isOpen:C,onOpen:_,onClose:B}=rP({isOpen:f,defaultIsOpen:p,onOpen:l,onClose:c}),{referenceRef:L,getPopperProps:P,getArrowInnerProps:O,getArrowProps:I}=nP({enabled:C,placement:u,arrowPadding:w,modifiers:b,gutter:x,offset:S,direction:T}),U=v.useId(),j=`tooltip-${d??U}`,F=v.useRef(null),z=v.useRef(),D=v.useCallback(()=>{z.current&&(clearTimeout(z.current),z.current=void 0)},[]),G=v.useRef(),V=v.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=void 0)},[]),q=v.useCallback(()=>{V(),B()},[B,V]),N=yW(F,q),H=v.useCallback(()=>{if(!y&&!z.current){C&&N();const ce=Iu(F);z.current=ce.setTimeout(_,t)}},[N,y,C,_,t]),Q=v.useCallback(()=>{D();const ce=Iu(F);G.current=ce.setTimeout(q,n)},[n,q,D]),te=v.useCallback(()=>{C&&r&&Q()},[r,Q,C]),ne=v.useCallback(()=>{C&&s&&Q()},[s,Q,C]),ue=v.useCallback(ce=>{C&&ce.key==="Escape"&&Q()},[C,Q]);_s(()=>Cg(F),"keydown",a?ue:void 0),_s(()=>{const ce=F.current;if(!ce)return null;const ve=zT(ce);return ve.localName==="body"?Iu(F):ve},"scroll",()=>{C&&i&&q()},{passive:!0,capture:!0}),v.useEffect(()=>{y&&(D(),C&&B())},[y,C,B,D]),v.useEffect(()=>()=>{D(),V()},[D,V]),_s(()=>F.current,"pointerleave",Q);const he=v.useCallback((ce={},ve=null)=>({...ce,ref:Mt(F,ve,L),onPointerEnter:me(ce.onPointerEnter,Z=>{Z.pointerType!=="touch"&&H()}),onClick:me(ce.onClick,te),onPointerDown:me(ce.onPointerDown,ne),onFocus:me(ce.onFocus,H),onBlur:me(ce.onBlur,Q),"aria-describedby":C?j:void 0}),[H,Q,ne,C,j,te,L]),Ae=v.useCallback((ce={},ve=null)=>P({...ce,style:{...ce.style,[tt.arrowSize.var]:g?`${g}px`:void 0,[tt.arrowShadowColor.var]:m}},ve),[P,g,m]),ze=v.useCallback((ce={},ve=null)=>{const St={...ce.style,position:"relative",transformOrigin:tt.transformOrigin.varRef};return{ref:ve,...E,...ce,id:j,role:"tooltip",style:St}},[E,j]);return{isOpen:C,show:H,hide:Q,getTriggerProps:he,getTooltipProps:ze,getTooltipPositionerProps:Ae,getArrowProps:I,getArrowInnerProps:O}}var $p="chakra-ui:close-tooltip";function yW(e,t){return v.useEffect(()=>{const n=Cg(e);return n.addEventListener($p,t),()=>n.removeEventListener($p,t)},[t,e]),()=>{const n=Cg(e),r=Iu(e);n.dispatchEvent(new r.CustomEvent($p))}}function bW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function wW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var xW=Y(Ao.div),ll=ee((e,t)=>{var n,r;const o=qn("Tooltip",e),i=ft(e),s=Wv(),{children:a,label:l,shouldWrapChildren:c,"aria-label":u,hasArrow:d,bg:f,portalProps:p,background:g,backgroundColor:m,bgColor:w,motionProps:b,...y}=i,x=(r=(n=g??m)!=null?n:f)!=null?r:w;if(x){o.bg=x;const P=MO(s,"colors",x);o[tt.arrowBg.var]=P}const S=vW({...y,direction:s.direction}),T=typeof a=="string"||c;let E;if(T)E=h.jsx(Y.span,{display:"inline-block",tabIndex:0,...S.getTriggerProps(),children:a});else{const P=v.Children.only(a);E=v.cloneElement(P,S.getTriggerProps(P.props,P.ref))}const C=!!u,_=S.getTooltipProps({},t),B=C?bW(_,["role","id"]):_,L=wW(_,["role","id"]);return l?h.jsxs(h.Fragment,{children:[E,h.jsx(oa,{children:S.isOpen&&h.jsx(ra,{...p,children:h.jsx(Y.div,{...S.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:h.jsxs(xW,{variants:gW,initial:"exit",animate:"enter",exit:"exit",...b,...B,__css:o,children:[l,C&&h.jsx(Y.span,{srOnly:!0,...L,children:u}),d&&h.jsx(Y.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:h.jsx(Y.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):h.jsx(h.Fragment,{children:a})});ll.displayName="Tooltip";var Eg={},bx=Vv;Eg.createRoot=bx.createRoot,Eg.hydrateRoot=bx.hydrateRoot;/** + * @remix-run/router v1.8.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Wl(){return Wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Zy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kW(){return Math.random().toString(36).substr(2,8)}function xx(e,t){return{usr:e.state,key:e.key,idx:t}}function Tg(e,t,n,r){return n===void 0&&(n=null),Wl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?la(t):t,{state:n,key:t&&t.key||r||kW()})}function _d(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function la(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function CW(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=so.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(Wl({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=so.Pop;let w=u(),b=w==null?null:w-c;c=w,l&&l({action:a,location:m.location,delta:b})}function f(w,b){a=so.Push;let y=Tg(m.location,w,b);n&&n(y,w),c=u()+1;let x=xx(y,c),S=m.createHref(y);try{s.pushState(x,"",S)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;o.location.assign(S)}i&&l&&l({action:a,location:m.location,delta:1})}function p(w,b){a=so.Replace;let y=Tg(m.location,w,b);n&&n(y,w),c=u();let x=xx(y,c),S=m.createHref(y);s.replaceState(x,"",S),i&&l&&l({action:a,location:m.location,delta:0})}function g(w){let b=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof w=="string"?w:_d(w);return rt(b,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,b)}let m={get action(){return a},get location(){return e(o,s)},listen(w){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(wx,d),l=w,()=>{o.removeEventListener(wx,d),l=null}},createHref(w){return t(o,w)},createURL:g,encodeLocation(w){let b=g(w);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(w){return s.go(w)}};return m}var Sx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Sx||(Sx={}));function EW(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?la(t):t,o=Yy(r.pathname||"/",n);if(o==null)return null;let i=xP(e);TW(i);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(rt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=yo([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(rt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),xP(i.children,t,u,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:OW(c,i.index),routesMeta:u})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of SP(i.path))o(i,s,l)}),t}function SP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=SP(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function TW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:IW(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const PW=/^:\w+$/,_W=3,RW=2,AW=1,$W=10,jW=-2,kx=e=>e==="*";function OW(e,t){let n=e.split("/"),r=n.length;return n.some(kx)&&(r+=jW),t&&(r+=RW),n.filter(o=>!kx(o)).reduce((o,i)=>o+(PW.test(i)?_W:i===""?AW:$W),r)}function IW(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function LW(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s{if(u==="*"){let f=a[d]||"";s=i.slice(0,i.length-f.length).replace(/(.)\/+$/,"$1")}return c[u]=FW(a[d]||"",u),c},{}),pathname:i,pathnameBase:s,pattern:e}}function BW(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function zW(e){try{return decodeURI(e)}catch(t){return Zy(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function FW(e,t){try{return decodeURIComponent(e)}catch(n){return Zy(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function Yy(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function NW(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?la(e):e;return{pathname:n?n.startsWith("/")?n:DW(n,t):t,search:UW(r),hash:WW(o)}}function DW(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function jp(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function CP(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=la(e):(o=Wl({},e),rt(!o.pathname||!o.pathname.includes("?"),jp("?","pathname","search",o)),rt(!o.pathname||!o.pathname.includes("#"),jp("#","pathname","hash",o)),rt(!o.search||!o.search.includes("#"),jp("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(r||s==null)a=n;else{let d=t.length-1;if(s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=NW(o,a),c=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const yo=e=>e.join("/").replace(/\/\/+/g,"/"),VW=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UW=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,WW=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function HW(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const EP=["post","put","patch","delete"];new Set(EP);const GW=["get",...EP];new Set(GW);/** + * React Router v6.15.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),s=v.useRef(!1);return _P(()=>{s.current=!0}),v.useCallback(function(l,c){if(c===void 0&&(c={}),!s.current)return;if(typeof l=="number"){n.go(l);return}let u=CP(l,JSON.parse(i),o,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:yo([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,i,o,e])}const ZW=v.createContext(null);function YW(e){let t=v.useContext(Vr).outlet;return t&&v.createElement(ZW.Provider,{value:e},t)}function AP(){let{matches:e}=v.useContext(Vr),t=e[e.length-1];return t?t.params:{}}function Xy(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=v.useContext(Vr),{pathname:o}=ca(),i=JSON.stringify(kP(r).map(s=>s.pathnameBase));return v.useMemo(()=>CP(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function QW(e,t){return XW(e,t)}function XW(e,t,n){uc()||rt(!1);let{navigator:r}=v.useContext($i),{matches:o}=v.useContext(Vr),i=o[o.length-1],s=i?i.params:{};i&&i.pathname;let a=i?i.pathnameBase:"/";i&&i.route;let l=ca(),c;if(t){var u;let m=typeof t=="string"?la(t):t;a==="/"||(u=m.pathname)!=null&&u.startsWith(a)||rt(!1),c=m}else c=l;let d=c.pathname||"/",f=a==="/"?d:d.slice(a.length)||"/",p=EW(e,{pathname:f}),g=rH(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:yo([a,r.encodeLocation?r.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:yo([a,r.encodeLocation?r.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n);return t&&g?v.createElement(Jf.Provider,{value:{location:Rd({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:so.Pop}},g):g}function JW(){let e=aH(),t=HW(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,i)}const eH=v.createElement(JW,null);class tH extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?v.createElement(Vr.Provider,{value:this.props.routeContext},v.createElement(PP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nH(e){let{routeContext:t,match:n,children:r}=e,o=v.useContext(Qy);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Vr.Provider,{value:t},r)}function rH(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let a=i.findIndex(l=>l.route.id&&(s==null?void 0:s[l.route.id]));a>=0||rt(!1),i=i.slice(0,Math.min(i.length,a+1))}return i.reduceRight((a,l,c)=>{let u=l.route.id?s==null?void 0:s[l.route.id]:null,d=null;n&&(d=l.route.errorElement||eH);let f=t.concat(i.slice(0,c+1)),p=()=>{let g;return u?g=d:l.route.Component?g=v.createElement(l.route.Component,null):l.route.element?g=l.route.element:g=a,v.createElement(nH,{match:l,routeContext:{outlet:a,matches:f,isDataRoute:n!=null},children:g})};return n&&(l.route.ErrorBoundary||l.route.errorElement||c===0)?v.createElement(tH,{location:n.location,revalidation:n.revalidation,component:d,error:u,children:p(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):p()},null)}var $P=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}($P||{}),Ad=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ad||{});function oH(e){let t=v.useContext(Qy);return t||rt(!1),t}function iH(e){let t=v.useContext(TP);return t||rt(!1),t}function sH(e){let t=v.useContext(Vr);return t||rt(!1),t}function jP(e){let t=sH(),n=t.matches[t.matches.length-1];return n.route.id||rt(!1),n.route.id}function aH(){var e;let t=v.useContext(PP),n=iH(Ad.UseRouteError),r=jP(Ad.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function lH(){let{router:e}=oH($P.UseNavigateStable),t=jP(Ad.UseNavigateStable),n=v.useRef(!1);return _P(()=>{n.current=!0}),v.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Rd({fromRouteId:t},i)))},[e,t])}function cH(e){return YW(e.context)}function xn(e){rt(!1)}function uH(e){let{basename:t="/",children:n=null,location:r,navigationType:o=so.Pop,navigator:i,static:s=!1}=e;uc()&&rt(!1);let a=t.replace(/^\/*/,"/"),l=v.useMemo(()=>({basename:a,navigator:i,static:s}),[a,i,s]);typeof r=="string"&&(r=la(r));let{pathname:c="/",search:u="",hash:d="",state:f=null,key:p="default"}=r,g=v.useMemo(()=>{let m=Yy(c,a);return m==null?null:{location:{pathname:m,search:u,hash:d,state:f,key:p},navigationType:o}},[a,c,u,d,f,p,o]);return g==null?null:v.createElement($i.Provider,{value:l},v.createElement(Jf.Provider,{children:n,value:g}))}function dH(e){let{children:t,location:n}=e;return QW(Pg(t),n)}new Promise(()=>{});function Pg(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let i=[...t,o];if(r.type===v.Fragment){n.push.apply(n,Pg(r.props.children,i));return}r.type!==xn&&rt(!1),!r.props.index||!r.props.children||rt(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Pg(r.props.children,i)),n.push(s)}),n}/** + * React Router DOM v6.15.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function fH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hH(e,t){return e.button===0&&(!t||t==="_self")&&!fH(e)}function _g(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function pH(e,t){let n=_g(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const mH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],gH=["aria-current","caseSensitive","className","end","style","to","children"],vH="startTransition",Cx=Hp[vH];function yH(e){let{basename:t,children:n,future:r,window:o}=e,i=v.useRef();i.current==null&&(i.current=SW({window:o,v5Compat:!0}));let s=i.current,[a,l]=v.useState({action:s.action,location:s.location}),{v7_startTransition:c}=r||{},u=v.useCallback(d=>{c&&Cx?Cx(()=>l(d)):l(d)},[l,c]);return v.useLayoutEffect(()=>s.listen(u),[s,u]),v.createElement(uH,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s})}const bH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rg=v.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:c,preventScrollReset:u}=t,d=OP(t,mH),{basename:f}=v.useContext($i),p,g=!1;if(typeof c=="string"&&wH.test(c)&&(p=c,bH))try{let y=new URL(window.location.href),x=c.startsWith("//")?new URL(y.protocol+c):new URL(c),S=Yy(x.pathname,f);x.origin===y.origin&&S!=null?c=S+x.search+x.hash:g=!0}catch{}let m=qW(c,{relative:o}),w=xH(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:o});function b(y){r&&r(y),y.defaultPrevented||w(y)}return v.createElement("a",$d({},d,{href:p||m,onClick:g||i?r:b,ref:n,target:l}))}),Ag=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,children:c}=t,u=OP(t,gH),d=Xy(l,{relative:u.relative}),f=ca(),p=v.useContext(TP),{navigator:g}=v.useContext($i),m=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,w=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;o||(w=w.toLowerCase(),b=b?b.toLowerCase():null,m=m.toLowerCase());let y=w===m||!s&&w.startsWith(m)&&w.charAt(m.length)==="/",x=b!=null&&(b===m||!s&&b.startsWith(m)&&b.charAt(m.length)==="/"),S=y?r:void 0,T;typeof i=="function"?T=i({isActive:y,isPending:x}):T=[i,y?"active":null,x?"pending":null].filter(Boolean).join(" ");let E=typeof a=="function"?a({isActive:y,isPending:x}):a;return v.createElement(Rg,$d({},u,{"aria-current":S,className:T,ref:n,style:E,to:l}),typeof c=="function"?c({isActive:y,isPending:x}):c)});var Ex;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(Ex||(Ex={}));var Tx;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Tx||(Tx={}));function xH(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s}=t===void 0?{}:t,a=RP(),l=ca(),c=Xy(e,{relative:s});return v.useCallback(u=>{if(hH(u,n)){u.preventDefault();let d=r!==void 0?r:_d(l)===_d(c);a(e,{replace:d,state:o,preventScrollReset:i,relative:s})}},[l,a,c,r,o,n,e,i,s])}function IP(e){let t=v.useRef(_g(e)),n=v.useRef(!1),r=ca(),o=v.useMemo(()=>pH(r.search,n.current?null:t.current),[r.search]),i=RP(),s=v.useCallback((a,l)=>{const c=_g(typeof a=="function"?a(o):a);n.current=!0,i("?"+c,l)},[i,o]);return[o,s]}let SH=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});Hl.bech32m=Vn=Hl.bech32=void 0;const jd="qpzry9x8gf2tvdw0s3jn54khce6mua7l",LP={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function Px(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=js(t)^r>>5}t=js(t);for(let n=0;n=n;)i-=n,a.push(o>>i&s);if(r)i>0&&a.push(o<=t)return"Excess padding";if(o<l)throw new TypeError("Exceeds length limit");s=s.toLowerCase();let c=Px(s);if(typeof c=="string")throw new Error(c);let u=s+"1";for(let d=0;d>5)throw new Error("Non 5-bit word");c=js(c)^f,u+=jd.charAt(f)}for(let d=0;d<6;++d)c=js(c);c^=t;for(let d=0;d<6;++d){const f=c>>(5-d)*5&31;u+=jd.charAt(f)}return u}function r(s,a){if(a=a||90,s.length<8)return s+" too short";if(s.length>a)return"Exceeds length limit";const l=s.toLowerCase(),c=s.toUpperCase();if(s!==l&&s!==c)return"Mixed-case string "+s;s=l;const u=s.lastIndexOf("1");if(u===-1)return"No separator character for "+s;if(u===0)return"Missing prefix for "+s;const d=s.slice(0,u),f=s.slice(u+1);if(f.length<6)return"Data too short";let p=Px(d);if(typeof p=="string")return p;const g=[];for(let m=0;m=f.length)&&g.push(b)}return p!==t?"Invalid checksum for "+s:{prefix:d,words:g}}function o(s,a){const l=r(s,a);if(typeof l=="object")return l}function i(s,a){const l=r(s,a);if(typeof l=="object")return l;throw new Error(l)}return{decodeUnsafe:o,decode:i,encode:n,toWords:kH,fromWordsUnsafe:CH,fromWords:EH}}var Vn=Hl.bech32=MP("bech32");Hl.bech32m=MP("bech32m");var BP={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(P){if(!Number.isSafeInteger(P))throw new Error(`Wrong integer: ${P}`)}e.assertNumber=t;function n(...P){const O=($,j)=>F=>$(j(F)),I=Array.from(P).reverse().reduce(($,j)=>$?O($,j.encode):j.encode,void 0),U=P.reduce(($,j)=>$?O($,j.decode):j.decode,void 0);return{encode:I,decode:U}}function r(P){return{encode:O=>{if(!Array.isArray(O)||O.length&&typeof O[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return O.map(I=>{if(t(I),I<0||I>=P.length)throw new Error(`Digit index outside alphabet: ${I} (alphabet: ${P.length})`);return P[I]})},decode:O=>{if(!Array.isArray(O)||O.length&&typeof O[0]!="string")throw new Error("alphabet.decode input should be array of strings");return O.map(I=>{if(typeof I!="string")throw new Error(`alphabet.decode: not string element=${I}`);const U=P.indexOf(I);if(U===-1)throw new Error(`Unknown letter: "${I}". Allowed: ${P}`);return U})}}}function o(P=""){if(typeof P!="string")throw new Error("join separator should be string");return{encode:O=>{if(!Array.isArray(O)||O.length&&typeof O[0]!="string")throw new Error("join.encode input should be array of strings");for(let I of O)if(typeof I!="string")throw new Error(`join.encode: non-string input=${I}`);return O.join(P)},decode:O=>{if(typeof O!="string")throw new Error("join.decode input should be string");return O.split(P)}}}function i(P,O="="){if(t(P),typeof O!="string")throw new Error("padding chr should be string");return{encode(I){if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("padding.encode input should be array of strings");for(let U of I)if(typeof U!="string")throw new Error(`padding.encode: non-string input=${U}`);for(;I.length*P%8;)I.push(O);return I},decode(I){if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("padding.encode input should be array of strings");for(let $ of I)if(typeof $!="string")throw new Error(`padding.decode: non-string input=${$}`);let U=I.length;if(U*P%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;U>0&&I[U-1]===O;U--)if(!((U-1)*P%8))throw new Error("Invalid padding: string has too much padding");return I.slice(0,U)}}}function s(P){if(typeof P!="function")throw new Error("normalize fn should be function");return{encode:O=>O,decode:O=>P(O)}}function a(P,O,I){if(O<2)throw new Error(`convertRadix: wrong from=${O}, base cannot be less than 2`);if(I<2)throw new Error(`convertRadix: wrong to=${I}, base cannot be less than 2`);if(!Array.isArray(P))throw new Error("convertRadix: data should be array");if(!P.length)return[];let U=0;const $=[],j=Array.from(P);for(j.forEach(F=>{if(t(F),F<0||F>=O)throw new Error(`Wrong integer: ${F}`)});;){let F=0,z=!0;for(let D=U;DO?l(O,P%O):P,c=(P,O)=>P+(O-l(P,O));function u(P,O,I,U){if(!Array.isArray(P))throw new Error("convertRadix2: data should be array");if(O<=0||O>32)throw new Error(`convertRadix2: wrong from=${O}`);if(I<=0||I>32)throw new Error(`convertRadix2: wrong to=${I}`);if(c(O,I)>32)throw new Error(`convertRadix2: carry overflow from=${O} to=${I} carryBits=${c(O,I)}`);let $=0,j=0;const F=2**I-1,z=[];for(const D of P){if(t(D),D>=2**O)throw new Error(`convertRadix2: invalid data word=${D} from=${O}`);if($=$<32)throw new Error(`convertRadix2: carry overflow pos=${j} from=${O}`);for(j+=O;j>=I;j-=I)z.push(($>>j-I&F)>>>0);$&=2**j-1}if($=$<=O)throw new Error("Excess padding");if(!U&&$)throw new Error(`Non-zero padding: ${$}`);return U&&j>0&&z.push($>>>0),z}function d(P){return t(P),{encode:O=>{if(!(O instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return a(Array.from(O),2**8,P)},decode:O=>{if(!Array.isArray(O)||O.length&&typeof O[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(a(O,P,2**8))}}}function f(P,O=!1){if(t(P),P<=0||P>32)throw new Error("radix2: bits should be in (0..32]");if(c(8,P)>32||c(P,8)>32)throw new Error("radix2: carry overflow");return{encode:I=>{if(!(I instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return u(Array.from(I),8,P,!O)},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(u(I,P,8,O))}}}function p(P){if(typeof P!="function")throw new Error("unsafeWrapper fn should be function");return function(...O){try{return P.apply(null,O)}catch{}}}function g(P,O){if(t(P),typeof O!="function")throw new Error("checksum fn should be function");return{encode(I){if(!(I instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const U=O(I).slice(0,P),$=new Uint8Array(I.length+P);return $.set(I),$.set(U,I.length),$},decode(I){if(!(I instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const U=I.slice(0,-P),$=O(U).slice(0,P),j=I.slice(-P);for(let F=0;FP.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(f(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),o("")),e.base64url=n(f(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),o(""));const m=P=>n(d(58),r(P),o(""));e.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const w=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(P){let O="";for(let I=0;In(g(4,O=>P(P(O))),e.base58);e.base58check=b;const y=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),x=[996825010,642813549,513874426,1027748829,705979059];function S(P){const O=P>>25;let I=(P&33554431)<<5;for(let U=0;U>U&1)===1&&(I^=x[U]);return I}function T(P,O,I=1){const U=P.length;let $=1;for(let j=0;j126)throw new Error(`Invalid prefix (${P})`);$=S($)^F>>5}$=S($);for(let j=0;jN)throw new TypeError(`Length ${H} exceeds limit ${N}`);return V=V.toLowerCase(),`${V}1${y.encode(q)}${T(V,q,O)}`}function z(V,q=90){if(typeof V!="string")throw new Error(`bech32.decode input should be string, not ${typeof V}`);if(V.length<8||q!==!1&&V.length>q)throw new TypeError(`Wrong string length: ${V.length} (${V}). Expected (8..${q})`);const N=V.toLowerCase();if(V!==N&&V!==V.toUpperCase())throw new Error("String must be lowercase or uppercase");V=N;const H=V.lastIndexOf("1");if(H===0||H===-1)throw new Error('Letter "1" must be present between prefix and data only');const Q=V.slice(0,H),te=V.slice(H+1);if(te.length<6)throw new Error("Data must be at least 6 characters long");const ne=y.decode(te).slice(0,-6),ue=T(Q,ne,O);if(!te.endsWith(ue))throw new Error(`Invalid checksum in ${V}: expected "${ue}"`);return{prefix:Q,words:ne}}const D=p(z);function G(V){const{prefix:q,words:N}=z(V,!1);return{prefix:q,words:N,bytes:U(N)}}return{encode:F,decode:z,decodeToBytes:G,decodeUnsafe:D,fromWords:U,fromWordsUnsafe:j,toWords:$}}e.bech32=E("bech32"),e.bech32m=E("bech32m"),e.utf8={encode:P=>new TextDecoder().decode(P),decode:P=>new TextEncoder().encode(P)},e.hex=n(f(4),r("0123456789abcdef"),o(""),s(P=>{if(typeof P!="string"||P.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof P} with length ${P.length}`);return P.toLowerCase()}));const C={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},_=`Invalid encoding type. Available types: ${Object.keys(C).join(", ")}`,B=(P,O)=>{if(typeof P!="string"||!C.hasOwnProperty(P))throw new TypeError(_);if(!(O instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return C[P].encode(O)};e.bytesToString=B,e.str=e.bytesToString;const L=(P,O)=>{if(!C.hasOwnProperty(P))throw new TypeError(_);if(typeof O!="string")throw new TypeError("stringToBytes() expects string");return C[P].decode(O)};e.stringToBytes=L,e.bytes=e.stringToBytes})(BP);const{bech32:rr,hex:Nn,utf8:TH}=BP,_x={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},Rx={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},Ax={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},$x={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},nu=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],PH={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},_H=BigInt("2100000000000000000"),jx=BigInt(1e11),$g={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},zP={};for(let e=0,t=Object.keys($g);eNn.encode(rr.fromWordsUnsafe(e)),16:e=>Nn.encode(rr.fromWordsUnsafe(e)),13:e=>TH.encode(rr.fromWordsUnsafe(e)),19:e=>Nn.encode(rr.fromWordsUnsafe(e)),23:e=>Nn.encode(rr.fromWordsUnsafe(e)),27:e=>Nn.encode(rr.fromWordsUnsafe(e)),6:Od,24:Od,3:$H,5:jH};function AH(e){return t=>({tagCode:parseInt(e),words:rr.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function Od(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function $H(e){const t=[];let n,r,o,i,s,a=rr.fromWordsUnsafe(e);for(;a.length>0;)n=Nn.encode(a.slice(0,33)),r=Nn.encode(a.slice(33,41)),o=parseInt(Nn.encode(a.slice(41,45)),16),i=parseInt(Nn.encode(a.slice(45,49)),16),s=parseInt(Nn.encode(a.slice(49,51)),16),a=a.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:o,fee_proportional_millionths:i,cltv_expiry_delta:s});return t}function jH(e){const t=e.slice().reverse().map(o=>[!!(o&1),!!(o&2),!!(o&4),!!(o&8),!!(o&16)]).reduce((o,i)=>o.concat(i),[]);for(;t.length{let s;t[i*2]?s="required":t[i*2+1]?s="supported":s="unsupported",n[o]=s});const r=t.slice(nu.length*2);return n.extra_bits={start_bit:nu.length*2,bits:r,has_required:r.reduce((o,i,s)=>s%2!==0?o||!1:o||i,!1)},n}function FP(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const o=BigInt(r),i=n?o*jx/PH[n]:o*jx;if(n==="p"&&o%BigInt(10)!==BigInt(0)||i>_H)throw new Error("Amount is outside of valid range");return t?i.toString():i}function OH(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=rr.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const o=r.prefix;let i=r.words,s=e.slice(o.length+1),a=i.slice(-104);i=i.slice(0,-104);let l=o.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=o.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const c=l[1];let u;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");u=t}else switch(c){case _x.bech32:u=_x;break;case Rx.bech32:u=Rx;break;case Ax.bech32:u=Ax;break;case $x.bech32:u=$x;break}if(!u||u.bech32!==c)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:c,value:u});const d=l[2];let f;if(d){const S=l[3];f=FP(d+S,!0),n.push({name:"amount",letters:l[2]+l[3],value:f})}else f=null;n.push({name:"separator",letters:"1"});const p=Od(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:s.slice(0,7),value:p}),s=s.slice(7);let g,m,w,b;for(;i.length>0;){const S=i[0].toString();g=zP[S]||"unknown_tag",m=RH[S]||AH(S),i=i.slice(1),w=Od(i.slice(0,2)),i=i.slice(2),b=i.slice(0,w),i=i.slice(w),n.push({name:g,tag:s[0],letters:s.slice(0,1+2+w),value:m(b)}),s=s.slice(1+2+w)}n.push({name:"signature",letters:s.slice(0,104),value:Nn.encode(rr.fromWordsUnsafe(a))}),s=s.slice(104),n.push({name:"checksum",letters:s});let y={paymentRequest:e,sections:n,get expiry(){let S=n.find(T=>T.name==="expiry");if(S)return x("timestamp")+S.value},get route_hints(){return n.filter(S=>S.name==="route_hint").map(S=>S.value)}};for(let S in $g)S!=="route_hint"&&Object.defineProperty(y,S,{get(){return x(S)}});return y;function x(S){let T=n.find(E=>E.name===S);return T?T.value:void 0}}var IH={decode:OH,hrpToMillisat:FP};function jg(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function LH(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function NP(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function MH(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");jg(e.outputLen),jg(e.blockLen)}function BH(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function zH(e,t){NP(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,Ip=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Qn=(e,t)=>e<<32-t|e>>>t,FH=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!FH)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function NH(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function e0(e){if(typeof e=="string"&&(e=NH(e)),!DP(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function DH(...e){const t=new Uint8Array(e.reduce((r,o)=>r+o.length,0));let n=0;return e.forEach(r=>{if(!DP(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class VP{clone(){return this._cloneInto()}}function UP(e){const t=r=>e().update(e0(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function WP(e=32){if(Op&&typeof Op.getRandomValues=="function")return Op.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function VH(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),s=Number(n>>o&i),a=Number(n&i),l=r?4:0,c=r?0:4;e.setUint32(t+l,s,r),e.setUint32(t+c,a,r)}class UH extends VP{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ip(this.buffer)}update(t){Qo.exists(this);const{view:n,buffer:r,blockLen:o}=this;t=e0(t);const i=t.length;for(let s=0;so-s&&(this.process(r,0),s=0);for(let d=s;du.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;de&t^~e&n,HH=(e,t,n)=>e&t^e&n^t&n,GH=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Yr=new Uint32Array(64);class HP extends UH{constructor(){super(64,32,8,!1),this.A=Zr[0]|0,this.B=Zr[1]|0,this.C=Zr[2]|0,this.D=Zr[3]|0,this.E=Zr[4]|0,this.F=Zr[5]|0,this.G=Zr[6]|0,this.H=Zr[7]|0}get(){const{A:t,B:n,C:r,D:o,E:i,F:s,G:a,H:l}=this;return[t,n,r,o,i,s,a,l]}set(t,n,r,o,i,s,a,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=s|0,this.G=a|0,this.H=l|0}process(t,n){for(let d=0;d<16;d++,n+=4)Yr[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const f=Yr[d-15],p=Yr[d-2],g=Qn(f,7)^Qn(f,18)^f>>>3,m=Qn(p,17)^Qn(p,19)^p>>>10;Yr[d]=m+Yr[d-7]+g+Yr[d-16]|0}let{A:r,B:o,C:i,D:s,E:a,F:l,G:c,H:u}=this;for(let d=0;d<64;d++){const f=Qn(a,6)^Qn(a,11)^Qn(a,25),p=u+f+WH(a,l,c)+GH[d]+Yr[d]|0,m=(Qn(r,2)^Qn(r,13)^Qn(r,22))+HH(r,o,i)|0;u=c,c=l,l=a,a=s+p|0,s=i,i=o,o=r,r=p+m|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,o,i,s,a,l,c,u)}roundClean(){Yr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class qH extends HP{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const Id=UP(()=>new HP);UP(()=>new qH);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const GP=BigInt(0),eh=BigInt(1),KH=BigInt(2),th=e=>e instanceof Uint8Array,ZH=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function mr(e){if(!th(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+o.length,0));let n=0;return e.forEach(r=>{if(!th(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function QH(e,t){if(e.length!==t.length)return!1;for(let n=0;nGP;e>>=eh,t+=1);return t}function eG(e,t){return e>>BigInt(t)&eh}const tG=(e,t,n)=>e|(n?eh:GP)<(KH<new Uint8Array(e),Ox=e=>Uint8Array.from(e);function ZP(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Lp(e),o=Lp(e),i=0;const s=()=>{r.fill(1),o.fill(0),i=0},a=(...d)=>n(o,r,...d),l=(d=Lp())=>{o=a(Ox([0]),d),r=a(),d.length!==0&&(o=a(Ox([1]),d),r=a())},c=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d{s(),l(d);let p;for(;!(p=f(c()));)l();return s(),p}}const nG={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function dc(e,t,n={}){const r=(o,i,s)=>{const a=nG[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=e[o];if(!(s&&l===void 0)&&!a(l,e))throw new Error(`Invalid param ${String(o)}=${l} (${typeof l}), expected ${i}`)};for(const[o,i]of Object.entries(t))r(o,i,!1);for(const[o,i]of Object.entries(n))r(o,i,!0);return e}const rG=Object.freeze(Object.defineProperty({__proto__:null,bitGet:eG,bitLen:JH,bitMask:r0,bitSet:tG,bytesToHex:mr,bytesToNumberBE:Xt,bytesToNumberLE:n0,concatBytes:ki,createHmacDrbg:ZP,ensureBytes:gt,equalBytes:QH,hexToBytes:Qs,hexToNumber:t0,numberToBytesBE:bo,numberToBytesLE:KP,numberToHexUnpadded:qP,numberToVarBytesBE:YH,utf8ToBytes:XH,validateObject:dc},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ct=BigInt(0),Qe=BigInt(1),Wo=BigInt(2),oG=BigInt(3),Og=BigInt(4),Ix=BigInt(5),Lx=BigInt(8);BigInt(9);BigInt(16);function yt(e,t){const n=e%t;return n>=ct?n:t+n}function iG(e,t,n){if(n<=ct||t 0");if(n===Qe)return ct;let r=Qe;for(;t>ct;)t&Qe&&(r=r*e%n),e=e*e%n,t>>=Qe;return r}function wn(e,t,n){let r=e;for(;t-- >ct;)r*=r,r%=n;return r}function Ig(e,t){if(e===ct||t<=ct)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=yt(e,t),r=t,o=ct,i=Qe;for(;n!==ct;){const a=r/n,l=r%n,c=o-i*a;r=n,n=l,o=i,i=c}if(r!==Qe)throw new Error("invert: does not exist");return yt(o,t)}function sG(e){const t=(e-Qe)/Wo;let n,r,o;for(n=e-Qe,r=0;n%Wo===ct;n/=Wo,r++);for(o=Wo;o(r[o]="function",r),t);return dc(e,n)}function uG(e,t,n){if(n 0");if(n===ct)return e.ONE;if(n===Qe)return t;let r=e.ONE,o=t;for(;n>ct;)n&Qe&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Qe;return r}function dG(e,t){const n=new Array(t.length),r=t.reduce((i,s,a)=>e.is0(s)?i:(n[a]=i,e.mul(i,s)),e.ONE),o=e.inv(r);return t.reduceRight((i,s,a)=>e.is0(s)?i:(n[a]=e.mul(i,n[a]),e.mul(i,s)),o),n}function o0(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function fG(e,t,n=!1,r={}){if(e<=ct)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:i}=o0(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=aG(e),a=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:r0(o),ZERO:ct,ONE:Qe,create:l=>yt(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return ct<=l&&ll===ct,isOdd:l=>(l&Qe)===Qe,neg:l=>yt(-l,e),eql:(l,c)=>l===c,sqr:l=>yt(l*l,e),add:(l,c)=>yt(l+c,e),sub:(l,c)=>yt(l-c,e),mul:(l,c)=>yt(l*c,e),pow:(l,c)=>uG(a,l,c),div:(l,c)=>yt(l*Ig(c,e),e),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>Ig(l,e),sqrt:r.sqrt||(l=>s(a,l)),invertBatch:l=>dG(a,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?KP(l,i):bo(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?n0(l):Xt(l)}});return Object.freeze(a)}function hG(e,t,n=!1){e=gt("privateHash",e);const r=e.length,o=o0(t).nByteLength+8;if(o<24||r1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${r}`);const i=n?n0(e):Xt(e);return yt(i,t-Qe)+Qe}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pG=BigInt(0),Mp=BigInt(1);function mG(e,t){const n=(o,i)=>{const s=i.negate();return o?s:i},r=o=>{const i=Math.ceil(t/o)+1,s=2**(o-1);return{windows:i,windowSize:s}};return{constTimeNegate:n,unsafeLadder(o,i){let s=e.ZERO,a=o;for(;i>pG;)i&Mp&&(s=s.add(a)),a=a.double(),i>>=Mp;return s},precomputeWindow(o,i){const{windows:s,windowSize:a}=r(i),l=[];let c=o,u=c;for(let d=0;d>=p,w>l&&(w-=f,s+=Mp);const b=m,y=m+Math.abs(w)-1,x=g%2!==0,S=w<0;w===0?u=u.add(n(x,i[b])):c=c.add(n(S,i[y]))}return{p:c,f:u}},wNAFCached(o,i,s,a){const l=o._WINDOW_SIZE||1;let c=i.get(o);return c||(c=this.precomputeWindow(o,l),l!==1&&i.set(o,a(c))),this.wNAF(l,c,s)}}}function YP(e){return cG(e.Fp),dc(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...o0(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function gG(e){const t=YP(e);dc(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:vG,hexToBytes:yG}=rG,Xo={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Xo;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:vG(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Xo,n=typeof e=="string"?yG(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:o,l:i}=Xo._parseInt(n.subarray(2)),{d:s,l:a}=Xo._parseInt(i);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s}},hexFromSig(e){const t=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,s=o.length/2,a=n(i),l=n(s);return`30${n(s+i+4)}02${l}${o}02${a}${r}`}},kr=BigInt(0),kn=BigInt(1);BigInt(2);const Mx=BigInt(3);BigInt(4);function bG(e){const t=gG(e),{Fp:n}=t,r=t.toBytes||((g,m,w)=>{const b=m.toAffine();return ki(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),o=t.fromBytes||(g=>{const m=g.subarray(1),w=n.fromBytes(m.subarray(0,n.BYTES)),b=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:w,y:b}});function i(g){const{a:m,b:w}=t,b=n.sqr(g),y=n.mul(b,g);return n.add(n.add(y,n.mul(g,m)),w)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function s(g){return typeof g=="bigint"&&krn.eql(x,n.ZERO);return y(w)&&y(b)?d.ZERO:new d(w,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const w=n.invertBatch(m.map(b=>b.pz));return m.map((b,y)=>b.toAffine(w[y])).map(d.fromAffine)}static fromHex(m){const w=d.fromAffine(o(gt("pointHex",m)));return w.assertValidity(),w}static fromPrivateKey(m){return d.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,c.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:m,y:w}=this.toAffine();if(!n.isValid(m)||!n.isValid(w))throw new Error("bad point: x or y not FE");const b=n.sqr(w),y=i(m);if(!n.eql(b,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){u(m);const{px:w,py:b,pz:y}=this,{px:x,py:S,pz:T}=m,E=n.eql(n.mul(w,T),n.mul(x,y)),C=n.eql(n.mul(b,T),n.mul(S,y));return E&&C}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:w}=t,b=n.mul(w,Mx),{px:y,py:x,pz:S}=this;let T=n.ZERO,E=n.ZERO,C=n.ZERO,_=n.mul(y,y),B=n.mul(x,x),L=n.mul(S,S),P=n.mul(y,x);return P=n.add(P,P),C=n.mul(y,S),C=n.add(C,C),T=n.mul(m,C),E=n.mul(b,L),E=n.add(T,E),T=n.sub(B,E),E=n.add(B,E),E=n.mul(T,E),T=n.mul(P,T),C=n.mul(b,C),L=n.mul(m,L),P=n.sub(_,L),P=n.mul(m,P),P=n.add(P,C),C=n.add(_,_),_=n.add(C,_),_=n.add(_,L),_=n.mul(_,P),E=n.add(E,_),L=n.mul(x,S),L=n.add(L,L),_=n.mul(L,P),T=n.sub(T,_),C=n.mul(L,B),C=n.add(C,C),C=n.add(C,C),new d(T,E,C)}add(m){u(m);const{px:w,py:b,pz:y}=this,{px:x,py:S,pz:T}=m;let E=n.ZERO,C=n.ZERO,_=n.ZERO;const B=t.a,L=n.mul(t.b,Mx);let P=n.mul(w,x),O=n.mul(b,S),I=n.mul(y,T),U=n.add(w,b),$=n.add(x,S);U=n.mul(U,$),$=n.add(P,O),U=n.sub(U,$),$=n.add(w,y);let j=n.add(x,T);return $=n.mul($,j),j=n.add(P,I),$=n.sub($,j),j=n.add(b,y),E=n.add(S,T),j=n.mul(j,E),E=n.add(O,I),j=n.sub(j,E),_=n.mul(B,$),E=n.mul(L,I),_=n.add(E,_),E=n.sub(O,_),_=n.add(O,_),C=n.mul(E,_),O=n.add(P,P),O=n.add(O,P),I=n.mul(B,I),$=n.mul(L,$),O=n.add(O,I),I=n.sub(P,I),I=n.mul(B,I),$=n.add($,I),P=n.mul(O,$),C=n.add(C,P),P=n.mul(j,$),E=n.mul(U,E),E=n.sub(E,P),P=n.mul(U,O),_=n.mul(j,_),_=n.add(_,P),new d(E,C,_)}subtract(m){return this.add(m.negate())}is0(){return this.equals(d.ZERO)}wNAF(m){return p.wNAFCached(this,c,m,w=>{const b=n.invertBatch(w.map(y=>y.pz));return w.map((y,x)=>y.toAffine(b[x])).map(d.fromAffine)})}multiplyUnsafe(m){const w=d.ZERO;if(m===kr)return w;if(a(m),m===kn)return this;const{endo:b}=t;if(!b)return p.unsafeLadder(this,m);let{k1neg:y,k1:x,k2neg:S,k2:T}=b.splitScalar(m),E=w,C=w,_=this;for(;x>kr||T>kr;)x&kn&&(E=E.add(_)),T&kn&&(C=C.add(_)),_=_.double(),x>>=kn,T>>=kn;return y&&(E=E.negate()),S&&(C=C.negate()),C=new d(n.mul(C.px,b.beta),C.py,C.pz),E.add(C)}multiply(m){a(m);let w=m,b,y;const{endo:x}=t;if(x){const{k1neg:S,k1:T,k2neg:E,k2:C}=x.splitScalar(w);let{p:_,f:B}=this.wNAF(T),{p:L,f:P}=this.wNAF(C);_=p.constTimeNegate(S,_),L=p.constTimeNegate(E,L),L=new d(n.mul(L.px,x.beta),L.py,L.pz),b=_.add(L),y=B.add(P)}else{const{p:S,f:T}=this.wNAF(w);b=S,y=T}return d.normalizeZ([b,y])[0]}multiplyAndAddUnsafe(m,w,b){const y=d.BASE,x=(T,E)=>E===kr||E===kn||!T.equals(y)?T.multiplyUnsafe(E):T.multiply(E),S=x(this,w).add(x(m,b));return S.is0()?void 0:S}toAffine(m){const{px:w,py:b,pz:y}=this,x=this.is0();m==null&&(m=x?n.ONE:n.inv(y));const S=n.mul(w,m),T=n.mul(b,m),E=n.mul(y,m);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(E,n.ONE))throw new Error("invZ was invalid");return{x:S,y:T}}isTorsionFree(){const{h:m,isTorsionFree:w}=t;if(m===kn)return!0;if(w)return w(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:w}=t;return m===kn?this:w?w(d,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),r(d,this,m)}toHex(m=!0){return mr(this.toRawBytes(m))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const f=t.nBitLength,p=mG(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:s}}function wG(e){const t=YP(e);return dc(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function xG(e){const t=wG(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function s($){return kr<$&&$mr(bo($,t.nByteLength));function g($){const j=r>>kn;return $>j}function m($){return g($)?a(-$):$}const w=($,j,F)=>Xt($.slice(j,F));class b{constructor(j,F,z){this.r=j,this.s=F,this.recovery=z,this.assertValidity()}static fromCompact(j){const F=t.nByteLength;return j=gt("compactSignature",j,F*2),new b(w(j,0,F),w(j,F,2*F))}static fromDER(j){const{r:F,s:z}=Xo.toSig(gt("DER",j));return new b(F,z)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(j){return new b(this.r,this.s,j)}recoverPublicKey(j){const{r:F,s:z,recovery:D}=this,G=C(gt("msgHash",j));if(D==null||![0,1,2,3].includes(D))throw new Error("recovery id invalid");const V=D===2||D===3?F+t.n:F;if(V>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const q=D&1?"03":"02",N=c.fromHex(q+p(V)),H=l(V),Q=a(-G*H),te=a(z*H),ne=c.BASE.multiplyAndAddUnsafe(N,Q,te);if(!ne)throw new Error("point at infinify");return ne.assertValidity(),ne}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Qs(this.toDERHex())}toDERHex(){return Xo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Qs(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const y={isValidPrivateKey($){try{return u($),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const $=t.randomBytes(n.BYTES+8),j=hG($,r);return bo(j,t.nByteLength)},precompute($=8,j=c.BASE){return j._setWindowSize($),j.multiply(BigInt(3)),j}};function x($,j=!0){return c.fromPrivateKey($).toRawBytes(j)}function S($){const j=$ instanceof Uint8Array,F=typeof $=="string",z=(j||F)&&$.length;return j?z===o||z===i:F?z===2*o||z===2*i:$ instanceof c}function T($,j,F=!0){if(S($))throw new Error("first arg must be private key");if(!S(j))throw new Error("second arg must be public key");return c.fromHex(j).multiply(u($)).toRawBytes(F)}const E=t.bits2int||function($){const j=Xt($),F=$.length*8-t.nBitLength;return F>0?j>>BigInt(F):j},C=t.bits2int_modN||function($){return a(E($))},_=r0(t.nBitLength);function B($){if(typeof $!="bigint")throw new Error("bigint expected");if(!(kr<=$&&$<_))throw new Error(`bigint expected < 2^${t.nBitLength}`);return bo($,t.nByteLength)}function L($,j,F=P){if(["recovered","canonical"].some(he=>he in F))throw new Error("sign() legacy options not supported");const{hash:z,randomBytes:D}=t;let{lowS:G,prehash:V,extraEntropy:q}=F;G==null&&(G=!0),$=gt("msgHash",$),V&&($=gt("prehashed msgHash",z($)));const N=C($),H=u(j),Q=[B(H),B(N)];if(q!=null){const he=q===!0?D(n.BYTES):q;Q.push(gt("extraEntropy",he,n.BYTES))}const te=ki(...Q),ne=N;function ue(he){const Ae=E(he);if(!f(Ae))return;const ze=l(Ae),ce=c.BASE.multiply(Ae).toAffine(),ve=a(ce.x);if(ve===kr)return;const St=a(ze*a(ne+ve*H));if(St===kr)return;let Z=(ce.x===ve?0:2)|Number(ce.y&kn),ye=St;return G&&g(St)&&(ye=m(St),Z^=1),new b(ve,ye,Z)}return{seed:te,k2sig:ue}}const P={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};function I($,j,F=P){const{seed:z,k2sig:D}=L($,j,F),G=t;return ZP(G.hash.outputLen,G.nByteLength,G.hmac)(z,D)}c.BASE._setWindowSize(8);function U($,j,F,z=O){var ce;const D=$;if(j=gt("msgHash",j),F=gt("publicKey",F),"strict"in z)throw new Error("options.strict was renamed to lowS");const{lowS:G,prehash:V}=z;let q,N;try{if(typeof D=="string"||D instanceof Uint8Array)try{q=b.fromDER(D)}catch(ve){if(!(ve instanceof Xo.Err))throw ve;q=b.fromCompact(D)}else if(typeof D=="object"&&typeof D.r=="bigint"&&typeof D.s=="bigint"){const{r:ve,s:St}=D;q=new b(ve,St)}else throw new Error("PARSE");N=c.fromHex(F)}catch(ve){if(ve.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(G&&q.hasHighS())return!1;V&&(j=t.hash(j));const{r:H,s:Q}=q,te=C(j),ne=l(Q),ue=a(te*ne),he=a(H*ne),Ae=(ce=c.BASE.multiplyAndAddUnsafe(N,ue,he))==null?void 0:ce.toAffine();return Ae?a(Ae.x)===H:!1}return{CURVE:t,getPublicKey:x,getSharedSecret:T,sign:I,verify:U,ProjectivePoint:c,Signature:b,utils:y}}class QP extends VP{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Qo.hash(t);const r=e0(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let s=0;snew QP(e,t).update(n).digest();XP.create=(e,t)=>new QP(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function SG(e){return{hash:e,hmac:(t,...n)=>XP(e,t,DH(...n)),randomBytes:WP}}function kG(e,t){const n=r=>xG({...e,...SG(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nh=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ld=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),JP=BigInt(1),Md=BigInt(2),Bx=(e,t)=>(e+t/Md)/t;function e_(e){const t=nh,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),c=e*e*e%t,u=c*c*e%t,d=wn(u,n,t)*u%t,f=wn(d,n,t)*u%t,p=wn(f,Md,t)*c%t,g=wn(p,o,t)*p%t,m=wn(g,i,t)*g%t,w=wn(m,a,t)*m%t,b=wn(w,l,t)*w%t,y=wn(b,a,t)*m%t,x=wn(y,n,t)*u%t,S=wn(x,s,t)*g%t,T=wn(S,r,t)*c%t,E=wn(T,Md,t);if(!Lg.eql(Lg.sqr(E),e))throw new Error("Cannot find square root");return E}const Lg=fG(nh,void 0,void 0,{sqrt:e_}),i0=kG({a:BigInt(0),b:BigInt(7),Fp:Lg,n:Ld,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ld,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-JP*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,s=BigInt("0x100000000000000000000000000000000"),a=Bx(i*e,t),l=Bx(-r*e,t);let c=yt(e-a*n-l*o,t),u=yt(-a*r-l*i,t);const d=c>s,f=u>s;if(d&&(c=t-c),f&&(u=t-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:f,k2:u}}}},Id),rh=BigInt(0),t_=e=>typeof e=="bigint"&&rhtypeof e=="bigint"&&rho.charCodeAt(0)));n=ki(r,r),zx[e]=n}return Id(ki(n,...t))}const s0=e=>e.toRawBytes(!0).slice(1),Mg=e=>bo(e,32),Bp=e=>yt(e,nh),Gl=e=>yt(e,Ld),a0=i0.ProjectivePoint,EG=(e,t,n)=>a0.BASE.multiplyAndAddUnsafe(e,t,n);function Bg(e){let t=i0.utils.normPrivateKeyToScalar(e),n=a0.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Gl(-t),bytes:s0(n)}}function n_(e){if(!t_(e))throw new Error("bad x: need 0 < x < p");const t=Bp(e*e),n=Bp(t*e+BigInt(7));let r=e_(n);r%Md!==rh&&(r=Bp(-r));const o=new a0(e,r,JP);return o.assertValidity(),o}function r_(...e){return Gl(Xt(Bd("BIP0340/challenge",...e)))}function TG(e){return Bg(e).bytes}function PG(e,t,n=WP(32)){const r=gt("message",e),{bytes:o,scalar:i}=Bg(t),s=gt("auxRand",n,32),a=Mg(i^Xt(Bd("BIP0340/aux",s))),l=Bd("BIP0340/nonce",a,o,r),c=Gl(Xt(l));if(c===rh)throw new Error("sign failed: k is zero");const{bytes:u,scalar:d}=Bg(c),f=r_(u,o,r),p=new Uint8Array(64);if(p.set(u,0),p.set(Mg(Gl(d+f*i)),32),!o_(p,r,o))throw new Error("sign: Invalid signature produced");return p}function o_(e,t,n){const r=gt("signature",e,64),o=gt("message",t),i=gt("publicKey",n,32);try{const s=n_(Xt(i)),a=Xt(r.subarray(0,32));if(!t_(a))return!1;const l=Xt(r.subarray(32,64));if(!CG(l))return!1;const c=r_(Mg(a),s0(s),o),u=EG(s,l,Gl(-c));return!(!u||!u.hasEvenY()||u.toAffine().x!==a)}catch{return!1}}const zg=(()=>({getPublicKey:TG,sign:PG,verify:o_,utils:{randomPrivateKey:i0.utils.randomPrivateKey,lift_x:n_,pointToBytes:s0,numberToBytesBE:bo,bytesToNumberBE:Xt,taggedHash:Bd,mod:yt}}))();var fc=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(fc||{}),Nt=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(Nt||{}),i_=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(i_||{}),Fa=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(Fa||{});function s_(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function _G(e){const t=[];for(const i of e){const s=new Uint8Array([i.type]);let a;i.type===1?a=new TextEncoder().encode(i.value):i.type===3?a=new Uint32Array([i.value]):a=s_(i.value);const l=new Uint8Array([a.length]);t.push(s),t.push(l),t.push(a)}let n=t.reduce((i,s)=>i+s.length,0);const r=new Uint8Array(n);let o=0;for(const i of t)r.set(i,o),o+=i.length;return r}function RG(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=a_(t.value),{type:t.type,value:n}})}function $G(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=s_(t[0].value):n=_G(t);const r=Vn.toWords(new Uint8Array(n.buffer));return Vn.encode(e,r,1023)}function jG(e){const{prefix:t,words:n}=Vn.decode(e,1023),r=new Uint8Array(Vn.fromWords(n));let o;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")o=[{type:0,value:a_(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=RG(r);o=AG(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:o}}function OG(e){return IH.decode(e)}function IG(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function LG(e){return["amount",e]}function l_(e){let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"&&(n=r[1]),r.length===3&&r[2]==="content-warning"&&r[0]==="l"&&(n=r[1]));return t?n:void 0}var MG=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/,BG=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g;function c_(e){if(typeof e!="string")return null;const t=e.match(MG);return t&&t.length===3?{prefix:t[1],bech32:`${t[1]}${t[2]}`}:null}function zG(e){return c_(e)!==null}function FG(e){const t=c_(e);return t===null?null:jG(t.bech32)}function NG(e,t){return`nostr:${$G(e,t)}`}function DG(e){return NG("npub",[{type:0,value:e}])}function l0(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function VG(e,t){if(!u_(e,t).isValid)return;const r=/(.*)?(wss:\/\/[a-zA-Z0-9.-]+)/,o={message:void 0,relayUrl:void 0,nurls:[]},i=r.exec(e);if(i)return o.message=i[1]?i[1].trim():void 0,o.relayUrl=i[2],o;const s=[],a=[];let l,c;const u=[];for(;(c=BG.exec(e))!==null;){const f=c[0];if(zG(f)){const p=FG(f);if(l=p.prefix,l==="npub"&&p.tlvItems.length>0){const g=p.tlvItems.filter(w=>w.type===0);if(g.length===0)continue;const m=g[0].value;s.push(m),u.push({index:c.index,length:f.length,replaceWith:m})}else if(l==="nprofile"){const g=p.tlvItems.filter(b=>b.type===0);if(g.length===0)continue;const m=g[0].value;s.push(m),u.push({index:c.index,length:f.length,replaceWith:m});const w=p.tlvItems.filter(b=>b.type===1);if(w.length===0)continue;for(const b of w)l0(b.value)?a.push(b.value):console.error(`Invalid relay url ${b.value}`)}}}let d=0;for(const{index:f,length:p,replaceWith:g}of u){const m=f+d;e=e.slice(0,m)+g+e.slice(m+p),d+=g.length-p}if(s.length>0&&l)return o.message=e.trim(),o.nurls=[{type:"npub",publicKeys:s,relayUrls:a}],o}function UG(e){if(!e)return"";let t=e.message?`${e.message} `:"";if(e.relayUrl)return`${t} ${e.relayUrl}`.trim();if(!e.nurls||e.nurls.length===0)return t.trim();for(const n of e.nurls)if(n.type==="npub")t+=`${DG(n.publicKeys[0])} `;else throw new Error(`Unsupported nurl type ${n.type}`);return t.trim()}function u_(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!l0(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return WG(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function WG(e){return/<[^>]*>/.test(e)}function HG(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let o=r[0],i=r[1],s=r[2],a;n.length===3&&(a=n[2]),t.push({kind:o,pubkey:i,identifier:s,relay:a})}if(t.length!==0)return t}function GG(e){const t=HG(e.tags);if(t)return t}function qG(e){const{kind:t,pubkey:n,identifier:r,relay:o}=e;return o?[`a:${t}:${n}:${r}, ${o}`]:[`a:${t}:${n}:${r}`]}function KG(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function ZG(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function YG(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function QG(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function XG(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let o=r[1]||"";t.includes(o)||t.push(o)}return t&&t.length>0?t:void 0}}function JG(e){return["d",e]}function eq(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function tq(e){return["lnurl",e]}function nq(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function rq(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function oq(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function iq(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function sq(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function aq(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(a=>a[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(a=>a[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let o;t[0].length===3?o=t[0][2]:r.length>0&&r[0].length===3&&(o=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!o||!i?void 0:{eventId:n,kind:o,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function lq(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const o=[];return t?(o.push(["e",t,n]),r&&o.push(["p",r])):r&&o.push(["p",r,n]),o}function cq(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function d_(e){return e?e.startsWith("Re:"):!1}function uq(e){return d_(e)?e:`Re: ${e}`}function dq(){const e=zg.utils.randomPrivateKey(),t=zg.getPublicKey(e);return{privateKey:mr(e),publicKey:mr(t)}}function fq(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var hq=new TextEncoder;new TextDecoder("utf-8");function f_(e){const t=Id(hq.encode(e));return mr(t)}function pq({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function mq(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function gq(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const o=OG(t.pr);let i;const s=o.sections.find(a=>a.name==="amount");if(s)i=s.value;else return!1;return!(n&&n.toString()!==i)}function vq(e){const t=new tn(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],o=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:o};return JSON.stringify(i)}var yq=new TextEncoder,Fx=new TextDecoder;function bq(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function wq(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=Vn.decode(e,2e4),n=new Uint8Array(Vn.fromWords(t));return Fx.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=bq(e);if(t){const{words:n}=Vn.decode(t,2e4),r=new Uint8Array(Vn.fromWords(n));return Fx.decode(r)}return e}throw new Error(`invalid url ${e}`)}function xq(e){const t=yq.encode(e),n=Vn.toWords(new Uint8Array(t));return Vn.encode("lnurl",n,2e4)}function h_(e){return e.endsWith(".onion")}function Sq(e){const[t,n]=e.split("@");return`${h_(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function kq(e){const[t,n]=e.split("@");return`${h_(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function Cq(e){let t=0;for(let n=0;nl[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),o]);const s=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=f_(s),Cq(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(l=>l[0]!=="nonce"),e.tags.push(["nonce",r.toString(),o]),e;if(n&&r>=n)return;r++}}function c0(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function Tq(e){return e.toLowerCase()}function Pq(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=zg.sign(e,t);return mr(n)}function _q(e){return e?JSON.stringify(e):""}function Rq(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var Aq=class{constructor(e){if(e){if(!c0(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=Tq(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(p_(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function p_(e){return!(e.length!==3||!Object.values(i_).includes(e[1].split(":")[0])||!c0(e[1].split(":")[1]))}function m_(e){const t=e.tags.filter(r=>r[0]==="i"&&p_(r));if(t.length===0)return;const n=[];for(const r of t){const o=new Aq;o.fromTag(r),n.push(o)}return n}var tn=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=fq(this.ToObj());this.id=f_(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,console.log(`Signing event ${this.id} with ${e.publicKey}`),this.sig=Pq(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=Eq(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}mentionUsers(e){if(!this.extractContent())this.content=UG({message:this.content,nurls:[{type:"npub",publicKeys:e}]});else throw new Error("Already has motified content")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t[0].publicKeys:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return VG(this.content,this.kind)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return YG(this)?ZG(this):KG(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return iq(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return sq(this)}addEventCoordinatesTag(e){this.addTag(qG(e))}hasEventCoordinatesTags(){return GG(this)}addIdentifierTag(e){this.addTag(JG(e))}hasIdentifierTags(){return XG(this)}addLnurlTag(e){this.addTag(tq(e))}hasLnurlTags(){return eq(this)}addAmountTag(e){this.addTag(LG(e))}hasAmountTags(){return IG(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return QG(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return cq(this)}addNonceTag(e){const t=rq(this,e);this.tags=t.tags}hasNonceTag(){return nq(this)}replaceNonceTag(e){const t=oq(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return l_(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return m_(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");lq(e).forEach(n=>this.addTag(n))}hasReportTags(){return aq(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return Nq({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=u_(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function $q(e){const t=new tn({content:e.text,kind:1});return e.subject&&t.addSubjectTag(e.subject),t}function jq(e){const t=new tn({content:e.text,kind:e.isDraft?30024:30023});return e.identifier&&t.addEventTag({eventId:e.identifier}),t}function Oq(e){const t=new tn({content:e.text,kind:1}),n=new tn(e.inResponseTo);if(n.kind!==1)throw new Error("Event you are responding to be SHORT_TEXT_NOTE");const r=n.hasSubjectTag();r?d_(r)?t.addSubjectTag(r):t.addSubjectTag(uq(r)):console.log("Event you are responding to does not have a subject.");const o=n.hasEventTags(),i=o?o.find(l=>l.marker==="root"):void 0;i?(t.addEventTag({eventId:i.eventId,relayUrl:e.relayUrl,marker:"root"}),t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"reply"})):t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"root"});const s=n.hasPublicKeyTags(),a=[];s&&a.push(s),a.push([n.pubkey,e.relayUrl]);for(const l of a)t.addPublicKeyTag(l[0],l[1]);return t}function Iq(e){if(e.text!=="+"&&e.text!=="-")throw new Error("Reaction must be either '+' or '-'");const t=new tn({content:e.text,kind:7,tags:[]});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function Lq(e){const t=new tn({content:JSON.stringify({...e.inResponseTo,relay:e.relayUrl}),kind:6});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function Mq(e){const t=new tn({content:_q(e.userMetadata),kind:0,tags:[]});if(e.claims)for(const n of e.claims)c0(n.identity)?t.addExternalIdentityClaimTag(n):console.log("Invalid provider name",n.identity);return e.mastodonUrl&&t.addTag(["mostr",e.mastodonUrl]),t}function Bq(e){if(!l0(e.relayUrl))throw new Error("Invalid server URL");const t=new tn({content:e.relayUrl,kind:2});return e.nonce&&t.addNonceTag(e.nonce),t}function zq(e){const t=new tn({content:"",kind:9734});return t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function Fq(e,t,n){const r=zq(e);r.signAndGenerateId(n);const o=r.toURI();return{event:r,eventUri:o,invoiceUrl:pq({callback:t,amount:e.amount,event:o,lnurl:e.lnurl})}}function Nq(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=vq(e.zapRequest),o=new tn({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&o.addEventTag({eventId:n[1]}),e.preimage&&o.addTag(["preimage",e.preimage]),o}var Co=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},Dq=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new tn(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const o=Rq(n.content);o&&(this.data=o)}const r=m_(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return kq(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return Sq(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return wq(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new Co;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const g_=Symbol("Comlink.proxy"),Vq=Symbol("Comlink.endpoint"),Uq=Symbol("Comlink.releaseProxy"),zp=Symbol("Comlink.finalizer"),Lu=Symbol("Comlink.thrown"),v_=e=>typeof e=="object"&&e!==null||typeof e=="function",Wq={canHandle:e=>v_(e)&&e[g_],serialize(e){const{port1:t,port2:n}=new MessageChannel;return b_(e,t),[n,[n]]},deserialize(e){return e.start(),x_(e)}},Hq={canHandle:e=>v_(e)&&Lu in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},y_=new Map([["proxy",Wq],["throw",Hq]]);function Gq(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function b_(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!Gq(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:i,type:s,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(Ho);let c;try{const u=a.slice(0,-1).reduce((f,p)=>f[p],e),d=a.reduce((f,p)=>f[p],e);switch(s){case"GET":c=d;break;case"SET":u[a.slice(-1)[0]]=Ho(o.data.value),c=!0;break;case"APPLY":c=d.apply(u,l);break;case"CONSTRUCT":{const f=new d(...l);c=Xq(f)}break;case"ENDPOINT":{const{port1:f,port2:p}=new MessageChannel;b_(e,p),c=Qq(f,[f])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[Lu]:0}}Promise.resolve(c).catch(u=>({value:u,[Lu]:0})).then(u=>{const[d,f]=Nd(u);t.postMessage(Object.assign(Object.assign({},d),{id:i}),f),s==="RELEASE"&&(t.removeEventListener("message",r),w_(t),zp in e&&typeof e[zp]=="function"&&e[zp]())}).catch(u=>{const[d,f]=Nd({value:new TypeError("Unserializable return value"),[Lu]:0});t.postMessage(Object.assign(Object.assign({},d),{id:i}),f)})}),t.start&&t.start()}function qq(e){return e.constructor.name==="MessagePort"}function w_(e){qq(e)&&e.close()}function x_(e,t){return Fg(e,[],t)}function ru(e){if(e)throw new Error("Proxy has been released and is not useable")}function S_(e){return Gi(e,{type:"RELEASE"}).then(()=>{w_(e)})}const zd=new WeakMap,Fd="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(zd.get(e)||0)-1;zd.set(e,t),t===0&&S_(e)});function Kq(e,t){const n=(zd.get(t)||0)+1;zd.set(t,n),Fd&&Fd.register(e,t,e)}function Zq(e){Fd&&Fd.unregister(e)}function Fg(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(i,s){if(ru(r),s===Uq)return()=>{Zq(o),S_(e),r=!0};if(s==="then"){if(t.length===0)return{then:()=>o};const a=Gi(e,{type:"GET",path:t.map(l=>l.toString())}).then(Ho);return a.then.bind(a)}return Fg(e,[...t,s])},set(i,s,a){ru(r);const[l,c]=Nd(a);return Gi(e,{type:"SET",path:[...t,s].map(u=>u.toString()),value:l},c).then(Ho)},apply(i,s,a){ru(r);const l=t[t.length-1];if(l===Vq)return Gi(e,{type:"ENDPOINT"}).then(Ho);if(l==="bind")return Fg(e,t.slice(0,-1));const[c,u]=Nx(a);return Gi(e,{type:"APPLY",path:t.map(d=>d.toString()),argumentList:c},u).then(Ho)},construct(i,s){ru(r);const[a,l]=Nx(s);return Gi(e,{type:"CONSTRUCT",path:t.map(c=>c.toString()),argumentList:a},l).then(Ho)}});return Kq(o,e),o}function Yq(e){return Array.prototype.concat.apply([],e)}function Nx(e){const t=e.map(Nd);return[t.map(n=>n[0]),Yq(t.map(n=>n[1]))]}const k_=new WeakMap;function Qq(e,t){return k_.set(e,t),e}function Xq(e){return Object.assign(e,{[g_]:!0})}function Nd(e){for(const[t,n]of y_)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},k_.get(e)||[]]}function Ho(e){switch(e.type){case"HANDLER":return y_.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Gi(e,t,n){return new Promise(r=>{const o=Jq();e.addEventListener("message",function i(s){!s.data||!s.data.id||s.data.id!==o||(e.removeEventListener("message",i),r(s.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function Jq(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const Dx=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,d))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,a),a},eK=e=>e?Dx(e):Dx;var C_={exports:{}},E_={},T_={exports:{}},P_={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Xs=v;function tK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nK=typeof Object.is=="function"?Object.is:tK,rK=Xs.useState,oK=Xs.useEffect,iK=Xs.useLayoutEffect,sK=Xs.useDebugValue;function aK(e,t){var n=t(),r=rK({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return iK(function(){o.value=n,o.getSnapshot=t,Fp(o)&&i({inst:o})},[e,n,t]),oK(function(){return Fp(o)&&i({inst:o}),e(function(){Fp(o)&&i({inst:o})})},[e]),sK(n),n}function Fp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nK(e,n)}catch{return!0}}function lK(e,t){return t()}var cK=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lK:aK;P_.useSyncExternalStore=Xs.useSyncExternalStore!==void 0?Xs.useSyncExternalStore:cK;T_.exports=P_;var uK=T_.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var oh=v,dK=uK;function fK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hK=typeof Object.is=="function"?Object.is:fK,pK=dK.useSyncExternalStore,mK=oh.useRef,gK=oh.useEffect,vK=oh.useMemo,yK=oh.useDebugValue;E_.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=mK(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=vK(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),o!==void 0&&s.hasValue){var g=s.value;if(o(g,p))return d=g}return d=p}if(g=d,hK(u,p))return g;var m=r(p);return o!==void 0&&o(g,m)?g:(u=p,d=m)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=pK(e,i[0],i[1]);return gK(function(){s.hasValue=!0,s.value=a},[a]),yK(a),a};C_.exports=E_;var bK=C_.exports;const wK=Ze(bK),{useSyncExternalStoreWithSelector:xK}=wK;function SK(e,t=e.getState,n){const r=xK(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return v.useDebugValue(r),r}const Vx=e=>{const t=typeof e=="function"?eK(e):e,n=(r,o)=>SK(t,r,o);return Object.assign(n,t),n},kK=e=>e?Vx(e):Vx,Rn=50,__={"wss://relay.shitforce.one":{read:!0,write:!0},"wss://relay.nostr.band":{read:!0,write:!0}};function CK(){const e=localStorage.getItem("nostr-client:keystore:keystore");if(e)if(e==="localstore"){const t=localStorage.getItem("nostr-client:keystore:public-key"),n=localStorage.getItem("nostr-client:keystore:private-key");if(t&&n)return{keystore:"localstore",publicKey:t,privateKey:n}}else{if(e==="nos2x")return{keystore:"nos2x",publicKey:void 0,privateKey:void 0};if(e==="download")return{keystore:"download",publicKey:void 0,privateKey:void 0}}return{keystore:"none",publicKey:void 0,privateKey:void 0}}function Np(e){localStorage.setItem("nostr-client:keystore:keystore",e.keystore),e.keystore==="localstore"&&e.publicKey&&e.privateKey?(localStorage.setItem("nostr-client:keystore:public-key",e.publicKey),localStorage.setItem("nostr-client:keystore:private-key",e.privateKey)):e.keystore==="nos2x"||e.keystore}const Ux=new Worker(new URL("/nostr-ts/assets/worker-99c26521.js",self.location),{type:"module"});function EK(e,t){let n=null,r=[];return function(o){r.push(o),n||(n=setTimeout(()=>{e(r),r=[],n=null},t))}}const K=kK((e,t)=>({store:x_(Ux),init:async n=>{await t().loadKeyStore(),await t().store.init(n);const o=EK(s=>{s.map(a=>{const l=a.data;if(l.type==="event:new"||l.type==="event:update"){const c=l.data;l.type==="event:new"?t().addEvent(c):l.type==="event:update"&&t().updateEvent(c)}else if(l.type==="relay:message"){const c=l.data;e({relayEvents:[...t().relayEvents,c]})}else l.type==="event:queue:update"&&t().updateQueueItem(l.data)})},100);Ux.addEventListener("message",o);const i=await t().store.getAllUsersFollowing();i&&e({followingUserIds:i.map(s=>s.user.pubkey)})},connected:!1,connect:async n=>{t().connected||(await t().store.connect(n),e({connected:!0}))},disconnect:async()=>{await t().store.disconnect(),e({connected:!1})},getRelays:async()=>t().store.getRelays(),updateRelay:async(n,r)=>t().store.updateRelay(n,r),relayEvents:[],getSubscriptions:async()=>t().store.getSubscriptions(),subscribe:async n=>t().store.subscribe(n),unsubscribe:async n=>(console.log(`Unsubscribing ${n}`),t().store.unsubscribe(n)),unsubscribeAll:async()=>(console.log("Unsubscribing all"),t().store.unsubscribeAll()),keystore:"none",loadKeyStore:()=>{const n=CK();e({keystore:n.keystore}),n.keystore==="localstore"&&n.publicKey&&n.privateKey&&e({keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0})},saveKeyStore:()=>{const n=t().keystore;if(n==="localstore"){const r=t().keypair;Np(r?{keystore:n,publicKey:r.publicKey,privateKey:r.privateKey}:{keystore:n})}},resetKeyStore:()=>{Np({keystore:"none"}),e({keystore:"none",keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1})},setKeyStore:n=>{n.keystore==="localstore"?(console.log(`Setting keystore for ${n.keystore}`,n),n.publicKey&&n.privateKey&&(e({keystore:n.keystore,keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().saveKeyStore())):n.keystore==="nos2x"?e({keystore:n.keystore,keypair:{publicKey:n.publicKey||""}}):console.error(`Unknown keystore ${n.keystore}`)},keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1,newEvent:new tn({kind:Nt.SHORT_TEXT_NOTE}),setNewEvent:n=>{e({newEvent:n})},newEventName:"NewShortTextNote",setNewEventName:n=>{e({newEventName:n})},setNewEventContent:n=>{e({newEvent:t().newEvent.setContentWithoutChecks(n)})},count:async n=>t().store.count(n),events:[],addEvent:n=>{e({events:[...t().events,n]})},updateEvent:n=>{const r=t().events.findIndex(o=>o.event.id===n.event.id);if(r!==-1){const o=[...t().events];o[r]=n,e({events:o})}},maxEvents:Rn,setMaxEvents:async n=>{await t().store.setMaxEvents(n),e({maxEvents:n})},determineApplicableRelays:async n=>{const r=await t().getRelays();return{relays:(n.relayUrls&&n.relayUrls.length>0?r.filter(i=>{var s;return(s=n.relayUrls)==null?void 0:s.includes(i.url)}):r).filter(i=>i.isReady&&i.write===!0),pow:0}},generateQueueItems:async n=>{let r=[];const{relays:o}=await t().determineApplicableRelays(n);if(n.relayUrls&&n.relayUrls.length>0?r=o.filter(s=>{var a;return(a=n.relayUrls)==null?void 0:a.includes(s.url)}):r=o,r.length===0)return;const i=[];for(const s of r)if(s.isReady&&s.write){const{relayUrls:a,...l}=n,c={...l,id:SH(),relayUrl:s.url,send:!1};i.push(c)}return i},addQueueItems:n=>{e({eventsPublishingQueue:[...t().eventsPublishingQueue,...n]})},updateQueueItem:async n=>{const r=t().eventsPublishingQueue,o=r.findIndex(i=>i.event.id===n.event.id);if(o!==-1){const i=[...r];i[o]=n,e({eventsPublishingQueue:i})}},getUser:async n=>t().store.getUser(n),addUser:async n=>t().store.addUser(n),updateUser:async n=>t().store.updateUser(n),countUsers:async()=>t().store.countUsers(),getEventById:n=>t().store.getEventById(n),eventProofOfWork:async(n,r)=>new Promise(o=>{const i=new Worker(new URL("/nostr-ts/assets/pow-worker-2b80afb9.js",self.location),{type:"module"});i.onmessage=function(s){o(s.data.result),i.terminate()},i.postMessage({event:n,bits:r})}),sendEvent:async n=>t().store.sendEvent(n),signAndSendEvent:async n=>{var f,p,g,m;const r=t().keypair;if(!r)throw new Error("Keypair not initialized");const o=t().keystore;let i=n.event;i.pubkey=r.publicKey,i.generateId();let s=n.relayUrls;const{relays:a,pow:l}=await t().determineApplicableRelays(n);if(a.length===0)throw(s==null?void 0:s.length)===0?new Error(`None of the required relays are available: ${s.join(", ")}.`):new Error("No write-enabled relays available.");s=a.map(w=>w.url);let c=n.pow;const u=l;if(c&&c!==0){if(c0){const w=await t().generateQueueItems({...n,relayUrls:s,pow:c});w&&(d=w),(p=(f=t()).addQueueItems)==null||p.call(f,d);const b=await t().eventProofOfWork(n.event,c);i=new tn(b);for(const y of d)y.event=i,y.powDone=Date.now()}if(o==="localstore")i.sign({privateKey:r.privateKey||"",publicKey:r.publicKey});else if(o==="nos2x")if(window.nostr&&window.nostr.signEvent){const w=await window.nostr.signEvent(i.ToObj());if(!w.sig)throw new Error("No signature");i.sig=w.sig}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore");if(i.isReadyToPublishOrThrow(),d.length===0){const w=await t().generateQueueItems({...n,relayUrls:s,pow:c,event:i});w&&(d=w),(m=(g=t()).addQueueItems)==null||m.call(g,d)}else for(const w of d)w.event=i,t().updateQueueItem(w);return await t().store.sendQueueItems(d),i.id},eventsPublishingQueue:[],clearEvents:async()=>{await t().store.clearEvents(),e({events:[]})},followUser:async n=>{await t().store.followUser(n);const r=await t().store.getAllUsersFollowing();r&&e({followingUserIds:r.map(o=>o.user.pubkey)})},unfollowUser:async n=>{await t().store.unfollowUser(n);const r=await t().store.getAllUsersFollowing();r&&e({followingUserIds:r.map(o=>o.user.pubkey)})},followingUser:async n=>t().store.followingUser(n),followingUserIds:[],getAllUsersFollowing:async()=>t().store.getAllUsersFollowing(),updateUserFollowing:async n=>t().store.updateUserFollowing(n),requestInformation:(n,r)=>t().store.requestInformation(n,r),hasSubscriptionForEventIds:async(n,r)=>t().store.hasSubscriptionForEventIds(n,r),hasViewSubscription:async n=>(await t().getSubscriptions()).some(o=>o.options&&o.options.view===n),setViewSubscription:async(n,r)=>{const o=await t().getSubscriptions(),i=[];for(const a of o)a.options&&a.options.view&&i.push(a.id);i.length>0&&await t().unsubscribe(i);const s=await t().getRelays();await t().subscribe({type:fc.REQ,filters:{...r,limit:r.limit?Math.round(r.limit/s.length):void 0},options:{view:n,timeoutIn:15e3}}),setTimeout(async()=>{await t().store.processActiveEvents(n)},1500),setTimeout(async()=>{await t().store.processActiveEvents(n)},6e3),setTimeout(async()=>{await t().store.processActiveEvents(n)},12e3)},removeViewSubscription:async n=>{const r=await t().getSubscriptions();console.log(`Remove view subscription ${n}`);const o=r.filter(i=>i.options&&i.options.view===n);o.length===0&&await t().unsubscribe(o.map(i=>i.id))}}));function TK(){const[e]=K(d=>[d.keystore]),[t]=K(d=>[d.keypairIsLoaded]),[n]=K(d=>[d.keypair]),[r]=K(d=>{var f;return[((f=d==null?void 0:d.keypair)==null?void 0:f.publicKey)||""]}),[o,i]=v.useState(!1),s=Ri(),[a,l]=v.useState(!1),c=()=>{const d=dq();K.getState().setKeyStore({keystore:"localstore",publicKey:d.publicKey,privateKey:d.privateKey})},u=async d=>{if(l(!0),window.nostr)try{const f=await window.nostr.getPublicKey();console.log(f),K.getState().setKeyStore({keystore:"nos2x",publicKey:f,privateKey:""}),l(!1)}catch(f){console.error("Error loading public key:",f),l(!1)}else{console.log(`Nostr extention not ready, retry ${d}`);const f=d?d+1:1;if(f>2){s({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),l(!1);return}setTimeout(()=>u(f),1e3)}};return h.jsxs(se,{children:[h.jsx(wt,{size:"lg",children:"Account"}),t?h.jsxs(le,{fontWeight:"bold",children:["Keypair loaded from ",e,"."]}):h.jsxs(h.Fragment,{children:[h.jsx(le,{fontWeight:"bold",marginBottom:2,children:"Keypair is not loaded."}),h.jsx(le,{marginBottom:2,children:"If you generate a new keypair, it will be stored in the browser local store (insecure). Alternatively get nos2x for Chrome, or nos2x-fox for Firefox, and store your keys in the extention (less insecure)."})]}),h.jsx(Ht,{marginTop:4,children:!e||(e==="none"?h.jsxs(h.Fragment,{children:[h.jsx(Te,{onClick:c,children:"Generate new keypair"}),h.jsx(Te,{isLoading:a,onClick:()=>u(),children:"Load from nos2x"})]}):h.jsx(Te,{onClick:()=>K.getState().resetKeyStore(),children:"Reset"}))}),n&&h.jsxs(se,{mt:4,children:[h.jsxs(_t,{marginBottom:4,children:[h.jsx(Rt,{children:"Public key:"}),h.jsx(mt,{type:"text",value:r,isReadOnly:!0})]}),e==="localstore"&&h.jsxs(_t,{marginBottom:4,children:[h.jsx(Rt,{children:"Private key:"}),h.jsxs(Ht,{spacing:2,children:[h.jsx(mt,{type:o?"text":"password",value:n.privateKey,isReadOnly:!0}),h.jsx(Te,{size:"sm",onClick:()=>i(!o),children:o?"Hide":"Show"})]})]})]})]})}function Ci(e,t){return e.length<=t?e:e?e.substring(0,t)+"...":"..."}function PK(){const[e,t]=v.useState(0),[n,r,o]=K(p=>[p.events.length,p.maxEvents,p.relayEvents]),[i,s]=v.useState(0),[a,l]=v.useState(0),[c,u]=v.useState(0),d=Ri(),f=async()=>{const p=await K.getState().countUsers();p&&t(p);const g=await K.getState().getSubscriptions();g&&l(g.length);const m=await K.getState().getRelays();m&&u(m.length)};return v.useEffect(()=>{const p=setInterval(f,1e3);return()=>clearInterval(p)},[]),v.useEffect(()=>{const p=o.length;if(p>0){const g=p-i;if(g>0){s(p);const m=o.slice(-g);for(const w of m){let b="",y=!0;if(w.data[0]===Fa.NOTICE)b=w.data[1];else if(w.data[0]===Fa.OK)b=`Event ${Ci(w.data[1],5)}: ${w.data[3]}`,y=w.data[2];else{if(w.data[0]===Fa.EOSE)return;w.data[0]===Fa.COUNT&&(b=`Relay ${w.data[1]}: ${JSON.stringify(w.data[2])} events`)}b!==""&&d({title:`Relay ${w.data[0]}`,position:"top-right",description:b,status:y?"info":"error",duration:5e3,isClosable:!0})}}}},[o]),h.jsx(se,{position:"fixed",bottom:0,left:0,right:0,p:3,backgroundColor:"gray.100",children:h.jsx(Ht,{spacing:4,children:h.jsxs(h.Fragment,{children:[h.jsxs(Ht,{spacing:2,children:[h.jsx(le,{fontSize:"sm",children:"Events:"}),h.jsxs(le,{fontSize:"xl",marginLeft:1,children:[n," (max ",r,")"]})]}),h.jsxs(Ht,{spacing:2,children:[h.jsx(le,{fontSize:"sm",children:"Users:"}),h.jsx(le,{fontSize:"xl",children:e})]}),h.jsx(Dl,{as:Ag,to:"/relays",children:h.jsxs(Ht,{spacing:2,children:[h.jsx(le,{fontSize:"sm",children:"Relays:"}),h.jsx(le,{fontSize:"xl",children:c})]})}),h.jsx(Dl,{as:Ag,to:"/subscriptions",children:h.jsxs(Ht,{spacing:2,children:[h.jsx(le,{fontSize:"sm",children:"Subscriptions:"}),h.jsx(le,{fontSize:"xl",children:a})]})})]})})})}function Ui({label:e,value:t,to:n,leftIcon:r}){return h.jsx(VV,{as:Ag,to:n,w:"100%",padding:2,border:"1px solid",borderColor:"gray.200",borderRadius:2,backgroundColor:"gray.100",_hover:{backgroundColor:"gray.300"},_activeLink:{backgroundColor:"gray.300"},children:h.jsxs(Ht,{children:[r,h.jsx(le,{fontSize:"md",fontWeight:"bold",children:e}),t&&h.jsx(le,{fontSize:"md",children:t})]})})}function _K(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Dd=_K(v),RK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Wx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=AK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Dd.createElement("svg",RK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Dd.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,13V18L3,20H10V18H5V13H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M14,15H20V19H14V15Z"}))},$K=Dd.memo?Dd.memo(Wx):Wx,jK=$K;const OK=Ze(jK);function IK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Vd=IK(v),LK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Hx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=MK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Vd.createElement("svg",LK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Vd.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"}))},BK=Vd.memo?Vd.memo(Hx):Hx,zK=BK;const FK=Ze(zK);function NK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Ud=NK(v),DK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Gx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=VK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Ud.createElement("svg",DK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Ud.createElement("path",{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}))},UK=Ud.memo?Ud.memo(Gx):Gx,WK=UK;const HK=Ze(WK);function GK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Wd=GK(v),qK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},qx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=KK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Wd.createElement("svg",qK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Wd.createElement("path",{d:"M11 10V12H9V14H7V12H5.8C5.4 13.2 4.3 14 3 14C1.3 14 0 12.7 0 11S1.3 8 3 8C4.3 8 5.4 8.8 5.8 10H11M3 10C2.4 10 2 10.4 2 11S2.4 12 3 12 4 11.6 4 11 3.6 10 3 10M16 14C18.7 14 24 15.3 24 18V20H8V18C8 15.3 13.3 14 16 14M16 12C13.8 12 12 10.2 12 8S13.8 4 16 4 20 5.8 20 8 18.2 12 16 12Z"}))},ZK=Wd.memo?Wd.memo(qx):qx,YK=ZK;const QK=Ze(YK);function XK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Hd=XK(v),JK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Kx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=eZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Hd.createElement("svg",JK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Hd.createElement("path",{d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"}))},tZ=Hd.memo?Hd.memo(Kx):Kx,nZ=tZ;const rZ=Ze(nZ);function oZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Gd=oZ(v),iZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Zx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=sZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Gd.createElement("svg",iZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Gd.createElement("path",{d:"M18 5H6V7H18M6 9H18V11H6M2 12H4V17H20V12H22V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17M18 13H6V15H18Z"}))},aZ=Gd.memo?Gd.memo(Zx):Zx,lZ=aZ;const cZ=Ze(lZ);function uZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var qd=uZ(v),dZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Yx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=fZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return qd.createElement("svg",dZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),qd.createElement("path",{d:"M17 19.1L19.5 20.6L18.8 17.8L21 15.9L18.1 15.7L17 13L15.9 15.6L13 15.9L15.2 17.8L14.5 20.6L17 19.1M3 14H11V16H3V14M3 6H15V8H3V6M3 10H15V12H3V10Z"}))},hZ=qd.memo?qd.memo(Yx):Yx,pZ=hZ;const mZ=Ze(pZ);function gZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Kd=gZ(v),vZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Qx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=yZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Kd.createElement("svg",vZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Kd.createElement("path",{d:"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z"}))},bZ=Kd.memo?Kd.memo(Qx):Qx,wZ=bZ;const xZ=Ze(wZ);function Xx(e){return Object.entries(e).map(([t,{read:n,write:r}])=>({url:t,read:n,write:r}))}function SZ({isOpen:e,onClose:t}){const[n,r]=v.useState(Xx(__)),[o,i]=v.useState(""),[s,a]=v.useState(!1),[l,c]=v.useState(!1),u=Ri(),d=async p=>{if(a(!0),window.nostr&&window.nostr.getRelays)try{const g=await window.nostr.getRelays();r(Xx(g)),a(!1)}catch(g){console.error("Error loading relays:",g);let m="Unknown error";g instanceof Error&&(m=g.message),u({title:"Error loading relays",description:m,status:"error",duration:5e3,isClosable:!0}),a(!1)}else{console.log(`Nostr extention not ready, retry ${p}`);const g=p?p+1:1;if(g>2){u({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),a(!1);return}setTimeout(()=>d(g),1e3)}};v.useEffect(()=>{const p=localStorage.getItem("nostr-client:relays");p&&r(JSON.parse(p))},[]);const f=async()=>{c(!0),localStorage.setItem("nostr-client:relays",JSON.stringify(n)),await K.getState().connect(n),c(!1),t()};return h.jsxs(yi,{isOpen:e,onClose:t,children:[h.jsx(xi,{}),h.jsxs(bi,{children:[h.jsx(wi,{children:"Connect to Relay(s)"}),h.jsx(aa,{}),h.jsxs(Si,{children:[h.jsxs(le,{children:["You can find a list of relays in the nostr-ts repository",h.jsx(Dl,{marginLeft:1,href:"https://github.com/franzos/nostr-ts/blob/master/discovered-relays.json",isExternal:!0,color:"blue.500",children:"github.com/franzos/nostr-ts"}),",",h.jsx(Dl,{marginLeft:1,marginRight:1,href:"https://nostr.info/relays/",isExternal:!0,color:"blue.500",children:"nostr.info"}),"and elsewhere."]}),h.jsx(il,{spacing:3,width:"100%",children:n&&n.map(p=>h.jsxs(Td,{width:"100%",alignItems:"center",borderBottom:"1px solid",borderColor:"gray.200",py:2,children:[h.jsx(le,{flex:"1",marginLeft:"2",children:p.url}),h.jsx(Te,{ml:"auto",onClick:()=>{const g=n.filter(m=>m.url!==p.url);r(g)},children:"Remove"})]},p.url))}),h.jsxs(Td,{direction:"row",alignItems:"center",children:[h.jsx(mt,{flex:"1",value:o,onChange:p=>i(p.target.value),placeholder:"Enter new relay URL"}),h.jsx(Te,{ml:2,onClick:()=>{o.trim()!==""&&(r([...n,{url:o,read:!0,write:!0}]),i(""))},children:"Add"})]}),h.jsx(Te,{isLoading:s,onClick:()=>d(),size:"xs",marginTop:2,children:"Load from nos2x"})]}),h.jsx(Hy,{children:h.jsx(Te,{colorScheme:"green",isDisabled:n.length===0,isLoading:l,onClick:f,children:"Connect"})})]})]})}function kZ(){const[e,t,n,r]=K(d=>{var f;return[d.connected,d.keystore,d.eventsPublishingQueue.length,((f=d.keypair)==null?void 0:f.publicKey)||""]}),[o,i]=v.useState([]),{isOpen:s,onOpen:a,onClose:l}=Hs(),c=async()=>{const d=await K.getState().getAllUsersFollowing();d&&i(d)};v.useEffect(()=>{const d=setInterval(c,1e3);return()=>clearInterval(d)},[]);const u=h.jsxs(il,{align:"start",spacing:5,w:"100%",children:[h.jsx(Ui,{label:"Home",to:"/",leftIcon:h.jsx(je,{as:HK,marginRight:1})}),e&&h.jsxs(h.Fragment,{children:[h.jsx(Ui,{label:"Following feed",to:"/following-feed",leftIcon:h.jsx(je,{as:mZ,marginRight:1})}),h.jsx(Ui,{label:"Following",value:o.length,to:"/following",leftIcon:h.jsx(je,{as:rZ,marginRight:1})}),h.jsx(Ui,{label:"Queue",value:n,to:"/queue",leftIcon:h.jsx(je,{as:cZ,marginRight:1})}),r&&r!==""&&h.jsx(Ui,{label:"Profile",to:"/profile",leftIcon:h.jsx(je,{as:xZ,marginRight:1})})]}),h.jsx(Ui,{label:"Account",value:t,to:"/account",leftIcon:h.jsx(je,{as:QK,marginRight:1})}),e?h.jsxs(Te,{w:"100%",colorScheme:"red",onClick:K.getState().disconnect,children:[h.jsx(je,{as:FK,marginRight:1}),"Disconnect"]}):h.jsx(Te,{w:"100%",colorScheme:"green",onClick:a,leftIcon:h.jsx(je,{as:OK}),children:"Connect to relay(s)"})]});return h.jsxs(h.Fragment,{children:[h.jsxs(GT,{maxW:"8xl",p:5,marginBottom:14,children:[h.jsxs(il,{spacing:5,align:"stretch",children:[h.jsx(il,{spacing:1,align:"start",children:h.jsx(wt,{as:"h1",size:"lg",children:"Nostr Client"})}),h.jsxs(ia,{templateColumns:["1fr","1fr 4fr"],gap:20,children:[u,h.jsx(se,{children:h.jsx(cH,{})})]})]}),SZ({isOpen:s,onOpen:a,onClose:l})]}),h.jsx(PK,{})]})}function CZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Zd=CZ(v),EZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Jx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=TZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Zd.createElement("svg",EZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Zd.createElement("path",{d:"M23,10C23,8.89 22.1,8 21,8H14.68L15.64,3.43C15.66,3.33 15.67,3.22 15.67,3.11C15.67,2.7 15.5,2.32 15.23,2.05L14.17,1L7.59,7.58C7.22,7.95 7,8.45 7,9V19A2,2 0 0,0 9,21H18C18.83,21 19.54,20.5 19.84,19.78L22.86,12.73C22.95,12.5 23,12.26 23,12V10M1,21H5V9H1V21Z"}))},PZ=Zd.memo?Zd.memo(Jx):Jx,_Z=PZ;const RZ=Ze(_Z);function AZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Yd=AZ(v),$Z=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},eS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=jZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Yd.createElement("svg",$Z({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Yd.createElement("path",{d:"M19,15H23V3H19M15,3H6C5.17,3 4.46,3.5 4.16,4.22L1.14,11.27C1.05,11.5 1,11.74 1,12V14A2,2 0 0,0 3,16H9.31L8.36,20.57C8.34,20.67 8.33,20.77 8.33,20.88C8.33,21.3 8.5,21.67 8.77,21.94L9.83,23L16.41,16.41C16.78,16.05 17,15.55 17,15V5C17,3.89 16.1,3 15,3Z"}))},OZ=Yd.memo?Yd.memo(eS):eS,IZ=OZ;const LZ=Ze(IZ);function MZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Qd=MZ(v),BZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},tS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=zZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Qd.createElement("svg",BZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Qd.createElement("path",{d:"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z"}))},FZ=Qd.memo?Qd.memo(tS):tS,NZ=FZ;const Ng=Ze(NZ),DZ=e=>{const t=new Date,n=new Date(e*1e3),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),i=Math.floor(o/60),s=Math.floor(i/60);return o<60?`${o} seconds ago`:i<60?`${i} minutes ago`:s<24?`${s} hours ago`:`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`};function R_({user:{pubkey:e,data:t},opts:{showAbout:n,showBanner:r,following:o,showFollowing:i,relayUrls:s}}){const a=t&&t.name?t.name:"Anonymous",l=t&&t.display_name?t.display_name:"Anonymous",c=t&&t.picture?t.picture:"",u=t&&t.banner?t.banner:void 0,d=t&&t.about?t.about:void 0,f=`/p/${e}?relays=${s.join(",")}`;return h.jsxs(h.Fragment,{children:[r&&u&&h.jsx(se,{marginBottom:2,children:h.jsx(ms,{src:u,alt:"banner"})}),h.jsxs(Td,{children:[h.jsx(se,{mr:"3",children:h.jsx(Rg,{to:f,children:h.jsx(Sd,{size:"sm",src:c})})}),h.jsxs(se,{overflowWrap:"anywhere",children:[h.jsxs(Rg,{to:f,children:[h.jsx(wt,{size:"sm",children:l}),h.jsx(le,{fontSize:"sm",children:a})]}),n&&d&&h.jsx(le,{fontSize:"sm",children:d})]}),h.jsx(My,{}),i&&h.jsx(Te,{variant:"outline",colorScheme:o?"red":"green",onClick:()=>o?K.getState().unfollowUser(e):K.getState().followUser({pubkey:e,relayUrls:s}),children:o?"Unfollow":"Follow"})]})]})}function Dp({user:e,options:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:s,avatarSize:a}}){const[l]=K(u=>[u.followingUserIds.find(d=>d===e.pubkey)]),c=e.data&&e.data.picture?e.data.picture:"";return h.jsx(h.Fragment,{children:h.jsxs(mP,{children:[h.jsx(pP,{children:s?h.jsxs(se,{position:"relative",children:[h.jsx(Sd,{size:a,src:c}),h.jsx(se,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(255, 255, 255, 0.5)"}),h.jsx(le,{position:"absolute",right:"0",bottom:"0",backgroundColor:"white",height:15,width:15,textAlign:"center",borderRadius:10,fontSize:12,children:s})]}):h.jsx(Sd,{size:a,src:c})}),h.jsxs(wP,{children:[h.jsx(gP,{}),h.jsx(yP,{}),h.jsx(hP,{children:i}),h.jsx(vP,{children:h.jsx(R_,{user:e,opts:{showAbout:t,showBanner:n,following:!!l,showFollowing:r,relayUrls:o,title:i,reaction:s,avatarSize:a}})})]})]})})}function A_({userComponent:e,event:t,reactions:n,reposts:r,mentions:o,replies:i,eventRelayUrls:s}){var q;const[a]=K(N=>[N.connected&&N.keystore!=="none"]),l=Ri(),[c,u]=v.useState(0),[d,f]=v.useState(0),[p,g]=v.useState(0),[m,w]=v.useState({});v.useEffect(()=>{f((n==null?void 0:n.filter(N=>N.event.content==="-").length)||0),u((n==null?void 0:n.filter(N=>N.event.content==="+").length)||0),g((r==null?void 0:r.length)||0),w((n==null?void 0:n.filter(N=>N.event.content!=="+"&&N.event.content!=="-").reduce((N,H)=>{var te;const Q=(te=H.event)!=null&&te.content?H.event.content:void 0;return Q&&N[Q]?N[Q]+=1:Q&&(N[Q]=1),N},{}))||{})},[n]);const b=l_(t),[y,x]=v.useState(b==null),S=(q=t==null?void 0:t.content)==null?void 0:q.match(/\bhttps?:\/\/\S+?\.(?:jpg|jpeg|png|gif)\b/gi),{isOpen:T,onOpen:E,onClose:C}=Hs(),{isOpen:_,onOpen:B,onClose:L}=Hs(),[P,O]=v.useState(null),I=N=>{O(N),E()},U=async()=>{const H=(await K.getState().getRelays()).find(Q=>s.includes(Q.url));if(H)return H;l({title:"Error",description:`None of the required relays are active ${s.join(", ")}.`,status:"error",duration:5e3,isClosable:!0})},$=async()=>{const N=await U();if(!N)return;const H=Oq({text:"",inResponseTo:{id:t.id,pubkey:t.pubkey},relayUrl:N.url});K.getState().setNewEvent(H),K.getState().setNewEventName("NewShortTextNoteResponse")},j=async(N,H)=>{const Q=await U();if(!Q)return;let te;switch(N){case"quote":te=Lq({inResponseTo:t,relayUrl:Q.url});break;case"reaction":if(!H)throw new Error("Reaction is required");te=Iq({text:H,inResponseTo:{id:t.id,pubkey:t.pubkey},relayUrl:Q.url});break;default:return}try{const ne=await K.getState().signAndSendEvent({event:te,relayUrls:[Q.url]});ne&&(l({title:"Success",description:`Event ${Ci(ne,5)} submitted`,status:"success",duration:5e3,isClosable:!0}),K.getState().requestInformation({source:"events",idsOrKeys:[ne],relayUrl:s[0]},{timeoutIn:1e4}))}catch(ne){let ue="";ne instanceof Error?ue=ne.message:ue=ne?ne.toString():"Unknown error",l({title:"Error",description:ue,status:"error",duration:5e3,isClosable:!0});return}},F=()=>h.jsxs(Ht,{children:[h.jsx(Te,{size:"sm",variant:"solid",colorScheme:"blue",onClick:()=>$(),isDisabled:!a,children:"Reply"}),h.jsx(Te,{size:"sm","aria-label":"Upvote",leftIcon:h.jsx(je,{as:RZ}),onClick:()=>j("reaction","+"),isDisabled:!a,children:c}),h.jsx(Te,{size:"sm","aria-label":"Downvote",leftIcon:h.jsx(je,{as:LZ}),onClick:()=>j("reaction","-"),isDisabled:!a,children:d}),h.jsx(Te,{size:"sm","aria-label":"Repost",leftIcon:h.jsx(je,{as:Ng}),onClick:()=>j("quote"),isDisabled:!a,children:p}),m&&Object.keys(m).slice(0,2).map(N=>h.jsxs(Te,{size:"sm","aria-label":"Repost",isDisabled:!0,children:[N," ",m[N]]},N))]}),z=h.jsxs(yi,{isOpen:_,onClose:L,size:"xl",children:[h.jsx(xi,{}),h.jsxs(bi,{maxHeight:"80vh",maxWidth:"80vw",children:[h.jsx(wi,{children:"Event"}),h.jsx(aa,{}),h.jsx(Si,{overflowY:"auto",children:h.jsx("pre",{children:h.jsx("code",{children:JSON.stringify(t,null,2)})})})]})]}),D=h.jsxs(yi,{isOpen:T,onClose:C,size:"full",closeOnOverlayClick:!0,children:[h.jsx(xi,{}),h.jsxs(bi,{children:[h.jsx(wi,{children:e&&e}),h.jsx(Si,{children:h.jsx(ms,{src:P||"",fallback:h.jsx(ms,{src:"/no-image.png"}),fallbackStrategy:"onError",alt:"Enlarged view",height:"80vh",marginLeft:"auto",marginRight:"auto"})}),h.jsxs(Hy,{children:[h.jsx(F,{}),h.jsx(Te,{marginLeft:4,onClick:C,children:"Close"})]})]})]});function G(N){if(!N)return"";const H=/(https?:\/\/[^\s]+)/g;return N.replace(H,Q=>`${Ci(Q,20)}`)}const V=h.jsxs(qD,{border:"1px solid #e1e1e1",style:{overflowWrap:"break-word",wordWrap:"break-word"},children:[h.jsx(GD,{p:0,children:h.jsxs(se,{children:[y?S&&S.length>0&&h.jsx(se,{className:"image-container",marginBottom:4,children:S.map((N,H)=>h.jsx(ms,{src:N,fallback:h.jsx(ms,{src:"/no-image.png"}),fallbackStrategy:"onError",alt:"",onClick:()=>I(N)},H))}):h.jsxs(Te,{size:"sm",width:"100%",onClick:()=>x(!0),children:["Show Content (",b,")"]}),h.jsx(se,{p:4,paddingBottom:0,children:e&&e})]})}),h.jsxs(WD,{p:4,children:[h.jsx(se,{style:{overflowWrap:"anywhere"},dangerouslySetInnerHTML:{__html:G(t.content)}}),h.jsx(le,{fontWeight:"bold",fontSize:12,marginTop:2,children:DZ(t.created_at)})]}),h.jsx(HD,{p:4,children:h.jsxs(Ht,{width:"100%",children:[h.jsx(F,{}),h.jsx(My,{}),h.jsx(le,{children:s[0]}),h.jsx(Te,{size:"sm",variant:"outline",onClick:()=>{B()},children:"Details"})]})})]});return h.jsxs(h.Fragment,{children:[V,h.jsxs(Ht,{padding:2,flexWrap:"wrap",children:[n&&h.jsxs(h.Fragment,{children:[h.jsx(le,{children:"Reactions"}),n.map((N,H)=>{const Q=N.user||{pubkey:N.event.pubkey};return h.jsx(se,{children:h.jsx(Dp,{user:Q,options:{title:"Reaction",showAbout:!0,showBanner:!0,relayUrls:s,reaction:N.event.content,avatarSize:"xs"}})},`${H}_${N.event.id}_${Q.pubkey}_reactions`)})]}),r&&h.jsxs(h.Fragment,{children:[h.jsx(le,{children:"Reposts"}),r.map((N,H)=>{const Q=N.user?N.user:{pubkey:N.event.pubkey};return h.jsxs(se,{children:[h.jsx(Dp,{user:Q,options:{title:"Repost",showAbout:!0,showBanner:!0,relayUrls:s,avatarSize:"xs"}}),h.jsx(je,{as:Ng})]},`${H}_${N.event.id}_${Q.pubkey}_reposts`)})]}),o&&h.jsxs(h.Fragment,{children:[h.jsx(le,{children:"Mentions"}),o.map((N,H)=>h.jsx(se,{children:h.jsx(Dp,{user:N,options:{title:"Mentioned",showAbout:!0,showBanner:!0,relayUrls:s,avatarSize:"xs"}})},`${H}_${t.id}_${N.pubkey}_mention`))]})]}),i&&i.map(N=>{const H=N.user?N.user:{pubkey:N.event.pubkey};return h.jsx(se,{marginLeft:10,children:h.jsx(A_,{event:N.event,userComponent:e,eventRelayUrls:s})},`${N.event.id}_${H.pubkey}_replies`)}),D,z]})}function ih(e){const[t,n]=K(f=>[f.events,f.maxEvents]),[r,o]=v.useState(0),[i,s]=v.useState(!1),[a,l]=v.useState(e.filters);v.useEffect(()=>{const f=setTimeout(()=>{s(!0)},5e3);return()=>{clearTimeout(f)}},[]);const c=async()=>{r===0&&o(r+1),await K.getState().setMaxEvents(n+Rn),e&&await K.getState().setViewSubscription(e.view,a)},u=async()=>{o(0),l(e.filters),await K.getState().setMaxEvents(Rn),await K.getState().clearEvents(),await K.getState().setViewSubscription(e.view,a),s(!1)},d=t.length>=n||i;return h.jsxs(se,{style:{overflowWrap:"break-word",wordWrap:"break-word"},children:[t.map(f=>h.jsx(se,{padding:2,children:h.jsx(A_,{event:f.event,user:f.user,reactions:f.reactions,reposts:f.reposts,mentions:f.mentions,replies:f.replies,eventRelayUrls:f.eventRelayUrls,userComponent:e&&e.userComponent?f.user&&f.user.pubkey?h.jsx(e.userComponent,{user:f.user,options:{showFollowing:!0,relayUrls:f.eventRelayUrls}}):h.jsx(e.userComponent,{user:{pubkey:f.event.pubkey},options:{relayUrls:f.eventRelayUrls}}):void 0},f.event.id)},f.event.id)),t.length===0&&h.jsx(le,{children:"Waiting for fresh content ... hold on."}),d&&h.jsxs(se,{display:"flex",justifyContent:"space-between",padding:2,children:[h.jsxs(Te,{flex:"1",marginRight:2,onClick:c,children:["Load ",Rn," more"]}),h.jsx(Te,{flex:"1",marginLeft:2,onClick:u,children:"Reset and load new (performance)"})]})]})}function Eo({user:e,options:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o}}){const[i]=K(s=>[s.followingUserIds.find(a=>a===e.pubkey)]);return h.jsx(R_,{user:e,opts:{showAbout:t,showBanner:n,following:!!i,showFollowing:r,relayUrls:o}})}function VZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Xd=VZ(v),UZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},nS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=WZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Xd.createElement("svg",UZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Xd.createElement("path",{d:"M2,21L23,12L2,3V10L17,12L2,14V21Z"}))},HZ=Xd.memo?Xd.memo(nS):nS,GZ=HZ;const qZ=Ze(GZ);function KZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Jd=KZ(v),ZZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},rS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=YZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Jd.createElement("svg",ZZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Jd.createElement("path",{d:"M4,9H20V11H4V9M4,13H14V15H4V13Z"}))},QZ=Jd.memo?Jd.memo(rS):rS,XZ=QZ;const JZ=Ze(XZ);function eY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var ef=eY(v),tY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},oS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=nY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return ef.createElement("svg",tY({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),ef.createElement("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"}))},rY=ef.memo?ef.memo(oS):oS,oY=rY;const iY=Ze(oY);function sY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var tf=sY(v),aY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},iS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=lY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return tf.createElement("svg",aY({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),tf.createElement("path",{d:"M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"}))},cY=tf.memo?tf.memo(iS):iS,uY=cY;const dY=Ze(uY);function fY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var nf=fY(v),hY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},sS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=pY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return nf.createElement("svg",hY({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),nf.createElement("path",{d:"M12,6C8.6,6 5.5,7.1 3,9L1.2,6.6C4.2,4.3 8,3 12,3C16,3 19.8,4.3 22.8,6.6L21,9C18.5,7.1 15.4,6 12,6M13,19C13,17.7 13.4,16.4 14.2,15.4C13.5,15.2 12.8,15 12,15C10.7,15 9.4,15.5 8.4,16.2L12,21L13,19.6C13,19.4 13,19.2 13,19M16.8,13.4C17.1,13.3 17.5,13.2 17.9,13.1L19.2,11.4C17.2,9.9 14.7,9 12,9C9.3,9 6.8,9.9 4.8,11.4L6.6,13.8C8.1,12.7 10,12 12,12C13.8,12 15.4,12.5 16.8,13.4M16.5,22.6L17.2,19.8L15,17.9L17.9,17.7L19,15L20.1,17.6L23,17.8L20.8,19.7L21.5,22.5L19,21.1L16.5,22.6Z"}))},mY=nf.memo?nf.memo(sS):sS,gY=mY;const vY=Ze(gY),sh=()=>{const[e]=K(E=>[E.connected&&E.keystore!=="none"]),[t,n]=v.useState([]),[r,o]=v.useState([]),[i]=K(E=>{var C;return[(C=E.newEvent)==null?void 0:C.hasPublicKeyTags()]}),[s,a]=v.useState(!1),[l,c,u,d,f]=K(E=>{var C;return[E.keystore,E.keypair,((C=E.newEvent)==null?void 0:C.kind)||0,E.newEventName,E.newEvent]}),[p,g]=v.useState(""),[m,w]=v.useState([]),b=v.useRef(void 0),y=Ri();v.useEffect(()=>{(async()=>{if(!i||d!=="NewShortTextNoteResponse"||i[0][1]===b.current)return;const C=[];if(i){b.current=i[0][1]||void 0;for(const _ of i)_.length===2&&C.push(_[1])}C.length>0&&w(C),T(d,!0)})()},[i,d]);const x=async()=>{if(a(!0),n([]),!f){n(["Event is required"]),y({title:"Error",description:"Event is required",status:"error",duration:5e3,isClosable:!0});return}if(l&&l==="none"){n(["Keystore is required"]),y({title:"Error",description:"Keystore is required",status:"error",duration:5e3,isClosable:!0});return}if(!c){n(["Keypair is required"]),y({title:"Error",description:"Keypair is required",status:"error",duration:5e3,isClosable:!0});return}if(p===""){n(["Event content is required"]),y({title:"Error",description:"Event content is required",status:"error",duration:5e3,isClosable:!0});return}try{K.getState().setNewEventContent(p);const E=await K.getState().signAndSendEvent({event:f,relayUrls:m});E&&(y({title:"Success",description:`Event ${Ci(E,5)} submitted`,status:"success",duration:5e3,isClosable:!0}),T("NewShortTextNote",!0,!0),a(!1))}catch(E){let C="";E instanceof Error?C=E.message:C=E?E.toString():"Unknown error",n([C]),y({title:"Error",description:C,status:"error",duration:5e3,isClosable:!0}),a(!1);return}},S=E=>{switch(E){case"NewShortTextNote":return"Short Text Note";case"NewRecommendRelay":return"Recommend Relay";case"NewLongFormContent":return"Long Form Content";case"NewShortTextNoteResponse":return"Short Text Note Response";case"NewQuoteRepost":return"Quote Repost";default:return""}},T=(E,C=!1,_=!1)=>{let B;if(!C&&E===d){console.log(`Already set to ${E}`);return}switch(E){case"NewShortTextNote":B=$q({text:""}),E="NewShortTextNote";break;case"NewRecommendRelay":B=Bq({relayUrl:Object.keys(__)[0]}),E="NewRecommendRelay";break;case"NewLongFormContent":B=jq({text:""}),E="NewLongFormContent";break;case"NewShortTextNoteResponse":B=K.getState().newEvent;break;default:n(["Invalid event type"]);return}K.getState().setNewEvent(B),K.getState().setNewEventName(E),n([]),_&&o([])};return h.jsxs(se,{width:"100%",children:[h.jsxs(_t,{marginBottom:4,children:[h.jsxs(Rt,{children:["Type: ",S(d)]}),r.map(E=>h.jsx(Eo,{user:E.user,options:{relayUrls:E.relayUrls}},E.user.pubkey))]}),h.jsxs(_t,{marginBottom:4,children:[h.jsx(Rt,{children:"Content"}),h.jsx(mt,{type:"text",as:u===Nt.LONG_FORM_CONTENT?Ky:mt,value:p,onChange:E=>g(E.target.value),placeholder:"Enter event content"})]}),h.jsxs(Ht,{marginBottom:4,children:[h.jsx(Hi,{"aria-label":"Short Text Note",icon:h.jsx(je,{as:JZ}),onClick:()=>T("NewShortTextNote"),isActive:d==="NewShortTextNote"}),h.jsx(Hi,{"aria-label":"NewLongFormContent",icon:h.jsx(je,{as:iY}),onClick:()=>T("NewLongFormContent"),isActive:d==="NewLongFormContent"}),h.jsx(Hi,{"aria-label":"NewShortTextNoteResponse",icon:h.jsx(je,{as:dY}),onClick:()=>T("NewShortTextNoteResponse"),isActive:d==="NewShortTextNoteResponse",isDisabled:d!=="NewShortTextNoteResponse"}),h.jsx(Hi,{"aria-label":"NewRecommendRelay",icon:h.jsx(je,{as:vY}),onClick:()=>T("NewRecommendRelay"),isActive:d==="NewRecommendRelay"}),h.jsx(Hi,{"aria-label":"NewQuoteRepost",icon:h.jsx(je,{as:Ng}),onClick:()=>T("NewQuoteRepost"),isActive:d==="NewQuoteRepost",isDisabled:d!=="NewQuoteRepost"})]}),t.map((E,C)=>h.jsx(se,{color:"red.500",children:E},C)),h.jsx(Te,{type:"submit",colorScheme:"blue",onClick:x,leftIcon:h.jsx(je,{as:qZ}),isDisabled:!e,isLoading:s,children:"Send"})]})};function yY(){const[e,t]=K(i=>[i.connected,i.events.length>=i.maxEvents]),n=new Co({kinds:[Nt.SHORT_TEXT_NOTE,Nt.LONG_FORM_CONTENT],limit:Rn}),r=v.useRef(!1),o=async()=>{!e||r.current||(r.current=!0,await K.getState().setMaxEvents(Rn),await K.getState().clearEvents(),await K.getState().setViewSubscription("welcome",n))};return v.useEffect(()=>{o()},[]),v.useEffect(()=>{setTimeout(()=>{o()},500)},[e]),v.useEffect(()=>{t&&(async()=>{e&&await K.getState().removeViewSubscription("welcome")})()},[t]),h.jsxs(ia,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[h.jsx(se,{children:e?h.jsx(se,{maxHeight:"80vh",overflowY:"auto",children:h.jsx(ih,{userComponent:Eo,view:"welcome",filters:n,connected:e})}):h.jsxs(se,{maxWidth:600,children:[h.jsx(wt,{size:"lg",children:"About Nostr"}),h.jsx(le,{marginBottom:2,fontWeight:"bold",children:"Tldr: Nostr is a decentralized social network."}),h.jsx(le,{marginBottom:4,children:"Nostr is anything you can imagine. A new reddit, Twitter, Facebook, Mastodon - Craigstslist or Ebay? It's only a matter of what the interface looks like, the underlying network is the same, and so is your identity - so you get to access it all, without giving up yourself."}),h.jsx(wt,{size:"md",children:"Connect to get started"}),h.jsx(le,{marginBottom:2,children:"You don't need an account to browse or follow users. All data is saved in your browser. To interact with events, generate or supply a keypair."}),h.jsx(le,{children:"nos2x and nos2x-fox should be working too."})]})}),h.jsxs(se,{display:"flex",flexDirection:"column",children:[h.jsx(wt,{as:"h2",size:"md",marginBottom:4,children:"Broadcast to the Network"}),h.jsx(sh,{})]})]})}function bY(){const[e,t]=v.useState([]),n=v.useRef(!1);return v.useEffect(()=>{(async()=>{if(n.current)return;n.current=!0;const o=await K.getState().getAllUsersFollowing();o&&t(o)})()},[]),h.jsxs(se,{children:[h.jsx(wt,{size:"lg",children:"Following"}),e.length>0?h.jsx(h.Fragment,{children:e.map(r=>h.jsx(se,{mb:"3",children:h.jsx(Eo,{user:r.user,options:{showFollowing:!0,relayUrls:r.relayUrls}},r.user.pubkey)},r.user.pubkey))}):h.jsxs(h.Fragment,{children:[h.jsx(le,{children:"Follow users to subscribe to their messages. The subscription is stored in your browser and not shared with relays."}),h.jsx(le,{fontWeight:"bold",children:"You are not following anyone."})]})]})}const $_=Object.keys(Nt).map(e=>({name:e,value:Nt[e]})),wY=e=>{const t=$_.find(n=>n.value===e);return t?t.name:"Unknown"},xY=e=>e.map(wY).join(", ");function SY(){const[e,t]=v.useState([]),[n,r]=v.useState(null),{isOpen:o,onOpen:i,onClose:s}=Hs(),a=async()=>{const u=await K.getState().getSubscriptions();u&&t(u)};v.useEffect(()=>{(async()=>{await a()})();const d=setInterval(a,1e3);return()=>clearInterval(d)},[]);const l=h.jsxs(yi,{isOpen:o,onClose:s,size:"xl",children:[" ",h.jsx(xi,{}),h.jsxs(bi,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",h.jsx(wi,{children:"Filters"}),h.jsx(aa,{}),h.jsxs(Si,{overflowY:"auto",children:[" ",h.jsx("pre",{children:n})]})]})]}),c=u=>{const d=u.options&&u.options.view?u.options.view:"";return h.jsxs(Ys,{children:[h.jsx($t,{children:h.jsx(ll,{label:u.id,children:Ci(u.id,5)})}),h.jsx($t,{children:h.jsx(ll,{label:u.relayUrl,children:u.relayUrl.substring(6)})}),h.jsx($t,{children:h.jsx(le,{fontSize:"sm",children:u.filters&&u.filters.kinds&&xY(u.filters.kinds)})}),h.jsx($t,{children:h.jsx(Te,{size:"sm",onClick:()=>{r(JSON.stringify(u.filters,null,2)),i()},children:"Show"})}),h.jsx($t,{children:h.jsx(ll,{label:d,children:Ci(d,5)})}),h.jsx($t,{children:h.jsx(Te,{size:"sm",onClick:()=>K.getState().unsubscribe([u.id]),children:"Unsubscribe"})})]},u.id)};return h.jsxs(se,{children:[h.jsx(wt,{size:"lg",children:"Subscriptions"}),h.jsxs(Xf,{variant:"simple",marginBottom:4,children:[h.jsx(Gy,{children:h.jsxs(Ys,{children:[h.jsx(jt,{children:"ID"}),h.jsx(jt,{children:"Relay"}),h.jsx(jt,{children:"Kind"}),h.jsx(jt,{children:"Filter"}),h.jsx(jt,{children:"View"}),h.jsx(jt,{children:"Action"})]})}),h.jsx(qy,{children:e.map(u=>c(u))})]}),h.jsx(wt,{size:"md",marginBottom:2,children:"Legend"}),$_.map(u=>h.jsxs(le,{children:[u.name," - ",u.value]},u.name)),l]})}async function Vp(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((o,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}var j_=class extends Dq{constructor(e){super(e)}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{if(!this.hasZapInfo()){const s=await Vp(n.url);if(!mq(s))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");this.lightningZapInfo=s}console.log("LnurlEndpointResponse",this.lightningZapInfo);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?xq(this.getLud16()):this.getLud06()},o=Fq(r,this.lightningZapInfo.callback,t),i=await Vp(o.invoiceUrl);if(!gq(r,i))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",i),{...i,event:o.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await Vp(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}};function kY(){const[e,t]=K(f=>[f.connected,f.events.length>=f.maxEvents]),[n,r]=v.useState(null),[o,i]=v.useState([]),[s]=IP(),l=AP().pubkey||"",c=`profile-${l}`,u=new Co({limit:Rn,authors:[l],kinds:[Nt.SHORT_TEXT_NOTE,Nt.LONG_FORM_CONTENT]}),d=async()=>{if(e){if(!n||n.user.pubkey!==l){await K.getState().setMaxEvents(Rn),await K.getState().clearEvents(),await K.getState().setViewSubscription(c,u);const f=await K.getState().getUser(l);if(f)r(f),i(f.relayUrls);else{r({user:new j_({pubkey:l}),relayUrls:o});for(const p of s.entries())p[0]==="relays"&&i(p[1].split(","))}}await K.getState().count({type:fc.COUNT,filters:new Co({kinds:[3],"#p":[l]}),options:{timeoutIn:1e4}})}};return v.useEffect(()=>{d()},[]),v.useEffect(()=>{d()},[l]),v.useEffect(()=>{t&&(async()=>{e&&await K.getState().removeViewSubscription(c)})()},[t]),h.jsxs(ia,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[h.jsxs(se,{maxHeight:"80vh",overflowY:"auto",children:[h.jsx(se,{children:n&&h.jsx(Eo,{user:n.user,options:{showAbout:!0,showBanner:!0,showFollowing:!0,relayUrls:n.relayUrls}})}),h.jsx(se,{children:e?h.jsx(ih,{view:c,filters:u,connected:e}):h.jsx(le,{children:"Not connected."})})]}),h.jsxs(se,{display:"flex",flexDirection:"column",children:[h.jsx(wt,{as:"h2",size:"md",marginBottom:4,children:"Broadcast to the Network"}),h.jsx(sh,{})]})]})}function CY(){const[e,t]=v.useState([]),[n,r]=v.useState(null),[o,i]=v.useState(!1),{isOpen:s,onOpen:a,onClose:l}=Hs(),c=async()=>{const g=await K.getState().getRelays();g&&t(g)};v.useEffect(()=>{(async()=>{await c()})();const m=setInterval(c,2e3);return()=>clearInterval(m)},[]);const u=async g=>{i(!0);const m=!g.read;await K.getState().updateRelay(g.url,{read:m}),await c(),i(!1)},d=async g=>{i(!0);const m=!g.write;await K.getState().updateRelay(g.url,{write:m}),await c(),i(!1)},f=h.jsxs(yi,{isOpen:s,onClose:l,size:"xl",children:[h.jsx(xi,{}),h.jsxs(bi,{maxHeight:"80vh",maxWidth:"80vw",children:[h.jsx(wi,{children:"Relay"}),h.jsx(aa,{}),h.jsx(Si,{overflowY:"auto",children:n&&n.info&&h.jsx("pre",{children:h.jsx("code",{children:JSON.stringify(n.info,null,2)})})})]})]}),p=g=>h.jsxs(Ys,{children:[h.jsx($t,{children:g.url}),h.jsx($t,{children:g.isReady?"Ready":"Not Ready"}),h.jsx($t,{children:h.jsx(Te,{size:"sm",onClick:()=>{r(g),a()},children:"Show"})}),h.jsx($t,{children:h.jsx(kg,{isChecked:g.read,onChange:()=>u(g),isDisabled:o})}),h.jsx($t,{children:h.jsx(kg,{isChecked:g.write,onChange:()=>d(g),isDisabled:o})})]},g.url);return h.jsxs(se,{children:[h.jsx(wt,{size:"lg",children:"Relays"}),h.jsxs(Xf,{variant:"simple",marginBottom:4,children:[h.jsx(Gy,{children:h.jsxs(Ys,{children:[h.jsx(jt,{children:"Ready"}),h.jsx(jt,{children:"Url"}),h.jsx(jt,{children:"Info"}),h.jsx(jt,{children:"Read"}),h.jsx(jt,{children:"Write"})]})}),h.jsx(qy,{children:e.map(g=>p(g))})]}),f]})}function EY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var rf=EY(v),TY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},aS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=PY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return rf.createElement("svg",TY({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),rf.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"}))},_Y=rf.memo?rf.memo(aS):aS,RY=_Y;const Up=Ze(RY);function AY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var of=AY(v),$Y=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},lS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=jY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return of.createElement("svg",$Y({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),of.createElement("path",{d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}))},OY=of.memo?of.memo(lS):lS,IY=OY;const Wp=Ze(IY);function LY(){const[e]=K(u=>[u.eventsPublishingQueue]),[t,n]=v.useState(null),r=u=>!!u.error,o=u=>u.error?u.error:"",{isOpen:i,onOpen:s,onClose:a}=Hs(),l=h.jsxs(yi,{isOpen:i,onClose:a,size:"xl",children:[h.jsx(xi,{}),h.jsxs(bi,{maxHeight:"80vh",maxWidth:"80vw",children:[h.jsx(wi,{children:"Queue Item Detail"}),h.jsx(aa,{}),h.jsx(Si,{overflowY:"auto",children:t&&h.jsx("pre",{children:h.jsx("code",{children:JSON.stringify(t,null,2)})})})]})]}),c=u=>{const d=u.event.id||"";return h.jsxs(Ys,{children:[h.jsx($t,{children:h.jsx(ll,{label:d,children:Ci(d,5)})}),h.jsx($t,{children:h.jsxs(Ht,{children:[u.pow?h.jsx(le,{children:u.pow}):h.jsx(le,{children:"0"}),h.jsx(le,{children:"/"}),h.jsx(je,{as:u.powDone?Up:Wp})]})}),h.jsx($t,{children:h.jsx(Te,{size:"sm",onClick:()=>{n(u),s()},children:"Show"})}),h.jsx($t,{children:h.jsx(je,{as:u.send?Up:Wp,marginRight:1})}),h.jsxs($t,{children:[h.jsx(je,{as:u.accepted?Up:Wp}),r(u)&&h.jsx(le,{color:"red.500",children:o(u)})]})]},d)};return h.jsxs(se,{children:[h.jsx(wt,{size:"lg",children:"Queue"}),h.jsxs(Xf,{variant:"simple",marginBottom:4,children:[h.jsx(Gy,{children:h.jsxs(Ys,{children:[h.jsx(jt,{children:"Event ID"}),h.jsx(jt,{children:"POW / Done"}),h.jsx(jt,{children:"Info"}),h.jsx(jt,{children:"Send"}),h.jsx(jt,{children:"Accepted"})]})}),h.jsx(qy,{children:e.map(u=>c(u))})]}),l]})}function MY(){const[e,t]=K(d=>[d.connected,d.events.length>=d.maxEvents]),[n,r]=v.useState(null),[o,i]=v.useState([]),[s]=IP(),l=AP().pubkey||"",c=`mentions-${l}`,u=new Co({limit:Rn,authors:[l],kinds:[Nt.SHORT_TEXT_NOTE,Nt.LONG_FORM_CONTENT],"#p":[l]});return v.useEffect(()=>{(async()=>{if(e&&(await K.getState().clearEvents(),await K.getState().setViewSubscription(c,u),!n)){const f=await K.getState().getUser(l);if(f)r(f),i(f.relayUrls);else{r({user:new j_({pubkey:l}),relayUrls:o});for(const p of s.entries())p[0]==="relays"&&i(p[1].split(","))}}})()},[]),v.useEffect(()=>{t&&(async()=>{e&&await K.getState().removeViewSubscription(c)})()},[t]),h.jsxs(ia,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[h.jsxs(se,{maxHeight:"80vh",overflowY:"auto",children:[h.jsxs(se,{children:[h.jsx(wt,{size:"lg",children:"Profile"}),n&&h.jsx(Eo,{user:n.user,options:{relayUrls:n.relayUrls}})]}),h.jsx(se,{children:e?h.jsx(ih,{userComponent:Eo,view:c,filters:u,connected:e}):h.jsx(le,{children:"Not connected."})})]}),h.jsxs(se,{display:"flex",flexDirection:"column",children:[h.jsx(wt,{as:"h2",size:"md",marginBottom:4,children:"Broadcast to the Network"}),h.jsx(sh,{})]})]})}function BY({props:e}){const[t,n]=v.useState({name:"",display_name:"",picture:"",banner:"",nip05:"",website:"",about:"",image:"",lud16:"",lud06:""}),[r,o]=v.useState(""),[i,s]=v.useState(!1),a=v.useRef(!1),l=Ri();v.useEffect(()=>{e.metadata&&!a.current&&n(Object.assign(t,e.metadata))},[e.metadata]);const c=async()=>{s(!0);const d={};for(const[p,g]of Object.entries(t))g&&g!==""&&(d[p]=g);const f=Mq({userMetadata:d,mastodonUrl:r});if(Object.keys(d).length===0){l({title:"No changes",description:"No changes to update.",status:"info",duration:5e3,isClosable:!0}),s(!1);return}try{await K.getState().signAndSendEvent({event:f}),s(!1),await K.getState().subscribe({type:fc.REQ,filters:new Co({authors:[e.pubkey],kinds:[Nt.METADATA]}),options:{timeoutIn:1e4}})}catch(p){console.error(p),s(!1)}},u=d=>{const{name:f,value:p}=d.target;n(g=>({...g,[f]:p})),a.current=!0};return h.jsxs(se,{marginBottom:10,children:[h.jsxs(_t,{id:"name",mb:4,children:[h.jsx(Rt,{children:"Name"}),h.jsx(mt,{name:"name",value:t.name,onChange:u})]}),h.jsxs(_t,{id:"display_name",mb:4,children:[h.jsx(Rt,{children:"Display Name"}),h.jsx(mt,{name:"display_name",value:t.display_name||"",onChange:u})]}),h.jsxs(_t,{id:"website",mb:4,children:[h.jsx(Rt,{children:"Website"}),h.jsx(mt,{name:"website",value:t.website||"",onChange:u})]}),h.jsxs(_t,{id:"about",mb:4,children:[h.jsx(Rt,{children:"About"}),h.jsx(Ky,{name:"about",value:t.about||"",onChange:u})]}),h.jsxs(_t,{id:"picture",mb:4,children:[h.jsx(Rt,{children:"Picture URL"}),h.jsx(mt,{name:"picture",value:t.picture||"",onChange:u}),h.jsx(Do,{children:"URL for your profile picture."})]}),h.jsxs(_t,{id:"banner",mb:4,children:[h.jsx(Rt,{children:"Banner URL"}),h.jsx(mt,{name:"banner",value:t.banner||"",onChange:u}),h.jsx(Do,{children:"URL for your profile banner."})]}),h.jsxs(_t,{id:"image",mb:4,children:[h.jsx(Rt,{children:"Image URL"}),h.jsx(mt,{name:"image",value:t.image||"",onChange:u}),h.jsx(Do,{children:"URL for an additional image."})]}),h.jsxs(_t,{id:"nip05",mb:4,children:[h.jsx(Rt,{children:"NIP05"}),h.jsx(mt,{name:"nip05",value:t.nip05||"",onChange:u}),h.jsx(Do,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),h.jsxs(_t,{id:"lud16",mb:4,children:[h.jsx(Rt,{children:"LUD16"}),h.jsx(mt,{name:"lud16",value:t.lud16||"",onChange:u}),h.jsx(Do,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),h.jsxs(_t,{id:"lud06",mb:4,children:[h.jsx(Rt,{children:"LUD06"}),h.jsx(mt,{name:"lud06",value:t.lud06||"",onChange:u}),h.jsx(Do,{children:"bech32 encoded lnurl"})]}),h.jsxs(_t,{id:"mastodonUrl",mb:4,children:[h.jsx(Rt,{children:"Mastodon URL"}),h.jsx(mt,{name:"mastodonUrl",value:r,onChange:d=>o(d.target.value)})]}),h.jsxs(tT,{children:[h.jsx(Te,{colorScheme:"blue",type:"submit",isLoading:i,onClick:c,children:"Send update"}),h.jsx(Te,{isDisabled:!a.current,onClick:()=>a.current=!1,children:"Reset"})]})]})}function zY(){const[e,t]=K(c=>{var u;return[((u=c.keypair)==null?void 0:u.publicKey)||"",c.connected]}),[n,r]=v.useState(null),[o,i]=v.useState([]),s=Ri(),a=async()=>{if(!e||e==="")return;const c=await K.getState().getUser(e);c&&(r(c.user),i(c.relayUrls))},l=async()=>{if(!e||e===""){s({title:"Not found",description:"No user data found yet. Did you publish your profile to one of the connected relays?",status:"error",duration:5e3,isClosable:!0});return}await K.getState().subscribe({type:fc.REQ,filters:new Co({authors:[e],kinds:[Nt.METADATA]}),options:{timeoutIn:1e4}}),s({title:"Refreshing ...",description:"Requesting information from the network.",status:"info",duration:5e3,isClosable:!0})};return v.useEffect(()=>{const c=setInterval(()=>{a()},1e3);return()=>{clearInterval(c)}},[]),h.jsxs(se,{children:[n?h.jsx(Eo,{user:n,options:{relayUrls:o}}):h.jsxs(h.Fragment,{children:[h.jsx(le,{children:'"No user data found yet. Did you publish your profile to one of the connected relays?".'}),t&&h.jsx(Te,{onClick:l,children:"Try again"})]}),h.jsx(wt,{as:"h2",size:"lg",mb:4,mt:4,children:"Update your profile"}),h.jsx(BY,{props:{pubkey:e,metadata:n==null?void 0:n.data}})]})}function FY(){const[e,t,n]=K(s=>[s.connected,s.events.length>=s.maxEvents,s.followingUserIds]),r=new Co({limit:Rn,authors:n,kinds:[Nt.SHORT_TEXT_NOTE,Nt.LONG_FORM_CONTENT]}),o="following-feed",i=async()=>{e&&(await K.getState().setMaxEvents(Rn),await K.getState().clearEvents(),await K.getState().setViewSubscription(o,r))};return v.useEffect(()=>{i()},[]),v.useEffect(()=>{t&&(async()=>{e&&await K.getState().removeViewSubscription(o)})()},[t]),h.jsxs(ia,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[h.jsx(se,{maxHeight:"80vh",overflowY:"auto",children:h.jsx(se,{children:e?h.jsx(ih,{userComponent:Eo,view:o,filters:r,connected:e}):h.jsx(le,{children:"Not connected."})})}),h.jsxs(se,{display:"flex",flexDirection:"column",children:[h.jsx(wt,{as:"h2",size:"md",marginBottom:4,children:"Broadcast to the Network"}),h.jsx(sh,{})]})]})}const NY=async()=>{await K.getState().init({maxEvents:Rn})};NY();Eg.createRoot(document.getElementById("root")).render(h.jsx(li.StrictMode,{children:h.jsx(SD,{children:h.jsx(yH,{basename:"/nostr-ts/",children:h.jsx(dH,{children:h.jsxs(xn,{element:h.jsx(kZ,{}),children:[h.jsx(xn,{path:"/",element:h.jsx(yY,{})}),h.jsx(xn,{path:"/account",element:h.jsx(TK,{})}),h.jsx(xn,{path:"/profile",element:h.jsx(zY,{})}),h.jsx(xn,{path:"/following",element:h.jsx(bY,{})}),h.jsx(xn,{path:"/following-feed",element:h.jsx(FY,{})}),h.jsx(xn,{path:"/mentions/:pubkey",element:h.jsx(MY,{})}),h.jsx(xn,{path:"/subscriptions",element:h.jsx(SY,{})}),h.jsx(xn,{path:"/relays",element:h.jsx(CY,{})}),h.jsx(xn,{path:"/queue",element:h.jsx(LY,{})}),h.jsx(xn,{path:"/p/:pubkey",element:h.jsx(kY,{})})]})})})})})); diff --git a/assets/index-ac056cee.js b/assets/index-ac056cee.js deleted file mode 100644 index b611601..0000000 --- a/assets/index-ac056cee.js +++ /dev/null @@ -1,435 +0,0 @@ -function LR(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lS={exports:{}},of={},cS={exports:{}},de={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Gl=Symbol.for("react.element"),MR=Symbol.for("react.portal"),BR=Symbol.for("react.fragment"),zR=Symbol.for("react.strict_mode"),FR=Symbol.for("react.profiler"),NR=Symbol.for("react.provider"),DR=Symbol.for("react.context"),UR=Symbol.for("react.forward_ref"),VR=Symbol.for("react.suspense"),WR=Symbol.for("react.memo"),HR=Symbol.for("react.lazy"),P0=Symbol.iterator;function GR(e){return e===null||typeof e!="object"?null:(e=P0&&e[P0]||e["@@iterator"],typeof e=="function"?e:null)}var uS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dS=Object.assign,fS={};function Xs(e,t,n){this.props=e,this.context=t,this.refs=fS,this.updater=n||uS}Xs.prototype.isReactComponent={};Xs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Xs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hS(){}hS.prototype=Xs.prototype;function zg(e,t,n){this.props=e,this.context=t,this.refs=fS,this.updater=n||uS}var Fg=zg.prototype=new hS;Fg.constructor=zg;dS(Fg,Xs.prototype);Fg.isPureReactComponent=!0;var _0=Array.isArray,pS=Object.prototype.hasOwnProperty,Ng={current:null},mS={key:!0,ref:!0,__self:!0,__source:!0};function gS(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)pS.call(t,r)&&!mS.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(10?vt(Js,--Xt):0,Os--,et===10&&(Os=1,af--),et}function sn(){return et=Xt2||cl(et)>3?"":" "}function gA(e,t){for(;--t&&sn()&&!(et<48||et>102||et>57&&et<65||et>70&&et<97););return ql(e,su()+(t<6&&ar()==32&&sn()==32))}function Wp(e){for(;sn();)switch(et){case e:return Xt;case 34:case 39:e!==34&&e!==39&&Wp(et);break;case 40:e===41&&Wp(e);break;case 92:sn();break}return Xt}function vA(e,t){for(;sn()&&e+et!==47+10;)if(e+et===42+42&&ar()===47)break;return"/*"+ql(t,Xt-1)+"*"+sf(e===47?e:sn())}function yA(e){for(;!cl(ar());)sn();return ql(e,Xt)}function bA(e){return kS(lu("",null,null,null,[""],e=SS(e),0,[0],e))}function lu(e,t,n,r,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,g=0,m=1,x=1,b=1,v=0,w="",S=o,k=i,T=r,E=w;x;)switch(g=v,v=sn()){case 40:if(g!=108&&vt(E,d-1)==58){Vp(E+=Ce(au(v),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:E+=au(v);break;case 9:case 10:case 13:case 32:E+=mA(g);break;case 92:E+=gA(su()-1,7);continue;case 47:switch(ar()){case 42:case 47:Sc(wA(vA(sn(),su()),t,n),l);break;default:E+="/"}break;case 123*m:a[c++]=er(E)*b;case 125*m:case 59:case 0:switch(v){case 0:case 125:x=0;case 59+u:b==-1&&(E=Ce(E,/\f/g,"")),p>0&&er(E)-d&&Sc(p>32?$0(E+";",r,n,d-1):$0(Ce(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(Sc(T=A0(E,t,n,c,u,o,a,w,S=[],k=[],d),i),v===123)if(u===0)lu(E,t,T,T,S,i,d,a,k);else switch(f===99&&vt(E,3)===110?100:f){case 100:case 108:case 109:case 115:lu(e,T,T,r&&Sc(A0(e,T,T,0,0,o,a,w,o,S=[],d),k),o,k,d,a,r?S:k);break;default:lu(E,T,T,T,[""],k,0,a,k)}}c=u=p=0,m=b=1,w=E="",d=s;break;case 58:d=1+er(E),p=g;default:if(m<1){if(v==123)--m;else if(v==125&&m++==0&&pA()==125)continue}switch(E+=sf(v),v*m){case 38:b=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(er(E)-1)*b,b=1;break;case 64:ar()===45&&(E+=au(sn())),f=ar(),u=d=er(w=E+=yA(su())),v++;break;case 45:g===45&&er(E)==2&&(m=0)}}return i}function A0(e,t,n,r,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=Wg(f),g=0,m=0,x=0;g0?f[b]+" "+v:Ce(v,/&\f/g,f[b])))&&(l[x++]=w);return lf(e,t,n,o===0?Ug:a,l,c,u)}function wA(e,t,n){return lf(e,t,n,yS,sf(hA()),ll(e,2,-2),0)}function $0(e,t,n,r){return lf(e,t,n,Vg,ll(e,0,r),ll(e,r+1,-1),r)}function gs(e,t){for(var n="",r=Wg(e),o=0;o6)switch(vt(e,t+1)){case 109:if(vt(e,t+4)!==45)break;case 102:return Ce(e,/(.+:)(.+)-([^]+)/,"$1"+Se+"$2-$3$1"+Mu+(vt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Vp(e,"stretch")?ES(Ce(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(vt(e,t+1)!==115)break;case 6444:switch(vt(e,er(e)-3-(~Vp(e,"!important")&&10))){case 107:return Ce(e,":",":"+Se)+e;case 101:return Ce(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Se+(vt(e,14)===45?"inline-":"")+"box$3$1"+Se+"$2$3$1"+Et+"$2box$3")+e}break;case 5936:switch(vt(e,t+11)){case 114:return Se+e+Et+Ce(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Se+e+Et+Ce(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Se+e+Et+Ce(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Se+e+Et+e+e}return e}var RA=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case Vg:t.return=ES(t.value,t.length);break;case bS:return gs([fa(t,{value:Ce(t.value,"@","@"+Se)})],o);case Ug:if(t.length)return fA(t.props,function(i){switch(dA(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return gs([fa(t,{props:[Ce(i,/:(read-\w+)/,":"+Mu+"$1")]})],o);case"::placeholder":return gs([fa(t,{props:[Ce(i,/:(plac\w+)/,":"+Se+"input-$1")]}),fa(t,{props:[Ce(i,/:(plac\w+)/,":"+Mu+"$1")]}),fa(t,{props:[Ce(i,/:(plac\w+)/,Et+"input-$1")]})],o)}return""})}},AA=[RA],$A=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var x=m.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||AA,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var x=m.getAttribute("data-emotion").split(" "),b=1;b=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var VA={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},WA=/[A-Z]|^ms/g,HA=/_EMO_([^_]+?)_([^]*?)_EMO_/g,OS=function(t){return t.charCodeAt(1)===45},I0=function(t){return t!=null&&typeof t!="boolean"},mh=CS(function(e){return OS(e)?e:e.replace(WA,"-$&").toLowerCase()}),L0=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(HA,function(r,o,i){return tr={name:o,styles:i,next:tr},o})}return VA[t]!==1&&!OS(t)&&typeof n=="number"&&n!==0?n+"px":n};function ul(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return tr={name:n.name,styles:n.styles,next:tr},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)tr={name:r.name,styles:r.styles,next:tr},r=r.next;var o=n.styles+";";return o}return GA(e,t,n)}case"function":{if(e!==void 0){var i=tr,s=n(e);return tr=i,ul(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function GA(e,t,n){var r="";if(Array.isArray(n))for(var o=0;oh.jsx(bf,{styles:BS}),t$=({scope:e=""})=>h.jsx(bf,{styles:MS` - html { - line-height: 1.5; - -webkit-text-size-adjust: 100%; - font-family: system-ui, sans-serif; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - touch-action: manipulation; - } - - body { - position: relative; - min-height: 100%; - margin: 0; - font-feature-settings: "kern"; - } - - ${e} :where(*, *::before, *::after) { - border-width: 0; - border-style: solid; - box-sizing: border-box; - word-wrap: break-word; - } - - main { - display: block; - } - - ${e} hr { - border-top-width: 1px; - box-sizing: content-box; - height: 0; - overflow: visible; - } - - ${e} :where(pre, code, kbd,samp) { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; - font-size: 1em; - } - - ${e} a { - background-color: transparent; - color: inherit; - text-decoration: inherit; - } - - ${e} abbr[title] { - border-bottom: none; - text-decoration: underline; - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - } - - ${e} :where(b, strong) { - font-weight: bold; - } - - ${e} small { - font-size: 80%; - } - - ${e} :where(sub,sup) { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - } - - ${e} sub { - bottom: -0.25em; - } - - ${e} sup { - top: -0.5em; - } - - ${e} img { - border-style: none; - } - - ${e} :where(button, input, optgroup, select, textarea) { - font-family: inherit; - font-size: 100%; - line-height: 1.15; - margin: 0; - } - - ${e} :where(button, input) { - overflow: visible; - } - - ${e} :where(button, select) { - text-transform: none; - } - - ${e} :where( - button::-moz-focus-inner, - [type="button"]::-moz-focus-inner, - [type="reset"]::-moz-focus-inner, - [type="submit"]::-moz-focus-inner - ) { - border-style: none; - padding: 0; - } - - ${e} fieldset { - padding: 0.35em 0.75em 0.625em; - } - - ${e} legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal; - } - - ${e} progress { - vertical-align: baseline; - } - - ${e} textarea { - overflow: auto; - } - - ${e} :where([type="checkbox"], [type="radio"]) { - box-sizing: border-box; - padding: 0; - } - - ${e} input[type="number"]::-webkit-inner-spin-button, - ${e} input[type="number"]::-webkit-outer-spin-button { - -webkit-appearance: none !important; - } - - ${e} input[type="number"] { - -moz-appearance: textfield; - } - - ${e} input[type="search"] { - -webkit-appearance: textfield; - outline-offset: -2px; - } - - ${e} input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none !important; - } - - ${e} ::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; - } - - ${e} details { - display: block; - } - - ${e} summary { - display: list-item; - } - - template { - display: none; - } - - [hidden] { - display: none !important; - } - - ${e} :where( - blockquote, - dl, - dd, - h1, - h2, - h3, - h4, - h5, - h6, - hr, - figure, - p, - pre - ) { - margin: 0; - } - - ${e} button { - background: transparent; - padding: 0; - } - - ${e} fieldset { - margin: 0; - padding: 0; - } - - ${e} :where(ol, ul) { - margin: 0; - padding: 0; - } - - ${e} textarea { - resize: vertical; - } - - ${e} :where(button, [role="button"]) { - cursor: pointer; - } - - ${e} button::-moz-focus-inner { - border: 0 !important; - } - - ${e} table { - border-collapse: collapse; - } - - ${e} :where(h1, h2, h3, h4, h5, h6) { - font-size: inherit; - font-weight: inherit; - } - - ${e} :where(button, input, optgroup, select, textarea) { - padding: 0; - line-height: inherit; - color: inherit; - } - - ${e} :where(img, svg, video, canvas, audio, iframe, embed, object) { - display: block; - } - - ${e} :where(img, video) { - max-width: 100%; - height: auto; - } - - [data-js-focus-visible] - :focus:not([data-focus-visible-added]):not( - [data-focus-visible-disabled] - ) { - outline: none; - box-shadow: none; - } - - ${e} select::-ms-expand { - display: none; - } - - ${BS} - `});function n$(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function tn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:s}=e,a=y.createContext(s);a.displayName=t;function l(){var c;const u=y.useContext(a);if(!u&&n){const d=new Error(i??n$(r,o));throw d.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,d,l),d}return u}return[a.Provider,l,a]}var[r$,o$]=tn({strict:!1,name:"PortalManagerContext"});function zS(e){const{children:t,zIndex:n}=e;return h.jsx(r$,{value:{zIndex:n},children:t})}zS.displayName="PortalManager";var Pr=globalThis!=null&&globalThis.document?y.useLayoutEffect:y.useEffect,FS={exports:{}},pn={},NS={exports:{}},DS={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(B,D){var H=B.length;B.push(D);e:for(;0>>1,q=B[U];if(0>>1;Uo(J,H))teo(ne,J)?(B[U]=ne,B[te]=H,U=te):(B[U]=J,B[G]=H,U=G);else if(teo(ne,H))B[U]=ne,B[te]=H,U=te;else break e}}return D}function o(B,D){var H=B.sortIndex-D.sortIndex;return H!==0?H:B.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,g=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(B){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=B)r(c),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(c)}}function S(B){if(m=!1,w(B),!g)if(n(l)!==null)g=!0,O(k);else{var D=n(c);D!==null&&F(S,D.startTime-B)}}function k(B,D){g=!1,m&&(m=!1,b(_),_=-1),p=!0;var H=f;try{for(w(D),d=n(l);d!==null&&(!(d.expirationTime>D)||B&&!P());){var U=d.callback;if(typeof U=="function"){d.callback=null,f=d.priorityLevel;var q=U(d.expirationTime<=D);D=e.unstable_now(),typeof q=="function"?d.callback=q:d===n(l)&&r(l),w(D)}else r(l);d=n(l)}if(d!==null)var N=!0;else{var G=n(c);G!==null&&F(S,G.startTime-D),N=!1}return N}finally{d=null,f=H,p=!1}}var T=!1,E=null,_=-1,z=5,L=-1;function P(){return!(e.unstable_now()-LB||125U?(B.sortIndex=H,t(c,B),n(l)===null&&B===n(c)&&(m?(b(_),_=-1):m=!0,F(S,H-U))):(B.sortIndex=q,t(l,B),g||p||(g=!0,O(k))),B},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(B){var D=f;return function(){var H=f;f=D;try{return B.apply(this,arguments)}finally{f=H}}}})(DS);NS.exports=DS;var i$=NS.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var US=y,cn=i$;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hp=Object.prototype.hasOwnProperty,s$=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,z0={},F0={};function a$(e){return Hp.call(F0,e)?!0:Hp.call(z0,e)?!1:s$.test(e)?F0[e]=!0:(z0[e]=!0,!1)}function l$(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function c$(e,t,n,r){if(t===null||typeof t>"u"||l$(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Dt(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var wt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wt[e]=new Dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wt[t]=new Dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wt[e]=new Dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wt[e]=new Dt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){wt[e]=new Dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wt[e]=new Dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wt[e]=new Dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wt[e]=new Dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wt[e]=new Dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zg=/[\-:]([a-z])/g;function Yg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zg,Yg);wt[t]=new Dt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zg,Yg);wt[t]=new Dt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zg,Yg);wt[t]=new Dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!1,!1)});wt.xlinkHref=new Dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qg(e,t,n,r){var o=wt.hasOwnProperty(t)?wt[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{vh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_a(e):""}function u$(e){switch(e.tag){case 5:return _a(e.type);case 16:return _a("Lazy");case 13:return _a("Suspense");case 19:return _a("SuspenseList");case 0:case 2:case 15:return e=yh(e.type,!1),e;case 11:return e=yh(e.type.render,!1),e;case 1:return e=yh(e.type,!0),e;default:return""}}function Zp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qi:return"Fragment";case Gi:return"Portal";case Gp:return"Profiler";case Xg:return"StrictMode";case qp:return"Suspense";case Kp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case HS:return(e.displayName||"Context")+".Consumer";case WS:return(e._context.displayName||"Context")+".Provider";case Jg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ev:return t=e.displayName||null,t!==null?t:Zp(e.type)||"Memo";case Qr:t=e._payload,e=e._init;try{return Zp(e(t))}catch{}}return null}function d$(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zp(t);case 8:return t===Xg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function wo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function f$(e){var t=qS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cc(e){e._valueTracker||(e._valueTracker=f$(e))}function KS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yp(e,t){var n=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function D0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=wo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ZS(e,t){t=t.checked,t!=null&&Qg(e,"checked",t,!1)}function Qp(e,t){ZS(e,t);var n=wo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xp(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xp(e,t.type,wo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function U0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Xp(e,t,n){(t!=="number"||Bu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ra=Array.isArray;function vs(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ec.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},h$=["Webkit","ms","Moz","O"];Object.keys(Fa).forEach(function(e){h$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fa[t]=Fa[e]})});function JS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fa.hasOwnProperty(e)&&Fa[e]?(""+t).trim():t+"px"}function ek(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=JS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var p$=Ge({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tm(e,t){if(t){if(p$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function nm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rm=null;function tv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var om=null,ys=null,bs=null;function H0(e){if(e=Yl(e)){if(typeof om!="function")throw Error(W(280));var t=e.stateNode;t&&(t=Cf(t),om(e.stateNode,e.type,t))}}function tk(e){ys?bs?bs.push(e):bs=[e]:ys=e}function nk(){if(ys){var e=ys,t=bs;if(bs=ys=null,H0(e),t)for(e=0;e>>=0,e===0?32:31-(E$(e)/T$|0)|0}var Tc=64,Pc=4194304;function Aa(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Du(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Aa(a):(i&=s,i!==0&&(r=Aa(i)))}else s=n&~o,s!==0?r=Aa(s):i!==0&&(r=Aa(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Kl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Un(t),e[t]=n}function A$(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Da),e1=String.fromCharCode(32),t1=!1;function Sk(e,t){switch(e){case"keyup":return o5.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ki=!1;function s5(e,t){switch(e){case"compositionend":return kk(t);case"keypress":return t.which!==32?null:(t1=!0,e1);case"textInput":return e=t.data,e===e1&&t1?null:e;default:return null}}function a5(e,t){if(Ki)return e==="compositionend"||!cv&&Sk(e,t)?(e=wk(),uu=sv=ro=null,Ki=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=i1(n)}}function Pk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _k(){for(var e=window,t=Bu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bu(e.document)}return t}function uv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function g5(e){var t=_k(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pk(n.ownerDocument.documentElement,n)){if(r!==null&&uv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=s1(n,i);var s=s1(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Zi=null,um=null,Va=null,dm=!1;function a1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;dm||Zi==null||Zi!==Bu(r)||(r=Zi,"selectionStart"in r&&uv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Va&&bl(Va,r)||(Va=r,r=Wu(um,"onSelect"),0Xi||(e.current=vm[Xi],vm[Xi]=null,Xi--)}function Oe(e,t){Xi++,vm[Xi]=e.current,e.current=t}var xo={},jt=Eo(xo),Gt=Eo(!1),li=xo;function Is(e,t){var n=e.type.contextTypes;if(!n)return xo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function qt(e){return e=e.childContextTypes,e!=null}function Gu(){Be(Gt),Be(jt)}function p1(e,t,n){if(jt.current!==xo)throw Error(W(168));Oe(jt,t),Oe(Gt,n)}function Bk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(W(108,d$(e)||"Unknown",o));return Ge({},n,r)}function qu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xo,li=jt.current,Oe(jt,e),Oe(Gt,Gt.current),!0}function m1(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=Bk(e,t,li),r.__reactInternalMemoizedMergedChildContext=e,Be(Gt),Be(jt),Oe(jt,e)):Be(Gt),Oe(Gt,n)}var br=null,Ef=!1,Oh=!1;function zk(e){br===null?br=[e]:br.push(e)}function _5(e){Ef=!0,zk(e)}function To(){if(!Oh&&br!==null){Oh=!0;var e=0,t=_e;try{var n=br;for(_e=1;e>=s,o-=s,kr=1<<32-Un(t)+o|n<_?(z=E,E=null):z=E.sibling;var L=f(b,E,w[_],S);if(L===null){E===null&&(E=z);break}e&&E&&L.alternate===null&&t(b,E),v=i(L,v,_),T===null?k=L:T.sibling=L,T=L,E=z}if(_===w.length)return n(b,E),De&&Lo(b,_),k;if(E===null){for(;__?(z=E,E=null):z=E.sibling;var P=f(b,E,L.value,S);if(P===null){E===null&&(E=z);break}e&&E&&P.alternate===null&&t(b,E),v=i(P,v,_),T===null?k=P:T.sibling=P,T=P,E=z}if(L.done)return n(b,E),De&&Lo(b,_),k;if(E===null){for(;!L.done;_++,L=w.next())L=d(b,L.value,S),L!==null&&(v=i(L,v,_),T===null?k=L:T.sibling=L,T=L);return De&&Lo(b,_),k}for(E=r(b,E);!L.done;_++,L=w.next())L=p(E,b,_,L.value,S),L!==null&&(e&&L.alternate!==null&&E.delete(L.key===null?_:L.key),v=i(L,v,_),T===null?k=L:T.sibling=L,T=L);return e&&E.forEach(function(j){return t(b,j)}),De&&Lo(b,_),k}function x(b,v,w,S){if(typeof w=="object"&&w!==null&&w.type===qi&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case kc:e:{for(var k=w.key,T=v;T!==null;){if(T.key===k){if(k=w.type,k===qi){if(T.tag===7){n(b,T.sibling),v=o(T,w.props.children),v.return=b,b=v;break e}}else if(T.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Qr&&S1(k)===T.type){n(b,T.sibling),v=o(T,w.props),v.ref=ya(b,T,w),v.return=b,b=v;break e}n(b,T);break}else t(b,T);T=T.sibling}w.type===qi?(v=Xo(w.props.children,b.mode,S,w.key),v.return=b,b=v):(S=yu(w.type,w.key,w.props,null,b.mode,S),S.ref=ya(b,v,w),S.return=b,b=S)}return s(b);case Gi:e:{for(T=w.key;v!==null;){if(v.key===T)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(b,v.sibling),v=o(v,w.children||[]),v.return=b,b=v;break e}else{n(b,v);break}else t(b,v);v=v.sibling}v=Nh(w,b.mode,S),v.return=b,b=v}return s(b);case Qr:return T=w._init,x(b,v,T(w._payload),S)}if(Ra(w))return g(b,v,w,S);if(ha(w))return m(b,v,w,S);Ic(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(b,v.sibling),v=o(v,w),v.return=b,b=v):(n(b,v),v=Fh(w,b.mode,S),v.return=b,b=v),s(b)):n(b,v)}return x}var Ms=Gk(!0),qk=Gk(!1),Ql={},cr=Eo(Ql),kl=Eo(Ql),Cl=Eo(Ql);function Go(e){if(e===Ql)throw Error(W(174));return e}function bv(e,t){switch(Oe(Cl,t),Oe(kl,e),Oe(cr,Ql),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:em(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=em(t,e)}Be(cr),Oe(cr,t)}function Bs(){Be(cr),Be(kl),Be(Cl)}function Kk(e){Go(Cl.current);var t=Go(cr.current),n=em(t,e.type);t!==n&&(Oe(kl,e),Oe(cr,n))}function wv(e){kl.current===e&&(Be(cr),Be(kl))}var Ve=Eo(0);function Ju(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jh=[];function xv(){for(var e=0;en?n:4,e(!0);var r=Ih.transition;Ih.transition={};try{e(!1),t()}finally{_e=n,Ih.transition=r}}function uC(){return Rn().memoizedState}function O5(e,t,n){var r=ho(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dC(e))fC(t,n);else if(n=Uk(e,t,n,r),n!==null){var o=zt();Vn(n,e,r,o),hC(n,t,r)}}function j5(e,t,n){var r=ho(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dC(e))fC(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Hn(a,s)){var l=t.interleaved;l===null?(o.next=o,vv(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Uk(e,t,o,r),n!==null&&(o=zt(),Vn(n,e,r,o),hC(n,t,r))}}function dC(e){var t=e.alternate;return e===He||t!==null&&t===He}function fC(e,t){Wa=ed=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rv(e,n)}}var td={readContext:_n,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},I5={readContext:_n,useCallback:function(e,t){return Qn().memoizedState=[e,t===void 0?null:t],e},useContext:_n,useEffect:C1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pu(4194308,4,iC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pu(4194308,4,e,t)},useInsertionEffect:function(e,t){return pu(4,2,e,t)},useMemo:function(e,t){var n=Qn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=O5.bind(null,He,e),[r.memoizedState,e]},useRef:function(e){var t=Qn();return e={current:e},t.memoizedState=e},useState:k1,useDebugValue:Tv,useDeferredValue:function(e){return Qn().memoizedState=e},useTransition:function(){var e=k1(!1),t=e[0];return e=$5.bind(null,e[1]),Qn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=He,o=Qn();if(De){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),ut===null)throw Error(W(349));ui&30||Qk(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,C1(Jk.bind(null,r,i,e),[e]),r.flags|=2048,Pl(9,Xk.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Qn(),t=ut.identifierPrefix;if(De){var n=Cr,r=kr;n=(r&~(1<<32-Un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=El++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[rr]=t,e[Sl]=r,SC(e,t,!1,!1),t.stateNode=e;e:{switch(s=nm(n,r),n){case"dialog":Ie("cancel",e),Ie("close",e),o=r;break;case"iframe":case"object":case"embed":Ie("load",e),o=r;break;case"video":case"audio":for(o=0;o<$a.length;o++)Ie($a[o],e);o=r;break;case"source":Ie("error",e),o=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=r;break;case"details":Ie("toggle",e),o=r;break;case"input":D0(e,r),o=Yp(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ge({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":V0(e,r),o=Jp(e,r),Ie("invalid",e);break;default:o=r}tm(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?ek(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&XS(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&hl(e,l):typeof l=="number"&&hl(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(fl.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ie("scroll",e):l!=null&&Qg(e,i,l,s))}switch(n){case"input":Cc(e),U0(e,r,!1);break;case"textarea":Cc(e),W0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+wo(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?vs(e,!!r.multiple,i,!1):r.defaultValue!=null&&vs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Hu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ct(t),null;case 6:if(e&&t.stateNode!=null)CC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=Go(Cl.current),Go(cr.current),jc(t)){if(r=t.stateNode,n=t.memoizedProps,r[rr]=t,(i=r.nodeValue!==n)&&(e=an,e!==null))switch(e.tag){case 3:Oc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Oc(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[rr]=t,t.stateNode=r}return Ct(t),null;case 13:if(Be(Ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(De&&on!==null&&t.mode&1&&!(t.flags&128))Dk(),Ls(),t.flags|=98560,i=!1;else if(i=jc(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(W(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(W(317));i[rr]=t}else Ls(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ct(t),i=!1}else Bn!==null&&(Mm(Bn),Bn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ve.current&1?it===0&&(it=3):jv())),t.updateQueue!==null&&(t.flags|=4),Ct(t),null);case 4:return Bs(),_m(e,t),e===null&&wl(t.stateNode.containerInfo),Ct(t),null;case 10:return gv(t.type._context),Ct(t),null;case 17:return qt(t.type)&&Gu(),Ct(t),null;case 19:if(Be(Ve),i=t.memoizedState,i===null)return Ct(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ba(i,!1);else{if(it!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ju(e),s!==null){for(t.flags|=128,ba(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Oe(Ve,Ve.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ze()>Fs&&(t.flags|=128,r=!0,ba(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ju(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ba(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!De)return Ct(t),null}else 2*Ze()-i.renderingStartTime>Fs&&n!==1073741824&&(t.flags|=128,r=!0,ba(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ze(),t.sibling=null,n=Ve.current,Oe(Ve,r?n&1|2:n&1),t):(Ct(t),null);case 22:case 23:return Ov(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?rn&1073741824&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function U5(e,t){switch(fv(t),t.tag){case 1:return qt(t.type)&&Gu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bs(),Be(Gt),Be(jt),xv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wv(t),null;case 13:if(Be(Ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Be(Ve),null;case 4:return Bs(),null;case 10:return gv(t.type._context),null;case 22:case 23:return Ov(),null;case 24:return null;default:return null}}var Mc=!1,Rt=!1,V5=typeof WeakSet=="function"?WeakSet:Set,X=null;function ns(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){qe(e,t,r)}else n.current=null}function Rm(e,t,n){try{n()}catch(r){qe(e,t,r)}}var j1=!1;function W5(e,t){if(fm=Uu,e=_k(),uv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===o&&(a=s),f===i&&++u===r&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(hm={focusedElem:e,selectionRange:n},Uu=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,x=g.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ln(t.type,m),x);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(S){qe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return g=j1,j1=!1,g}function Ha(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Rm(t,n,i)}o=o.next}while(o!==r)}}function _f(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Am(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function EC(e){var t=e.alternate;t!==null&&(e.alternate=null,EC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[rr],delete t[Sl],delete t[gm],delete t[T5],delete t[P5])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function TC(e){return e.tag===5||e.tag===3||e.tag===4}function I1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||TC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $m(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Hu));else if(r!==4&&(e=e.child,e!==null))for($m(e,t,n),e=e.sibling;e!==null;)$m(e,t,n),e=e.sibling}function Om(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Om(e,t,n),e=e.sibling;e!==null;)Om(e,t,n),e=e.sibling}var pt=null,Mn=!1;function Wr(e,t,n){for(n=n.child;n!==null;)PC(e,t,n),n=n.sibling}function PC(e,t,n){if(lr&&typeof lr.onCommitFiberUnmount=="function")try{lr.onCommitFiberUnmount(wf,n)}catch{}switch(n.tag){case 5:Rt||ns(n,t);case 6:var r=pt,o=Mn;pt=null,Wr(e,t,n),pt=r,Mn=o,pt!==null&&(Mn?(e=pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pt.removeChild(n.stateNode));break;case 18:pt!==null&&(Mn?(e=pt,n=n.stateNode,e.nodeType===8?$h(e.parentNode,n):e.nodeType===1&&$h(e,n),vl(e)):$h(pt,n.stateNode));break;case 4:r=pt,o=Mn,pt=n.stateNode.containerInfo,Mn=!0,Wr(e,t,n),pt=r,Mn=o;break;case 0:case 11:case 14:case 15:if(!Rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Rm(n,t,s),o=o.next}while(o!==r)}Wr(e,t,n);break;case 1:if(!Rt&&(ns(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){qe(n,t,a)}Wr(e,t,n);break;case 21:Wr(e,t,n);break;case 22:n.mode&1?(Rt=(r=Rt)||n.memoizedState!==null,Wr(e,t,n),Rt=r):Wr(e,t,n);break;default:Wr(e,t,n)}}function L1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new V5),t.forEach(function(r){var o=J5.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function On(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Ze()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*G5(r/1960))-r,10e?16:e,oo===null)var r=!1;else{if(e=oo,oo=null,od=0,ge&6)throw Error(W(331));var o=ge;for(ge|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lZe()-Av?Qo(e,0):Rv|=n),Kt(e,t)}function LC(e,t){t===0&&(e.mode&1?(t=Pc,Pc<<=1,!(Pc&130023424)&&(Pc=4194304)):t=1);var n=zt();e=Ir(e,t),e!==null&&(Kl(e,t,n),Kt(e,n))}function X5(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),LC(e,n)}function J5(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(t),LC(e,n)}var MC;MC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gt.current)Ht=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ht=!1,N5(e,t,n);Ht=!!(e.flags&131072)}else Ht=!1,De&&t.flags&1048576&&Fk(t,Zu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;mu(e,t),e=t.pendingProps;var o=Is(t,jt.current);xs(t,n),o=kv(null,t,r,e,o,n);var i=Cv();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qt(r)?(i=!0,qu(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,yv(t),o.updater=Tf,t.stateNode=o,o._reactInternals=t,Sm(t,r,e,n),t=Em(null,t,r,!0,i,n)):(t.tag=0,De&&i&&dv(t),Lt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(mu(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=tO(r),e=Ln(r,e),o){case 0:t=Cm(null,t,r,e,n);break e;case 1:t=A1(null,t,r,e,n);break e;case 11:t=_1(null,t,r,e,n);break e;case 14:t=R1(null,t,r,Ln(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ln(r,o),Cm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ln(r,o),A1(e,t,r,o,n);case 3:e:{if(bC(t),e===null)throw Error(W(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Vk(e,t),Xu(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=zs(Error(W(423)),t),t=$1(e,t,r,n,o);break e}else if(r!==o){o=zs(Error(W(424)),t),t=$1(e,t,r,n,o);break e}else for(on=co(t.stateNode.containerInfo.firstChild),an=t,De=!0,Bn=null,n=qk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ls(),r===o){t=Lr(e,t,n);break e}Lt(e,t,r,n)}t=t.child}return t;case 5:return Kk(t),e===null&&bm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,pm(r,o)?s=null:i!==null&&pm(r,i)&&(t.flags|=32),yC(e,t),Lt(e,t,s,n),t.child;case 6:return e===null&&bm(t),null;case 13:return wC(e,t,n);case 4:return bv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ms(t,null,r,n):Lt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ln(r,o),_1(e,t,r,o,n);case 7:return Lt(e,t,t.pendingProps,n),t.child;case 8:return Lt(e,t,t.pendingProps.children,n),t.child;case 12:return Lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Oe(Yu,r._currentValue),r._currentValue=s,i!==null)if(Hn(i.value,s)){if(i.children===o.children&&!Gt.current){t=Lr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=_r(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),wm(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(W(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),wm(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Lt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,xs(t,n),o=_n(o),r=r(o),t.flags|=1,Lt(e,t,r,n),t.child;case 14:return r=t.type,o=Ln(r,t.pendingProps),o=Ln(r.type,o),R1(e,t,r,o,n);case 15:return gC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ln(r,o),mu(e,t),t.tag=1,qt(r)?(e=!0,qu(t)):e=!1,xs(t,n),Hk(t,r,o),Sm(t,r,o,n),Em(null,t,r,!0,e,n);case 19:return xC(e,t,n);case 22:return vC(e,t,n)}throw Error(W(156,t.tag))};function BC(e,t){return ck(e,t)}function eO(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,n,r){return new eO(e,t,n,r)}function Iv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tO(e){if(typeof e=="function")return Iv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Jg)return 11;if(e===ev)return 14}return 2}function po(e,t){var n=e.alternate;return n===null?(n=En(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function yu(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Iv(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case qi:return Xo(n.children,o,i,t);case Xg:s=8,o|=8;break;case Gp:return e=En(12,n,t,o|2),e.elementType=Gp,e.lanes=i,e;case qp:return e=En(13,n,t,o),e.elementType=qp,e.lanes=i,e;case Kp:return e=En(19,n,t,o),e.elementType=Kp,e.lanes=i,e;case GS:return Af(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case WS:s=10;break e;case HS:s=9;break e;case Jg:s=11;break e;case ev:s=14;break e;case Qr:s=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=En(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Xo(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function Af(e,t,n,r){return e=En(22,e,r,t),e.elementType=GS,e.lanes=n,e.stateNode={isHidden:!1},e}function Fh(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function Nh(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nO(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wh(0),this.expirationTimes=wh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Lv(e,t,n,r,o,i,s,a,l){return e=new nO(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=En(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yv(i),e}function rO(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DC)}catch(e){console.error(e)}}DC(),FS.exports=pn;var Fv=FS.exports,[UC,lO]=tn({strict:!1,name:"PortalContext"}),Nv="chakra-portal",cO=".chakra-portal",uO=e=>h.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),dO=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=y.useState(null),i=y.useRef(null),[,s]=y.useState({});y.useEffect(()=>s({}),[]);const a=lO(),l=o$();Pr(()=>{if(!r)return;const u=r.ownerDocument,d=t?a??u.body:u.body;if(!d)return;i.current=u.createElement("div"),i.current.className=Nv,d.appendChild(i.current),s({});const f=i.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const c=l!=null&&l.zIndex?h.jsx(uO,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return i.current?Fv.createPortal(h.jsx(UC,{value:i.current,children:c}),i.current):h.jsx("span",{ref:u=>{u&&o(u)}})},fO=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),s=y.useMemo(()=>{const l=o==null?void 0:o.ownerDocument.createElement("div");return l&&(l.className=Nv),l},[o]),[,a]=y.useState({});return Pr(()=>a({}),[]),Pr(()=>{if(!(!s||!i))return i.appendChild(s),()=>{i.removeChild(s)}},[s,i]),i&&s?Fv.createPortal(h.jsx(UC,{value:r?s:null,children:t}),s):null};function na(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?h.jsx(fO,{containerRef:n,...r}):h.jsx(dO,{...r})}na.className=Nv;na.selector=cO;na.displayName="Portal";function Dv(){const e=y.useContext(dl);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var Uv=y.createContext({});Uv.displayName="ColorModeContext";function Vv(){const e=y.useContext(Uv);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var Fc={light:"chakra-ui-light",dark:"chakra-ui-dark"};function hO(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const o=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,o==null||o()},setClassName(r){document.body.classList.add(r?Fc.dark:Fc.light),document.body.classList.remove(r?Fc.light:Fc.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const o=n.query(),i=s=>{r(s.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(i):o.addEventListener("change",i),()=>{typeof o.removeListener=="function"?o.removeListener(i):o.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var pO="chakra-ui-color-mode";function mO(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var gO=mO(pO),V1=()=>{};function W1(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function VC(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:o,disableTransitionOnChange:i}={},colorModeManager:s=gO}=e,a=o==="dark"?"dark":"light",[l,c]=y.useState(()=>W1(s,a)),[u,d]=y.useState(()=>W1(s)),{getSystemTheme:f,setClassName:p,setDataset:g,addListener:m}=y.useMemo(()=>hO({preventTransition:i}),[i]),x=o==="system"&&!l?u:l,b=y.useCallback(S=>{const k=S==="system"?f():S;c(k),p(k==="dark"),g(k),s.set(k)},[s,f,p,g]);Pr(()=>{o==="system"&&d(f())},[]),y.useEffect(()=>{const S=s.get();if(S){b(S);return}if(o==="system"){b("system");return}b(a)},[s,a,o,b]);const v=y.useCallback(()=>{b(x==="dark"?"light":"dark")},[x,b]);y.useEffect(()=>{if(r)return m(b)},[r,m,b]);const w=y.useMemo(()=>({colorMode:t??x,toggleColorMode:t?V1:v,setColorMode:t?V1:b,forced:t!==void 0}),[x,v,b,t]);return h.jsx(Uv.Provider,{value:w,children:n})}VC.displayName="ColorModeProvider";function WC(){const e=Vv(),t=Dv();return{...e,theme:t}}var se=(...e)=>e.filter(Boolean).join(" ");function Wn(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Nn(e,...t){return vO(e)?e(...t):e}var vO=e=>typeof e=="function",ke=e=>e?"":void 0,Dh=e=>e?!0:void 0;function me(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function yO(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var ad={exports:{}};ad.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",g="[object GeneratorFunction]",m="[object Map]",x="[object Number]",b="[object Null]",v="[object Object]",w="[object Proxy]",S="[object RegExp]",k="[object Set]",T="[object String]",E="[object Undefined]",_="[object WeakMap]",z="[object ArrayBuffer]",L="[object DataView]",P="[object Float32Array]",j="[object Float64Array]",I="[object Int8Array]",V="[object Int16Array]",$="[object Int32Array]",O="[object Uint8Array]",F="[object Uint8ClampedArray]",B="[object Uint16Array]",D="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,U=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,N={};N[P]=N[j]=N[I]=N[V]=N[$]=N[O]=N[F]=N[B]=N[D]=!0,N[a]=N[l]=N[z]=N[u]=N[L]=N[d]=N[f]=N[p]=N[m]=N[x]=N[v]=N[S]=N[k]=N[T]=N[_]=!1;var G=typeof wc=="object"&&wc&&wc.Object===Object&&wc,J=typeof self=="object"&&self&&self.Object===Object&&self,te=G||J||Function("return this")(),ne=t&&!t.nodeType&&t,ue=ne&&!0&&e&&!e.nodeType&&e,he=ue&&ue.exports===ne,Ae=he&&G.process,ze=function(){try{var C=ue&&ue.require&&ue.require("util").types;return C||Ae&&Ae.binding&&Ae.binding("util")}catch{}}(),le=ze&&ze.isTypedArray;function ve(C,R,M){switch(M.length){case 0:return C.call(R);case 1:return C.call(R,M[0]);case 2:return C.call(R,M[0],M[1]);case 3:return C.call(R,M[0],M[1],M[2])}return C.apply(R,M)}function xt(C,R){for(var M=-1,Q=Array(C);++M-1}function H_(C,R){var M=this.__data__,Q=gc(M,C);return Q<0?(++this.size,M.push([C,R])):M[Q][1]=R,this}gr.prototype.clear=D_,gr.prototype.delete=U_,gr.prototype.get=V_,gr.prototype.has=W_,gr.prototype.set=H_;function ji(C){var R=-1,M=C==null?0:C.length;for(this.clear();++R1?M[pe-1]:void 0,Fe=pe>2?M[2]:void 0;for($e=C.length>3&&typeof $e=="function"?(pe--,$e):void 0,Fe&&wR(M[0],M[1],Fe)&&($e=pe<3?void 0:$e,pe=1),R=Object(R);++Q-1&&C%1==0&&C0){if(++R>=o)return arguments[0]}else R=0;return C.apply(void 0,arguments)}}function _R(C){if(C!=null){try{return Vr.call(C)}catch{}try{return C+""}catch{}}return""}function bc(C,R){return C===R||C!==C&&R!==R}var lh=v0(function(){return arguments}())?v0:function(C){return ua(C)&&gn.call(C,"callee")&&!$_.call(C,"callee")},ch=Array.isArray;function uh(C){return C!=null&&S0(C.length)&&!dh(C)}function RR(C){return ua(C)&&uh(C)}var x0=j_||IR;function dh(C){if(!jo(C))return!1;var R=vc(C);return R==p||R==g||R==c||R==w}function S0(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=s}function jo(C){var R=typeof C;return C!=null&&(R=="object"||R=="function")}function ua(C){return C!=null&&typeof C=="object"}function AR(C){if(!ua(C)||vc(C)!=v)return!1;var R=h0(C);if(R===null)return!0;var M=gn.call(R,"constructor")&&R.constructor;return typeof M=="function"&&M instanceof M&&Vr.call(M)==hc}var k0=le?K(le):sR;function $R(C){return mR(C,C0(C))}function C0(C){return uh(C)?nR(C,!0):aR(C)}var OR=gR(function(C,R,M,Q){y0(C,R,M,Q)});function jR(C){return function(){return C}}function E0(C){return C}function IR(){return!1}e.exports=OR})(ad,ad.exports);var bO=ad.exports;const sr=Xe(bO);var wO=e=>/!(important)?$/.test(e),H1=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,xO=(e,t)=>n=>{const r=String(t),o=wO(r),i=H1(r),s=e?`${e}.${i}`:i;let a=Wn(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=H1(a),o?`${a} !important`:a};function Wv(e){const{scale:t,transform:n,compose:r}=e;return(i,s)=>{var a;const l=xO(t,i)(s);let c=(a=n==null?void 0:n(l,s))!=null?a:l;return r&&(c=r(c,s)),c}}var Nc=(...e)=>t=>e.reduce((n,r)=>r(n),t);function yn(e,t){return n=>{const r={property:n,scale:e};return r.transform=Wv({scale:e,transform:t}),r}}var SO=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function kO(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:SO(t),transform:n?Wv({scale:n,compose:r}):r}}var HC=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function CO(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...HC].join(" ")}function EO(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...HC].join(" ")}var TO={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},PO={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function _O(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var RO={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},Bm={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},AO=new Set(Object.values(Bm)),zm=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),$O=e=>e.trim();function OO(e,t){if(e==null||zm.has(e))return e;if(!(Fm(e)||zm.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o==null?void 0:o[1],s=o==null?void 0:o[2];if(!i||!s)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[l,...c]=s.split(",").map($O).filter(Boolean);if((c==null?void 0:c.length)===0)return e;const u=l in Bm?Bm[l]:l;c.unshift(u);const d=c.map(f=>{if(AO.has(f))return f;const p=f.indexOf(" "),[g,m]=p!==-1?[f.substr(0,p),f.substr(p+1)]:[f],x=Fm(m)?m:m&&m.split(" "),b=`colors.${g}`,v=b in t.__cssMap?t.__cssMap[b].varRef:g;return x?[v,...Array.isArray(x)?x:[x]].join(" "):v});return`${a}(${d.join(", ")})`}var Fm=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),jO=(e,t)=>OO(e,t??{});function IO(e){return/^var\(--.+\)$/.test(e)}var LO=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Zn=e=>t=>`${e}(${t})`,we={filter(e){return e!=="auto"?e:TO},backdropFilter(e){return e!=="auto"?e:PO},ring(e){return _O(we.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?CO():e==="auto-gpu"?EO():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=LO(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(IO(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:jO,blur:Zn("blur"),opacity:Zn("opacity"),brightness:Zn("brightness"),contrast:Zn("contrast"),dropShadow:Zn("drop-shadow"),grayscale:Zn("grayscale"),hueRotate:Zn("hue-rotate"),invert:Zn("invert"),saturate:Zn("saturate"),sepia:Zn("sepia"),bgImage(e){return e==null||Fm(e)||zm.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=RO[e])!=null?t:{},o={flexDirection:e};return n&&(o[n]=1),r&&(o[r]=1),o}},A={borderWidths:yn("borderWidths"),borderStyles:yn("borderStyles"),colors:yn("colors"),borders:yn("borders"),gradients:yn("gradients",we.gradient),radii:yn("radii",we.px),space:yn("space",Nc(we.vh,we.px)),spaceT:yn("space",Nc(we.vh,we.px)),degreeT(e){return{property:e,transform:we.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Wv({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:yn("sizes",Nc(we.vh,we.px)),sizesT:yn("sizes",Nc(we.vh,we.fraction)),shadows:yn("shadows"),logical:kO,blur:yn("blur",we.blur)},bu={background:A.colors("background"),backgroundColor:A.colors("backgroundColor"),backgroundImage:A.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:we.bgClip},bgSize:A.prop("backgroundSize"),bgPosition:A.prop("backgroundPosition"),bg:A.colors("background"),bgColor:A.colors("backgroundColor"),bgPos:A.prop("backgroundPosition"),bgRepeat:A.prop("backgroundRepeat"),bgAttachment:A.prop("backgroundAttachment"),bgGradient:A.gradients("backgroundImage"),bgClip:{transform:we.bgClip}};Object.assign(bu,{bgImage:bu.backgroundImage,bgImg:bu.backgroundImage});var xe={border:A.borders("border"),borderWidth:A.borderWidths("borderWidth"),borderStyle:A.borderStyles("borderStyle"),borderColor:A.colors("borderColor"),borderRadius:A.radii("borderRadius"),borderTop:A.borders("borderTop"),borderBlockStart:A.borders("borderBlockStart"),borderTopLeftRadius:A.radii("borderTopLeftRadius"),borderStartStartRadius:A.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:A.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:A.radii("borderTopRightRadius"),borderStartEndRadius:A.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:A.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:A.borders("borderRight"),borderInlineEnd:A.borders("borderInlineEnd"),borderBottom:A.borders("borderBottom"),borderBlockEnd:A.borders("borderBlockEnd"),borderBottomLeftRadius:A.radii("borderBottomLeftRadius"),borderBottomRightRadius:A.radii("borderBottomRightRadius"),borderLeft:A.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:A.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:A.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:A.borders(["borderLeft","borderRight"]),borderInline:A.borders("borderInline"),borderY:A.borders(["borderTop","borderBottom"]),borderBlock:A.borders("borderBlock"),borderTopWidth:A.borderWidths("borderTopWidth"),borderBlockStartWidth:A.borderWidths("borderBlockStartWidth"),borderTopColor:A.colors("borderTopColor"),borderBlockStartColor:A.colors("borderBlockStartColor"),borderTopStyle:A.borderStyles("borderTopStyle"),borderBlockStartStyle:A.borderStyles("borderBlockStartStyle"),borderBottomWidth:A.borderWidths("borderBottomWidth"),borderBlockEndWidth:A.borderWidths("borderBlockEndWidth"),borderBottomColor:A.colors("borderBottomColor"),borderBlockEndColor:A.colors("borderBlockEndColor"),borderBottomStyle:A.borderStyles("borderBottomStyle"),borderBlockEndStyle:A.borderStyles("borderBlockEndStyle"),borderLeftWidth:A.borderWidths("borderLeftWidth"),borderInlineStartWidth:A.borderWidths("borderInlineStartWidth"),borderLeftColor:A.colors("borderLeftColor"),borderInlineStartColor:A.colors("borderInlineStartColor"),borderLeftStyle:A.borderStyles("borderLeftStyle"),borderInlineStartStyle:A.borderStyles("borderInlineStartStyle"),borderRightWidth:A.borderWidths("borderRightWidth"),borderInlineEndWidth:A.borderWidths("borderInlineEndWidth"),borderRightColor:A.colors("borderRightColor"),borderInlineEndColor:A.colors("borderInlineEndColor"),borderRightStyle:A.borderStyles("borderRightStyle"),borderInlineEndStyle:A.borderStyles("borderInlineEndStyle"),borderTopRadius:A.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:A.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:A.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:A.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(xe,{rounded:xe.borderRadius,roundedTop:xe.borderTopRadius,roundedTopLeft:xe.borderTopLeftRadius,roundedTopRight:xe.borderTopRightRadius,roundedTopStart:xe.borderStartStartRadius,roundedTopEnd:xe.borderStartEndRadius,roundedBottom:xe.borderBottomRadius,roundedBottomLeft:xe.borderBottomLeftRadius,roundedBottomRight:xe.borderBottomRightRadius,roundedBottomStart:xe.borderEndStartRadius,roundedBottomEnd:xe.borderEndEndRadius,roundedLeft:xe.borderLeftRadius,roundedRight:xe.borderRightRadius,roundedStart:xe.borderInlineStartRadius,roundedEnd:xe.borderInlineEndRadius,borderStart:xe.borderInlineStart,borderEnd:xe.borderInlineEnd,borderTopStartRadius:xe.borderStartStartRadius,borderTopEndRadius:xe.borderStartEndRadius,borderBottomStartRadius:xe.borderEndStartRadius,borderBottomEndRadius:xe.borderEndEndRadius,borderStartRadius:xe.borderInlineStartRadius,borderEndRadius:xe.borderInlineEndRadius,borderStartWidth:xe.borderInlineStartWidth,borderEndWidth:xe.borderInlineEndWidth,borderStartColor:xe.borderInlineStartColor,borderEndColor:xe.borderInlineEndColor,borderStartStyle:xe.borderInlineStartStyle,borderEndStyle:xe.borderInlineEndStyle});var MO={color:A.colors("color"),textColor:A.colors("color"),fill:A.colors("fill"),stroke:A.colors("stroke")},Nm={boxShadow:A.shadows("boxShadow"),mixBlendMode:!0,blendMode:A.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:A.prop("backgroundBlendMode"),opacity:!0};Object.assign(Nm,{shadow:Nm.boxShadow});var BO={filter:{transform:we.filter},blur:A.blur("--chakra-blur"),brightness:A.propT("--chakra-brightness",we.brightness),contrast:A.propT("--chakra-contrast",we.contrast),hueRotate:A.degreeT("--chakra-hue-rotate"),invert:A.propT("--chakra-invert",we.invert),saturate:A.propT("--chakra-saturate",we.saturate),dropShadow:A.propT("--chakra-drop-shadow",we.dropShadow),backdropFilter:{transform:we.backdropFilter},backdropBlur:A.blur("--chakra-backdrop-blur"),backdropBrightness:A.propT("--chakra-backdrop-brightness",we.brightness),backdropContrast:A.propT("--chakra-backdrop-contrast",we.contrast),backdropHueRotate:A.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:A.propT("--chakra-backdrop-invert",we.invert),backdropSaturate:A.propT("--chakra-backdrop-saturate",we.saturate)},ld={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:we.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:A.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:A.space("gap"),rowGap:A.space("rowGap"),columnGap:A.space("columnGap")};Object.assign(ld,{flexDir:ld.flexDirection});var GC={gridGap:A.space("gridGap"),gridColumnGap:A.space("gridColumnGap"),gridRowGap:A.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},zO={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:we.outline},outlineOffset:!0,outlineColor:A.colors("outlineColor")},xn={width:A.sizesT("width"),inlineSize:A.sizesT("inlineSize"),height:A.sizes("height"),blockSize:A.sizes("blockSize"),boxSize:A.sizes(["width","height"]),minWidth:A.sizes("minWidth"),minInlineSize:A.sizes("minInlineSize"),minHeight:A.sizes("minHeight"),minBlockSize:A.sizes("minBlockSize"),maxWidth:A.sizes("maxWidth"),maxInlineSize:A.sizes("maxInlineSize"),maxHeight:A.sizes("maxHeight"),maxBlockSize:A.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (min-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?o:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (max-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?o:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:A.propT("float",we.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(xn,{w:xn.width,h:xn.height,minW:xn.minWidth,maxW:xn.maxWidth,minH:xn.minHeight,maxH:xn.maxHeight,overscroll:xn.overscrollBehavior,overscrollX:xn.overscrollBehaviorX,overscrollY:xn.overscrollBehaviorY});var FO={listStyleType:!0,listStylePosition:!0,listStylePos:A.prop("listStylePosition"),listStyleImage:!0,listStyleImg:A.prop("listStyleImage")};function NO(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},UO=DO(NO),VO={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},WO={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Uh=(e,t,n)=>{const r={},o=UO(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},HO={srOnly:{transform(e){return e===!0?VO:e==="focusable"?WO:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Uh(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Uh(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Uh(t,e,n)}},Ka={position:!0,pos:A.prop("position"),zIndex:A.prop("zIndex","zIndices"),inset:A.spaceT("inset"),insetX:A.spaceT(["left","right"]),insetInline:A.spaceT("insetInline"),insetY:A.spaceT(["top","bottom"]),insetBlock:A.spaceT("insetBlock"),top:A.spaceT("top"),insetBlockStart:A.spaceT("insetBlockStart"),bottom:A.spaceT("bottom"),insetBlockEnd:A.spaceT("insetBlockEnd"),left:A.spaceT("left"),insetInlineStart:A.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:A.spaceT("right"),insetInlineEnd:A.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Ka,{insetStart:Ka.insetInlineStart,insetEnd:Ka.insetInlineEnd});var GO={ring:{transform:we.ring},ringColor:A.colors("--chakra-ring-color"),ringOffset:A.prop("--chakra-ring-offset-width"),ringOffsetColor:A.colors("--chakra-ring-offset-color"),ringInset:A.prop("--chakra-ring-inset")},Le={margin:A.spaceT("margin"),marginTop:A.spaceT("marginTop"),marginBlockStart:A.spaceT("marginBlockStart"),marginRight:A.spaceT("marginRight"),marginInlineEnd:A.spaceT("marginInlineEnd"),marginBottom:A.spaceT("marginBottom"),marginBlockEnd:A.spaceT("marginBlockEnd"),marginLeft:A.spaceT("marginLeft"),marginInlineStart:A.spaceT("marginInlineStart"),marginX:A.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:A.spaceT("marginInline"),marginY:A.spaceT(["marginTop","marginBottom"]),marginBlock:A.spaceT("marginBlock"),padding:A.space("padding"),paddingTop:A.space("paddingTop"),paddingBlockStart:A.space("paddingBlockStart"),paddingRight:A.space("paddingRight"),paddingBottom:A.space("paddingBottom"),paddingBlockEnd:A.space("paddingBlockEnd"),paddingLeft:A.space("paddingLeft"),paddingInlineStart:A.space("paddingInlineStart"),paddingInlineEnd:A.space("paddingInlineEnd"),paddingX:A.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:A.space("paddingInline"),paddingY:A.space(["paddingTop","paddingBottom"]),paddingBlock:A.space("paddingBlock")};Object.assign(Le,{m:Le.margin,mt:Le.marginTop,mr:Le.marginRight,me:Le.marginInlineEnd,marginEnd:Le.marginInlineEnd,mb:Le.marginBottom,ml:Le.marginLeft,ms:Le.marginInlineStart,marginStart:Le.marginInlineStart,mx:Le.marginX,my:Le.marginY,p:Le.padding,pt:Le.paddingTop,py:Le.paddingY,px:Le.paddingX,pb:Le.paddingBottom,pl:Le.paddingLeft,ps:Le.paddingInlineStart,paddingStart:Le.paddingInlineStart,pr:Le.paddingRight,pe:Le.paddingInlineEnd,paddingEnd:Le.paddingInlineEnd});var qO={textDecorationColor:A.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:A.shadows("textShadow")},KO={clipPath:!0,transform:A.propT("transform",we.transform),transformOrigin:!0,translateX:A.spaceT("--chakra-translate-x"),translateY:A.spaceT("--chakra-translate-y"),skewX:A.degreeT("--chakra-skew-x"),skewY:A.degreeT("--chakra-skew-y"),scaleX:A.prop("--chakra-scale-x"),scaleY:A.prop("--chakra-scale-y"),scale:A.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:A.degreeT("--chakra-rotate")},ZO={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:A.prop("transitionDuration","transition.duration"),transitionProperty:A.prop("transitionProperty","transition.property"),transitionTimingFunction:A.prop("transitionTimingFunction","transition.easing")},YO={fontFamily:A.prop("fontFamily","fonts"),fontSize:A.prop("fontSize","fontSizes",we.px),fontWeight:A.prop("fontWeight","fontWeights"),lineHeight:A.prop("lineHeight","lineHeights"),letterSpacing:A.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},QO={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:A.spaceT("scrollMargin"),scrollMarginTop:A.spaceT("scrollMarginTop"),scrollMarginBottom:A.spaceT("scrollMarginBottom"),scrollMarginLeft:A.spaceT("scrollMarginLeft"),scrollMarginRight:A.spaceT("scrollMarginRight"),scrollMarginX:A.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:A.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:A.spaceT("scrollPadding"),scrollPaddingTop:A.spaceT("scrollPaddingTop"),scrollPaddingBottom:A.spaceT("scrollPaddingBottom"),scrollPaddingLeft:A.spaceT("scrollPaddingLeft"),scrollPaddingRight:A.spaceT("scrollPaddingRight"),scrollPaddingX:A.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:A.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function qC(e){return Wn(e)&&e.reference?e.reference:String(e)}var Lf=(e,...t)=>t.map(qC).join(` ${e} `).replace(/calc/g,""),G1=(...e)=>`calc(${Lf("+",...e)})`,q1=(...e)=>`calc(${Lf("-",...e)})`,Dm=(...e)=>`calc(${Lf("*",...e)})`,K1=(...e)=>`calc(${Lf("/",...e)})`,Z1=e=>{const t=qC(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Dm(t,-1)},No=Object.assign(e=>({add:(...t)=>No(G1(e,...t)),subtract:(...t)=>No(q1(e,...t)),multiply:(...t)=>No(Dm(e,...t)),divide:(...t)=>No(K1(e,...t)),negate:()=>No(Z1(e)),toString:()=>e.toString()}),{add:G1,subtract:q1,multiply:Dm,divide:K1,negate:Z1});function XO(e,t="-"){return e.replace(/\s+/g,t)}function JO(e){const t=XO(e.toString());return tj(ej(t))}function ej(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function tj(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function nj(e,t=""){return[t,e].filter(Boolean).join("-")}function rj(e,t){return`var(${e}${t?`, ${t}`:""})`}function oj(e,t=""){return JO(`--${nj(e,t)}`)}function oe(e,t,n){const r=oj(e,n);return{variable:r,reference:rj(r,t)}}function ij(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=oe(`${e}-${o}`,i);continue}n[r]=oe(`${e}-${r}`)}return n}function sj(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function aj(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function Um(e){if(e==null)return e;const{unitless:t}=aj(e);return t||typeof e=="number"?`${e}px`:e}var KC=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Hv=e=>Object.fromEntries(Object.entries(e).sort(KC));function Y1(e){const t=Hv(e);return Object.assign(Object.values(t),t)}function lj(e){const t=Object.keys(Hv(e));return new Set(t)}function Q1(e){var t;if(!e)return e;e=(t=Um(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function Oa(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${Um(e)})`),t&&n.push("and",`(max-width: ${Um(t)})`),n.join(" ")}function cj(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=Y1(e),r=Object.entries(e).sort(KC).map(([s,a],l,c)=>{var u;let[,d]=(u=c[l+1])!=null?u:[];return d=parseFloat(d)>0?Q1(d):void 0,{_minW:Q1(a),breakpoint:s,minW:a,maxW:d,maxWQuery:Oa(null,d),minWQuery:Oa(a),minMaxQuery:Oa(a,d)}}),o=lj(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive(s){const a=Object.keys(s);return a.length>0&&a.every(l=>o.has(l))},asObject:Hv(e),asArray:Y1(e),details:r,get(s){return r.find(a=>a.breakpoint===s)},media:[null,...n.map(s=>Oa(s)).slice(1)],toArrayValue(s){if(!Wn(s))throw new Error("toArrayValue: value must be an object");const a=i.map(l=>{var c;return(c=s[l])!=null?c:null});for(;sj(a)===null;)a.pop();return a},toObjectValue(s){if(!Array.isArray(s))throw new Error("toObjectValue: value must be an array");return s.reduce((a,l,c)=>{const u=i[c];return u!=null&&l!=null&&(a[u]=l),a},{})}}}var ht={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Hr=e=>ZC(t=>e(t,"&"),"[role=group]","[data-group]",".group"),vr=e=>ZC(t=>e(t,"~ &"),"[data-peer]",".peer"),ZC=(e,...t)=>t.map(e).join(", "),Mf={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:Hr(ht.hover),_peerHover:vr(ht.hover),_groupFocus:Hr(ht.focus),_peerFocus:vr(ht.focus),_groupFocusVisible:Hr(ht.focusVisible),_peerFocusVisible:vr(ht.focusVisible),_groupActive:Hr(ht.active),_peerActive:vr(ht.active),_groupDisabled:Hr(ht.disabled),_peerDisabled:vr(ht.disabled),_groupInvalid:Hr(ht.invalid),_peerInvalid:vr(ht.invalid),_groupChecked:Hr(ht.checked),_peerChecked:vr(ht.checked),_groupFocusWithin:Hr(ht.focusWithin),_peerFocusWithin:vr(ht.focusWithin),_peerPlaceholderShown:vr(ht.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},YC=Object.keys(Mf);function X1(e,t){return oe(String(e).replace(/\./g,"-"),void 0,t)}function uj(e,t){let n={};const r={};for(const[o,i]of Object.entries(e)){const{isSemantic:s,value:a}=i,{variable:l,reference:c}=X1(o,t==null?void 0:t.cssVarPrefix);if(!s){if(o.startsWith("space")){const f=o.split("."),[p,...g]=f,m=`${p}.-${g.join(".")}`,x=No.negate(a),b=No.negate(c);r[m]={value:x,var:l,varRef:b}}n[l]=a,r[o]={value:a,var:l,varRef:c};continue}const u=f=>{const g=[String(o).split(".")[0],f].join(".");if(!e[g])return f;const{reference:x}=X1(g,t==null?void 0:t.cssVarPrefix);return x},d=Wn(a)?a:{default:a};n=sr(n,Object.entries(d).reduce((f,[p,g])=>{var m,x;if(!g)return f;const b=u(`${g}`);if(p==="default")return f[l]=b,f;const v=(x=(m=Mf)==null?void 0:m[p])!=null?x:p;return f[v]={[l]:b},f},{})),r[o]={value:c,var:l,varRef:c}}return{cssVars:n,cssMap:r}}function dj(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function fj(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function hj(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function J1(e,t,n={}){const{stop:r,getKey:o}=n;function i(s,a=[]){var l;if(hj(s)||Array.isArray(s)){const c={};for(const[u,d]of Object.entries(s)){const f=(l=o==null?void 0:o(u))!=null?l:u,p=[...a,f];if(r!=null&&r(s,p))return t(s,a);c[f]=i(d,p)}return c}return t(s,a)}return i(e)}var pj=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function mj(e){return fj(e,pj)}function gj(e){return e.semanticTokens}function vj(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}var yj=e=>YC.includes(e)||e==="default";function bj({tokens:e,semanticTokens:t}){const n={};return J1(e,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!1,value:r})}),J1(t,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(yj)}),n}function wj(e){var t;const n=vj(e),r=mj(n),o=gj(n),i=bj({tokens:r,semanticTokens:o}),s=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:a,cssVars:l}=uj(i,{cssVarPrefix:s});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:a,__breakpoints:cj(n.breakpoints)}),n}var Gv=sr({},bu,xe,MO,ld,xn,BO,GO,zO,GC,HO,Ka,Nm,Le,QO,YO,qO,KO,FO,ZO);Object.assign({},Le,xn,ld,GC,Ka);var xj=[...Object.keys(Gv),...YC],Sj={...Gv,...Mf},kj=e=>e in Sj,Cj=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const s in e){let a=Nn(e[s],t);if(a==null)continue;if(a=Wn(a)&&n(a)?r(a):a,!Array.isArray(a)){i[s]=a;continue}const l=a.slice(0,o.length).length;for(let c=0;ce.startsWith("--")&&typeof t=="string"&&!Tj(t),_j=(e,t)=>{var n,r;if(t==null)return t;const o=l=>{var c,u;return(u=(c=e.__cssMap)==null?void 0:c[l])==null?void 0:u.varRef},i=l=>{var c;return(c=o(l))!=null?c:l},[s,a]=Ej(t);return t=(r=(n=o(s))!=null?n:i(a))!=null?r:i(t),t};function Rj(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,s=!1)=>{var a,l,c;const u=Nn(i,r),d=Cj(u)(r);let f={};for(let p in d){const g=d[p];let m=Nn(g,r);p in n&&(p=n[p]),Pj(p,m)&&(m=_j(r,m));let x=t[p];if(x===!0&&(x={property:p}),Wn(m)){f[p]=(a=f[p])!=null?a:{},f[p]=sr({},f[p],o(m,!0));continue}let b=(c=(l=x==null?void 0:x.transform)==null?void 0:l.call(x,m,r,u))!=null?c:m;b=x!=null&&x.processResult?o(b,!0):b;const v=Nn(x==null?void 0:x.property,r);if(!s&&(x!=null&&x.static)){const w=Nn(x.static,r);f=sr({},f,w)}if(v&&Array.isArray(v)){for(const w of v)f[w]=b;continue}if(v){v==="&"&&Wn(b)?f=sr({},f,b):f[v]=b;continue}if(Wn(b)){f=sr({},f,b);continue}f[p]=b}return f};return o}var QC=e=>t=>Rj({theme:t,pseudos:Mf,configs:Gv})(e);function je(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Aj(e,t){if(Array.isArray(e))return e;if(Wn(e))return t(e);if(e!=null)return[e]}function $j(e,t){for(let n=t+1;n{sr(c,{[w]:f?v[w]:{[b]:v[w]}})});continue}if(!p){f?sr(c,v):c[b]=v;continue}c[b]=v}}return c}}function jj(e){return t=>{var n;const{variant:r,size:o,theme:i}=t,s=Oj(i);return sr({},Nn((n=e.baseStyle)!=null?n:{},t),s(e,"sizes",o,t),s(e,"variants",r,t))}}function Ij(e,t,n){var r,o,i;return(i=(o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)!=null?i:n}function ft(e){return dj(e,["styleConfig","size","variant","colorScheme"])}var Lj={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Mj={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},Bj={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},zj={property:Lj,easing:Mj,duration:Bj},Fj=zj,Nj={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Dj=Nj,Uj={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Vj=Uj,Wj={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Hj=Wj,Gj={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},qj=Gj,Kj={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Zj=Kj,Yj={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Qj=Yj,Xj={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Jj=Xj,e3={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},XC=e3,JC={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},t3={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},n3={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},r3={...JC,...t3,container:n3},e2=r3,o3={breakpoints:Hj,zIndices:Dj,radii:Zj,blur:Jj,colors:qj,...XC,sizes:e2,shadows:Qj,space:JC,borders:Vj,transition:Fj},{defineMultiStyleConfig:i3,definePartsStyle:ja}=je(["stepper","step","title","description","indicator","separator","icon","number"]),wr=oe("stepper-indicator-size"),os=oe("stepper-icon-size"),is=oe("stepper-title-font-size"),Ia=oe("stepper-description-font-size"),xa=oe("stepper-accent-color"),s3=ja(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[xa.variable]:`colors.${e}.500`,_dark:{[xa.variable]:`colors.${e}.200`}},title:{fontSize:is.reference,fontWeight:"medium"},description:{fontSize:Ia.reference,color:"chakra-subtle-text"},number:{fontSize:is.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:os.reference,height:os.reference},indicator:{flexShrink:0,borderRadius:"full",width:wr.reference,height:wr.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:xa.reference},"&[data-status=complete]":{bg:xa.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:xa.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${wr.reference} - 8px)`,top:`calc(${wr.reference} + 4px)`,insetStart:`calc(${wr.reference} / 2 - 1px)`}}})),a3=i3({baseStyle:s3,sizes:{xs:ja({stepper:{[wr.variable]:"sizes.4",[os.variable]:"sizes.3",[is.variable]:"fontSizes.xs",[Ia.variable]:"fontSizes.xs"}}),sm:ja({stepper:{[wr.variable]:"sizes.6",[os.variable]:"sizes.4",[is.variable]:"fontSizes.sm",[Ia.variable]:"fontSizes.xs"}}),md:ja({stepper:{[wr.variable]:"sizes.8",[os.variable]:"sizes.5",[is.variable]:"fontSizes.md",[Ia.variable]:"fontSizes.sm"}}),lg:ja({stepper:{[wr.variable]:"sizes.10",[os.variable]:"sizes.6",[is.variable]:"fontSizes.lg",[Ia.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function Pe(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...u){r();for(const d of u)t[d]=l(d);return Pe(e,t)}function i(...u){for(const d of u)d in t||(t[d]=l(d));return Pe(e,t)}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(u){const p=`chakra-${(["container","root"].includes(u??"")?[e]:[e,u]).filter(Boolean).join("__")}`;return{className:p,selector:`.${p}`,toString:()=>u}}return{parts:o,toPart:l,extend:i,selectors:s,classnames:a,get keys(){return Object.keys(t)},__type:{}}}var l3=Pe("accordion").parts("root","container","button","panel").extend("icon"),c3=Pe("alert").parts("title","description","container").extend("icon","spinner"),u3=Pe("avatar").parts("label","badge","container").extend("excessLabel","group"),d3=Pe("breadcrumb").parts("link","item","container").extend("separator");Pe("button").parts();var f3=Pe("checkbox").parts("control","icon","container").extend("label");Pe("progress").parts("track","filledTrack").extend("label");var h3=Pe("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),p3=Pe("editable").parts("preview","input","textarea"),m3=Pe("form").parts("container","requiredIndicator","helperText"),g3=Pe("formError").parts("text","icon"),v3=Pe("input").parts("addon","field","element","group"),y3=Pe("list").parts("container","item","icon"),b3=Pe("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),w3=Pe("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),x3=Pe("numberinput").parts("root","field","stepperGroup","stepper");Pe("pininput").parts("field");var S3=Pe("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),k3=Pe("progress").parts("label","filledTrack","track"),C3=Pe("radio").parts("container","control","label"),E3=Pe("select").parts("field","icon"),T3=Pe("slider").parts("container","track","thumb","filledTrack","mark"),P3=Pe("stat").parts("container","label","helpText","number","icon"),_3=Pe("switch").parts("container","track","thumb"),R3=Pe("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),A3=Pe("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),$3=Pe("tag").parts("container","label","closeButton"),O3=Pe("card").parts("container","header","body","footer");function qo(e,t,n){return Math.min(Math.max(e,n),t)}class j3 extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var La=j3;function qv(e){if(typeof e!="string")throw new La(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=D3.test(e)?M3(e):e;const n=B3.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(Rl(a,2),16)),parseInt(Rl(s[3]||"f",2),16)/255]}const r=z3.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=F3.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=N3.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(qo(0,100,a)!==a)throw new La(e);if(qo(0,100,l)!==l)throw new La(e);return[...U3(s,a,l),Number.isNaN(c)?1:c]}throw new La(e)}function I3(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const eb=e=>parseInt(e.replace(/_/g,""),36),L3="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=eb(t.substring(0,3)),r=eb(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function M3(e){const t=e.toLowerCase().trim(),n=L3[I3(t)];if(!n)throw new La(e);return`#${n}`}const Rl=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),B3=new RegExp(`^#${Rl("([a-f0-9])",3)}([a-f0-9])?$`,"i"),z3=new RegExp(`^#${Rl("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),F3=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Rl(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),N3=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,D3=/^[a-z]+$/i,tb=e=>Math.round(e*255),U3=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(tb);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(tb)};function V3(e,t,n,r){return`rgba(${qo(0,255,e).toFixed()}, ${qo(0,255,t).toFixed()}, ${qo(0,255,n).toFixed()}, ${parseFloat(qo(0,1,r).toFixed(3))})`}function W3(e,t){const[n,r,o,i]=qv(e);return V3(n,r,o,i-t)}function H3(e){const[t,n,r,o]=qv(e);let i=s=>{const a=qo(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}function G3(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,Bt=(e,t,n)=>{const r=G3(e,`colors.${t}`,t);try{return H3(r),r}catch{return n??"#000000"}},K3=e=>{const[t,n,r]=qv(e);return(t*299+n*587+r*114)/1e3},Z3=e=>t=>{const n=Bt(t,e);return K3(n)<128?"dark":"light"},Y3=e=>t=>Z3(e)(t)==="dark",Ns=(e,t)=>n=>{const r=Bt(n,e);return W3(r,1-t)};function nb(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( - 45deg, - ${t} 25%, - transparent 25%, - transparent 50%, - ${t} 50%, - ${t} 75%, - transparent 75%, - transparent - )`,backgroundSize:`${e} ${e}`}}var Q3=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function X3(e){const t=Q3();return!e||q3(e)?t:e.string&&e.colors?e4(e.string,e.colors):e.string&&!e.colors?J3(e.string):e.colors&&!e.string?t4(e.colors):t}function J3(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${o.toString(16)}`.substr(-2)}return n}function e4(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Kv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function t2(e){return Wn(e)&&e.reference?e.reference:String(e)}var Bf=(e,...t)=>t.map(t2).join(` ${e} `).replace(/calc/g,""),rb=(...e)=>`calc(${Bf("+",...e)})`,ob=(...e)=>`calc(${Bf("-",...e)})`,Vm=(...e)=>`calc(${Bf("*",...e)})`,ib=(...e)=>`calc(${Bf("/",...e)})`,sb=e=>{const t=t2(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:Vm(t,-1)},xr=Object.assign(e=>({add:(...t)=>xr(rb(e,...t)),subtract:(...t)=>xr(ob(e,...t)),multiply:(...t)=>xr(Vm(e,...t)),divide:(...t)=>xr(ib(e,...t)),negate:()=>xr(sb(e)),toString:()=>e.toString()}),{add:rb,subtract:ob,multiply:Vm,divide:ib,negate:sb});function n4(e){return!Number.isInteger(parseFloat(e.toString()))}function r4(e,t="-"){return e.replace(/\s+/g,t)}function n2(e){const t=r4(e.toString());return t.includes("\\.")?e:n4(e)?t.replace(".","\\."):e}function o4(e,t=""){return[t,n2(e)].filter(Boolean).join("-")}function i4(e,t){return`var(${n2(e)}${t?`, ${t}`:""})`}function s4(e,t=""){return`--${o4(e,t)}`}function st(e,t){const n=s4(e,t==null?void 0:t.prefix);return{variable:n,reference:i4(n,a4(t==null?void 0:t.fallback))}}function a4(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:l4,definePartsStyle:wu}=je(_3.keys),Za=st("switch-track-width"),Jo=st("switch-track-height"),Vh=st("switch-track-diff"),c4=xr.subtract(Za,Jo),Wm=st("switch-thumb-x"),Sa=st("switch-bg"),u4=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Za.reference],height:[Jo.reference],transitionProperty:"common",transitionDuration:"fast",[Sa.variable]:"colors.gray.300",_dark:{[Sa.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Sa.variable]:`colors.${t}.500`,_dark:{[Sa.variable]:`colors.${t}.200`}},bg:Sa.reference}},d4={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Jo.reference],height:[Jo.reference],_checked:{transform:`translateX(${Wm.reference})`}},f4=wu(e=>({container:{[Vh.variable]:c4,[Wm.variable]:Vh.reference,_rtl:{[Wm.variable]:xr(Vh).negate().toString()}},track:u4(e),thumb:d4})),h4={sm:wu({container:{[Za.variable]:"1.375rem",[Jo.variable]:"sizes.3"}}),md:wu({container:{[Za.variable]:"1.875rem",[Jo.variable]:"sizes.4"}}),lg:wu({container:{[Za.variable]:"2.875rem",[Jo.variable]:"sizes.6"}})},p4=l4({baseStyle:f4,sizes:h4,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:m4,definePartsStyle:ks}=je(R3.keys),g4=ks({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),cd={"&[data-is-numeric=true]":{textAlign:"end"}},v4=ks(e=>{const{colorScheme:t}=e;return{th:{color:re("gray.600","gray.400")(e),borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},td:{borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},caption:{color:re("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),y4=ks(e=>{const{colorScheme:t}=e;return{th:{color:re("gray.600","gray.400")(e),borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},td:{borderBottom:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e),...cd},caption:{color:re("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:re(`${t}.100`,`${t}.700`)(e)},td:{background:re(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),b4={simple:v4,striped:y4,unstyled:{}},w4={sm:ks({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:ks({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:ks({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},x4=m4({baseStyle:g4,variants:b4,sizes:w4,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Vt=oe("tabs-color"),zn=oe("tabs-bg"),Dc=oe("tabs-border-color"),{defineMultiStyleConfig:S4,definePartsStyle:ur}=je(A3.keys),k4=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},C4=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},E4=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},T4={p:4},P4=ur(e=>({root:k4(e),tab:C4(e),tablist:E4(e),tabpanel:T4})),_4={sm:ur({tab:{py:1,px:4,fontSize:"sm"}}),md:ur({tab:{fontSize:"md",py:2,px:4}}),lg:ur({tab:{fontSize:"lg",py:3,px:4}})},R4=ur(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",o=r?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{[Vt.variable]:`colors.${t}.600`,_dark:{[Vt.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[zn.variable]:"colors.gray.200",_dark:{[zn.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Vt.reference,bg:zn.reference}}}),A4=ur(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Dc.variable]:"transparent",_selected:{[Vt.variable]:`colors.${t}.600`,[Dc.variable]:"colors.white",_dark:{[Vt.variable]:`colors.${t}.300`,[Dc.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Dc.reference},color:Vt.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),$4=ur(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[zn.variable]:"colors.gray.50",_dark:{[zn.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[zn.variable]:"colors.white",[Vt.variable]:`colors.${t}.600`,_dark:{[zn.variable]:"colors.gray.800",[Vt.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Vt.reference,bg:zn.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),O4=ur(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Bt(n,`${t}.700`),bg:Bt(n,`${t}.100`)}}}}),j4=ur(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Vt.variable]:"colors.gray.600",_dark:{[Vt.variable]:"inherit"},_selected:{[Vt.variable]:"colors.white",[zn.variable]:`colors.${t}.600`,_dark:{[Vt.variable]:"colors.gray.800",[zn.variable]:`colors.${t}.300`}},color:Vt.reference,bg:zn.reference}}}),I4=ur({}),L4={line:R4,enclosed:A4,"enclosed-colored":$4,"soft-rounded":O4,"solid-rounded":j4,unstyled:I4},M4=S4({baseStyle:P4,sizes:_4,variants:L4,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Qe=ij("badge",["bg","color","shadow"]),B4={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Qe.bg.reference,color:Qe.color.reference,boxShadow:Qe.shadow.reference},z4=e=>{const{colorScheme:t,theme:n}=e,r=Ns(`${t}.500`,.6)(n);return{[Qe.bg.variable]:`colors.${t}.500`,[Qe.color.variable]:"colors.white",_dark:{[Qe.bg.variable]:r,[Qe.color.variable]:"colors.whiteAlpha.800"}}},F4=e=>{const{colorScheme:t,theme:n}=e,r=Ns(`${t}.200`,.16)(n);return{[Qe.bg.variable]:`colors.${t}.100`,[Qe.color.variable]:`colors.${t}.800`,_dark:{[Qe.bg.variable]:r,[Qe.color.variable]:`colors.${t}.200`}}},N4=e=>{const{colorScheme:t,theme:n}=e,r=Ns(`${t}.200`,.8)(n);return{[Qe.color.variable]:`colors.${t}.500`,_dark:{[Qe.color.variable]:r},[Qe.shadow.variable]:`inset 0 0 0px 1px ${Qe.color.reference}`}},D4={solid:z4,subtle:F4,outline:N4},Ya={baseStyle:B4,variants:D4,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:U4,definePartsStyle:ei}=je($3.keys),ab=oe("tag-bg"),lb=oe("tag-color"),Wh=oe("tag-shadow"),xu=oe("tag-min-height"),Su=oe("tag-min-width"),ku=oe("tag-font-size"),Cu=oe("tag-padding-inline"),V4={fontWeight:"medium",lineHeight:1.2,outline:0,[lb.variable]:Qe.color.reference,[ab.variable]:Qe.bg.reference,[Wh.variable]:Qe.shadow.reference,color:lb.reference,bg:ab.reference,boxShadow:Wh.reference,borderRadius:"md",minH:xu.reference,minW:Su.reference,fontSize:ku.reference,px:Cu.reference,_focusVisible:{[Wh.variable]:"shadows.outline"}},W4={lineHeight:1.2,overflow:"visible"},H4={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},G4=ei({container:V4,label:W4,closeButton:H4}),q4={sm:ei({container:{[xu.variable]:"sizes.5",[Su.variable]:"sizes.5",[ku.variable]:"fontSizes.xs",[Cu.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:ei({container:{[xu.variable]:"sizes.6",[Su.variable]:"sizes.6",[ku.variable]:"fontSizes.sm",[Cu.variable]:"space.2"}}),lg:ei({container:{[xu.variable]:"sizes.8",[Su.variable]:"sizes.8",[ku.variable]:"fontSizes.md",[Cu.variable]:"space.3"}})},K4={subtle:ei(e=>{var t;return{container:(t=Ya.variants)==null?void 0:t.subtle(e)}}),solid:ei(e=>{var t;return{container:(t=Ya.variants)==null?void 0:t.solid(e)}}),outline:ei(e=>{var t;return{container:(t=Ya.variants)==null?void 0:t.outline(e)}})},Z4=U4({variants:K4,baseStyle:G4,sizes:q4,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Er,defineMultiStyleConfig:Y4}=je(v3.keys),ss=oe("input-height"),as=oe("input-font-size"),ls=oe("input-padding"),cs=oe("input-border-radius"),Q4=Er({addon:{height:ss.reference,fontSize:as.reference,px:ls.reference,borderRadius:cs.reference},field:{width:"100%",height:ss.reference,fontSize:as.reference,px:ls.reference,borderRadius:cs.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Gr={lg:{[as.variable]:"fontSizes.lg",[ls.variable]:"space.4",[cs.variable]:"radii.md",[ss.variable]:"sizes.12"},md:{[as.variable]:"fontSizes.md",[ls.variable]:"space.4",[cs.variable]:"radii.md",[ss.variable]:"sizes.10"},sm:{[as.variable]:"fontSizes.sm",[ls.variable]:"space.3",[cs.variable]:"radii.sm",[ss.variable]:"sizes.8"},xs:{[as.variable]:"fontSizes.xs",[ls.variable]:"space.2",[cs.variable]:"radii.sm",[ss.variable]:"sizes.6"}},X4={lg:Er({field:Gr.lg,group:Gr.lg}),md:Er({field:Gr.md,group:Gr.md}),sm:Er({field:Gr.sm,group:Gr.sm}),xs:Er({field:Gr.xs,group:Gr.xs})};function Zv(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||re("blue.500","blue.300")(e),errorBorderColor:n||re("red.500","red.300")(e)}}var J4=Er(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Zv(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:re("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Bt(t,r),boxShadow:`0 0 0 1px ${Bt(t,r)}`},_focusVisible:{zIndex:1,borderColor:Bt(t,n),boxShadow:`0 0 0 1px ${Bt(t,n)}`}},addon:{border:"1px solid",borderColor:re("inherit","whiteAlpha.50")(e),bg:re("gray.100","whiteAlpha.300")(e)}}}),eI=Er(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Zv(e);return{field:{border:"2px solid",borderColor:"transparent",bg:re("gray.100","whiteAlpha.50")(e),_hover:{bg:re("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Bt(t,r)},_focusVisible:{bg:"transparent",borderColor:Bt(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:re("gray.100","whiteAlpha.50")(e)}}}),tI=Er(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Zv(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Bt(t,r),boxShadow:`0px 1px 0px 0px ${Bt(t,r)}`},_focusVisible:{borderColor:Bt(t,n),boxShadow:`0px 1px 0px 0px ${Bt(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),nI=Er({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),rI={outline:J4,filled:eI,flushed:tI,unstyled:nI},Ee=Y4({baseStyle:Q4,sizes:X4,variants:rI,defaultProps:{size:"md",variant:"outline"}}),cb,oI={...(cb=Ee.baseStyle)==null?void 0:cb.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},ub,db,iI={outline:e=>{var t,n;return(n=(t=Ee.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=Ee.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=Ee.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(db=(ub=Ee.variants)==null?void 0:ub.unstyled.field)!=null?db:{}},fb,hb,pb,mb,gb,vb,yb,bb,sI={xs:(hb=(fb=Ee.sizes)==null?void 0:fb.xs.field)!=null?hb:{},sm:(mb=(pb=Ee.sizes)==null?void 0:pb.sm.field)!=null?mb:{},md:(vb=(gb=Ee.sizes)==null?void 0:gb.md.field)!=null?vb:{},lg:(bb=(yb=Ee.sizes)==null?void 0:yb.lg.field)!=null?bb:{}},aI={baseStyle:oI,sizes:sI,variants:iI,defaultProps:{size:"md",variant:"outline"}},Uc=st("tooltip-bg"),Hh=st("tooltip-fg"),lI=st("popper-arrow-bg"),cI={bg:Uc.reference,color:Hh.reference,[Uc.variable]:"colors.gray.700",[Hh.variable]:"colors.whiteAlpha.900",_dark:{[Uc.variable]:"colors.gray.300",[Hh.variable]:"colors.gray.900"},[lI.variable]:Uc.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},uI={baseStyle:cI},{defineMultiStyleConfig:dI,definePartsStyle:Ma}=je(k3.keys),fI=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=re(nb(),nb("1rem","rgba(0,0,0,0.1)"))(e),s=re(`${t}.500`,`${t}.200`)(e),a=`linear-gradient( - to right, - transparent 0%, - ${Bt(n,s)} 50%, - transparent 100% - )`;return{...!r&&o&&i,...r?{bgImage:a}:{bgColor:s}}},hI={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},pI=e=>({bg:re("gray.100","whiteAlpha.300")(e)}),mI=e=>({transitionProperty:"common",transitionDuration:"slow",...fI(e)}),gI=Ma(e=>({label:hI,filledTrack:mI(e),track:pI(e)})),vI={xs:Ma({track:{h:"1"}}),sm:Ma({track:{h:"2"}}),md:Ma({track:{h:"3"}}),lg:Ma({track:{h:"4"}})},yI=dI({sizes:vI,baseStyle:gI,defaultProps:{size:"md",colorScheme:"blue"}}),bI=e=>typeof e=="function";function Ft(e,...t){return bI(e)?e(...t):e}var{definePartsStyle:Eu,defineMultiStyleConfig:wI}=je(f3.keys),Qa=oe("checkbox-size"),xI=e=>{const{colorScheme:t}=e;return{w:Qa.reference,h:Qa.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:re(`${t}.500`,`${t}.200`)(e),borderColor:re(`${t}.500`,`${t}.200`)(e),color:re("white","gray.900")(e),_hover:{bg:re(`${t}.600`,`${t}.300`)(e),borderColor:re(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:re("gray.200","transparent")(e),bg:re("gray.200","whiteAlpha.300")(e),color:re("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:re(`${t}.500`,`${t}.200`)(e),borderColor:re(`${t}.500`,`${t}.200`)(e),color:re("white","gray.900")(e)},_disabled:{bg:re("gray.100","whiteAlpha.100")(e),borderColor:re("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:re("red.500","red.300")(e)}}},SI={_disabled:{cursor:"not-allowed"}},kI={userSelect:"none",_disabled:{opacity:.4}},CI={transitionProperty:"transform",transitionDuration:"normal"},EI=Eu(e=>({icon:CI,container:SI,control:Ft(xI,e),label:kI})),TI={sm:Eu({control:{[Qa.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:Eu({control:{[Qa.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:Eu({control:{[Qa.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},ud=wI({baseStyle:EI,sizes:TI,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:PI,definePartsStyle:Tu}=je(C3.keys),_I=e=>{var t;const n=(t=Ft(ud.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},RI=Tu(e=>{var t,n,r,o;return{label:(n=(t=ud).baseStyle)==null?void 0:n.call(t,e).label,container:(o=(r=ud).baseStyle)==null?void 0:o.call(r,e).container,control:_I(e)}}),AI={md:Tu({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Tu({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Tu({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},$I=PI({baseStyle:RI,sizes:AI,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:OI,definePartsStyle:jI}=je(E3.keys),Vc=oe("select-bg"),wb,II={...(wb=Ee.baseStyle)==null?void 0:wb.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Vc.reference,[Vc.variable]:"colors.white",_dark:{[Vc.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Vc.reference}},LI={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},MI=jI({field:II,icon:LI}),Wc={paddingInlineEnd:"8"},xb,Sb,kb,Cb,Eb,Tb,Pb,_b,BI={lg:{...(xb=Ee.sizes)==null?void 0:xb.lg,field:{...(Sb=Ee.sizes)==null?void 0:Sb.lg.field,...Wc}},md:{...(kb=Ee.sizes)==null?void 0:kb.md,field:{...(Cb=Ee.sizes)==null?void 0:Cb.md.field,...Wc}},sm:{...(Eb=Ee.sizes)==null?void 0:Eb.sm,field:{...(Tb=Ee.sizes)==null?void 0:Tb.sm.field,...Wc}},xs:{...(Pb=Ee.sizes)==null?void 0:Pb.xs,field:{...(_b=Ee.sizes)==null?void 0:_b.xs.field,...Wc},icon:{insetEnd:"1"}}},zI=OI({baseStyle:MI,sizes:BI,variants:Ee.variants,defaultProps:Ee.defaultProps}),Gh=oe("skeleton-start-color"),qh=oe("skeleton-end-color"),FI={[Gh.variable]:"colors.gray.100",[qh.variable]:"colors.gray.400",_dark:{[Gh.variable]:"colors.gray.800",[qh.variable]:"colors.gray.600"},background:Gh.reference,borderColor:qh.reference,opacity:.7,borderRadius:"sm"},NI={baseStyle:FI},Kh=oe("skip-link-bg"),DI={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Kh.variable]:"colors.white",_dark:{[Kh.variable]:"colors.gray.700"},bg:Kh.reference}},UI={baseStyle:DI},{defineMultiStyleConfig:VI,definePartsStyle:zf}=je(T3.keys),Al=oe("slider-thumb-size"),$l=oe("slider-track-size"),no=oe("slider-bg"),WI=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Kv({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},HI=e=>({...Kv({orientation:e.orientation,horizontal:{h:$l.reference},vertical:{w:$l.reference}}),overflow:"hidden",borderRadius:"sm",[no.variable]:"colors.gray.200",_dark:{[no.variable]:"colors.whiteAlpha.200"},_disabled:{[no.variable]:"colors.gray.300",_dark:{[no.variable]:"colors.whiteAlpha.300"}},bg:no.reference}),GI=e=>{const{orientation:t}=e;return{...Kv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Al.reference,h:Al.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},qI=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[no.variable]:`colors.${t}.500`,_dark:{[no.variable]:`colors.${t}.200`},bg:no.reference}},KI=zf(e=>({container:WI(e),track:HI(e),thumb:GI(e),filledTrack:qI(e)})),ZI=zf({container:{[Al.variable]:"sizes.4",[$l.variable]:"sizes.1"}}),YI=zf({container:{[Al.variable]:"sizes.3.5",[$l.variable]:"sizes.1"}}),QI=zf({container:{[Al.variable]:"sizes.2.5",[$l.variable]:"sizes.0.5"}}),XI={lg:ZI,md:YI,sm:QI},JI=VI({baseStyle:KI,sizes:XI,defaultProps:{size:"md",colorScheme:"blue"}}),Do=st("spinner-size"),eL={width:[Do.reference],height:[Do.reference]},tL={xs:{[Do.variable]:"sizes.3"},sm:{[Do.variable]:"sizes.4"},md:{[Do.variable]:"sizes.6"},lg:{[Do.variable]:"sizes.8"},xl:{[Do.variable]:"sizes.12"}},nL={baseStyle:eL,sizes:tL,defaultProps:{size:"md"}},{defineMultiStyleConfig:rL,definePartsStyle:r2}=je(P3.keys),oL={fontWeight:"medium"},iL={opacity:.8,marginBottom:"2"},sL={verticalAlign:"baseline",fontWeight:"semibold"},aL={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},lL=r2({container:{},label:oL,helpText:iL,number:sL,icon:aL}),cL={md:r2({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},uL=rL({baseStyle:lL,sizes:cL,defaultProps:{size:"md"}}),Zh=oe("kbd-bg"),dL={[Zh.variable]:"colors.gray.100",_dark:{[Zh.variable]:"colors.whiteAlpha.100"},bg:Zh.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},fL={baseStyle:dL},hL={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},pL={baseStyle:hL},{defineMultiStyleConfig:mL,definePartsStyle:gL}=je(y3.keys),vL={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},yL=gL({icon:vL}),bL=mL({baseStyle:yL}),{defineMultiStyleConfig:wL,definePartsStyle:xL}=je(b3.keys),Jn=oe("menu-bg"),Yh=oe("menu-shadow"),SL={[Jn.variable]:"#fff",[Yh.variable]:"shadows.sm",_dark:{[Jn.variable]:"colors.gray.700",[Yh.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Jn.reference,boxShadow:Yh.reference},kL={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Jn.variable]:"colors.gray.100",_dark:{[Jn.variable]:"colors.whiteAlpha.100"}},_active:{[Jn.variable]:"colors.gray.200",_dark:{[Jn.variable]:"colors.whiteAlpha.200"}},_expanded:{[Jn.variable]:"colors.gray.100",_dark:{[Jn.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Jn.reference},CL={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},EL={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},TL={opacity:.6},PL={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},_L={transitionProperty:"common",transitionDuration:"normal"},RL=xL({button:_L,list:SL,item:kL,groupTitle:CL,icon:EL,command:TL,divider:PL}),AL=wL({baseStyle:RL}),{defineMultiStyleConfig:$L,definePartsStyle:Hm}=je(w3.keys),Qh=oe("modal-bg"),Xh=oe("modal-shadow"),OL={bg:"blackAlpha.600",zIndex:"modal"},jL=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},IL=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[Qh.variable]:"colors.white",[Xh.variable]:"shadows.lg",_dark:{[Qh.variable]:"colors.gray.700",[Xh.variable]:"shadows.dark-lg"},bg:Qh.reference,boxShadow:Xh.reference}},LL={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},ML={position:"absolute",top:"2",insetEnd:"3"},BL=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},zL={px:"6",py:"4"},FL=Hm(e=>({overlay:OL,dialogContainer:Ft(jL,e),dialog:Ft(IL,e),header:LL,closeButton:ML,body:Ft(BL,e),footer:zL}));function jn(e){return Hm(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var NL={xs:jn("xs"),sm:jn("sm"),md:jn("md"),lg:jn("lg"),xl:jn("xl"),"2xl":jn("2xl"),"3xl":jn("3xl"),"4xl":jn("4xl"),"5xl":jn("5xl"),"6xl":jn("6xl"),full:jn("full")},DL=$L({baseStyle:FL,sizes:NL,defaultProps:{size:"md"}}),{defineMultiStyleConfig:UL,definePartsStyle:o2}=je(x3.keys),Yv=st("number-input-stepper-width"),i2=st("number-input-input-padding"),VL=xr(Yv).add("0.5rem").toString(),Jh=st("number-input-bg"),ep=st("number-input-color"),tp=st("number-input-border-color"),WL={[Yv.variable]:"sizes.6",[i2.variable]:VL},HL=e=>{var t,n;return(n=(t=Ft(Ee.baseStyle,e))==null?void 0:t.field)!=null?n:{}},GL={width:Yv.reference},qL={borderStart:"1px solid",borderStartColor:tp.reference,color:ep.reference,bg:Jh.reference,[ep.variable]:"colors.chakra-body-text",[tp.variable]:"colors.chakra-border-color",_dark:{[ep.variable]:"colors.whiteAlpha.800",[tp.variable]:"colors.whiteAlpha.300"},_active:{[Jh.variable]:"colors.gray.200",_dark:{[Jh.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},KL=o2(e=>{var t;return{root:WL,field:(t=Ft(HL,e))!=null?t:{},stepperGroup:GL,stepper:qL}});function Hc(e){var t,n,r;const o=(t=Ee.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},s=(r=(n=o.field)==null?void 0:n.fontSize)!=null?r:"md",a=XC.fontSizes[s];return o2({field:{...o.field,paddingInlineEnd:i2.reference,verticalAlign:"top"},stepper:{fontSize:xr(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var ZL={xs:Hc("xs"),sm:Hc("sm"),md:Hc("md"),lg:Hc("lg")},YL=UL({baseStyle:KL,sizes:ZL,variants:Ee.variants,defaultProps:Ee.defaultProps}),Rb,QL={...(Rb=Ee.baseStyle)==null?void 0:Rb.field,textAlign:"center"},XL={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},Ab,$b,JL={outline:e=>{var t,n,r;return(r=(n=Ft((t=Ee.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=Ft((t=Ee.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=Ft((t=Ee.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:($b=(Ab=Ee.variants)==null?void 0:Ab.unstyled.field)!=null?$b:{}},eM={baseStyle:QL,sizes:XL,variants:JL,defaultProps:Ee.defaultProps},{defineMultiStyleConfig:tM,definePartsStyle:nM}=je(S3.keys),Gc=st("popper-bg"),rM=st("popper-arrow-bg"),Ob=st("popper-arrow-shadow-color"),oM={zIndex:10},iM={[Gc.variable]:"colors.white",bg:Gc.reference,[rM.variable]:Gc.reference,[Ob.variable]:"colors.gray.200",_dark:{[Gc.variable]:"colors.gray.700",[Ob.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},sM={px:3,py:2,borderBottomWidth:"1px"},aM={px:3,py:2},lM={px:3,py:2,borderTopWidth:"1px"},cM={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},uM=nM({popper:oM,content:iM,header:sM,body:aM,footer:lM,closeButton:cM}),dM=tM({baseStyle:uM}),{definePartsStyle:Gm,defineMultiStyleConfig:fM}=je(h3.keys),np=oe("drawer-bg"),rp=oe("drawer-box-shadow");function Mi(e){return Gm(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var hM={bg:"blackAlpha.600",zIndex:"overlay"},pM={display:"flex",zIndex:"modal",justifyContent:"center"},mM=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[np.variable]:"colors.white",[rp.variable]:"shadows.lg",_dark:{[np.variable]:"colors.gray.700",[rp.variable]:"shadows.dark-lg"},bg:np.reference,boxShadow:rp.reference}},gM={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},vM={position:"absolute",top:"2",insetEnd:"3"},yM={px:"6",py:"2",flex:"1",overflow:"auto"},bM={px:"6",py:"4"},wM=Gm(e=>({overlay:hM,dialogContainer:pM,dialog:Ft(mM,e),header:gM,closeButton:vM,body:yM,footer:bM})),xM={xs:Mi("xs"),sm:Mi("md"),md:Mi("lg"),lg:Mi("2xl"),xl:Mi("4xl"),full:Mi("full")},SM=fM({baseStyle:wM,sizes:xM,defaultProps:{size:"xs"}}),{definePartsStyle:kM,defineMultiStyleConfig:CM}=je(p3.keys),EM={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},TM={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},PM={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},_M=kM({preview:EM,input:TM,textarea:PM}),RM=CM({baseStyle:_M}),{definePartsStyle:AM,defineMultiStyleConfig:$M}=je(m3.keys),Cs=oe("form-control-color"),OM={marginStart:"1",[Cs.variable]:"colors.red.500",_dark:{[Cs.variable]:"colors.red.300"},color:Cs.reference},jM={mt:"2",[Cs.variable]:"colors.gray.600",_dark:{[Cs.variable]:"colors.whiteAlpha.600"},color:Cs.reference,lineHeight:"normal",fontSize:"sm"},IM=AM({container:{width:"100%",position:"relative"},requiredIndicator:OM,helperText:jM}),LM=$M({baseStyle:IM}),{definePartsStyle:MM,defineMultiStyleConfig:BM}=je(g3.keys),Es=oe("form-error-color"),zM={[Es.variable]:"colors.red.500",_dark:{[Es.variable]:"colors.red.300"},color:Es.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},FM={marginEnd:"0.5em",[Es.variable]:"colors.red.500",_dark:{[Es.variable]:"colors.red.300"},color:Es.reference},NM=MM({text:zM,icon:FM}),DM=BM({baseStyle:NM}),UM={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},VM={baseStyle:UM},WM={fontFamily:"heading",fontWeight:"bold"},HM={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},GM={baseStyle:WM,sizes:HM,defaultProps:{size:"xl"}},{defineMultiStyleConfig:qM,definePartsStyle:KM}=je(d3.keys),op=oe("breadcrumb-link-decor"),ZM={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:op.reference,[op.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[op.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},YM=KM({link:ZM}),QM=qM({baseStyle:YM}),XM={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},s2=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:re("gray.800","whiteAlpha.900")(e),_hover:{bg:re("gray.100","whiteAlpha.200")(e)},_active:{bg:re("gray.200","whiteAlpha.300")(e)}};const r=Ns(`${t}.200`,.12)(n),o=Ns(`${t}.200`,.24)(n);return{color:re(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:re(`${t}.50`,r)(e)},_active:{bg:re(`${t}.100`,o)(e)}}},JM=e=>{const{colorScheme:t}=e,n=re("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...Ft(s2,e)}},eB={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},tB=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=re("gray.100","whiteAlpha.200")(e);return{bg:l,color:re("gray.800","whiteAlpha.900")(e),_hover:{bg:re("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:re("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:o="white",hoverBg:i=`${n}.600`,activeBg:s=`${n}.700`}=(t=eB[n])!=null?t:{},a=re(r,`${n}.200`)(e);return{bg:a,color:re(o,"gray.800")(e),_hover:{bg:re(i,`${n}.300`)(e),_disabled:{bg:a}},_active:{bg:re(s,`${n}.400`)(e)}}},nB=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:re(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:re(`${t}.700`,`${t}.500`)(e)}}},rB={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},oB={ghost:s2,outline:JM,solid:tB,link:nB,unstyled:rB},iB={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},sB={baseStyle:XM,variants:oB,sizes:iB,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:ti,defineMultiStyleConfig:aB}=je(O3.keys),dd=oe("card-bg"),Rr=oe("card-padding"),a2=oe("card-shadow"),Pu=oe("card-radius"),l2=oe("card-border-width","0"),c2=oe("card-border-color"),lB=ti({container:{[dd.variable]:"colors.chakra-body-bg",backgroundColor:dd.reference,boxShadow:a2.reference,borderRadius:Pu.reference,color:"chakra-body-text",borderWidth:l2.reference,borderColor:c2.reference},body:{padding:Rr.reference,flex:"1 1 0%"},header:{padding:Rr.reference},footer:{padding:Rr.reference}}),cB={sm:ti({container:{[Pu.variable]:"radii.base",[Rr.variable]:"space.3"}}),md:ti({container:{[Pu.variable]:"radii.md",[Rr.variable]:"space.5"}}),lg:ti({container:{[Pu.variable]:"radii.xl",[Rr.variable]:"space.7"}})},uB={elevated:ti({container:{[a2.variable]:"shadows.base",_dark:{[dd.variable]:"colors.gray.700"}}}),outline:ti({container:{[l2.variable]:"1px",[c2.variable]:"colors.chakra-border-color"}}),filled:ti({container:{[dd.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Rr.variable]:0},header:{[Rr.variable]:0},footer:{[Rr.variable]:0}}},dB=aB({baseStyle:lB,variants:uB,sizes:cB,defaultProps:{variant:"elevated",size:"md"}}),Xa=st("close-button-size"),ka=st("close-button-bg"),fB={w:[Xa.reference],h:[Xa.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[ka.variable]:"colors.blackAlpha.100",_dark:{[ka.variable]:"colors.whiteAlpha.100"}},_active:{[ka.variable]:"colors.blackAlpha.200",_dark:{[ka.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:ka.reference},hB={lg:{[Xa.variable]:"sizes.10",fontSize:"md"},md:{[Xa.variable]:"sizes.8",fontSize:"xs"},sm:{[Xa.variable]:"sizes.6",fontSize:"2xs"}},pB={baseStyle:fB,sizes:hB,defaultProps:{size:"md"}},{variants:mB,defaultProps:gB}=Ya,vB={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Qe.bg.reference,color:Qe.color.reference,boxShadow:Qe.shadow.reference},yB={baseStyle:vB,variants:mB,defaultProps:gB},bB={w:"100%",mx:"auto",maxW:"prose",px:"4"},wB={baseStyle:bB},xB={opacity:.6,borderColor:"inherit"},SB={borderStyle:"solid"},kB={borderStyle:"dashed"},CB={solid:SB,dashed:kB},EB={baseStyle:xB,variants:CB,defaultProps:{variant:"solid"}},{definePartsStyle:TB,defineMultiStyleConfig:PB}=je(l3.keys),_B={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},RB={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},AB={pt:"2",px:"4",pb:"5"},$B={fontSize:"1.25em"},OB=TB({container:_B,button:RB,panel:AB,icon:$B}),jB=PB({baseStyle:OB}),{definePartsStyle:Xl,defineMultiStyleConfig:IB}=je(c3.keys),ln=oe("alert-fg"),Mr=oe("alert-bg"),LB=Xl({container:{bg:Mr.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:ln.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:ln.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function Qv(e){const{theme:t,colorScheme:n}=e,r=Ns(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var MB=Xl(e=>{const{colorScheme:t}=e,n=Qv(e);return{container:{[ln.variable]:`colors.${t}.500`,[Mr.variable]:n.light,_dark:{[ln.variable]:`colors.${t}.200`,[Mr.variable]:n.dark}}}}),BB=Xl(e=>{const{colorScheme:t}=e,n=Qv(e);return{container:{[ln.variable]:`colors.${t}.500`,[Mr.variable]:n.light,_dark:{[ln.variable]:`colors.${t}.200`,[Mr.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:ln.reference}}}),zB=Xl(e=>{const{colorScheme:t}=e,n=Qv(e);return{container:{[ln.variable]:`colors.${t}.500`,[Mr.variable]:n.light,_dark:{[ln.variable]:`colors.${t}.200`,[Mr.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:ln.reference}}}),FB=Xl(e=>{const{colorScheme:t}=e;return{container:{[ln.variable]:"colors.white",[Mr.variable]:`colors.${t}.500`,_dark:{[ln.variable]:"colors.gray.900",[Mr.variable]:`colors.${t}.200`},color:ln.reference}}}),NB={subtle:MB,"left-accent":BB,"top-accent":zB,solid:FB},DB=IB({baseStyle:LB,variants:NB,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:u2,defineMultiStyleConfig:UB}=je(u3.keys),Ts=oe("avatar-border-color"),Ja=oe("avatar-bg"),Ol=oe("avatar-font-size"),Ds=oe("avatar-size"),VB={borderRadius:"full",border:"0.2em solid",borderColor:Ts.reference,[Ts.variable]:"white",_dark:{[Ts.variable]:"colors.gray.800"}},WB={bg:Ja.reference,fontSize:Ol.reference,width:Ds.reference,height:Ds.reference,lineHeight:"1",[Ja.variable]:"colors.gray.200",_dark:{[Ja.variable]:"colors.whiteAlpha.400"}},HB=e=>{const{name:t,theme:n}=e,r=t?X3({string:t}):"colors.gray.400",o=Y3(r)(n);let i="white";return o||(i="gray.800"),{bg:Ja.reference,fontSize:Ol.reference,color:i,borderColor:Ts.reference,verticalAlign:"top",width:Ds.reference,height:Ds.reference,"&:not([data-loaded])":{[Ja.variable]:r},[Ts.variable]:"colors.white",_dark:{[Ts.variable]:"colors.gray.800"}}},GB={fontSize:Ol.reference,lineHeight:"1"},qB=u2(e=>({badge:Ft(VB,e),excessLabel:Ft(WB,e),container:Ft(HB,e),label:GB}));function qr(e){const t=e!=="100%"?e2[e]:void 0;return u2({container:{[Ds.variable]:t??e,[Ol.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[Ds.variable]:t??e,[Ol.variable]:`calc(${t??e} / 2.5)`}})}var KB={"2xs":qr(4),xs:qr(6),sm:qr(8),md:qr(12),lg:qr(16),xl:qr(24),"2xl":qr(32),full:qr("100%")},ZB=UB({baseStyle:qB,sizes:KB,defaultProps:{size:"md"}}),YB={Accordion:jB,Alert:DB,Avatar:ZB,Badge:Ya,Breadcrumb:QM,Button:sB,Checkbox:ud,CloseButton:pB,Code:yB,Container:wB,Divider:EB,Drawer:SM,Editable:RM,Form:LM,FormError:DM,FormLabel:VM,Heading:GM,Input:Ee,Kbd:fL,Link:pL,List:bL,Menu:AL,Modal:DL,NumberInput:YL,PinInput:eM,Popover:dM,Progress:yI,Radio:$I,Select:zI,Skeleton:NI,SkipLink:UI,Slider:JI,Spinner:nL,Stat:uL,Switch:p4,Table:x4,Tabs:M4,Tag:Z4,Textarea:aI,Tooltip:uI,Card:dB,Stepper:a3},QB={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},XB={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},JB="ltr",ez={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},tz={semanticTokens:QB,direction:JB,...o3,components:YB,styles:XB,config:ez};function nz(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var rz=nz();function oz(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function iz(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},d2=sz(iz);function f2(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];t(o,r,e)&&(n[r]=o)}),n}var h2=e=>f2(e,t=>t!=null);function az(e){return typeof e=="function"}function p2(e,...t){return az(e)?e(...t):e}function lz(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var cz=typeof Element<"u",uz=typeof Map=="function",dz=typeof Set=="function",fz=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function _u(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!_u(e[r],t[r]))return!1;return!0}var i;if(uz&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!_u(r.value[1],t.get(r.value[0])))return!1;return!0}if(dz&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(fz&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(cz&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!_u(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var hz=function(t,n){try{return _u(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const pz=Xe(hz);function m2(e,t={}){var n;const{styleConfig:r,...o}=t,{theme:i,colorMode:s}=WC(),a=e?d2(i,`components.${e}`):void 0,l=r||a,c=sr({theme:i,colorMode:s},(n=l==null?void 0:l.defaultProps)!=null?n:{},h2(oz(o,["children"]))),u=y.useRef({});if(l){const f=jj(l)(c);pz(u.current,f)||(u.current=f)}return u.current}function Gn(e,t={}){return m2(e,t)}function Nr(e,t={}){return m2(e,t)}var mz=new Set([...xj,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),gz=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function vz(e){return gz.has(e)||!mz.has(e)}function yz(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}function bz(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var wz=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,xz=CS(function(e){return wz.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Sz=xz,kz=function(t){return t!=="theme"},jb=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Sz:kz},Ib=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},Cz=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return AS(n,r,o),KA(function(){return $S(n,r,o)}),null},Ez=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,s;n!==void 0&&(i=n.label,s=n.target);var a=Ib(t,n,r),l=a||jb(o),c=!l("as");return function(){var u=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;pt=>{const{theme:n,css:r,__css:o,sx:i,...s}=t,a=f2(s,(d,f)=>kj(f)),l=p2(e,t),c=yz({},o,l,h2(a),i),u=QC(c)(t.theme);return r?[u,r]:u};function ip(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=vz);const o=_z({baseStyle:n}),i=Pz(e,r)(o);return si.forwardRef(function(l,c){const{colorMode:u,forced:d}=Vv();return si.createElement(i,{ref:c,"data-theme":d?u:void 0,...l})})}function Rz(){const e=new Map;return new Proxy(ip,{apply(t,n,r){return ip(...r)},get(t,n){return e.has(n)||e.set(n,ip(n)),e.get(n)}})}var Z=Rz();function ee(e){return y.forwardRef(e)}function g2(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=y.createContext(void 0);o.displayName=r;function i(){var s;const a=y.useContext(o);if(!a&&t){const l=new Error(n);throw l.name="ContextError",(s=Error.captureStackTrace)==null||s.call(Error,l,i),l}return a}return[o.Provider,i,o]}function Az(e){const{cssVarsRoot:t,theme:n,children:r}=e,o=y.useMemo(()=>wj(n),[n]);return h.jsxs(QA,{theme:o,children:[h.jsx($z,{root:t}),r]})}function $z({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return h.jsx(bf,{styles:n=>({[t]:n.__cssVars})})}g2({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function Oz(e){return g2({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function jz(){const{colorMode:e}=Vv();return h.jsx(bf,{styles:t=>{const n=d2(t,"styles.global"),r=p2(n,{theme:t,colorMode:e});return r?QC(r)(t):void 0}})}var v2=y.createContext({getDocument(){return document},getWindow(){return window}});v2.displayName="EnvironmentContext";function y2(e){const{children:t,environment:n,disabled:r}=e,o=y.useRef(null),i=y.useMemo(()=>n||{getDocument:()=>{var a,l;return(l=(a=o.current)==null?void 0:a.ownerDocument)!=null?l:document},getWindow:()=>{var a,l;return(l=(a=o.current)==null?void 0:a.ownerDocument.defaultView)!=null?l:window}},[n]),s=!r||!n;return h.jsxs(v2.Provider,{value:i,children:[t,s&&h.jsx("span",{id:"__chakra_env",hidden:!0,ref:o})]})}y2.displayName="EnvironmentProvider";var Iz=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:o,resetCSS:i=!0,theme:s={},environment:a,cssVarsRoot:l,disableEnvironment:c,disableGlobalStyle:u}=e,d=h.jsx(y2,{environment:a,disabled:c,children:t});return h.jsx(Az,{theme:s,cssVarsRoot:l,children:h.jsxs(VC,{colorModeManager:n,options:s.config,children:[i?h.jsx(t$,{scope:o}):h.jsx(e$,{}),!u&&h.jsx(jz,{}),r?h.jsx(zS,{zIndex:r,children:d}):d]})})},Lz=(e,t)=>e.find(n=>n.id===t);function Mb(e,t){const n=b2(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function b2(e,t){for(const[n,r]of Object.entries(e))if(Lz(r,t))return n}function Mz(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function Bz(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,o=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,i=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",s=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:o,right:i,left:s}}function ni(e,t=[]){const n=y.useRef(e);return y.useEffect(()=>{n.current=e}),y.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function zz(e,t){const n=ni(e);y.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function jl(e,t){const n=y.useRef(!1),r=y.useRef(!1);y.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),y.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const w2=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Ff=y.createContext({}),Jl=y.createContext(null),Nf=typeof document<"u",hd=Nf?y.useLayoutEffect:y.useEffect,x2=y.createContext({strict:!1});function Fz(e,t,n,r){const{visualElement:o}=y.useContext(Ff),i=y.useContext(x2),s=y.useContext(Jl),a=y.useContext(w2).reducedMotion,l=y.useRef();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;return y.useInsertionEffect(()=>{c&&c.update(n,s)}),hd(()=>{c&&c.render()}),y.useEffect(()=>{c&&c.updateFeatures()}),(window.HandoffAppearAnimations?hd:y.useEffect)(()=>{c&&c.animationState&&c.animationState.animateChanges()}),c}function us(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Nz(e,t,n){return y.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):us(n)&&(n.current=r))},[t])}function Il(e){return typeof e=="string"||Array.isArray(e)}function Df(e){return typeof e=="object"&&typeof e.start=="function"}const Xv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Jv=["initial",...Xv];function Uf(e){return Df(e.animate)||Jv.some(t=>Il(e[t]))}function S2(e){return!!(Uf(e)||e.variants)}function Dz(e,t){if(Uf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Il(n)?n:void 0,animate:Il(r)?r:void 0}}return e.inherit!==!1?t:{}}function Uz(e){const{initial:t,animate:n}=Dz(e,y.useContext(Ff));return y.useMemo(()=>({initial:t,animate:n}),[Bb(t),Bb(n)])}function Bb(e){return Array.isArray(e)?e.join(" "):e}const zb={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"]},Ll={};for(const e in zb)Ll[e]={isEnabled:t=>zb[e].some(n=>!!t[n])};function Vz(e){for(const t in e)Ll[t]={...Ll[t],...e[t]}}const ey=y.createContext({}),k2=y.createContext({}),Wz=Symbol.for("motionComponentSymbol");function Hz({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&Vz(e);function i(a,l){let c;const u={...y.useContext(w2),...a,layoutId:Gz(a)},{isStatic:d}=u,f=Uz(a),p=r(a,d);if(!d&&Nf){f.visualElement=Fz(o,p,u,t);const g=y.useContext(k2),m=y.useContext(x2).strict;f.visualElement&&(c=f.visualElement.loadFeatures(u,m,e,g))}return y.createElement(Ff.Provider,{value:f},c&&f.visualElement?y.createElement(c,{visualElement:f.visualElement,...u}):null,n(o,a,Nz(p,f.visualElement,l),p,d,f.visualElement))}const s=y.forwardRef(i);return s[Wz]=o,s}function Gz({layoutId:e}){const t=y.useContext(ey).id;return t&&e!==void 0?t+"-"+e:e}function qz(e){function t(r,o={}){return Hz(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const Kz=["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 ty(e){return typeof e!="string"||e.includes("-")?!1:!!(Kz.indexOf(e)>-1||/[A-Z]/.test(e))}const pd={};function Zz(e){Object.assign(pd,e)}const ec=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pi=new Set(ec);function C2(e,{layout:t,layoutId:n}){return Pi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!pd[e]||e==="opacity")}const Jt=e=>!!(e&&e.getVelocity),Yz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Qz=ec.length;function Xz(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let s=0;st=>typeof t=="string"&&t.startsWith(e),T2=E2("--"),qm=E2("var(--"),Jz=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,eF=(e,t)=>t&&typeof e=="number"?t.transform(e):e,So=(e,t,n)=>Math.min(Math.max(n,e),t),_i={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},el={..._i,transform:e=>So(0,1,e)},qc={..._i,default:1},tl=e=>Math.round(e*1e5)/1e5,Vf=/(-)?([\d]*\.?[\d])+/g,P2=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,tF=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function tc(e){return typeof e=="string"}const nc=e=>({test:t=>tc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Yr=nc("deg"),dr=nc("%"),ie=nc("px"),nF=nc("vh"),rF=nc("vw"),Fb={...dr,parse:e=>dr.parse(e)/100,transform:e=>dr.transform(e*100)},Nb={..._i,transform:Math.round},_2={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,radius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,size:ie,top:ie,right:ie,bottom:ie,left:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,rotate:Yr,rotateX:Yr,rotateY:Yr,rotateZ:Yr,scale:qc,scaleX:qc,scaleY:qc,scaleZ:qc,skew:Yr,skewX:Yr,skewY:Yr,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:el,originX:Fb,originY:Fb,originZ:ie,zIndex:Nb,fillOpacity:el,strokeOpacity:el,numOctaves:Nb};function ny(e,t,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const f=t[d];if(T2(d)){i[d]=f;continue}const p=_2[d],g=eF(f,p);if(Pi.has(d)){if(l=!0,s[d]=g,!u)continue;f!==(p.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=g):o[d]=g}if(t.transform||(l||r?o.transform=Xz(e.transform,n,u,r):o.transform&&(o.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:p=0}=a;o.transformOrigin=`${d} ${f} ${p}`}}const ry=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function R2(e,t,n){for(const r in t)!Jt(t[r])&&!C2(r,n)&&(e[r]=t[r])}function oF({transformTemplate:e},t,n){return y.useMemo(()=>{const r=ry();return ny(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function iF(e,t,n){const r=e.style||{},o={};return R2(o,r,e),Object.assign(o,oF(e,t,n)),e.transformValues?e.transformValues(o):o}function sF(e,t,n){const r={},o=iF(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const aF=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 md(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||aF.has(e)}let A2=e=>!md(e);function lF(e){e&&(A2=t=>t.startsWith("on")?!md(t):e(t))}try{lF(require("@emotion/is-prop-valid").default)}catch{}function cF(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(A2(o)||n===!0&&md(o)||!t&&!md(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function Db(e,t,n){return typeof e=="string"?e:ie.transform(t+n*e)}function uF(e,t,n){const r=Db(t,e.x,e.width),o=Db(n,e.y,e.height);return`${r} ${o}`}const dF={offset:"stroke-dashoffset",array:"stroke-dasharray"},fF={offset:"strokeDashoffset",array:"strokeDasharray"};function hF(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?dF:fF;e[i.offset]=ie.transform(-r);const s=ie.transform(t),a=ie.transform(n);e[i.array]=`${s} ${a}`}function oy(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d,f){if(ny(e,c,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:g,dimensions:m}=e;p.transform&&(m&&(g.transform=p.transform),delete p.transform),m&&(o!==void 0||i!==void 0||g.transform)&&(g.transformOrigin=uF(m,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&hF(p,s,a,l,!1)}const $2=()=>({...ry(),attrs:{}}),iy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pF(e,t,n,r){const o=y.useMemo(()=>{const i=$2();return oy(i,t,{enableHardwareAcceleration:!1},iy(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};R2(i,e.style,e),o.style={...i,...o.style}}return o}function mF(e=!1){return(n,r,o,{latestValues:i},s)=>{const l=(ty(n)?pF:sF)(r,i,s,n),u={...cF(r,typeof n=="string",e),...l,ref:o},{children:d}=r,f=y.useMemo(()=>Jt(d)?d.get():d,[d]);return y.createElement(n,{...u,children:f})}}const sy=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function O2(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const j2=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 I2(e,t,n,r){O2(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(j2.has(o)?o:sy(o),t.attrs[o])}function ay(e,t){const{style:n}=e,r={};for(const o in n)(Jt(n[o])||t.style&&Jt(t.style[o])||C2(o,e))&&(r[o]=n[o]);return r}function L2(e,t){const n=ay(e,t);for(const r in e)if(Jt(e[r])||Jt(t[r])){const o=ec.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function ly(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function M2(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const gd=e=>Array.isArray(e),gF=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),vF=e=>gd(e)?e[e.length-1]||0:e;function Ru(e){const t=Jt(e)?e.get():e;return gF(t)?t.toValue():t}function yF({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const s={latestValues:bF(r,o,i,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const B2=e=>(t,n)=>{const r=y.useContext(Ff),o=y.useContext(Jl),i=()=>yF(e,t,r,o);return n?i():M2(i)};function bF(e,t,n,r){const o={},i=r(e,{});for(const f in i)o[f]=Ru(i[f]);let{initial:s,animate:a}=e;const l=Uf(e),c=S2(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;return d&&typeof d!="boolean"&&!Df(d)&&(Array.isArray(d)?d:[d]).forEach(p=>{const g=ly(e,p);if(!g)return;const{transitionEnd:m,transition:x,...b}=g;for(const v in b){let w=b[v];if(Array.isArray(w)){const S=u?w.length-1:0;w=w[S]}w!==null&&(o[v]=w)}for(const v in m)o[v]=m[v]}),o}const wF={useVisualState:B2({scrapeMotionValuesFromProps:L2,createRenderState:$2,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}oy(n,r,{enableHardwareAcceleration:!1},iy(t.tagName),e.transformTemplate),I2(t,n)}})},xF={useVisualState:B2({scrapeMotionValuesFromProps:ay,createRenderState:ry})};function SF(e,{forwardMotionProps:t=!1},n,r){return{...ty(e)?wF:xF,preloadedFeatures:n,useRender:mF(t),createVisualElement:r,Component:e}}function Tr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const z2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Wf(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const kF=e=>t=>z2(t)&&e(t,Wf(t));function Ar(e,t,n,r){return Tr(e,t,kF(n),r)}const CF=(e,t)=>n=>t(e(n)),mo=(...e)=>e.reduce(CF);function F2(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Ub=F2("dragHorizontal"),Vb=F2("dragVertical");function N2(e){let t=!1;if(e==="y")t=Vb();else if(e==="x")t=Ub();else{const n=Ub(),r=Vb();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function D2(){const e=N2(!0);return e?(e(),!1):!0}class Po{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Ke=e=>e;function EF(e){let t=[],n=[],r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&o,f=d?t:n;return c&&s.add(l),f.indexOf(l)===-1&&(f.push(l),d&&o&&(r=t.length)),l},cancel:l=>{const c=n.indexOf(l);c!==-1&&n.splice(c,1),s.delete(l)},process:l=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let c=0;c(d[f]=EF(()=>n=!0),d),{}),s=d=>i[d].process(o),a=d=>{n=!1,o.delta=r?1e3/60:Math.max(Math.min(d-o.timestamp,TF),1),o.timestamp=d,o.isProcessing=!0,Kc.forEach(s),o.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,o.isProcessing||e(a)};return{schedule:Kc.reduce((d,f)=>{const p=i[f];return d[f]=(g,m=!1,x=!1)=>(n||l(),p.schedule(g,m,x)),d},{}),cancel:d=>Kc.forEach(f=>i[f].cancel(d)),state:o,steps:i}}const{schedule:Ue,cancel:Br,state:Tt,steps:sp}=PF(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ke,!0);function Wb(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(i,s)=>{if(i.type==="touch"||D2())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&Ue.update(()=>a[r](i,s))};return Ar(e.current,n,o,{passive:!e.getProps()[r]})}class _F extends Po{mount(){this.unmount=mo(Wb(this.node,!0),Wb(this.node,!1))}unmount(){}}class RF extends Po{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=mo(Tr(this.node.current,"focus",()=>this.onFocus()),Tr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const U2=(e,t)=>t?e===t?!0:U2(e,t.parentElement):!1;function ap(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Wf(n))}class AF extends Po{constructor(){super(...arguments),this.removeStartListeners=Ke,this.removeEndListeners=Ke,this.removeAccessibleListeners=Ke,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),i=Ar(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u}=this.node.getProps();Ue.update(()=>{U2(this.node.current,a.target)?c&&c(a,l):u&&u(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),s=Ar(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=mo(i,s),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const s=a=>{a.key!=="Enter"||!this.checkPressEnd()||ap("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&Ue.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Tr(this.node.current,"keyup",s),ap("down",(a,l)=>{this.startPress(a,l)})},n=Tr(this.node.current,"keydown",t),r=()=>{this.isPressing&&ap("cancel",(i,s)=>this.cancelPress(i,s))},o=Tr(this.node.current,"blur",r);this.removeAccessibleListeners=mo(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Ue.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!D2()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Ue.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ar(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Tr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=mo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Km=new WeakMap,lp=new WeakMap,$F=e=>{const t=Km.get(e.target);t&&t(e)},OF=e=>{e.forEach($F)};function jF({root:e,...t}){const n=e||document;lp.has(n)||lp.set(n,{});const r=lp.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(OF,{root:e,...t})),r[o]}function IF(e,t,n){const r=jF(t);return Km.set(e,n),r.observe(e),()=>{Km.delete(e),r.unobserve(e)}}const LF={some:0,all:1};class MF extends Po{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:LF[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return IF(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(BF(t,n))&&this.startObserver()}unmount(){}}function BF({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const zF={inView:{Feature:MF},tap:{Feature:AF},focus:{Feature:RF},hover:{Feature:_F}};function V2(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function NF(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Hf(e,t,n){const r=e.getProps();return ly(r,t,n!==void 0?n:r.custom,FF(e),NF(e))}const DF="framerAppearId",UF="data-"+sy(DF);let VF=Ke,cy=Ke;const go=e=>e*1e3,$r=e=>e/1e3,WF={current:!1},W2=e=>Array.isArray(e)&&typeof e[0]=="number";function H2(e){return!!(!e||typeof e=="string"&&G2[e]||W2(e)||Array.isArray(e)&&e.every(H2))}const Ba=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,G2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ba([0,.65,.55,1]),circOut:Ba([.55,0,1,.45]),backIn:Ba([.31,.01,.66,-.59]),backOut:Ba([.33,1.53,.69,.99])};function q2(e){if(e)return W2(e)?Ba(e):Array.isArray(e)?e.map(q2):G2[e]}function HF(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=q2(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"})}function GF(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const K2=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,qF=1e-7,KF=12;function ZF(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=K2(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>qF&&++aZF(i,0,1,e,n);return i=>i===0||i===1?i:K2(o(i),t,r)}const YF=rc(.42,0,1,1),QF=rc(0,0,.58,1),Z2=rc(.42,0,.58,1),XF=e=>Array.isArray(e)&&typeof e[0]!="number",Y2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Q2=e=>t=>1-e(1-t),X2=e=>1-Math.sin(Math.acos(e)),uy=Q2(X2),JF=Y2(uy),J2=rc(.33,1.53,.69,.99),dy=Q2(J2),e6=Y2(dy),t6=e=>(e*=2)<1?.5*dy(e):.5*(2-Math.pow(2,-10*(e-1))),n6={linear:Ke,easeIn:YF,easeInOut:Z2,easeOut:QF,circIn:X2,circInOut:JF,circOut:uy,backIn:dy,backInOut:e6,backOut:J2,anticipate:t6},Hb=e=>{if(Array.isArray(e)){cy(e.length===4);const[t,n,r,o]=e;return rc(t,n,r,o)}else if(typeof e=="string")return n6[e];return e},fy=(e,t)=>n=>!!(tc(n)&&tF.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),eE=(e,t,n)=>r=>{if(!tc(r))return r;const[o,i,s,a]=r.match(Vf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},r6=e=>So(0,255,e),cp={..._i,transform:e=>Math.round(r6(e))},Ko={test:fy("rgb","red"),parse:eE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+cp.transform(e)+", "+cp.transform(t)+", "+cp.transform(n)+", "+tl(el.transform(r))+")"};function o6(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Zm={test:fy("#"),parse:o6,transform:Ko.transform},ds={test:fy("hsl","hue"),parse:eE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dr.transform(tl(t))+", "+dr.transform(tl(n))+", "+tl(el.transform(r))+")"},It={test:e=>Ko.test(e)||Zm.test(e)||ds.test(e),parse:e=>Ko.test(e)?Ko.parse(e):ds.test(e)?ds.parse(e):Zm.parse(e),transform:e=>tc(e)?e:e.hasOwnProperty("red")?Ko.transform(e):ds.transform(e)},We=(e,t,n)=>-n*e+n*t+e;function up(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function i6({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=up(l,a,e+1/3),i=up(l,a,e),s=up(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}const dp=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},s6=[Zm,Ko,ds],a6=e=>s6.find(t=>t.test(e));function Gb(e){const t=a6(e);let n=t.parse(e);return t===ds&&(n=i6(n)),n}const tE=(e,t)=>{const n=Gb(e),r=Gb(t),o={...n};return i=>(o.red=dp(n.red,r.red,i),o.green=dp(n.green,r.green,i),o.blue=dp(n.blue,r.blue,i),o.alpha=We(n.alpha,r.alpha,i),Ko.transform(o))};function l6(e){var t,n;return isNaN(e)&&tc(e)&&(((t=e.match(Vf))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(P2))===null||n===void 0?void 0:n.length)||0)>0}const nE={regex:Jz,countKey:"Vars",token:"${v}",parse:Ke},rE={regex:P2,countKey:"Colors",token:"${c}",parse:It.parse},oE={regex:Vf,countKey:"Numbers",token:"${n}",parse:_i.parse};function fp(e,{regex:t,countKey:n,token:r,parse:o}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(o)))}function vd(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&fp(n,nE),fp(n,rE),fp(n,oE),n}function iE(e){return vd(e).values}function sE(e){const{values:t,numColors:n,numVars:r,tokenised:o}=vd(e),i=t.length;return s=>{let a=o;for(let l=0;ltypeof e=="number"?0:e;function u6(e){const t=iE(e);return sE(e)(t.map(c6))}const ko={test:l6,parse:iE,createTransformer:sE,getAnimatableNone:u6},aE=(e,t)=>n=>`${n>0?t:e}`;function lE(e,t){return typeof e=="number"?n=>We(e,t,n):It.test(e)?tE(e,t):e.startsWith("var(")?aE(e,t):uE(e,t)}const cE=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,s)=>lE(i,t[s]));return i=>{for(let s=0;s{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=lE(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}},uE=(e,t)=>{const n=ko.createTransformer(t),r=vd(e),o=vd(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?mo(cE(r.values,o.values),n):aE(e,t)},Ml=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},qb=(e,t)=>n=>We(e,t,n);function f6(e){return typeof e=="number"?qb:typeof e=="string"?It.test(e)?tE:uE:Array.isArray(e)?cE:typeof e=="object"?d6:qb}function h6(e,t,n){const r=[],o=n||f6(e[0]),i=e.length-1;for(let s=0;st[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=h6(t,r,o),a=s.length,l=c=>{let u=0;if(a>1)for(;ul(So(e[0],e[i-1],c)):l}function p6(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Ml(0,t,r);e.push(We(n,1,o))}}function m6(e){const t=[0];return p6(t,e.length-1),t}function g6(e,t){return e.map(n=>n*t)}function v6(e,t){return e.map(()=>t||Z2).splice(0,e.length-1)}function yd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=XF(r)?r.map(Hb):Hb(r),i={done:!1,value:t[0]},s=g6(n&&n.length===t.length?n:m6(t),e),a=dE(s,t,{ease:Array.isArray(o)?o:v6(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}function fE(e,t){return t?e*(1e3/t):0}const y6=5;function hE(e,t,n){const r=Math.max(t-y6,0);return fE(n-e(r),t-r)}const hp=.001,b6=.01,Kb=10,w6=.05,x6=1;function S6({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;VF(e<=go(Kb));let s=1-t;s=So(w6,x6,s),e=So(b6,Kb,$r(e)),s<1?(o=c=>{const u=c*s,d=u*e,f=u-n,p=Ym(c,s),g=Math.exp(-d);return hp-f/p*g},i=c=>{const d=c*s*e,f=d*n+n,p=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-d),m=Ym(Math.pow(c,2),s);return(-o(c)+hp>0?-1:1)*((f-p)*g)/m}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-hp+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=C6(o,i,a);if(e=go(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const k6=12;function C6(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function P6(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Zb(e,T6)&&Zb(e,E6)){const n=S6(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function pE({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,velocity:u,duration:d,isResolvedFromDuration:f}=P6(r),p=u?-$r(u):0,g=l/(2*Math.sqrt(a*c)),m=i-o,x=$r(Math.sqrt(a/c)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let v;if(g<1){const w=Ym(x,g);v=S=>{const k=Math.exp(-g*x*S);return i-k*((p+g*x*m)/w*Math.sin(w*S)+m*Math.cos(w*S))}}else if(g===1)v=w=>i-Math.exp(-x*w)*(m+(p+x*m)*w);else{const w=x*Math.sqrt(g*g-1);v=S=>{const k=Math.exp(-g*x*S),T=Math.min(w*S,300);return i-k*((p+g*x*m)*Math.sinh(T)+w*m*Math.cosh(T))/w}}return{calculatedDuration:f&&d||null,next:w=>{const S=v(w);if(f)s.done=w>=d;else{let k=p;w!==0&&(g<1?k=hE(v,w,S):k=0);const T=Math.abs(k)<=n,E=Math.abs(i-S)<=t;s.done=T&&E}return s.value=s.done?i:S,s}}}function Yb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=_=>a!==void 0&&_l,g=_=>a===void 0?l:l===void 0||Math.abs(a-_)-m*Math.exp(-_/r),w=_=>b+v(_),S=_=>{const z=v(_),L=w(_);f.done=Math.abs(z)<=c,f.value=f.done?b:L};let k,T;const E=_=>{p(f.value)&&(k=_,T=pE({keyframes:[f.value,g(f.value)],velocity:hE(w,_,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:_=>{let z=!1;return!T&&k===void 0&&(z=!0,S(_),E(_)),k!==void 0&&_>k?T.next(_-k):(!z&&S(_),f)}}}const _6=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>Br(t),now:()=>Tt.isProcessing?Tt.timestamp:performance.now()}},Qb=2e4;function Xb(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=Qb?1/0:t}const R6={decay:Yb,inertia:Yb,tween:yd,keyframes:yd,spring:pE};function bd({autoplay:e=!0,delay:t=0,driver:n=_6,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...f}){let p=1,g=!1,m,x;const b=()=>{x=new Promise(U=>{m=U})};b();let v;const w=R6[o]||yd;let S;w!==yd&&typeof r[0]!="number"&&(S=dE([0,100],r,{clamp:!1}),r=[0,100]);const k=w({...f,keyframes:r});let T;a==="mirror"&&(T=w({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let E="idle",_=null,z=null,L=null;k.calculatedDuration===null&&i&&(k.calculatedDuration=Xb(k));const{calculatedDuration:P}=k;let j=1/0,I=1/0;P!==null&&(j=P+s,I=j*(i+1)-s);let V=0;const $=U=>{if(z===null)return;p>0&&(z=Math.min(z,U)),p<0&&(z=Math.min(U-I/p,z)),_!==null?V=_:V=Math.round(U-z)*p;const q=V-t*(p>=0?1:-1),N=p>=0?q<0:q>I;V=Math.max(q,0),E==="finished"&&_===null&&(V=I);let G=V,J=k;if(i){const he=V/j;let Ae=Math.floor(he),ze=he%1;!ze&&he>=1&&(ze=1),ze===1&&Ae--,Ae=Math.min(Ae,i+1);const le=!!(Ae%2);le&&(a==="reverse"?(ze=1-ze,s&&(ze-=s/j)):a==="mirror"&&(J=T));let ve=So(0,1,ze);V>I&&(ve=a==="reverse"&&le?1:0),G=ve*j}const te=N?{done:!1,value:r[0]}:J.next(G);S&&(te.value=S(te.value));let{done:ne}=te;!N&&P!==null&&(ne=p>=0?V>=I:V<=0);const ue=_===null&&(E==="finished"||E==="running"&&ne);return d&&d(te.value),ue&&B(),te},O=()=>{v&&v.stop(),v=void 0},F=()=>{E="idle",O(),m(),b(),z=L=null},B=()=>{E="finished",u&&u(),O(),m()},D=()=>{if(g)return;v||(v=n($));const U=v.now();l&&l(),_!==null?z=U-_:(!z||E==="finished")&&(z=U),E==="finished"&&b(),L=z,_=null,E="running",v.start()};e&&D();const H={then(U,q){return x.then(U,q)},get time(){return $r(V)},set time(U){U=go(U),V=U,_!==null||!v||p===0?_=U:z=v.now()-U/p},get duration(){const U=k.calculatedDuration===null?Xb(k):k.calculatedDuration;return $r(U)},get speed(){return p},set speed(U){U===p||!v||(p=U,H.time=$r(V))},get state(){return E},play:D,pause:()=>{E="paused",_=V},stop:()=>{g=!0,E!=="idle"&&(E="idle",c&&c(),F())},cancel:()=>{L!==null&&$(L),F()},complete:()=>{E="finished"},sample:U=>(z=0,$(U))};return H}function A6(e){let t;return()=>(t===void 0&&(t=e()),t)}const $6=A6(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),O6=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Zc=10,j6=2e4,I6=(e,t)=>t.type==="spring"||e==="backgroundColor"||!H2(t.ease);function L6(e,t,{onUpdate:n,onComplete:r,...o}){if(!($6()&&O6.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let s=!1,a,l;const c=()=>{l=new Promise(v=>{a=v})};c();let{keyframes:u,duration:d=300,ease:f,times:p}=o;if(I6(t,o)){const v=bd({...o,repeat:0,delay:0});let w={done:!1,value:u[0]};const S=[];let k=0;for(;!w.done&&kg.cancel(),x=()=>{Ue.update(m),a(),c()};return g.onfinish=()=>{e.set(GF(u,o)),r&&r(),x()},{then(v,w){return l.then(v,w)},attachTimeline(v){return g.timeline=v,g.onfinish=null,Ke},get time(){return $r(g.currentTime||0)},set time(v){g.currentTime=go(v)},get speed(){return g.playbackRate},set speed(v){g.playbackRate=v},get duration(){return $r(d)},play:()=>{s||(g.play(),Br(m))},pause:()=>g.pause(),stop:()=>{if(s=!0,g.playState==="idle")return;const{currentTime:v}=g;if(v){const w=bd({...o,autoplay:!1});e.setWithVelocity(w.sample(v-Zc).value,w.sample(v).value,Zc)}x()},complete:()=>g.finish(),cancel:x}}function M6({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Ke,pause:Ke,stop:Ke,then:i=>(i(),Promise.resolve()),cancel:Ke,complete:Ke});return t?bd({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const B6={type:"spring",stiffness:500,damping:25,restSpeed:10},z6=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),F6={type:"keyframes",duration:.8},N6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},D6=(e,{keyframes:t})=>t.length>2?F6:Pi.has(e)?e.startsWith("scale")?z6(t[1]):B6:N6,Qm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ko.test(t)||t==="0")&&!t.startsWith("url(")),U6=new Set(["brightness","contrast","saturate","opacity"]);function V6(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Vf)||[];if(!r)return e;const o=n.replace(r,"");let i=U6.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const W6=/([a-z-]*)\(.*?\)/g,Xm={...ko,getAnimatableNone:e=>{const t=e.match(W6);return t?t.map(V6).join(" "):e}},H6={..._2,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:Xm,WebkitFilter:Xm},hy=e=>H6[e];function mE(e,t){let n=hy(e);return n!==Xm&&(n=ko),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const gE=e=>/^0[^.\s]+$/.test(e);function G6(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||gE(e)}function q6(e,t,n,r){const o=Qm(t,n);let i;Array.isArray(n)?i=[...n]:i=[null,n];const s=r.from!==void 0?r.from:e.get();let a;const l=[];for(let c=0;co=>{const i=vE(r,e)||{},s=i.delay||r.delay||0;let{elapsed:a=0}=r;a=a-go(s);const l=q6(t,e,n,i),c=l[0],u=l[l.length-1],d=Qm(e,c),f=Qm(e,u);let p={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-a,onUpdate:g=>{t.set(g),i.onUpdate&&i.onUpdate(g)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(K6(i)||(p={...p,...D6(e,p)}),p.duration&&(p.duration=go(p.duration)),p.repeatDelay&&(p.repeatDelay=go(p.repeatDelay)),!d||!f||WF.current||i.type===!1)return M6(p);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const g=L6(t,e,p);if(g)return g}return bd(p)};function wd(e){return!!(Jt(e)&&e.add)}const Z6=e=>/^\-?\d*\.?\d+$/.test(e);function my(e,t){e.indexOf(t)===-1&&e.push(t)}function gy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class vy{constructor(){this.subscriptions=[]}add(t){return my(this.subscriptions,t),()=>gy(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class Q6{constructor(t,n={}){this.version="10.15.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:i,timestamp:s}=Tt;this.lastUpdated!==s&&(this.timeDelta=i,this.lastUpdated=s,Ue.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()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Ue.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=Y6(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new vy);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?fE(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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 Us(e,t){return new Q6(e,t)}const yE=e=>t=>t.test(e),X6={test:e=>e==="auto",parse:e=>e},bE=[_i,ie,dr,Yr,rF,nF,X6],Ca=e=>bE.find(yE(e)),J6=[...bE,It,ko],eN=e=>J6.find(yE(e));function tN(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Us(n))}function nN(e,t){const n=Hf(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const s in i){const a=vF(i[s]);tN(e,s,a)}}function rN(e,t,n){var r,o;const i=Object.keys(t).filter(a=>!e.hasValue(a)),s=i.length;if(s)for(let a=0;al.remove(d))),c.push(m)}return s&&Promise.all(c).then(()=>{s&&nN(e,s)}),c}function Jm(e,t,n={}){const r=Hf(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(wE(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=o;return aN(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function aN(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(lN).forEach((c,u)=>{c.notify("AnimationStart",t),s.push(Jm(c,t,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(s)}function lN(e,t){return e.sortNodePosition(t)}function cN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Jm(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Jm(e,t,n);else{const o=typeof t=="function"?Hf(e,t,n.custom):t;r=Promise.all(wE(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const uN=[...Xv].reverse(),dN=Xv.length;function fN(e){return t=>Promise.all(t.map(({animation:n,options:r})=>cN(e,n,r)))}function hN(e){let t=fN(e);const n=mN();let r=!0;const o=(l,c)=>{const u=Hf(e,c);if(u){const{transition:d,transitionEnd:f,...p}=u;l={...l,...p,...f}}return l};function i(l){t=l(e)}function s(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},f=[],p=new Set;let g={},m=1/0;for(let b=0;bm&&k;const L=Array.isArray(S)?S:[S];let P=L.reduce(o,{});T===!1&&(P={});const{prevResolvedValues:j={}}=w,I={...j,...P},V=$=>{z=!0,p.delete($),w.needsAnimating[$]=!0};for(const $ in I){const O=P[$],F=j[$];g.hasOwnProperty($)||(O!==F?gd(O)&&gd(F)?!V2(O,F)||_?V($):w.protectedKeys[$]=!0:O!==void 0?V($):p.add($):O!==void 0&&p.has($)?V($):w.protectedKeys[$]=!0)}w.prevProp=S,w.prevResolvedValues=P,w.isActive&&(g={...g,...P}),r&&e.blockInitialAnimation&&(z=!1),z&&!E&&f.push(...L.map($=>({animation:$,options:{type:v,...l}})))}if(p.size){const b={};p.forEach(v=>{const w=e.getBaseTarget(v);w!==void 0&&(b[v]=w)}),f.push({animation:b})}let x=!!f.length;return r&&u.initial===!1&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(f):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(l,c)}),n[l].isActive=c;const f=s(u,l);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n}}function pN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!V2(t,e):!1}function Io(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mN(){return{animate:Io(!0),whileInView:Io(),whileHover:Io(),whileTap:Io(),whileDrag:Io(),whileFocus:Io(),exit:Io()}}class gN extends Po{constructor(t){super(t),t.animationState||(t.animationState=hN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Df(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let vN=0;class yN extends Po{constructor(){super(...arguments),this.id=vN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const i=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const bN={animation:{Feature:gN},exit:{Feature:yN}},Jb=(e,t)=>Math.abs(e-t);function wN(e,t){const n=Jb(e.x,t.x),r=Jb(e.y,t.y);return Math.sqrt(n**2+r**2)}class xE{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=mp(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,d=wN(c.offset,{x:0,y:0})>=3;if(!u&&!d)return;const{point:f}=c,{timestamp:p}=Tt;this.history.push({...f,timestamp:p});const{onStart:g,onMove:m}=this.handlers;u||(g&&g(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,u)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=pp(u,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(c,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,p=mp(c.type==="pointercancel"?this.lastMoveEventInfo:pp(u,this.transformPagePoint),this.history);this.startEvent&&d&&d(c,p),f&&f(c,p)},!z2(t))return;this.handlers=n,this.transformPagePoint=r;const o=Wf(t),i=pp(o,this.transformPagePoint),{point:s}=i,{timestamp:a}=Tt;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=n;l&&l(t,mp(i,this.history)),this.removeListeners=mo(Ar(window,"pointermove",this.handlePointerMove),Ar(window,"pointerup",this.handlePointerUp),Ar(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Br(this.updatePoint)}}function pp(e,t){return t?{point:t(e.point)}:e}function ew(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mp({point:e},t){return{point:e,delta:ew(e,SE(t)),offset:ew(e,xN(t)),velocity:SN(t,.1)}}function xN(e){return e[0]}function SE(e){return e[e.length-1]}function SN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=SE(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>go(t)));)n--;if(!r)return{x:0,y:0};const i=$r(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function un(e){return e.max-e.min}function eg(e,t=0,n=.01){return Math.abs(e-t)<=n}function tw(e,t,n,r=.5){e.origin=r,e.originPoint=We(t.min,t.max,e.origin),e.scale=un(n)/un(t),(eg(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=We(n.min,n.max,e.origin)-e.originPoint,(eg(e.translate)||isNaN(e.translate))&&(e.translate=0)}function nl(e,t,n,r){tw(e.x,t.x,n.x,r?r.originX:void 0),tw(e.y,t.y,n.y,r?r.originY:void 0)}function nw(e,t,n){e.min=n.min+t.min,e.max=e.min+un(t)}function kN(e,t,n){nw(e.x,t.x,n.x),nw(e.y,t.y,n.y)}function rw(e,t,n){e.min=t.min-n.min,e.max=e.min+un(t)}function rl(e,t,n){rw(e.x,t.x,n.x),rw(e.y,t.y,n.y)}function CN(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?We(n,e,r.max):Math.min(e,n)),e}function ow(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function EN(e,{top:t,left:n,bottom:r,right:o}){return{x:ow(e.x,n,o),y:ow(e.y,t,r)}}function iw(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Ml(t.min,t.max-r,e.min):r>o&&(n=Ml(e.min,e.max-o,t.min)),So(0,1,n)}function _N(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const tg=.35;function RN(e=tg){return e===!1?e=0:e===!0&&(e=tg),{x:sw(e,"left","right"),y:sw(e,"top","bottom")}}function sw(e,t,n){return{min:aw(e,t),max:aw(e,n)}}function aw(e,t){return typeof e=="number"?e:e[t]||0}const lw=()=>({translate:0,scale:1,origin:0,originPoint:0}),fs=()=>({x:lw(),y:lw()}),cw=()=>({min:0,max:0}),Je=()=>({x:cw(),y:cw()});function Xn(e){return[e("x"),e("y")]}function kE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function AN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $N(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function gp(e){return e===void 0||e===1}function ng({scale:e,scaleX:t,scaleY:n}){return!gp(e)||!gp(t)||!gp(n)}function Bo(e){return ng(e)||CE(e)||e.z||e.rotate||e.rotateX||e.rotateY}function CE(e){return uw(e.x)||uw(e.y)}function uw(e){return e&&e!=="0%"}function xd(e,t,n){const r=e-n,o=t*r;return n+o}function dw(e,t,n,r,o){return o!==void 0&&(e=xd(e,o,r)),xd(e,n,r)+t}function rg(e,t=0,n=1,r,o){e.min=dw(e.min,t,n,r,o),e.max=dw(e.max,t,n,r,o)}function EE(e,{x:t,y:n}){rg(e.x,t.translate,t.scale,t.originPoint),rg(e.y,n.translate,n.scale,n.originPoint)}function ON(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function Jr(e,t){e.min=e.min+t,e.max=e.max+t}function hw(e,t,[n,r,o]){const i=t[o]!==void 0?t[o]:.5,s=We(e.min,e.max,i);rg(e,t[n],t[r],s,t.scale)}const jN=["x","scaleX","originX"],IN=["y","scaleY","originY"];function hs(e,t){hw(e.x,t,jN),hw(e.y,t,IN)}function TE(e,t){return kE($N(e.getBoundingClientRect(),t))}function LN(e,t,n){const r=TE(e,n),{scroll:o}=t;return o&&(Jr(r.x,o.offset.x),Jr(r.y,o.offset.y)),r}const MN=new WeakMap;class BN{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Je(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=l=>{this.stopAnimation(),n&&this.snapToCursor(Wf(l,"page").point)},i=(l,c)=>{const{drag:u,dragPropagation:d,onDragStart:f}=this.getProps();if(u&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=N2(u),!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),Xn(g=>{let m=this.getAxisMotionValue(g).get()||0;if(dr.test(m)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[g];b&&(m=un(b)*(parseFloat(m)/100))}}this.originPoint[g]=m}),f&&Ue.update(()=>f(l,c),!1,!0);const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},s=(l,c)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:f,onDrag:p}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:g}=c;if(d&&this.currentDirection===null){this.currentDirection=zN(g),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",c.point,g),this.updateAxis("y",c.point,g),this.visualElement.render(),p&&p(l,c)},a=(l,c)=>this.stop(l,c);this.panSession=new xE(t,{onSessionStart:o,onStart:i,onMove:s,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Ue.update(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Yc(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=CN(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&us(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=EN(r.layoutBox,t):this.constraints=!1,this.elastic=RN(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xn(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=_N(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!us(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=LN(r,o.root,this.visualElement.getTransformPagePoint());let s=TN(o.layout.layoutBox,i);if(n){const a=n(AN(s));this.hasMutatedConstraints=!!a,a&&(s=kE(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Xn(u=>{if(!Yc(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=o?200:1e6,p=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(py(t,r,0,n))}stopAnimation(){Xn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Xn(n=>{const{drag:r}=this.getProps();if(!Yc(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-We(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!us(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Xn(s=>{const a=this.getAxisMotionValue(s);if(a){const l=a.get();o[s]=PN({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Xn(s=>{if(!Yc(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(We(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;MN.set(this.visualElement,this);const t=this.visualElement.current,n=Ar(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();us(l)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const s=Tr(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Xn(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=tg,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Yc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FN extends Po{constructor(t){super(t),this.removeGroupControls=Ke,this.removeListeners=Ke,this.controls=new BN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ke}unmount(){this.removeGroupControls(),this.removeListeners()}}const pw=e=>(t,n)=>{e&&Ue.update(()=>e(t,n))};class NN extends Po{constructor(){super(...arguments),this.removePointerDownListener=Ke}onPointerDown(t){this.session=new xE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:pw(t),onStart:pw(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.update(()=>o(i,s))}}}mount(){this.removePointerDownListener=Ar(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function PE(){const e=y.useContext(Jl);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=y.useId();return y.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}function DN(){return UN(y.useContext(Jl))}function UN(e){return e===null?!0:e.isPresent}const Au={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function mw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ea={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ie.test(e))e=parseFloat(e);else return e;const n=mw(e,t.target.x),r=mw(e,t.target.y);return`${n}% ${r}%`}},VN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=ko.parse(e);if(o.length>5)return r;const i=ko.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=We(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}};class WN extends si.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;Zz(HN),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Au.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,s=r.projection;return s&&(s.isPresent=i,o||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function _E(e){const[t,n]=PE(),r=y.useContext(ey);return si.createElement(WN,{...e,layoutGroup:r,switchLayoutGroup:y.useContext(k2),isPresent:t,safeToRemove:n})}const HN={borderRadius:{...Ea,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ea,borderTopRightRadius:Ea,borderBottomLeftRadius:Ea,borderBottomRightRadius:Ea,boxShadow:VN},RE=["TopLeft","TopRight","BottomLeft","BottomRight"],GN=RE.length,gw=e=>typeof e=="string"?parseFloat(e):e,vw=e=>typeof e=="number"||ie.test(e);function qN(e,t,n,r,o,i){o?(e.opacity=We(0,n.opacity!==void 0?n.opacity:1,KN(r)),e.opacityExit=We(t.opacity!==void 0?t.opacity:1,0,ZN(r))):i&&(e.opacity=We(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;srt?1:n(Ml(e,t,r))}function bw(e,t){e.min=t.min,e.max=t.max}function bn(e,t){bw(e.x,t.x),bw(e.y,t.y)}function ww(e,t,n,r,o){return e-=t,e=xd(e,1/n,r),o!==void 0&&(e=xd(e,1/o,r)),e}function YN(e,t=0,n=1,r=.5,o,i=e,s=e){if(dr.test(t)&&(t=parseFloat(t),t=We(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=We(i.min,i.max,r);e===i&&(a-=t),e.min=ww(e.min,t,n,a,o),e.max=ww(e.max,t,n,a,o)}function xw(e,t,[n,r,o],i,s){YN(e,t[n],t[r],t[o],t.scale,i,s)}const QN=["x","scaleX","originX"],XN=["y","scaleY","originY"];function Sw(e,t,n,r){xw(e.x,t,QN,n?n.x:void 0,r?r.x:void 0),xw(e.y,t,XN,n?n.y:void 0,r?r.y:void 0)}function kw(e){return e.translate===0&&e.scale===1}function $E(e){return kw(e.x)&&kw(e.y)}function JN(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function OE(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Cw(e){return un(e.x)/un(e.y)}class e8{constructor(){this.members=[]}add(t){my(this.members,t),t.scheduleRender()}remove(t){if(gy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ew(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(r+=`rotate(${l}deg) `),c&&(r+=`rotateX(${c}deg) `),u&&(r+=`rotateY(${u}deg) `)}const s=e.x.scale*t.x,a=e.y.scale*t.y;return(s!==1||a!==1)&&(r+=`scale(${s}, ${a})`),r||"none"}const t8=(e,t)=>e.depth-t.depth;class n8{constructor(){this.children=[],this.isDirty=!1}add(t){my(this.children,t),this.isDirty=!0}remove(t){gy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(t8),this.isDirty=!1,this.children.forEach(t)}}function r8(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Br(r),e(i-t))};return Ue.read(r,!0),()=>Br(r)}function o8(e){window.MotionDebug&&window.MotionDebug.record(e)}function i8(e){return e instanceof SVGElement&&e.tagName!=="svg"}function s8(e,t,n){const r=Jt(e)?e:Us(e);return r.start(py("",r,t,n)),r.animation}const Tw=["","X","Y","Z"],Pw=1e3;let a8=0;const zo={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function jE({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t==null?void 0:t()){this.id=a8++,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=()=>{zo.totalNodes=zo.resolvedTargetDeltas=zo.recalculatedProjection=0,this.nodes.forEach(u8),this.nodes.forEach(m8),this.nodes.forEach(g8),this.nodes.forEach(d8),o8(zo)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=r8(f,250),Au.hasAnimatedSinceResize&&(Au.hasAnimatedSinceResize=!1,this.nodes.forEach(Rw))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||x8,{onLayoutAnimationStart:x,onLayoutAnimationComplete:b}=u.getProps(),v=!this.targetLayout||!OE(this.targetLayout,g)||p,w=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,w);const S={...vE(m,"layout"),onPlay:x,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else f||Rw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Br(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(v8),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!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 u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(f8),this.sharedNodes.forEach(y8)}scheduleUpdateProjection(){Ue.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Ue.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 k=S/1e3;Aw(d.x,s.x,k),Aw(d.y,s.y,k),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(rl(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b8(this.relativeTarget,this.relativeTargetOrigin,f,k),w&&JN(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Je()),bn(w,this.relativeTarget)),m&&(this.animationValues=u,qN(u,c,this.latestValues,k,v,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Br(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{Au.hasAnimatedSinceResize=!0,this.currentAnimation=s8(0,Pw,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Pw),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&IE(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Je();const d=un(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=un(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}bn(a,l),hs(a,u),nl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new e8),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(_w),this.root.sharedNodes.clear()}}}function l8(e){e.updateLayout()}function c8(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,s=n.source!==e.layout.source;i==="size"?Xn(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=un(f);f.min=r[d].min,f.max=f.min+p}):IE(i,n.layoutBox,r)&&Xn(d=>{const f=s?n.measuredBox[d]:n.layoutBox[d],p=un(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=fs();nl(a,r,n.layoutBox);const l=fs();s?nl(l,e.applyTransform(o,!0),n.measuredBox):nl(l,r,n.layoutBox);const c=!$E(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=Je();rl(g,n.layoutBox,f.layoutBox);const m=Je();rl(m,r,p.layoutBox),OE(g,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function u8(e){zo.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function d8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function f8(e){e.clearSnapshot()}function _w(e){e.clearMeasurements()}function h8(e){e.isLayoutDirty=!1}function p8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Rw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function m8(e){e.resolveTargetDelta()}function g8(e){e.calcProjection()}function v8(e){e.resetRotation()}function y8(e){e.removeLeadSnapshot()}function Aw(e,t,n){e.translate=We(t.translate,0,n),e.scale=We(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function $w(e,t,n,r){e.min=We(t.min,n.min,r),e.max=We(t.max,n.max,r)}function b8(e,t,n,r){$w(e.x,t.x,n.x,r),$w(e.y,t.y,n.y,r)}function w8(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const x8={duration:.45,ease:[.4,0,.1,1]},Ow=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),jw=Ow("applewebkit/")&&!Ow("chrome/")?Math.round:Ke;function Iw(e){e.min=jw(e.min),e.max=jw(e.max)}function S8(e){Iw(e.x),Iw(e.y)}function IE(e,t,n){return e==="position"||e==="preserve-aspect"&&!eg(Cw(t),Cw(n),.2)}const k8=jE({attachResizeListener:(e,t)=>Tr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vp={current:void 0},LE=jE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vp.current){const e=new k8({});e.mount(window),e.setOptions({layoutScroll:!0}),vp.current=e}return vp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),C8={pan:{Feature:NN},drag:{Feature:FN,ProjectionNode:LE,MeasureLayout:_E}},E8=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function T8(e){const t=E8.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function og(e,t,n=1){const[r,o]=T8(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():qm(o)?og(o,t,n+1):o}function P8(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const i=o.get();if(!qm(i))return;const s=og(i,r);s&&o.set(s)});for(const o in t){const i=t[o];if(!qm(i))continue;const s=og(i,r);s&&(t[o]=s,n||(n={}),n[o]===void 0&&(n[o]=i))}return{target:t,transitionEnd:n}}const _8=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ME=e=>_8.has(e),R8=e=>Object.keys(e).some(ME),Lw=e=>e===_i||e===ie,Mw=(e,t)=>parseFloat(e.split(", ")[t]),Bw=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return Mw(o[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?Mw(i[1],e):0}},A8=new Set(["x","y","z"]),$8=ec.filter(e=>!A8.has(e));function O8(e){const t=[];return $8.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Vs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Bw(4,13),y:Bw(5,14)};Vs.translateX=Vs.x;Vs.translateY=Vs.y;const j8=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:s}=i,a={};s==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Vs[c](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Vs[c](l,i)}),e},I8=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(ME);let i=[],s=!1;const a=[];if(o.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ca(u);const f=t[l];let p;if(gd(f)){const g=f.length,m=f[0]===null?1:0;u=f[m],d=Ca(u);for(let x=m;x=0?window.pageYOffset:null,c=j8(t,e,a);return i.length&&i.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nf&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:r}}else return{target:t,transitionEnd:r}};function L8(e,t,n,r){return R8(t)?I8(e,t,n,r):{target:t,transitionEnd:r}}const M8=(e,t,n,r)=>{const o=P8(e,t,r);return t=o.target,r=o.transitionEnd,L8(e,t,n,r)},ig={current:null},BE={current:!1};function B8(){if(BE.current=!0,!!Nf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ig.current=e.matches;e.addListener(t),t()}else ig.current=!1}function z8(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],s=n[o];if(Jt(i))e.addValue(o,i),wd(r)&&r.add(o);else if(Jt(s))e.addValue(o,Us(i,{owner:e})),wd(r)&&r.remove(o);else if(s!==i)if(e.hasValue(o)){const a=e.getValue(o);!a.hasAnimated&&a.set(i)}else{const a=e.getStaticValue(o);e.addValue(o,Us(a!==void 0?a:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const zw=new WeakMap,zE=Object.keys(Ll),F8=zE.length,Fw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],N8=Jv.length;class D8{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:i},s={}){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=()=>Ue.render(this.render,!1,!0);const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=s,this.isControllingVariants=Uf(n),this.isVariantNode=S2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const f=u[d];a[d]!==void 0&&Jt(f)&&(f.set(a[d],!1),wd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,zw.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),BE.current||B8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ig.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){zw.delete(this.current),this.projection&&this.projection.unmount(),Br(this.notifyUpdate),Br(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Pi.has(t),o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,i){let s,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:i,layoutScroll:f,layoutRoot:p})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Je()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Us(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=ly(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Jt(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new vy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class FE extends D8{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},i){let s=iN(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),s&&(s=o(s))),i){rN(this,r,s);const a=M8(this,r,s,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function U8(e){return window.getComputedStyle(e)}class V8 extends FE{readValueFromInstance(t,n){if(Pi.has(n)){const r=hy(n);return r&&r.default||0}else{const r=U8(t),o=(T2(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return TE(t,n)}build(t,n,r,o){ny(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return ay(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){O2(t,n,r,o)}}class W8 extends FE{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Pi.has(n)){const r=hy(n);return r&&r.default||0}return n=j2.has(n)?n:sy(n),t.getAttribute(n)}measureInstanceViewportBox(){return Je()}scrapeMotionValuesFromProps(t,n){return L2(t,n)}build(t,n,r,o){oy(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){I2(t,n,r,o)}mount(t){this.isSVGTag=iy(t.tagName),super.mount(t)}}const H8=(e,t)=>ty(e)?new W8(t,{enableHardwareAcceleration:!1}):new V8(t,{enableHardwareAcceleration:!0}),G8={layout:{ProjectionNode:LE,MeasureLayout:_E}},q8={...bN,...zF,...C8,...G8},_o=qz((e,t)=>SF(e,t,q8,H8));function NE(){const e=y.useRef(!1);return hd(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function K8(){const e=NE(),[t,n]=y.useState(0),r=y.useCallback(()=>{e.current&&n(t+1)},[t]);return[y.useCallback(()=>Ue.postRender(r),[r]),t]}class Z8 extends y.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Y8({children:e,isPresent:t}){const n=y.useId(),r=y.useRef(null),o=y.useRef({width:0,height:0,top:0,left:0});return y.useInsertionEffect(()=>{const{width:i,height:s,top:a,left:l}=o.current;if(t||!r.current||!i||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${i}px !important; - height: ${s}px !important; - top: ${a}px !important; - left: ${l}px !important; - } - `),()=>{document.head.removeChild(c)}},[t]),y.createElement(Z8,{isPresent:t,childRef:r,sizeRef:o},y.cloneElement(e,{ref:r}))}const yp=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=M2(Q8),l=y.useId(),c=y.useMemo(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:u=>{a.set(u,!0);for(const d of a.values())if(!d)return;r&&r()},register:u=>(a.set(u,!1),()=>a.delete(u))}),i?void 0:[n]);return y.useMemo(()=>{a.forEach((u,d)=>a.set(d,!1))},[n]),y.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=y.createElement(Y8,{isPresent:n},e)),y.createElement(Jl.Provider,{value:c},e)};function Q8(){return new Map}function X8(e){return y.useEffect(()=>()=>e(),[])}const Vi=e=>e.key||"";function J8(e,t){e.forEach(n=>{const r=Vi(n);t.set(r,n)})}function eD(e){const t=[];return y.Children.forEach(e,n=>{y.isValidElement(n)&&t.push(n)}),t}const ra=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:s="sync"})=>{const a=y.useContext(ey).forceRender||K8()[0],l=NE(),c=eD(e);let u=c;const d=y.useRef(new Map).current,f=y.useRef(u),p=y.useRef(new Map).current,g=y.useRef(!0);if(hd(()=>{g.current=!1,J8(c,p),f.current=u}),X8(()=>{g.current=!0,p.clear(),d.clear()}),g.current)return y.createElement(y.Fragment,null,u.map(v=>y.createElement(yp,{key:Vi(v),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:s},v)));u=[...u];const m=f.current.map(Vi),x=c.map(Vi),b=m.length;for(let v=0;v{if(x.indexOf(w)!==-1)return;const S=p.get(w);if(!S)return;const k=m.indexOf(w);let T=v;if(!T){const E=()=>{p.delete(w),d.delete(w);const _=f.current.findIndex(z=>z.key===w);if(f.current.splice(_,1),!d.size){if(f.current=c,l.current===!1)return;a(),r&&r()}};T=y.createElement(yp,{key:Vi(S),isPresent:!1,onExitComplete:E,custom:t,presenceAffectsLayout:i,mode:s},S),d.set(w,T)}u.splice(k,0,T)}),u=u.map(v=>{const w=v.key;return d.has(w)?v:y.createElement(yp,{key:Vi(v),isPresent:!0,presenceAffectsLayout:i,mode:s},v)}),y.createElement(y.Fragment,null,d.size?u:u.map(v=>y.cloneElement(v)))};var tD={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},DE=y.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:o,requestClose:i=!1,position:s="bottom",duration:a=5e3,containerStyle:l,motionVariants:c=tD,toastSpacing:u="0.5rem"}=e,[d,f]=y.useState(a),p=DN();jl(()=>{p||r==null||r()},[p]),jl(()=>{f(a)},[a]);const g=()=>f(null),m=()=>f(a),x=()=>{p&&o()};y.useEffect(()=>{p&&i&&o()},[p,i,o]),zz(x,d);const b=y.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:u,...l}),[l,u]),v=y.useMemo(()=>Mz(s),[s]);return h.jsx(_o.div,{layout:!0,className:"chakra-toast",variants:c,initial:"initial",animate:"animate",exit:"exit",onHoverStart:g,onHoverEnd:m,custom:{position:s},style:v,children:h.jsx(Z.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Nn(n,{id:t,onClose:x})})})});DE.displayName="ToastComponent";function nD(e,t){var n;const r=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=i==null?void 0:i[t])!=null?n:r}var Nw={path:h.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[h.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),h.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),h.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Me=ee((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:s,className:a,__css:l,...c}=e,u=se("chakra-icon",a),d=Gn("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...l,...d},p={ref:t,focusable:i,className:u,__css:f},g=r??Nw.viewBox;if(n&&typeof n!="string")return h.jsx(Z.svg,{as:n,...p,...c});const m=s??Nw.path;return h.jsx(Z.svg,{verticalAlign:"middle",viewBox:g,...p,...c,children:m})});Me.displayName="Icon";function rD(e){return h.jsx(Me,{viewBox:"0 0 24 24",...e,children:h.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function oD(e){return h.jsx(Me,{viewBox:"0 0 24 24",...e,children:h.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function Dw(e){return h.jsx(Me,{viewBox:"0 0 24 24",...e,children:h.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var iD=JA({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),yy=ee((e,t)=>{const n=Gn("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:s="transparent",className:a,...l}=ft(e),c=se("chakra-spinner",a),u={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:s,borderLeftColor:s,animation:`${iD} ${i} linear infinite`,...n};return h.jsx(Z.div,{ref:t,__css:u,className:c,...l,children:r&&h.jsx(Z.span,{srOnly:!0,children:r})})});yy.displayName="Spinner";var[sD,by]=tn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[aD,wy]=tn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),UE={info:{icon:oD,colorScheme:"blue"},warning:{icon:Dw,colorScheme:"orange"},success:{icon:rD,colorScheme:"green"},error:{icon:Dw,colorScheme:"red"},loading:{icon:yy,colorScheme:"blue"}};function lD(e){return UE[e].colorScheme}function cD(e){return UE[e].icon}var VE=ee(function(t,n){const r=wy(),{status:o}=by(),i={display:"inline",...r.description};return h.jsx(Z.div,{ref:n,"data-status":o,...t,className:se("chakra-alert__desc",t.className),__css:i})});VE.displayName="AlertDescription";function WE(e){const{status:t}=by(),n=cD(t),r=wy(),o=t==="loading"?r.spinner:r.icon;return h.jsx(Z.span,{display:"inherit","data-status":t,...e,className:se("chakra-alert__icon",e.className),__css:o,children:e.children||h.jsx(n,{h:"100%",w:"100%"})})}WE.displayName="AlertIcon";var HE=ee(function(t,n){const r=wy(),{status:o}=by();return h.jsx(Z.div,{ref:n,"data-status":o,...t,className:se("chakra-alert__title",t.className),__css:r.title})});HE.displayName="AlertTitle";var GE=ee(function(t,n){var r;const{status:o="info",addRole:i=!0,...s}=ft(t),a=(r=t.colorScheme)!=null?r:lD(o),l=Nr("Alert",{...t,colorScheme:a}),c={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return h.jsx(sD,{value:{status:o},children:h.jsx(aD,{value:l,children:h.jsx(Z.div,{"data-status":o,role:i?"alert":void 0,ref:n,...s,className:se("chakra-alert",t.className),__css:c})})})});GE.displayName="Alert";function uD(e){return h.jsx(Me,{focusable:"false","aria-hidden":!0,...e,children:h.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var Gf=ee(function(t,n){const r=Gn("CloseButton",t),{children:o,isDisabled:i,__css:s,...a}=ft(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return h.jsx(Z.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...l,...r,...s},...a,children:o||h.jsx(uD,{width:"1em",height:"1em"})})});Gf.displayName="CloseButton";var dD={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},or=fD(dD);function fD(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(s=>({...s,[i]:s[i].filter(a=>a.id!=o)}))},notify:(o,i)=>{const s=hD(o,i),{position:a,id:l}=s;return r(c=>{var u,d;const p=a.includes("top")?[s,...(u=c[a])!=null?u:[]]:[...(d=c[a])!=null?d:[],s];return{...c,[a]:p}}),l},update:(o,i)=>{o&&r(s=>{const a={...s},{position:l,index:c}=Mb(a,o);return l&&c!==-1&&(a[l][c]={...a[l][c],...i,message:qE(i)}),a})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,c)=>(l[c]=i[c].map(u=>({...u,requestClose:!0})),l),{...i}))},close:o=>{r(i=>{const s=b2(i,o);return s?{...i,[s]:i[s].map(a=>a.id==o?{...a,requestClose:!0}:a)}:i})},isActive:o=>!!Mb(or.getState(),o).position}}var Uw=0;function hD(e,t={}){var n,r;Uw+=1;const o=(n=t.id)!=null?n:Uw,i=(r=t.position)!=null?r:"bottom";return{id:o,message:e,position:i,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>or.removeToast(String(o),i),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var pD=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:s,description:a,colorScheme:l,icon:c}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return h.jsxs(GE,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[h.jsx(WE,{children:c}),h.jsxs(Z.div,{flex:"1",maxWidth:"100%",children:[o&&h.jsx(HE,{id:u==null?void 0:u.title,children:o}),a&&h.jsx(VE,{id:u==null?void 0:u.description,display:"block",children:a})]}),i&&h.jsx(Gf,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function qE(e={}){const{render:t,toastComponent:n=pD}=e;return o=>typeof t=="function"?t({...o,...e}):h.jsx(n,{...o,...e})}function mD(e,t){const n=o=>{var i;return{...t,...o,position:nD((i=o==null?void 0:o.position)!=null?i:t==null?void 0:t.position,e)}},r=o=>{const i=n(o),s=qE(i);return or.notify(s,i)};return r.update=(o,i)=>{or.update(o,n(i))},r.promise=(o,i)=>{const s=r({...i.loading,status:"loading",duration:null});o.then(a=>r.update(s,{status:"success",duration:5e3,...Nn(i.success,a)})).catch(a=>r.update(s,{status:"error",duration:5e3,...Nn(i.error,a)}))},r.closeAll=or.closeAll,r.close=or.close,r.isActive=or.isActive,r}var[gD,vD]=tn({name:"ToastOptionsContext",strict:!1}),yD=e=>{const t=y.useSyncExternalStore(or.subscribe,or.getState,or.getState),{motionVariants:n,component:r=DE,portalProps:o}=e,s=Object.keys(t).map(a=>{const l=t[a];return h.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${a}`,style:Bz(a),children:h.jsx(ra,{initial:!1,children:l.map(c=>h.jsx(r,{motionVariants:n,...c},c.id))})},a)});return h.jsx(na,{...o,children:s})};function Ri(e){const{theme:t}=WC(),n=vD();return y.useMemo(()=>mD(t.direction,{...n,...e}),[e,t.direction,n])}var bD=e=>function({children:n,theme:r=e,toastOptions:o,...i}){return h.jsxs(Iz,{theme:r,...i,children:[h.jsx(gD,{value:o==null?void 0:o.defaultOptions,children:n}),h.jsx(yD,{...o})]})},wD=bD(tz);function xD(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Mt(...e){return t=>{e.forEach(n=>{xD(n,t)})}}function SD(...e){return y.useMemo(()=>Mt(...e),e)}var Vw={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},ri={enter:{duration:.2,ease:Vw.easeOut},exit:{duration:.1,ease:Vw.easeIn}},oi={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},kD={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:oi.enter(ri.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:oi.exit(ri.exit,n),transitionEnd:t==null?void 0:t.exit}}},KE={initial:"exit",animate:"enter",exit:"exit",variants:kD},CD=y.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:s,transitionEnd:a,delay:l,...c}=t,u=o||r?"enter":"exit",d=r?o&&r:!0,f={transition:s,transitionEnd:a,delay:l};return h.jsx(ra,{custom:f,children:d&&h.jsx(_o.div,{ref:n,className:se("chakra-fade",i),custom:f,...KE,animate:u,...c})})});CD.displayName="Fade";var ED={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(i=n==null?void 0:n.exit)!=null?i:oi.exit(ri.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:oi.enter(ri.enter,n),transitionEnd:e==null?void 0:e.enter}}},ZE={initial:"exit",animate:"enter",exit:"exit",variants:ED},TD=y.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:s=.95,className:a,transition:l,transitionEnd:c,delay:u,...d}=t,f=r?o&&r:!0,p=o||r?"enter":"exit",g={initialScale:s,reverse:i,transition:l,transitionEnd:c,delay:u};return h.jsx(ra,{custom:g,children:f&&h.jsx(_o.div,{ref:n,className:se("chakra-offset-slide",a),...ZE,animate:p,custom:g,...d})})});TD.displayName="ScaleFade";var PD={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,x:e,y:t,transition:(i=n==null?void 0:n.exit)!=null?i:oi.exit(ri.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:oi.enter(ri.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{var s;const a={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:oi.exit(ri.exit,i),...o?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},sg={initial:"initial",animate:"enter",exit:"exit",variants:PD},_D=y.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:s,offsetX:a=0,offsetY:l=8,transition:c,transitionEnd:u,delay:d,...f}=t,p=r?o&&r:!0,g=o||r?"enter":"exit",m={offsetX:a,offsetY:l,reverse:i,transition:c,transitionEnd:u,delay:d};return h.jsx(ra,{custom:m,children:p&&h.jsx(_o.div,{ref:n,className:se("chakra-offset-slide",s),custom:m,...sg,animate:g,...f})})});_D.displayName="SlideFade";var[RD,AD]=tn({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function $D(e){var t;const n=e.split(" "),r=(t=n[0])!=null?t:"",o=n.length>1?n[n.length-1]:"";return r&&o?`${r.charAt(0)}${o.charAt(0)}`:r.charAt(0)}function YE(e){const{name:t,getInitials:n,...r}=e,o=AD();return h.jsx(Z.div,{role:"img","aria-label":t,...r,__css:o.label,children:t?n==null?void 0:n(t):null})}YE.displayName="AvatarName";var QE=e=>h.jsxs(Z.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...e,children:[h.jsx("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),h.jsx("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),ag=ee(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:i,...s}=t;return h.jsx("img",{width:r,height:o,ref:n,alt:i,...s})});ag.displayName="NativeImage";function XE(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:i,crossOrigin:s,sizes:a,ignoreFallback:l}=e,[c,u]=y.useState("pending");y.useEffect(()=>{u(n?"loading":"pending")},[n]);const d=y.useRef(),f=y.useCallback(()=>{if(!n)return;p();const g=new Image;g.src=n,s&&(g.crossOrigin=s),r&&(g.srcset=r),a&&(g.sizes=a),t&&(g.loading=t),g.onload=m=>{p(),u("loaded"),o==null||o(m)},g.onerror=m=>{p(),u("failed"),i==null||i(m)},d.current=g},[n,s,r,a,o,i,t]),p=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return Pr(()=>{if(!l)return c==="loading"&&f(),()=>{p()}},[c,f,l]),l?"loaded":c}var OD=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function jD(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var ps=ee(function(t,n){const{fallbackSrc:r,fallback:o,src:i,srcSet:s,align:a,fit:l,loading:c,ignoreFallback:u,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:p,...g}=t,m=r!==void 0||o!==void 0,x=c!=null||u||!m,b=XE({...t,crossOrigin:d,ignoreFallback:x}),v=OD(b,f),w={ref:n,objectFit:l,objectPosition:a,...x?g:jD(g,["onError","onLoad"])};return v?o||h.jsx(Z.img,{as:ag,className:"chakra-image__placeholder",src:r,...w}):h.jsx(Z.img,{as:ag,src:i,srcSet:s,crossOrigin:d,loading:c,referrerPolicy:p,className:"chakra-image",...w})});ps.displayName="Image";function JE(e){const{src:t,srcSet:n,onError:r,onLoad:o,getInitials:i,name:s,borderRadius:a,loading:l,iconLabel:c,icon:u=h.jsx(QE,{}),ignoreFallback:d,referrerPolicy:f,crossOrigin:p}=e,m=XE({src:t,onError:r,crossOrigin:p,ignoreFallback:d})==="loaded";return!t||!m?s?h.jsx(YE,{className:"chakra-avatar__initials",getInitials:i,name:s}):y.cloneElement(u,{role:"img","aria-label":c}):h.jsx(Z.img,{src:t,srcSet:n,alt:s,onLoad:o,referrerPolicy:f,crossOrigin:p??void 0,className:"chakra-avatar__img",loading:l,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:a}})}JE.displayName="AvatarImage";var ID={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},Sd=ee((e,t)=>{const n=Nr("Avatar",e),[r,o]=y.useState(!1),{src:i,srcSet:s,name:a,showBorder:l,borderRadius:c="full",onError:u,onLoad:d,getInitials:f=$D,icon:p=h.jsx(QE,{}),iconLabel:g=" avatar",loading:m,children:x,borderColor:b,ignoreFallback:v,crossOrigin:w,referrerPolicy:S,...k}=ft(e),T={borderRadius:c,borderWidth:l?"2px":void 0,...ID,...n.container};return b&&(T.borderColor=b),h.jsx(Z.span,{ref:t,...k,className:se("chakra-avatar",e.className),"data-loaded":ke(r),__css:T,children:h.jsxs(RD,{value:n,children:[h.jsx(JE,{src:i,srcSet:s,loading:m,onLoad:me(d,()=>{o(!0)}),onError:u,getInitials:f,name:a,borderRadius:c,icon:p,iconLabel:g,ignoreFallback:v,crossOrigin:w,referrerPolicy:S}),x]})})});Sd.displayName="Avatar";function LD(e){return y.Children.toArray(e).filter(t=>y.isValidElement(t))}var[MD,BD]=tn({strict:!1,name:"ButtonGroupContext"}),zD={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},FD={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},eT=ee(function(t,n){const{size:r,colorScheme:o,variant:i,className:s,spacing:a="0.5rem",isAttached:l,isDisabled:c,orientation:u="horizontal",...d}=t,f=se("chakra-button__group",s),p=y.useMemo(()=>({size:r,colorScheme:o,variant:i,isDisabled:c}),[r,o,i,c]);let g={display:"inline-flex",...l?zD[u]:FD[u](a)};const m=u==="vertical";return h.jsx(MD,{value:p,children:h.jsx(Z.div,{ref:n,role:"group",__css:g,className:f,"data-attached":l?"":void 0,"data-orientation":u,flexDir:m?"column":void 0,...d})})});eT.displayName="ButtonGroup";function ND(e){const[t,n]=y.useState(!e);return{ref:y.useCallback(i=>{i&&n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}function lg(e){const{children:t,className:n,...r}=e,o=y.isValidElement(t)?y.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=se("chakra-button__icon",n);return h.jsx(Z.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i,children:o})}lg.displayName="ButtonIcon";function cg(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=h.jsx(yy,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:s,...a}=e,l=se("chakra-button__spinner",i),c=n==="start"?"marginEnd":"marginStart",u=y.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[c]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,c,r]);return h.jsx(Z.div,{className:l,...a,__css:u,children:o})}cg.displayName="ButtonSpinner";var Te=ee((e,t)=>{const n=BD(),r=Gn("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:i,isActive:s,children:a,leftIcon:l,rightIcon:c,loadingText:u,iconSpacing:d="0.5rem",type:f,spinner:p,spinnerPlacement:g="start",className:m,as:x,...b}=ft(e),v=y.useMemo(()=>{const T={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:T}}},[r,n]),{ref:w,type:S}=ND(x),k={rightIcon:c,leftIcon:l,iconSpacing:d,children:a};return h.jsxs(Z.button,{ref:SD(t,w),as:x,type:f??S,"data-active":ke(s),"data-loading":ke(i),__css:v,className:se("chakra-button",m),...b,disabled:o||i,children:[i&&g==="start"&&h.jsx(cg,{className:"chakra-button__spinner--start",label:u,placement:"start",spacing:d,children:p}),i?u||h.jsx(Z.span,{opacity:0,children:h.jsx(Ww,{...k})}):h.jsx(Ww,{...k}),i&&g==="end"&&h.jsx(cg,{className:"chakra-button__spinner--end",label:u,placement:"end",spacing:d,children:p})]})});Te.displayName="Button";function Ww(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return h.jsxs(h.Fragment,{children:[t&&h.jsx(lg,{marginEnd:o,children:t}),r,n&&h.jsx(lg,{marginStart:o,children:n})]})}var Wi=ee((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...s}=e,a=n||r,l=y.isValidElement(a)?y.cloneElement(a,{"aria-hidden":!0,focusable:!1}):null;return h.jsx(Te,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...s,children:l})});Wi.displayName="IconButton";var[DD,xy]=Oz("Card"),UD=ee(function(t,n){const{className:r,...o}=t,i=xy();return h.jsx(Z.div,{ref:n,className:se("chakra-card__body",r),__css:i.body,...o})}),VD=ee(function(t,n){const{className:r,justify:o,...i}=t,s=xy();return h.jsx(Z.div,{ref:n,className:se("chakra-card__footer",r),__css:{display:"flex",justifyContent:o,...s.footer},...i})}),WD=ee(function(t,n){const{className:r,...o}=t,i=xy();return h.jsx(Z.div,{ref:n,className:se("chakra-card__header",r),__css:i.header,...o})}),HD=ee(function(t,n){const{className:r,children:o,direction:i="column",justify:s,align:a,...l}=ft(t),c=Nr("Card",t);return h.jsx(Z.div,{ref:n,className:se("chakra-card",r),__css:{display:"flex",flexDirection:i,justifyContent:s,alignItems:a,position:"relative",minWidth:0,wordWrap:"break-word",...c.container},...l,children:h.jsx(DD,{value:c,children:o})})}),[GD,tT]=tn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[qD,qf]=tn({strict:!1,name:"FormControlContext"});function KD(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...s}=e,a=y.useId(),l=t||`field-${a}`,c=`${l}-label`,u=`${l}-feedback`,d=`${l}-helptext`,[f,p]=y.useState(!1),[g,m]=y.useState(!1),[x,b]=y.useState(!1),v=y.useCallback((E={},_=null)=>({id:d,...E,ref:Mt(_,z=>{z&&m(!0)})}),[d]),w=y.useCallback((E={},_=null)=>({...E,ref:_,"data-focus":ke(x),"data-disabled":ke(o),"data-invalid":ke(r),"data-readonly":ke(i),id:E.id!==void 0?E.id:c,htmlFor:E.htmlFor!==void 0?E.htmlFor:l}),[l,o,x,r,i,c]),S=y.useCallback((E={},_=null)=>({id:u,...E,ref:Mt(_,z=>{z&&p(!0)}),"aria-live":"polite"}),[u]),k=y.useCallback((E={},_=null)=>({...E,...s,ref:_,role:"group"}),[s]),T=y.useCallback((E={},_=null)=>({...E,ref:_,role:"presentation","aria-hidden":!0,children:E.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!x,onFocus:()=>b(!0),onBlur:()=>b(!1),hasFeedbackText:f,setHasFeedbackText:p,hasHelpText:g,setHasHelpText:m,id:l,labelId:c,feedbackId:u,helpTextId:d,htmlProps:s,getHelpTextProps:v,getErrorMessageProps:S,getRootProps:k,getLabelProps:w,getRequiredIndicatorProps:T}}var Pt=ee(function(t,n){const r=Nr("Form",t),o=ft(t),{getRootProps:i,htmlProps:s,...a}=KD(o),l=se("chakra-form-control",t.className);return h.jsx(qD,{value:a,children:h.jsx(GD,{value:r,children:h.jsx(Z.div,{...i({},n),className:l,__css:r.container})})})});Pt.displayName="FormControl";var Fo=ee(function(t,n){const r=qf(),o=tT(),i=se("chakra-form__helper-text",t.className);return h.jsx(Z.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:i})});Fo.displayName="FormHelperText";var _t=ee(function(t,n){var r;const o=Gn("FormLabel",t),i=ft(t),{className:s,children:a,requiredIndicator:l=h.jsx(nT,{}),optionalIndicator:c=null,...u}=i,d=qf(),f=(r=d==null?void 0:d.getLabelProps(u,n))!=null?r:{ref:n,...u};return h.jsxs(Z.label,{...f,className:se("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...o},children:[a,d!=null&&d.isRequired?l:c]})});_t.displayName="FormLabel";var nT=ee(function(t,n){const r=qf(),o=tT();if(!(r!=null&&r.isRequired))return null;const i=se("chakra-form__required-indicator",t.className);return h.jsx(Z.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:i})});nT.displayName="RequiredIndicator";function rT(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=oT(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":Dh(n),"aria-required":Dh(o),"aria-readonly":Dh(r)}}function oT(e){var t,n,r;const o=qf(),{id:i,disabled:s,readOnly:a,required:l,isRequired:c,isInvalid:u,isReadOnly:d,isDisabled:f,onFocus:p,onBlur:g,...m}=e,x=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&x.push(o.feedbackId),o!=null&&o.hasHelpText&&x.push(o.helpTextId),{...m,"aria-describedby":x.join(" ")||void 0,id:i??(o==null?void 0:o.id),isDisabled:(t=s??f)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=a??d)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=l??c)!=null?r:o==null?void 0:o.isRequired,isInvalid:u??(o==null?void 0:o.isInvalid),onFocus:me(o==null?void 0:o.onFocus,p),onBlur:me(o==null?void 0:o.onBlur,g)}}var ZD={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};const YD=()=>typeof document<"u";let Hw=!1,oc=null,hi=!1,ug=!1;const dg=new Set;function Sy(e,t){dg.forEach(n=>n(e,t))}const QD=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function XD(e){return!(e.metaKey||!QD&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Gw(e){hi=!0,XD(e)&&(oc="keyboard",Sy("keyboard",e))}function Bi(e){if(oc="pointer",e.type==="mousedown"||e.type==="pointerdown"){hi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;Sy("pointer",e)}}function JD(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function e9(e){JD(e)&&(hi=!0,oc="virtual")}function t9(e){e.target===window||e.target===document||(!hi&&!ug&&(oc="virtual",Sy("virtual",e)),hi=!1,ug=!1)}function n9(){hi=!1,ug=!0}function qw(){return oc!=="pointer"}function r9(){if(!YD()||Hw)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){hi=!0,e.apply(this,n)},document.addEventListener("keydown",Gw,!0),document.addEventListener("keyup",Gw,!0),document.addEventListener("click",e9,!0),window.addEventListener("focus",t9,!0),window.addEventListener("blur",n9,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Bi,!0),document.addEventListener("pointermove",Bi,!0),document.addEventListener("pointerup",Bi,!0)):(document.addEventListener("mousedown",Bi,!0),document.addEventListener("mousemove",Bi,!0),document.addEventListener("mouseup",Bi,!0)),Hw=!0}function o9(e){r9(),e(qw());const t=()=>e(qw());return dg.add(t),()=>{dg.delete(t)}}function i9(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function s9(e={}){const t=oT(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:i,id:s,onBlur:a,onFocus:l,"aria-describedby":c}=t,{defaultChecked:u,isChecked:d,isFocusable:f,onChange:p,isIndeterminate:g,name:m,value:x,tabIndex:b=void 0,"aria-label":v,"aria-labelledby":w,"aria-invalid":S,...k}=e,T=i9(k,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),E=ni(p),_=ni(a),z=ni(l),[L,P]=y.useState(!1),[j,I]=y.useState(!1),[V,$]=y.useState(!1),[O,F]=y.useState(!1);y.useEffect(()=>o9(P),[]);const B=y.useRef(null),[D,H]=y.useState(!0),[U,q]=y.useState(!!u),N=d!==void 0,G=N?d:U,J=y.useCallback(K=>{if(r||n){K.preventDefault();return}N||q(G?K.target.checked:g?!0:K.target.checked),E==null||E(K)},[r,n,G,N,g,E]);Pr(()=>{B.current&&(B.current.indeterminate=!!g)},[g]),jl(()=>{n&&I(!1)},[n,I]),Pr(()=>{const K=B.current;if(!(K!=null&&K.form))return;const ye=()=>{q(!!u)};return K.form.addEventListener("reset",ye),()=>{var be;return(be=K.form)==null?void 0:be.removeEventListener("reset",ye)}},[]);const te=n&&!f,ne=y.useCallback(K=>{K.key===" "&&F(!0)},[F]),ue=y.useCallback(K=>{K.key===" "&&F(!1)},[F]);Pr(()=>{if(!B.current)return;B.current.checked!==G&&q(B.current.checked)},[B.current]);const he=y.useCallback((K={},ye=null)=>{const be=at=>{j&&at.preventDefault(),F(!0)};return{...K,ref:ye,"data-active":ke(O),"data-hover":ke(V),"data-checked":ke(G),"data-focus":ke(j),"data-focus-visible":ke(j&&L),"data-indeterminate":ke(g),"data-disabled":ke(n),"data-invalid":ke(i),"data-readonly":ke(r),"aria-hidden":!0,onMouseDown:me(K.onMouseDown,be),onMouseUp:me(K.onMouseUp,()=>F(!1)),onMouseEnter:me(K.onMouseEnter,()=>$(!0)),onMouseLeave:me(K.onMouseLeave,()=>$(!1))}},[O,G,n,j,L,V,g,i,r]),Ae=y.useCallback((K={},ye=null)=>({...K,ref:ye,"data-active":ke(O),"data-hover":ke(V),"data-checked":ke(G),"data-focus":ke(j),"data-focus-visible":ke(j&&L),"data-indeterminate":ke(g),"data-disabled":ke(n),"data-invalid":ke(i),"data-readonly":ke(r)}),[O,G,n,j,L,V,g,i,r]),ze=y.useCallback((K={},ye=null)=>({...T,...K,ref:Mt(ye,be=>{be&&H(be.tagName==="LABEL")}),onClick:me(K.onClick,()=>{var be;D||((be=B.current)==null||be.click(),requestAnimationFrame(()=>{var at;(at=B.current)==null||at.focus({preventScroll:!0})}))}),"data-disabled":ke(n),"data-checked":ke(G),"data-invalid":ke(i)}),[T,n,G,i,D]),le=y.useCallback((K={},ye=null)=>({...K,ref:Mt(B,ye),type:"checkbox",name:m,value:x,id:s,tabIndex:b,onChange:me(K.onChange,J),onBlur:me(K.onBlur,_,()=>I(!1)),onFocus:me(K.onFocus,z,()=>I(!0)),onKeyDown:me(K.onKeyDown,ne),onKeyUp:me(K.onKeyUp,ue),required:o,checked:G,disabled:te,readOnly:r,"aria-label":v,"aria-labelledby":w,"aria-invalid":S?!!S:i,"aria-describedby":c,"aria-disabled":n,style:ZD}),[m,x,s,J,_,z,ne,ue,o,G,te,r,v,w,S,i,c,n,b]),ve=y.useCallback((K={},ye=null)=>({...K,ref:ye,onMouseDown:me(K.onMouseDown,a9),"data-disabled":ke(n),"data-checked":ke(G),"data-invalid":ke(i)}),[G,n,i]);return{state:{isInvalid:i,isFocused:j,isChecked:G,isActive:O,isHovered:V,isIndeterminate:g,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:ze,getCheckboxProps:he,getIndicatorProps:Ae,getInputProps:le,getLabelProps:ve,htmlProps:T}}function a9(e){e.preventDefault(),e.stopPropagation()}function Ps(e,t,n,r){const o=ni(n);return y.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i==null||i.removeEventListener(t,o,r)}}function l9(e){return"current"in e}var iT=()=>typeof window<"u";function c9(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var u9=e=>iT()&&e.test(navigator.vendor),d9=e=>iT()&&e.test(c9()),f9=()=>d9(/mac|iphone|ipad|ipod/i),h9=()=>f9()&&u9(/apple/i);function p9(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var i,s;return(s=(i=t.current)==null?void 0:i.ownerDocument)!=null?s:document};Ps(o,"pointerdown",i=>{if(!h9()||!r)return;const s=i.target,l=(n??[t]).some(c=>{const u=l9(c)?c.current:c;return(u==null?void 0:u.contains(s))||u===s});o().activeElement!==s&&l&&(i.preventDefault(),s.focus())})}function m9(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var fg="data-focus-lock",sT="data-focus-lock-disabled",g9="data-no-focus-lock",v9="data-autofocus-inside",y9="data-no-autofocus";function b9(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function w9(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function aT(e,t){return w9(t||null,function(n){return e.forEach(function(r){return b9(r,n)})})}var bp={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},ir=function(){return ir=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=0}).sort(z9)},F9=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ty=F9.join(","),N9="".concat(Ty,", [data-focus-guard]"),ET=function(e,t){return mr((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?N9:Ty)?[r]:[],ET(r))},[])},D9=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Kf([e.contentDocument.body],t):[e]},Kf=function(e,t){return e.reduce(function(n,r){var o,i=ET(r,t),s=(o=[]).concat.apply(o,i.map(function(a){return D9(a,t)}));return n.concat(s,r.parentNode?mr(r.parentNode.querySelectorAll(Ty)).filter(function(a){return a===r}):[])},[])},U9=function(e){var t=e.querySelectorAll("[".concat(v9,"]"));return mr(t).map(function(n){return Kf([n])}).reduce(function(n,r){return n.concat(r)},[])},Py=function(e,t){return mr(e).filter(function(n){return bT(t,n)}).filter(function(n){return L9(n)})},Kw=function(e,t){return t===void 0&&(t=new Map),mr(e).filter(function(n){return wT(t,n)})},pg=function(e,t,n){return CT(Py(Kf(e,n),t),!0,n)},Zw=function(e,t){return CT(Py(Kf(e),t),!1)},V9=function(e,t){return Py(U9(e),t)},_s=function(e,t){return e.shadowRoot?_s(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:mr(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?_s(o,t):!1}return _s(n,t)})},W9=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(s,a){return!t.has(a)})},TT=function(e){return e.parentNode?TT(e.parentNode):e},_y=function(e){var t=kd(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(fg);return n.push.apply(n,o?W9(mr(TT(r).querySelectorAll("[".concat(fg,'="').concat(o,'"]:not([').concat(sT,'="disabled"])')))):[r]),n},[])},H9=function(e){try{return e()}catch{return}},zl=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?zl(t.shadowRoot):t instanceof HTMLIFrameElement&&H9(function(){return t.contentWindow.document})?zl(t.contentWindow.document):t}},G9=function(e,t){return e===t},q9=function(e,t){return!!mr(e.querySelectorAll("iframe")).some(function(n){return G9(n,t)})},PT=function(e,t){return t===void 0&&(t=zl(gT(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:_y(e).some(function(n){return _s(n,t)||q9(n,t)})},K9=function(e){e===void 0&&(e=document);var t=zl(e);return t?mr(e.querySelectorAll("[".concat(g9,"]"))).some(function(n){return _s(n,t)}):!1},Z9=function(e,t){return t.filter(kT).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ry=function(e,t){return kT(e)&&e.name?Z9(e,t):e},Y9=function(e){var t=new Set;return e.forEach(function(n){return t.add(Ry(n,e))}),e.filter(function(n){return t.has(n)})},Yw=function(e){return e[0]&&e.length>1?Ry(e[0],e):e[0]},Qw=function(e,t){return e.length>1?e.indexOf(Ry(e[t],e)):t},_T="NEW_FOCUS",Q9=function(e,t,n,r){var o=e.length,i=e[0],s=e[o-1],a=Ey(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,c=r?t.indexOf(r):l,u=r?e.indexOf(r):-1,d=l-c,f=t.indexOf(i),p=t.indexOf(s),g=Y9(t),m=n!==void 0?g.indexOf(n):-1,x=m-(r?g.indexOf(r):l),b=Qw(e,0),v=Qw(e,o-1);if(l===-1||u===-1)return _T;if(!d&&u>=0)return u;if(l<=f&&a&&Math.abs(d)>1)return v;if(l>=p&&a&&Math.abs(d)>1)return b;if(d&&Math.abs(x)>1)return u;if(l<=f)return v;if(l>p)return b;if(d)return Math.abs(d)>1?u:(o+u+d)%o}},X9=function(e){return function(t){var n,r=(n=xT(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},J9=function(e,t,n){var r=e.map(function(i){var s=i.node;return s}),o=Kw(r.filter(X9(n)));return o&&o.length?Yw(o):Yw(Kw(t))},mg=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&mg(e.parentNode.host||e.parentNode,t),t},wp=function(e,t){for(var n=mg(e),r=mg(t),o=0;o=0)return i}return!1},RT=function(e,t,n){var r=kd(e),o=kd(t),i=r[0],s=!1;return o.filter(Boolean).forEach(function(a){s=wp(s||a,a)||s,n.filter(Boolean).forEach(function(l){var c=wp(i,l);c&&(!s||_s(c,s)?s=c:s=wp(c,s))})}),s},eU=function(e,t){return e.reduce(function(n,r){return n.concat(V9(r,t))},[])},tU=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(B9)},nU=function(e,t){var n=zl(kd(e).length>0?document:gT(e).ownerDocument),r=_y(e).filter(Cd),o=RT(n||e,e,r),i=new Map,s=Zw(r,i),a=pg(r,i).filter(function(p){var g=p.node;return Cd(g)});if(!(!a[0]&&(a=s,!a[0]))){var l=Zw([o],i).map(function(p){var g=p.node;return g}),c=tU(l,a),u=c.map(function(p){var g=p.node;return g}),d=Q9(u,l,n,t);if(d===_T){var f=J9(s,u,eU(r,i));if(f)return{node:f};console.warn("focus-lock: cannot find any node to move focus into");return}return d===void 0?d:c[d]}},rU=function(e){var t=_y(e).filter(Cd),n=RT(e,e,t),r=new Map,o=pg([n],r,!0),i=pg(t,r).filter(function(s){var a=s.node;return Cd(a)}).map(function(s){var a=s.node;return a});return o.map(function(s){var a=s.node,l=s.index;return{node:a,index:l,lockItem:i.indexOf(a)>=0,guard:Ey(a)}})},oU=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},xp=0,Sp=!1,AT=function(e,t,n){n===void 0&&(n={});var r=nU(e,t);if(!Sp&&r){if(xp>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Sp=!0,setTimeout(function(){Sp=!1},1);return}xp++,oU(r.node,n.focusOptions),xp--}};function Ay(e){setTimeout(e,1)}var iU=function(){return document&&document.activeElement===document.body},sU=function(){return iU()||K9()},Rs=null,ms=null,As=null,Fl=!1,aU=function(){return!0},lU=function(t){return(Rs.whiteList||aU)(t)},cU=function(t,n){As={observerNode:t,portaledElement:n}},uU=function(t){return As&&As.portaledElement===t};function Xw(e,t,n,r){var o=null,i=e;do{var s=r[i];if(s.guard)s.node.dataset.focusAutoGuard&&(o=s);else if(s.lockItem){if(i!==e)return;o=null}else break}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var dU=function(t){return t&&"current"in t?t.current:t},fU=function(t){return t?!!Fl:Fl==="meanwhile"},hU=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},pU=function(t,n){return n.some(function(r){return hU(t,r,r)})},Ed=function(){var t=!1;if(Rs){var n=Rs,r=n.observed,o=n.persistentFocus,i=n.autoFocus,s=n.shards,a=n.crossFrame,l=n.focusOptions,c=r||As&&As.portaledElement,u=document&&document.activeElement;if(c){var d=[c].concat(s.map(dU).filter(Boolean));if((!u||lU(u))&&(o||fU(a)||!sU()||!ms&&i)&&(c&&!(PT(d)||u&&pU(u,d)||uU(u))&&(document&&!ms&&u&&!i?(u.blur&&u.blur(),document.body.focus()):(t=AT(d,ms,{focusOptions:l}),As={})),Fl=!1,ms=document&&document.activeElement),document){var f=document&&document.activeElement,p=rU(d),g=p.map(function(m){var x=m.node;return x}).indexOf(f);g>-1&&(p.filter(function(m){var x=m.guard,b=m.node;return x&&b.dataset.focusAutoGuard}).forEach(function(m){var x=m.node;return x.removeAttribute("tabIndex")}),Xw(g,p.length,1,p),Xw(g,-1,-1,p))}}}return t},$T=function(t){Ed()&&t&&(t.stopPropagation(),t.preventDefault())},$y=function(){return Ay(Ed)},mU=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||cU(r,n)},gU=function(){return null},OT=function(){Fl="just",Ay(function(){Fl="meanwhile"})},vU=function(){document.addEventListener("focusin",$T),document.addEventListener("focusout",$y),window.addEventListener("blur",OT)},yU=function(){document.removeEventListener("focusin",$T),document.removeEventListener("focusout",$y),window.removeEventListener("blur",OT)};function bU(e){return e.filter(function(t){var n=t.disabled;return!n})}function wU(e){var t=e.slice(-1)[0];t&&!Rs&&vU();var n=Rs,r=n&&t&&t.id===n.id;Rs=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(ms=null,(!r||n.observed!==t.observed)&&t.onActivation(),Ed(),Ay(Ed)):(yU(),ms=null)}hT.assignSyncMedium(mU);pT.assignMedium($y);k9.assignMedium(function(e){return e({moveFocusInside:AT,focusInside:PT})});const xU=A9(bU,wU)(gU);var jT=y.forwardRef(function(t,n){return y.createElement(mT,ai({sideCar:xU,ref:n},t))}),IT=mT.propTypes||{};IT.sideCar;m9(IT,["sideCar"]);jT.propTypes={};const Jw=jT;function LT(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Oy(e){var t;if(!LT(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function SU(e){var t,n;return(n=(t=MT(e))==null?void 0:t.defaultView)!=null?n:window}function MT(e){return LT(e)?e.ownerDocument:document}function kU(e){return MT(e).activeElement}function CU(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function EU(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function BT(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Oy(e)&&CU(e)?e:BT(EU(e))}var zT=e=>e.hasAttribute("tabindex"),TU=e=>zT(e)&&e.tabIndex===-1;function PU(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function FT(e){return e.parentElement&&FT(e.parentElement)?!0:e.hidden}function _U(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function NT(e){if(!Oy(e)||FT(e)||PU(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():_U(e)?!0:zT(e)}function RU(e){return e?Oy(e)&&NT(e)&&!TU(e):!1}var AU=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],$U=AU.join(),OU=e=>e.offsetWidth>0&&e.offsetHeight>0;function DT(e){const t=Array.from(e.querySelectorAll($U));return t.unshift(e),t.filter(n=>NT(n)&&OU(n))}var ex,jU=(ex=Jw.default)!=null?ex:Jw,UT=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:s,autoFocus:a,persistentFocus:l,lockFocusAcrossFrames:c}=e,u=y.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&DT(r.current).length===0&&requestAnimationFrame(()=>{var g;(g=r.current)==null||g.focus()})},[t,r]),d=y.useCallback(()=>{var p;(p=n==null?void 0:n.current)==null||p.focus()},[n]),f=o&&!n;return h.jsx(jU,{crossFrame:c,persistentFocus:l,autoFocus:a,disabled:s,onActivation:u,onDeactivation:d,returnFocus:f,children:i})};UT.displayName="FocusLock";var IU=rz?y.useLayoutEffect:y.useEffect;function tx(e,t=[]){const n=y.useRef(e);return IU(()=>{n.current=e}),y.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function LU(e,t){const n=y.useId();return y.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function MU(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Ws(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=tx(n),s=tx(t),[a,l]=y.useState(e.defaultIsOpen||!1),[c,u]=MU(r,a),d=LU(o,"disclosure"),f=y.useCallback(()=>{c||l(!1),s==null||s()},[c,s]),p=y.useCallback(()=>{c||l(!0),i==null||i()},[c,i]),g=y.useCallback(()=>{(u?f:p)()},[u,p,f]);return{isOpen:!!u,onOpen:p,onClose:f,onToggle:g,isControlled:c,getButtonProps:(m={})=>({...m,"aria-expanded":u,"aria-controls":d,onClick:lz(m.onClick,g)}),getDisclosureProps:(m={})=>({...m,hidden:!u,id:d})}}var mt=ee(function(t,n){const{htmlSize:r,...o}=t,i=Nr("Input",o),s=ft(o),a=rT(s),l=se("chakra-input",t.className);return h.jsx(Z.input,{size:r,...a,__css:i.field,ref:n,className:l})});mt.displayName="Input";mt.id="Input";var Nl=ee(function(t,n){const r=Gn("Link",t),{className:o,isExternal:i,...s}=ft(t);return h.jsx(Z.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:n,className:se("chakra-link",o),...s,__css:r})});Nl.displayName="Link";var ic=ee(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:s,column:a,row:l,autoFlow:c,autoRows:u,templateRows:d,autoColumns:f,templateColumns:p,...g}=t,m={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:s,gridAutoColumns:f,gridColumn:a,gridRow:l,gridAutoFlow:c,gridAutoRows:u,gridTemplateRows:d,gridTemplateColumns:p};return h.jsx(Z.div,{ref:n,__css:m,...g})});ic.displayName="Grid";function BU(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Wn(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var jy=Z("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});jy.displayName="Spacer";var ce=ee(function(t,n){const r=Gn("Text",t),{className:o,align:i,decoration:s,casing:a,...l}=ft(t),c=bz({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return h.jsx(Z.p,{ref:n,className:se("chakra-text",t.className),...c,...l,__css:r})});ce.displayName="Text";var VT=e=>h.jsx(Z.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});VT.displayName="StackItem";function zU(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":BU(n,o=>r[o])}}var Iy=ee((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:s="0.5rem",wrap:a,children:l,divider:c,className:u,shouldWrapChildren:d,...f}=e,p=n?"row":r??"column",g=y.useMemo(()=>zU({spacing:s,direction:p}),[s,p]),m=!!c,x=!d&&!m,b=y.useMemo(()=>{const w=LD(l);return x?w:w.map((S,k)=>{const T=typeof S.key<"u"?S.key:k,E=k+1===w.length,z=d?h.jsx(VT,{children:S},T):S;if(!m)return z;const L=y.cloneElement(c,{__css:g}),P=E?null:L;return h.jsxs(y.Fragment,{children:[z,P]},T)})},[c,g,m,x,d,l]),v=se("chakra-stack",u);return h.jsx(Z.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:p,flexWrap:a,gap:m?void 0:s,className:v,...f,children:b})});Iy.displayName="Stack";var ol=ee((e,t)=>h.jsx(Iy,{align:"center",...e,direction:"column",ref:t}));ol.displayName="VStack";var Wt=ee((e,t)=>h.jsx(Iy,{align:"center",...e,direction:"row",ref:t}));Wt.displayName="HStack";var Ot=ee(function(t,n){const r=Gn("Heading",t),{className:o,...i}=ft(t);return h.jsx(Z.h2,{ref:n,className:se("chakra-heading",t.className),...i,__css:r})});Ot.displayName="Heading";var ae=Z("div");ae.displayName="Box";var WT=ee(function(t,n){const{size:r,centerContent:o=!0,...i}=t,s=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return h.jsx(ae,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...i})});WT.displayName="Square";var FU=ee(function(t,n){const{size:r,...o}=t;return h.jsx(WT,{size:r,ref:n,borderRadius:"9999px",...o})});FU.displayName="Circle";ee(function(t,n){const{isExternal:r,target:o,rel:i,className:s,...a}=t;return h.jsx(Z.a,{...a,ref:n,className:se("chakra-linkbox__overlay",s),rel:r?"noopener noreferrer":i,target:r?"_blank":o,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});var NU=ee(function(t,n){const{className:r,...o}=t;return h.jsx(Z.div,{ref:n,position:"relative",...o,className:se("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})}),HT=ee(function(t,n){const{className:r,centerContent:o,...i}=ft(t),s=Gn("Container",t);return h.jsx(Z.div,{ref:n,className:se("chakra-container",r),...i,__css:{...s,...o&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});HT.displayName="Container";var Td=ee(function(t,n){const{direction:r,align:o,justify:i,wrap:s,basis:a,grow:l,shrink:c,...u}=t,d={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:s,flexBasis:a,flexGrow:l,flexShrink:c};return h.jsx(Z.div,{ref:n,__css:d,...u})});Td.displayName="Flex";function DU(e){const t=e.current;if(!t)return!1;const n=kU(t);return!n||t.contains(n)?!1:!!RU(n)}function UU(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;jl(()=>{if(!i||DU(e))return;const s=(o==null?void 0:o.current)||e.current;let a;if(s)return a=requestAnimationFrame(()=>{s.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(a)}},[i,e,o])}var VU={preventScroll:!0,shouldFocus:!1};function WU(e,t=VU){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:i}=t,s=HU(e)?e.current:e,a=o&&i,l=y.useRef(a),c=y.useRef(i);Pr(()=>{!c.current&&i&&(l.current=a),c.current=i},[i,a]);const u=y.useCallback(()=>{if(!(!i||!s||!l.current)&&(l.current=!1,!s.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var d;(d=n.current)==null||d.focus({preventScroll:r})});else{const d=DT(s);d.length>0&&requestAnimationFrame(()=>{d[0].focus({preventScroll:r})})}},[i,r,s,n]);jl(()=>{u()},[u]),Ps(s,"transitionend",u)}function HU(e){return"current"in e}var zi=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),tt={arrowShadowColor:zi("--popper-arrow-shadow-color"),arrowSize:zi("--popper-arrow-size","8px"),arrowSizeHalf:zi("--popper-arrow-size-half"),arrowBg:zi("--popper-arrow-bg"),transformOrigin:zi("--popper-transform-origin"),arrowOffset:zi("--popper-arrow-offset")};function GU(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var qU={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},KU=e=>qU[e],nx={scroll:!0,resize:!0};function ZU(e){let t;return typeof e=="object"?t={enabled:!0,options:{...nx,...e}}:t={enabled:e,options:nx},t}var YU={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},QU={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{rx(e)},effect:({state:e})=>()=>{rx(e)}},rx=e=>{e.elements.popper.style.setProperty(tt.transformOrigin.var,KU(e.placement))},XU={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{JU(e)}},JU=e=>{var t;if(!e.placement)return;const n=eV(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:tt.arrowSize.varRef,height:tt.arrowSize.varRef,zIndex:-1});const r={[tt.arrowSizeHalf.var]:`calc(${tt.arrowSize.varRef} / 2 - 1px)`,[tt.arrowOffset.var]:`calc(${tt.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},eV=e=>{if(e.startsWith("top"))return{property:"bottom",value:tt.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:tt.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:tt.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:tt.arrowOffset.varRef}},tV={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{ox(e)},effect:({state:e})=>()=>{ox(e)}},ox=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=GU(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:tt.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},nV={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},rV={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function oV(e,t="ltr"){var n,r;const o=((n=nV[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=rV[e])!=null?r:o}var Zt="top",An="bottom",$n="right",Yt="left",Ly="auto",sc=[Zt,An,$n,Yt],Hs="start",Dl="end",iV="clippingParents",GT="viewport",Ta="popper",sV="reference",ix=sc.reduce(function(e,t){return e.concat([t+"-"+Hs,t+"-"+Dl])},[]),qT=[].concat(sc,[Ly]).reduce(function(e,t){return e.concat([t,t+"-"+Hs,t+"-"+Dl])},[]),aV="beforeRead",lV="read",cV="afterRead",uV="beforeMain",dV="main",fV="afterMain",hV="beforeWrite",pV="write",mV="afterWrite",gV=[aV,lV,cV,uV,dV,fV,hV,pV,mV];function hr(e){return e?(e.nodeName||"").toLowerCase():null}function dn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function pi(e){var t=dn(e).Element;return e instanceof t||e instanceof Element}function Pn(e){var t=dn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function My(e){if(typeof ShadowRoot>"u")return!1;var t=dn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function vV(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!Pn(i)||!hr(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function yV(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!Pn(o)||!hr(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const bV={name:"applyStyles",enabled:!0,phase:"write",fn:vV,effect:yV,requires:["computeStyles"]};function fr(e){return e.split("-")[0]}var ii=Math.max,Pd=Math.min,Gs=Math.round;function gg(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function KT(){return!/^((?!chrome|android).)*safari/i.test(gg())}function qs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Pn(e)&&(o=e.offsetWidth>0&&Gs(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Gs(r.height)/e.offsetHeight||1);var s=pi(e)?dn(e):window,a=s.visualViewport,l=!KT()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,f=r.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function By(e){var t=qs(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function ZT(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&My(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function zr(e){return dn(e).getComputedStyle(e)}function wV(e){return["table","td","th"].indexOf(hr(e))>=0}function Ro(e){return((pi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zf(e){return hr(e)==="html"?e:e.assignedSlot||e.parentNode||(My(e)?e.host:null)||Ro(e)}function sx(e){return!Pn(e)||zr(e).position==="fixed"?null:e.offsetParent}function xV(e){var t=/firefox/i.test(gg()),n=/Trident/i.test(gg());if(n&&Pn(e)){var r=zr(e);if(r.position==="fixed")return null}var o=Zf(e);for(My(o)&&(o=o.host);Pn(o)&&["html","body"].indexOf(hr(o))<0;){var i=zr(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function ac(e){for(var t=dn(e),n=sx(e);n&&wV(n)&&zr(n).position==="static";)n=sx(n);return n&&(hr(n)==="html"||hr(n)==="body"&&zr(n).position==="static")?t:n||xV(e)||t}function zy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function il(e,t,n){return ii(e,Pd(t,n))}function SV(e,t,n){var r=il(e,t,n);return r>n?n:r}function YT(){return{top:0,right:0,bottom:0,left:0}}function QT(e){return Object.assign({},YT(),e)}function XT(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var kV=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,QT(typeof t!="number"?t:XT(t,sc))};function CV(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fr(n.placement),l=zy(a),c=[Yt,$n].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=kV(o.padding,n),f=By(i),p=l==="y"?Zt:Yt,g=l==="y"?An:$n,m=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],x=s[l]-n.rects.reference[l],b=ac(i),v=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,w=m/2-x/2,S=d[p],k=v-f[u]-d[g],T=v/2-f[u]/2+w,E=il(S,T,k),_=l;n.modifiersData[r]=(t={},t[_]=E,t.centerOffset=E-T,t)}}function EV(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||ZT(t.elements.popper,o)&&(t.elements.arrow=o))}const TV={name:"arrow",enabled:!0,phase:"main",fn:CV,effect:EV,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ks(e){return e.split("-")[1]}var PV={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _V(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Gs(n*o)/o||0,y:Gs(r*o)/o||0}}function ax(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,g=s.y,m=g===void 0?0:g,x=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=x.x,m=x.y;var b=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),w=Yt,S=Zt,k=window;if(c){var T=ac(n),E="clientHeight",_="clientWidth";if(T===dn(n)&&(T=Ro(n),zr(T).position!=="static"&&a==="absolute"&&(E="scrollHeight",_="scrollWidth")),T=T,o===Zt||(o===Yt||o===$n)&&i===Dl){S=An;var z=d&&T===k&&k.visualViewport?k.visualViewport.height:T[E];m-=z-r.height,m*=l?1:-1}if(o===Yt||(o===Zt||o===An)&&i===Dl){w=$n;var L=d&&T===k&&k.visualViewport?k.visualViewport.width:T[_];p-=L-r.width,p*=l?1:-1}}var P=Object.assign({position:a},c&&PV),j=u===!0?_V({x:p,y:m},dn(n)):{x:p,y:m};if(p=j.x,m=j.y,l){var I;return Object.assign({},P,(I={},I[S]=v?"0":"",I[w]=b?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},P,(t={},t[S]=v?m+"px":"",t[w]=b?p+"px":"",t.transform="",t))}function RV(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:fr(t.placement),variation:Ks(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ax(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ax(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const AV={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:RV,data:{}};var Qc={passive:!0};function $V(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=dn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Qc)}),a&&l.addEventListener("resize",n.update,Qc),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Qc)}),a&&l.removeEventListener("resize",n.update,Qc)}}const OV={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$V,data:{}};var jV={left:"right",right:"left",bottom:"top",top:"bottom"};function $u(e){return e.replace(/left|right|bottom|top/g,function(t){return jV[t]})}var IV={start:"end",end:"start"};function lx(e){return e.replace(/start|end/g,function(t){return IV[t]})}function Fy(e){var t=dn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ny(e){return qs(Ro(e)).left+Fy(e).scrollLeft}function LV(e,t){var n=dn(e),r=Ro(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=KT();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Ny(e),y:l}}function MV(e){var t,n=Ro(e),r=Fy(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ii(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ii(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Ny(e),l=-r.scrollTop;return zr(o||n).direction==="rtl"&&(a+=ii(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Dy(e){var t=zr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function JT(e){return["html","body","#document"].indexOf(hr(e))>=0?e.ownerDocument.body:Pn(e)&&Dy(e)?e:JT(Zf(e))}function sl(e,t){var n;t===void 0&&(t=[]);var r=JT(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=dn(r),s=o?[i].concat(i.visualViewport||[],Dy(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(sl(Zf(s)))}function vg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function BV(e,t){var n=qs(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function cx(e,t,n){return t===GT?vg(LV(e,n)):pi(t)?BV(t,n):vg(MV(Ro(e)))}function zV(e){var t=sl(Zf(e)),n=["absolute","fixed"].indexOf(zr(e).position)>=0,r=n&&Pn(e)?ac(e):e;return pi(r)?t.filter(function(o){return pi(o)&&ZT(o,r)&&hr(o)!=="body"}):[]}function FV(e,t,n,r){var o=t==="clippingParents"?zV(e):[].concat(t),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=cx(e,c,r);return l.top=ii(u.top,l.top),l.right=Pd(u.right,l.right),l.bottom=Pd(u.bottom,l.bottom),l.left=ii(u.left,l.left),l},cx(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function eP(e){var t=e.reference,n=e.element,r=e.placement,o=r?fr(r):null,i=r?Ks(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case Zt:l={x:s,y:t.y-n.height};break;case An:l={x:s,y:t.y+t.height};break;case $n:l={x:t.x+t.width,y:a};break;case Yt:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?zy(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Hs:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Dl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Ul(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?iV:a,c=n.rootBoundary,u=c===void 0?GT:c,d=n.elementContext,f=d===void 0?Ta:d,p=n.altBoundary,g=p===void 0?!1:p,m=n.padding,x=m===void 0?0:m,b=QT(typeof x!="number"?x:XT(x,sc)),v=f===Ta?sV:Ta,w=e.rects.popper,S=e.elements[g?v:f],k=FV(pi(S)?S:S.contextElement||Ro(e.elements.popper),l,u,s),T=qs(e.elements.reference),E=eP({reference:T,element:w,strategy:"absolute",placement:o}),_=vg(Object.assign({},w,E)),z=f===Ta?_:T,L={top:k.top-z.top+b.top,bottom:z.bottom-k.bottom+b.bottom,left:k.left-z.left+b.left,right:z.right-k.right+b.right},P=e.modifiersData.offset;if(f===Ta&&P){var j=P[o];Object.keys(L).forEach(function(I){var V=[$n,An].indexOf(I)>=0?1:-1,$=[Zt,An].indexOf(I)>=0?"y":"x";L[I]+=j[$]*V})}return L}function NV(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?qT:l,u=Ks(r),d=u?a?ix:ix.filter(function(g){return Ks(g)===u}):sc,f=d.filter(function(g){return c.indexOf(g)>=0});f.length===0&&(f=d);var p=f.reduce(function(g,m){return g[m]=Ul(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[fr(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function DV(e){if(fr(e)===Ly)return[];var t=$u(e);return[lx(e),t,lx(t)]}function UV(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,g=p===void 0?!0:p,m=n.allowedAutoPlacements,x=t.options.placement,b=fr(x),v=b===x,w=l||(v||!g?[$u(x)]:DV(x)),S=[x].concat(w).reduce(function(G,J){return G.concat(fr(J)===Ly?NV(t,{placement:J,boundary:u,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:m}):J)},[]),k=t.rects.reference,T=t.rects.popper,E=new Map,_=!0,z=S[0],L=0;L=0,$=V?"width":"height",O=Ul(t,{placement:P,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),F=V?I?$n:Yt:I?An:Zt;k[$]>T[$]&&(F=$u(F));var B=$u(F),D=[];if(i&&D.push(O[j]<=0),a&&D.push(O[F]<=0,O[B]<=0),D.every(function(G){return G})){z=P,_=!1;break}E.set(P,D)}if(_)for(var H=g?3:1,U=function(J){var te=S.find(function(ne){var ue=E.get(ne);if(ue)return ue.slice(0,J).every(function(he){return he})});if(te)return z=te,"break"},q=H;q>0;q--){var N=U(q);if(N==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const VV={name:"flip",enabled:!0,phase:"main",fn:UV,requiresIfExists:["offset"],data:{_skip:!1}};function ux(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function dx(e){return[Zt,$n,An,Yt].some(function(t){return e[t]>=0})}function WV(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=Ul(t,{elementContext:"reference"}),a=Ul(t,{altBoundary:!0}),l=ux(s,r),c=ux(a,o,i),u=dx(l),d=dx(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const HV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WV};function GV(e,t,n){var r=fr(e),o=[Yt,Zt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Yt,$n].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function qV(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=qT.reduce(function(u,d){return u[d]=GV(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const KV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qV};function ZV(e){var t=e.state,n=e.name;t.modifiersData[n]=eP({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const YV={name:"popperOffsets",enabled:!0,phase:"read",fn:ZV,data:{}};function QV(e){return e==="x"?"y":"x"}function XV(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,x=Ul(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),b=fr(t.placement),v=Ks(t.placement),w=!v,S=zy(b),k=QV(S),T=t.modifiersData.popperOffsets,E=t.rects.reference,_=t.rects.popper,z=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,L=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(T){if(i){var I,V=S==="y"?Zt:Yt,$=S==="y"?An:$n,O=S==="y"?"height":"width",F=T[S],B=F+x[V],D=F-x[$],H=p?-_[O]/2:0,U=v===Hs?E[O]:_[O],q=v===Hs?-_[O]:-E[O],N=t.elements.arrow,G=p&&N?By(N):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:YT(),te=J[V],ne=J[$],ue=il(0,E[O],G[O]),he=w?E[O]/2-H-ue-te-L.mainAxis:U-ue-te-L.mainAxis,Ae=w?-E[O]/2+H+ue+ne+L.mainAxis:q+ue+ne+L.mainAxis,ze=t.elements.arrow&&ac(t.elements.arrow),le=ze?S==="y"?ze.clientTop||0:ze.clientLeft||0:0,ve=(I=P==null?void 0:P[S])!=null?I:0,xt=F+he-ve-le,K=F+Ae-ve,ye=il(p?Pd(B,xt):B,F,p?ii(D,K):D);T[S]=ye,j[S]=ye-F}if(a){var be,at=S==="x"?Zt:Yt,Ur=S==="x"?An:$n,St=T[k],qn=k==="y"?"height":"width",Vr=St+x[at],gn=St-x[Ur],Oi=[Zt,Yt].indexOf(b)!==-1,la=(be=P==null?void 0:P[k])!=null?be:0,hc=Oi?Vr:St-E[qn]-_[qn]-la+L.altAxis,pc=Oi?St+E[qn]+_[qn]-la-L.altAxis:gn,Ao=p&&Oi?SV(hc,St,pc):il(p?hc:Vr,St,p?pc:gn);T[k]=Ao,j[k]=Ao-St}t.modifiersData[r]=j}}const JV={name:"preventOverflow",enabled:!0,phase:"main",fn:XV,requiresIfExists:["offset"]};function e7(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function t7(e){return e===dn(e)||!Pn(e)?Fy(e):e7(e)}function n7(e){var t=e.getBoundingClientRect(),n=Gs(t.width)/e.offsetWidth||1,r=Gs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function r7(e,t,n){n===void 0&&(n=!1);var r=Pn(t),o=Pn(t)&&n7(t),i=Ro(t),s=qs(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((hr(t)!=="body"||Dy(i))&&(a=t7(t)),Pn(t)?(l=qs(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Ny(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function o7(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function i7(e){var t=o7(e);return gV.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function s7(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function a7(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var fx={placement:"bottom",modifiers:[],strategy:"absolute"};function hx(){for(var e=arguments.length,t=new Array(e),n=0;n{}),w=y.useCallback(()=>{var L;!t||!g.current||!m.current||((L=v.current)==null||L.call(v),x.current=u7(g.current,m.current,{placement:b,modifiers:[tV,XU,QU,{...YU,enabled:!!f},{name:"eventListeners",...ZU(s)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:a??[0,l]}},{name:"flip",enabled:!!c,options:{padding:8}},{name:"preventOverflow",enabled:!!d,options:{boundary:u}},...n??[]],strategy:o}),x.current.forceUpdate(),v.current=x.current.destroy)},[b,t,n,f,s,i,a,l,c,d,u,o]);y.useEffect(()=>()=>{var L;!g.current&&!m.current&&((L=x.current)==null||L.destroy(),x.current=null)},[]);const S=y.useCallback(L=>{g.current=L,w()},[w]),k=y.useCallback((L={},P=null)=>({...L,ref:Mt(S,P)}),[S]),T=y.useCallback(L=>{m.current=L,w()},[w]),E=y.useCallback((L={},P=null)=>({...L,ref:Mt(T,P),style:{...L.style,position:o,minWidth:f?void 0:"max-content",inset:"0 auto auto 0"}}),[o,T,f]),_=y.useCallback((L={},P=null)=>{const{size:j,shadowColor:I,bg:V,style:$,...O}=L;return{...O,ref:P,"data-popper-arrow":"",style:d7(L)}},[]),z=y.useCallback((L={},P=null)=>({...L,ref:P,"data-popper-arrow-inner":""}),[]);return{update(){var L;(L=x.current)==null||L.update()},forceUpdate(){var L;(L=x.current)==null||L.forceUpdate()},transformOrigin:tt.transformOrigin.varRef,referenceRef:S,popperRef:T,getPopperProps:E,getArrowProps:_,getArrowInnerProps:z,getReferenceProps:k}}function d7(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}function nP(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=ni(n),s=ni(t),[a,l]=y.useState(e.defaultIsOpen||!1),c=r!==void 0?r:a,u=r!==void 0,d=y.useId(),f=o??`disclosure-${d}`,p=y.useCallback(()=>{u||l(!1),s==null||s()},[u,s]),g=y.useCallback(()=>{u||l(!0),i==null||i()},[u,i]),m=y.useCallback(()=>{c?p():g()},[c,g,p]);function x(v={}){return{...v,"aria-expanded":c,"aria-controls":f,onClick(w){var S;(S=v.onClick)==null||S.call(v,w),m()}}}function b(v={}){return{...v,hidden:!c,id:f}}return{isOpen:c,onOpen:g,onClose:p,onToggle:m,isControlled:u,getButtonProps:x,getDisclosureProps:b}}function f7(e){const{isOpen:t,ref:n}=e,[r,o]=y.useState(t),[i,s]=y.useState(!1);return y.useEffect(()=>{i||(o(t),s(!0))},[t,i,r]),Ps(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var l;const c=SU(n.current),u=new c.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(u)}}}function h7(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var p7={slideInBottom:{...sg,custom:{offsetY:16,reverse:!0}},slideInRight:{...sg,custom:{offsetX:16,reverse:!0}},scale:{...ZE,custom:{initialScale:.95,reverse:!0}},none:{}},m7=Z(_o.section),g7=e=>p7[e||"none"],rP=y.forwardRef((e,t)=>{const{preset:n,motionProps:r=g7(n),...o}=e;return h.jsx(m7,{ref:t,...r,...o})});rP.displayName="ModalTransition";var v7=Object.defineProperty,y7=(e,t,n)=>t in e?v7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b7=(e,t,n)=>(y7(e,typeof t!="symbol"?t+"":t,n),n),w7=class{constructor(){b7(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},yg=new w7;function oP(e,t){const[n,r]=y.useState(0);return y.useEffect(()=>{const o=e.current;if(o){if(t){const i=yg.add(o);r(i)}return()=>{yg.remove(o),r(0)}}},[t,e]),n}var x7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fi=new WeakMap,Xc=new WeakMap,Jc={},kp=0,iP=function(e){return e&&(e.host||iP(e.parentNode))},S7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=iP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},k7=function(e,t,n,r){var o=S7(t,Array.isArray(e)?e:[e]);Jc[n]||(Jc[n]=new WeakMap);var i=Jc[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else{var p=f.getAttribute(r),g=p!==null&&p!=="false",m=(Fi.get(f)||0)+1,x=(i.get(f)||0)+1;Fi.set(f,m),i.set(f,x),s.push(f),m===1&&g&&Xc.set(f,!0),x===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}})};return u(t),a.clear(),kp++,function(){s.forEach(function(d){var f=Fi.get(d)-1,p=i.get(d)-1;Fi.set(d,f),i.set(d,p),f||(Xc.has(d)||d.removeAttribute(r),Xc.delete(d)),p||d.removeAttribute(n)}),kp--,kp||(Fi=new WeakMap,Fi=new WeakMap,Xc=new WeakMap,Jc={})}},C7=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||x7(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),k7(r,o,n,"aria-hidden")):function(){return null}};function E7(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:s=!0,onOverlayClick:a,onEsc:l}=e,c=y.useRef(null),u=y.useRef(null),[d,f,p]=P7(r,"chakra-modal","chakra-modal--header","chakra-modal--body");T7(c,t&&s);const g=oP(c,t),m=y.useRef(null),x=y.useCallback(z=>{m.current=z.target},[]),b=y.useCallback(z=>{z.key==="Escape"&&(z.stopPropagation(),i&&(n==null||n()),l==null||l())},[i,n,l]),[v,w]=y.useState(!1),[S,k]=y.useState(!1),T=y.useCallback((z={},L=null)=>({role:"dialog",...z,ref:Mt(L,c),id:d,tabIndex:-1,"aria-modal":!0,"aria-labelledby":v?f:void 0,"aria-describedby":S?p:void 0,onClick:me(z.onClick,P=>P.stopPropagation())}),[p,S,d,f,v]),E=y.useCallback(z=>{z.stopPropagation(),m.current===z.target&&yg.isTopModal(c.current)&&(o&&(n==null||n()),a==null||a())},[n,o,a]),_=y.useCallback((z={},L=null)=>({...z,ref:Mt(L,u),onClick:me(z.onClick,E),onKeyDown:me(z.onKeyDown,b),onMouseDown:me(z.onMouseDown,x)}),[b,x,E]);return{isOpen:t,onClose:n,headerId:f,bodyId:p,setBodyMounted:k,setHeaderMounted:w,dialogRef:c,overlayRef:u,getDialogProps:T,getDialogContainerProps:_,index:g}}function T7(e,t){const n=e.current;y.useEffect(()=>{if(!(!e.current||!t))return C7(e.current)},[t,e,n])}function P7(e,...t){const n=y.useId(),r=e||n;return y.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[_7,oa]=tn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[R7,mi]=tn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),gi=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:i,initialFocusRef:s,finalFocusRef:a,returnFocusOnClose:l,blockScrollOnMount:c,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:f,lockFocusAcrossFrames:p,onCloseComplete:g}=t,m=Nr("Modal",t),b={...E7(t),autoFocus:o,trapFocus:i,initialFocusRef:s,finalFocusRef:a,returnFocusOnClose:l,blockScrollOnMount:c,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:f,lockFocusAcrossFrames:p};return h.jsx(R7,{value:b,children:h.jsx(_7,{value:m,children:h.jsx(ra,{onExitComplete:g,children:b.isOpen&&h.jsx(na,{...n,children:r})})})})};gi.displayName="Modal";var Ou="right-scroll-bar-position",ju="width-before-scroll-bar",A7="with-scroll-bars-hidden",$7="--removed-body-scroll-bar-size",sP=dT(),Cp=function(){},Yf=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Cp,onWheelCapture:Cp,onTouchMoveCapture:Cp}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,g=e.inert,m=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,v=e.gapMode,w=lT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,k=aT([n,t]),T=ir(ir({},w),o);return y.createElement(y.Fragment,null,u&&y.createElement(S,{sideCar:sP,removeScrollBar:c,shards:d,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:v}),s?y.cloneElement(y.Children.only(a),ir(ir({},T),{ref:k})):y.createElement(b,ir({},T,{className:l,ref:k}),a))});Yf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yf.classNames={fullWidth:ju,zeroRight:Ou};var px,O7=function(){if(px)return px;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function j7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=O7();return t&&e.setAttribute("nonce",t),e}function I7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function L7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var M7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=j7())&&(I7(t,n),L7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},B7=function(){var e=M7();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},aP=function(){var e=B7(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},z7={left:0,top:0,right:0,gap:0},Ep=function(e){return parseInt(e||"",10)||0},F7=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ep(n),Ep(r),Ep(o)]},N7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return z7;var t=F7(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},D7=aP(),U7=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(A7,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Ou,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(ju,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Ou," .").concat(Ou,` { - right: 0 `).concat(r,`; - } - - .`).concat(ju," .").concat(ju,` { - margin-right: 0 `).concat(r,`; - } - - body { - `).concat($7,": ").concat(a,`px; - } -`)},V7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=y.useMemo(function(){return N7(o)},[o]);return y.createElement(D7,{styles:U7(i,!t,o,n?"":"!important")})},bg=!1;if(typeof window<"u")try{var eu=Object.defineProperty({},"passive",{get:function(){return bg=!0,!0}});window.addEventListener("test",eu,eu),window.removeEventListener("test",eu,eu)}catch{bg=!1}var Ni=bg?{passive:!1}:!1,W7=function(e){return e.tagName==="TEXTAREA"},lP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!W7(e)&&n[t]==="visible")},H7=function(e){return lP(e,"overflowY")},G7=function(e){return lP(e,"overflowX")},mx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=cP(e,r);if(o){var i=uP(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},q7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},K7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},cP=function(e,t){return e==="v"?H7(t):G7(t)},uP=function(e,t){return e==="v"?q7(t):K7(t)},Z7=function(e,t){return e==="h"&&t==="rtl"?-1:1},Y7=function(e,t,n,r,o){var i=Z7(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=uP(e,a),g=p[0],m=p[1],x=p[2],b=m-x-i*g;(g||b)&&cP(e,a)&&(d+=b,f+=g),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&d===0||!o&&s>d)||!u&&(o&&f===0||!o&&-s>f))&&(c=!0),c},tu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gx=function(e){return[e.deltaX,e.deltaY]},vx=function(e){return e&&"current"in e?e.current:e},Q7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},X7=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},J7=0,Di=[];function eW(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(J7++)[0],i=y.useState(aP)[0],s=y.useRef(e);y.useEffect(function(){s.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=x9([e.lockRef.current],(e.shards||[]).map(vx),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!s.current.allowPinchZoom;var b=tu(m),v=n.current,w="deltaX"in m?m.deltaX:v[0]-b[0],S="deltaY"in m?m.deltaY:v[1]-b[1],k,T=m.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&E==="h"&&T.type==="range")return!1;var _=mx(E,T);if(!_)return!0;if(_?k=E:(k=E==="v"?"h":"v",_=mx(E,T)),!_)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=k),!k)return!0;var z=r.current||k;return Y7(z,x,m,z==="h"?w:S,!0)},[]),l=y.useCallback(function(m){var x=m;if(!(!Di.length||Di[Di.length-1]!==i)){var b="deltaY"in x?gx(x):tu(x),v=t.current.filter(function(k){return k.name===x.type&&k.target===x.target&&Q7(k.delta,b)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(vx).filter(Boolean).filter(function(k){return k.contains(x.target)}),S=w.length>0?a(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),c=y.useCallback(function(m,x,b,v){var w={name:m,delta:x,target:b,should:v};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=y.useCallback(function(m){n.current=tu(m),r.current=void 0},[]),d=y.useCallback(function(m){c(m.type,gx(m),m.target,a(m,e.lockRef.current))},[]),f=y.useCallback(function(m){c(m.type,tu(m),m.target,a(m,e.lockRef.current))},[]);y.useEffect(function(){return Di.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ni),document.addEventListener("touchmove",l,Ni),document.addEventListener("touchstart",u,Ni),function(){Di=Di.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Ni),document.removeEventListener("touchmove",l,Ni),document.removeEventListener("touchstart",u,Ni)}},[]);var p=e.removeScrollBar,g=e.inert;return y.createElement(y.Fragment,null,g?y.createElement(i,{styles:X7(o)}):null,p?y.createElement(V7,{gapMode:e.gapMode}):null)}const tW=S9(sP,eW);var dP=y.forwardRef(function(e,t){return y.createElement(Yf,ir({},e,{ref:t,sideCar:tW}))});dP.classNames=Yf.classNames;const nW=dP;function rW(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:s,finalFocusRef:a,returnFocusOnClose:l,preserveScrollBarGap:c,lockFocusAcrossFrames:u,isOpen:d}=mi(),[f,p]=PE();y.useEffect(()=>{!f&&p&&setTimeout(p)},[f,p]);const g=oP(r,d);return h.jsx(UT,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:a,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:u,children:h.jsx(nW,{removeScrollBar:!c,allowPinchZoom:s,enabled:g===1&&i,forwardProps:!0,children:e.children})})}var vi=ee((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:i,...s}=e,{getDialogProps:a,getDialogContainerProps:l}=mi(),c=a(s,t),u=l(o),d=se("chakra-modal__content",n),f=oa(),p={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...f.dialog},g={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...f.dialogContainer},{motionPreset:m}=mi();return h.jsx(rW,{children:h.jsx(Z.div,{...u,className:"chakra-modal__content-container",tabIndex:-1,__css:g,children:h.jsx(rP,{preset:m,motionProps:i,className:d,...c,__css:p,children:r})})})});vi.displayName="ModalContent";var Uy=ee((e,t)=>{const{className:n,...r}=e,o=se("chakra-modal__footer",n),s={display:"flex",alignItems:"center",justifyContent:"flex-end",...oa().footer};return h.jsx(Z.footer,{ref:t,...r,__css:s,className:o})});Uy.displayName="ModalFooter";var yi=ee((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=mi();y.useEffect(()=>(i(!0),()=>i(!1)),[i]);const s=se("chakra-modal__header",n),l={flex:0,...oa().header};return h.jsx(Z.header,{ref:t,className:s,id:o,...r,__css:l})});yi.displayName="ModalHeader";var oW=Z(_o.div),bi=ee((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,s=se("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...oa().overlay},{motionPreset:c}=mi(),d=o||(c==="none"?{}:KE);return h.jsx(oW,{...d,__css:l,ref:t,className:s,...i})});bi.displayName="ModalOverlay";var wi=ee((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=mi();y.useEffect(()=>(i(!0),()=>i(!1)),[i]);const s=se("chakra-modal__body",n),a=oa();return h.jsx(Z.div,{ref:t,className:s,id:o,...r,__css:a.body})});wi.displayName="ModalBody";var ia=ee((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=mi(),s=se("chakra-modal__close-btn",r),a=oa();return h.jsx(Gf,{ref:t,__css:a.closeButton,className:s,onClick:me(n,l=>{l.stopPropagation(),i()}),...o})});ia.displayName="ModalCloseButton";var[iW,Ai]=tn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[sW,lc]=tn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),fP=ee(function(t,n){const{getHeaderProps:r}=Ai(),o=lc();return h.jsx(Z.header,{...r(t,n),className:se("chakra-popover__header",t.className),__css:o.header})});fP.displayName="PopoverHeader";function hP(e){const t=y.Children.only(e.children),{getTriggerProps:n}=Ai();return y.cloneElement(t,n(t.props,t.ref))}hP.displayName="PopoverTrigger";var Ui={click:"click",hover:"hover"};function aW(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:i=!0,autoFocus:s=!0,arrowSize:a,arrowShadowColor:l,trigger:c=Ui.click,openDelay:u=200,closeDelay:d=200,isLazy:f,lazyBehavior:p="unmount",computePositionOnMount:g,...m}=e,{isOpen:x,onClose:b,onOpen:v,onToggle:w}=nP(e),S=y.useRef(null),k=y.useRef(null),T=y.useRef(null),E=y.useRef(!1),_=y.useRef(!1);x&&(_.current=!0);const[z,L]=y.useState(!1),[P,j]=y.useState(!1),I=y.useId(),V=o??I,[$,O,F,B]=["popover-trigger","popover-content","popover-header","popover-body"].map(K=>`${K}-${V}`),{referenceRef:D,getArrowProps:H,getPopperProps:U,getArrowInnerProps:q,forceUpdate:N}=tP({...m,enabled:x||!!g}),G=f7({isOpen:x,ref:T});p9({enabled:x,ref:k}),UU(T,{focusRef:k,visible:x,shouldFocus:i&&c===Ui.click}),WU(T,{focusRef:r,visible:x,shouldFocus:s&&c===Ui.click});const J=h7({wasSelected:_.current,enabled:f,mode:p,isSelected:G.present}),te=y.useCallback((K={},ye=null)=>{const be={...K,style:{...K.style,transformOrigin:tt.transformOrigin.varRef,[tt.arrowSize.var]:a?`${a}px`:void 0,[tt.arrowShadowColor.var]:l},ref:Mt(T,ye),children:J?K.children:null,id:O,tabIndex:-1,role:"dialog",onKeyDown:me(K.onKeyDown,at=>{n&&at.key==="Escape"&&b()}),onBlur:me(K.onBlur,at=>{const Ur=yx(at),St=Tp(T.current,Ur),qn=Tp(k.current,Ur);x&&t&&(!St&&!qn)&&b()}),"aria-labelledby":z?F:void 0,"aria-describedby":P?B:void 0};return c===Ui.hover&&(be.role="tooltip",be.onMouseEnter=me(K.onMouseEnter,()=>{E.current=!0}),be.onMouseLeave=me(K.onMouseLeave,at=>{at.nativeEvent.relatedTarget!==null&&(E.current=!1,setTimeout(()=>b(),d))})),be},[J,O,z,F,P,B,c,n,b,x,t,d,l,a]),ne=y.useCallback((K={},ye=null)=>U({...K,style:{visibility:x?"visible":"hidden",...K.style}},ye),[x,U]),ue=y.useCallback((K,ye=null)=>({...K,ref:Mt(ye,S,D)}),[S,D]),he=y.useRef(),Ae=y.useRef(),ze=y.useCallback(K=>{S.current==null&&D(K)},[D]),le=y.useCallback((K={},ye=null)=>{const be={...K,ref:Mt(k,ye,ze),id:$,"aria-haspopup":"dialog","aria-expanded":x,"aria-controls":O};return c===Ui.click&&(be.onClick=me(K.onClick,w)),c===Ui.hover&&(be.onFocus=me(K.onFocus,()=>{he.current===void 0&&v()}),be.onBlur=me(K.onBlur,at=>{const Ur=yx(at),St=!Tp(T.current,Ur);x&&t&&St&&b()}),be.onKeyDown=me(K.onKeyDown,at=>{at.key==="Escape"&&b()}),be.onMouseEnter=me(K.onMouseEnter,()=>{E.current=!0,he.current=window.setTimeout(()=>v(),u)}),be.onMouseLeave=me(K.onMouseLeave,()=>{E.current=!1,he.current&&(clearTimeout(he.current),he.current=void 0),Ae.current=window.setTimeout(()=>{E.current===!1&&b()},d)})),be},[$,x,O,c,ze,w,v,t,b,u,d]);y.useEffect(()=>()=>{he.current&&clearTimeout(he.current),Ae.current&&clearTimeout(Ae.current)},[]);const ve=y.useCallback((K={},ye=null)=>({...K,id:F,ref:Mt(ye,be=>{L(!!be)})}),[F]),xt=y.useCallback((K={},ye=null)=>({...K,id:B,ref:Mt(ye,be=>{j(!!be)})}),[B]);return{forceUpdate:N,isOpen:x,onAnimationComplete:G.onComplete,onClose:b,getAnchorProps:ue,getArrowProps:H,getArrowInnerProps:q,getPopoverPositionerProps:ne,getPopoverProps:te,getTriggerProps:le,getHeaderProps:ve,getBodyProps:xt}}function Tp(e,t){return e===t||(e==null?void 0:e.contains(t))}function yx(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function pP(e){const t=Nr("Popover",e),{children:n,...r}=ft(e),o=Dv(),i=aW({...r,direction:o.direction});return h.jsx(iW,{value:i,children:h.jsx(sW,{value:t,children:Nn(n,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}pP.displayName="Popover";var Pp=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function mP(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:i,boxShadow:s,shadowColor:a}=e,{getArrowProps:l,getArrowInnerProps:c}=Ai(),u=lc(),d=(t=n??r)!=null?t:o,f=i??s;return h.jsx(Z.div,{...l(),className:"chakra-popover__arrow-positioner",children:h.jsx(Z.div,{className:se("chakra-popover__arrow",e.className),...c(e),__css:{"--popper-arrow-shadow-color":Pp("colors",a),"--popper-arrow-bg":Pp("colors",d),"--popper-arrow-shadow":Pp("shadows",f),...u.arrow}})})}mP.displayName="PopoverArrow";var gP=ee(function(t,n){const{getBodyProps:r}=Ai(),o=lc();return h.jsx(Z.div,{...r(t,n),className:se("chakra-popover__body",t.className),__css:o.body})});gP.displayName="PopoverBody";var vP=ee(function(t,n){const{onClose:r}=Ai(),o=lc();return h.jsx(Gf,{size:"sm",onClick:r,className:se("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});vP.displayName="PopoverCloseButton";function lW(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var cW={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},uW=Z(_o.section),yP=ee(function(t,n){const{variants:r=cW,...o}=t,{isOpen:i}=Ai();return h.jsx(uW,{ref:n,variants:lW(r),initial:!1,animate:i?"enter":"exit",...o})});yP.displayName="PopoverTransition";var bP=ee(function(t,n){const{rootProps:r,motionProps:o,...i}=t,{getPopoverProps:s,getPopoverPositionerProps:a,onAnimationComplete:l}=Ai(),c=lc(),u={position:"relative",display:"flex",flexDirection:"column",...c.content};return h.jsx(Z.div,{...a(r),__css:c.popper,className:"chakra-popover__popper",children:h.jsx(yP,{...o,...s(i,n),onAnimationComplete:yO(l,i.onAnimationComplete),className:se("chakra-popover__content",t.className),__css:u})})});bP.displayName="PopoverContent";var wg=ee(function(t,n){const r=Nr("Switch",t),{spacing:o="0.5rem",children:i,...s}=ft(t),{getIndicatorProps:a,getInputProps:l,getCheckboxProps:c,getRootProps:u,getLabelProps:d}=s9(s),f=y.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),p=y.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),g=y.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return h.jsxs(Z.label,{...u(),className:se("chakra-switch",t.className),__css:f,children:[h.jsx("input",{className:"chakra-switch__input",...l({},n)}),h.jsx(Z.span,{...c(),className:"chakra-switch__track",__css:p,children:h.jsx(Z.span,{__css:r.thumb,className:"chakra-switch__thumb",...a()})}),i&&h.jsx(Z.span,{className:"chakra-switch__label",...d(),__css:g,children:i})]})});wg.displayName="Switch";var[dW,cc]=tn({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `}),Qf=ee((e,t)=>{const n=Nr("Table",e),{className:r,layout:o,...i}=ft(e);return h.jsx(dW,{value:n,children:h.jsx(Z.table,{ref:t,__css:{tableLayout:o,...n.table},className:se("chakra-table",r),...i})})});Qf.displayName="Table";var Vy=ee((e,t)=>{const n=cc();return h.jsx(Z.thead,{...e,ref:t,__css:n.thead})}),Zs=ee((e,t)=>{const n=cc();return h.jsx(Z.tr,{...e,ref:t,__css:n.tr})}),Wy=ee((e,t)=>{const n=cc();return h.jsx(Z.tbody,{...e,ref:t,__css:n.tbody})}),At=ee(({isNumeric:e,...t},n)=>{const r=cc();return h.jsx(Z.td,{...t,ref:n,__css:r.td,"data-is-numeric":e})}),$t=ee(({isNumeric:e,...t},n)=>{const r=cc();return h.jsx(Z.th,{...t,ref:n,__css:r.th,"data-is-numeric":e})});function fW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var hW=["h","minH","height","minHeight"],Hy=ee((e,t)=>{const n=Gn("Textarea",e),{className:r,rows:o,...i}=ft(e),s=rT(i),a=o?fW(n,hW):n;return h.jsx(Z.textarea,{ref:t,rows:o,...s,className:se("chakra-textarea",r),__css:a})});Hy.displayName="Textarea";var pW={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},xg=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Iu=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function mW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:i,closeOnPointerDown:s=o,closeOnEsc:a=!0,onOpen:l,onClose:c,placement:u,id:d,isOpen:f,defaultIsOpen:p,arrowSize:g=10,arrowShadowColor:m,arrowPadding:x,modifiers:b,isDisabled:v,gutter:w,offset:S,direction:k,...T}=e,{isOpen:E,onOpen:_,onClose:z}=nP({isOpen:f,defaultIsOpen:p,onOpen:l,onClose:c}),{referenceRef:L,getPopperProps:P,getArrowInnerProps:j,getArrowProps:I}=tP({enabled:E,placement:u,arrowPadding:x,modifiers:b,gutter:w,offset:S,direction:k}),V=y.useId(),O=`tooltip-${d??V}`,F=y.useRef(null),B=y.useRef(),D=y.useCallback(()=>{B.current&&(clearTimeout(B.current),B.current=void 0)},[]),H=y.useRef(),U=y.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=void 0)},[]),q=y.useCallback(()=>{U(),z()},[z,U]),N=gW(F,q),G=y.useCallback(()=>{if(!v&&!B.current){E&&N();const le=Iu(F);B.current=le.setTimeout(_,t)}},[N,v,E,_,t]),J=y.useCallback(()=>{D();const le=Iu(F);H.current=le.setTimeout(q,n)},[n,q,D]),te=y.useCallback(()=>{E&&r&&J()},[r,J,E]),ne=y.useCallback(()=>{E&&s&&J()},[s,J,E]),ue=y.useCallback(le=>{E&&le.key==="Escape"&&J()},[E,J]);Ps(()=>xg(F),"keydown",a?ue:void 0),Ps(()=>{const le=F.current;if(!le)return null;const ve=BT(le);return ve.localName==="body"?Iu(F):ve},"scroll",()=>{E&&i&&q()},{passive:!0,capture:!0}),y.useEffect(()=>{v&&(D(),E&&z())},[v,E,z,D]),y.useEffect(()=>()=>{D(),U()},[D,U]),Ps(()=>F.current,"pointerleave",J);const he=y.useCallback((le={},ve=null)=>({...le,ref:Mt(F,ve,L),onPointerEnter:me(le.onPointerEnter,K=>{K.pointerType!=="touch"&&G()}),onClick:me(le.onClick,te),onPointerDown:me(le.onPointerDown,ne),onFocus:me(le.onFocus,G),onBlur:me(le.onBlur,J),"aria-describedby":E?O:void 0}),[G,J,ne,E,O,te,L]),Ae=y.useCallback((le={},ve=null)=>P({...le,style:{...le.style,[tt.arrowSize.var]:g?`${g}px`:void 0,[tt.arrowShadowColor.var]:m}},ve),[P,g,m]),ze=y.useCallback((le={},ve=null)=>{const xt={...le.style,position:"relative",transformOrigin:tt.transformOrigin.varRef};return{ref:ve,...T,...le,id:O,role:"tooltip",style:xt}},[T,O]);return{isOpen:E,show:G,hide:J,getTriggerProps:he,getTooltipProps:ze,getTooltipPositionerProps:Ae,getArrowProps:I,getArrowInnerProps:j}}var _p="chakra-ui:close-tooltip";function gW(e,t){return y.useEffect(()=>{const n=xg(e);return n.addEventListener(_p,t),()=>n.removeEventListener(_p,t)},[t,e]),()=>{const n=xg(e),r=Iu(e);n.dispatchEvent(new r.CustomEvent(_p))}}function vW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function yW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var bW=Z(_o.div),al=ee((e,t)=>{var n,r;const o=Gn("Tooltip",e),i=ft(e),s=Dv(),{children:a,label:l,shouldWrapChildren:c,"aria-label":u,hasArrow:d,bg:f,portalProps:p,background:g,backgroundColor:m,bgColor:x,motionProps:b,...v}=i,w=(r=(n=g??m)!=null?n:f)!=null?r:x;if(w){o.bg=w;const P=Ij(s,"colors",w);o[tt.arrowBg.var]=P}const S=mW({...v,direction:s.direction}),k=typeof a=="string"||c;let T;if(k)T=h.jsx(Z.span,{display:"inline-block",tabIndex:0,...S.getTriggerProps(),children:a});else{const P=y.Children.only(a);T=y.cloneElement(P,S.getTriggerProps(P.props,P.ref))}const E=!!u,_=S.getTooltipProps({},t),z=E?vW(_,["role","id"]):_,L=yW(_,["role","id"]);return l?h.jsxs(h.Fragment,{children:[T,h.jsx(ra,{children:S.isOpen&&h.jsx(na,{...p,children:h.jsx(Z.div,{...S.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:h.jsxs(bW,{variants:pW,initial:"exit",animate:"enter",exit:"exit",...b,...z,__css:o,children:[l,E&&h.jsx(Z.span,{srOnly:!0,...L,children:u}),d&&h.jsx(Z.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:h.jsx(Z.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):h.jsx(h.Fragment,{children:a})});al.displayName="Tooltip";var Sg={},bx=Fv;Sg.createRoot=bx.createRoot,Sg.hydrateRoot=bx.hydrateRoot;/** - * @remix-run/router v1.8.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Gy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xW(){return Math.random().toString(36).substr(2,8)}function xx(e,t){return{usr:e.state,key:e.key,idx:t}}function kg(e,t,n,r){return n===void 0&&(n=null),Vl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?sa(t):t,{state:n,key:t&&t.key||r||xW()})}function _d(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function sa(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function SW(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=io.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(Vl({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=io.Pop;let x=u(),b=x==null?null:x-c;c=x,l&&l({action:a,location:m.location,delta:b})}function f(x,b){a=io.Push;let v=kg(m.location,x,b);n&&n(v,x),c=u()+1;let w=xx(v,c),S=m.createHref(v);try{s.pushState(w,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(S)}i&&l&&l({action:a,location:m.location,delta:1})}function p(x,b){a=io.Replace;let v=kg(m.location,x,b);n&&n(v,x),c=u();let w=xx(v,c),S=m.createHref(v);s.replaceState(w,"",S),i&&l&&l({action:a,location:m.location,delta:0})}function g(x){let b=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof x=="string"?x:_d(x);return rt(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let m={get action(){return a},get location(){return e(o,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(wx,d),l=x,()=>{o.removeEventListener(wx,d),l=null}},createHref(x){return t(o,x)},createURL:g,encodeLocation(x){let b=g(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(x){return s.go(x)}};return m}var Sx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Sx||(Sx={}));function kW(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?sa(t):t,o=qy(r.pathname||"/",n);if(o==null)return null;let i=wP(e);CW(i);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(rt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=vo([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(rt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),wP(i.children,t,u,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:$W(c,i.index),routesMeta:u})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of xP(i.path))o(i,s,l)}),t}function xP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=xP(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function CW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:OW(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const EW=/^:\w+$/,TW=3,PW=2,_W=1,RW=10,AW=-2,kx=e=>e==="*";function $W(e,t){let n=e.split("/"),r=n.length;return n.some(kx)&&(r+=AW),t&&(r+=PW),n.filter(o=>!kx(o)).reduce((o,i)=>o+(EW.test(i)?TW:i===""?_W:RW),r)}function OW(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function jW(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s{if(u==="*"){let f=a[d]||"";s=i.slice(0,i.length-f.length).replace(/(.)\/+$/,"$1")}return c[u]=BW(a[d]||"",u),c},{}),pathname:i,pathnameBase:s,pattern:e}}function LW(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Gy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function MW(e){try{return decodeURI(e)}catch(t){return Gy(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function BW(e,t){try{return decodeURIComponent(e)}catch(n){return Gy(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function qy(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function zW(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?sa(e):e;return{pathname:n?n.startsWith("/")?n:FW(n,t):t,search:DW(r),hash:UW(o)}}function FW(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Rp(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function SP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kP(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=sa(e):(o=Vl({},e),rt(!o.pathname||!o.pathname.includes("?"),Rp("?","pathname","search",o)),rt(!o.pathname||!o.pathname.includes("#"),Rp("#","pathname","hash",o)),rt(!o.search||!o.search.includes("#"),Rp("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(r||s==null)a=n;else{let d=t.length-1;if(s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=zW(o,a),c=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const vo=e=>e.join("/").replace(/\/\/+/g,"/"),NW=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DW=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,UW=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function VW(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const CP=["post","put","patch","delete"];new Set(CP);const WW=["get",...CP];new Set(WW);/** - * React Router v6.15.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),s=y.useRef(!1);return PP(()=>{s.current=!0}),y.useCallback(function(l,c){if(c===void 0&&(c={}),!s.current)return;if(typeof l=="number"){n.go(l);return}let u=kP(l,JSON.parse(i),o,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:vo([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,i,o,e])}const qW=y.createContext(null);function KW(e){let t=y.useContext(Dr).outlet;return t&&y.createElement(qW.Provider,{value:e},t)}function RP(){let{matches:e}=y.useContext(Dr),t=e[e.length-1];return t?t.params:{}}function Zy(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=y.useContext(Dr),{pathname:o}=aa(),i=JSON.stringify(SP(r).map(s=>s.pathnameBase));return y.useMemo(()=>kP(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function ZW(e,t){return YW(e,t)}function YW(e,t,n){uc()||rt(!1);let{navigator:r}=y.useContext($i),{matches:o}=y.useContext(Dr),i=o[o.length-1],s=i?i.params:{};i&&i.pathname;let a=i?i.pathnameBase:"/";i&&i.route;let l=aa(),c;if(t){var u;let m=typeof t=="string"?sa(t):t;a==="/"||(u=m.pathname)!=null&&u.startsWith(a)||rt(!1),c=m}else c=l;let d=c.pathname||"/",f=a==="/"?d:d.slice(a.length)||"/",p=kW(e,{pathname:f}),g=tH(p&&p.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:vo([a,r.encodeLocation?r.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:vo([a,r.encodeLocation?r.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n);return t&&g?y.createElement(Xf.Provider,{value:{location:Rd({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:io.Pop}},g):g}function QW(){let e=iH(),t=VW(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:o},n):null,i)}const XW=y.createElement(QW,null);class JW extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?y.createElement(Dr.Provider,{value:this.props.routeContext},y.createElement(TP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function eH(e){let{routeContext:t,match:n,children:r}=e,o=y.useContext(Ky);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Dr.Provider,{value:t},r)}function tH(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let a=i.findIndex(l=>l.route.id&&(s==null?void 0:s[l.route.id]));a>=0||rt(!1),i=i.slice(0,Math.min(i.length,a+1))}return i.reduceRight((a,l,c)=>{let u=l.route.id?s==null?void 0:s[l.route.id]:null,d=null;n&&(d=l.route.errorElement||XW);let f=t.concat(i.slice(0,c+1)),p=()=>{let g;return u?g=d:l.route.Component?g=y.createElement(l.route.Component,null):l.route.element?g=l.route.element:g=a,y.createElement(eH,{match:l,routeContext:{outlet:a,matches:f,isDataRoute:n!=null},children:g})};return n&&(l.route.ErrorBoundary||l.route.errorElement||c===0)?y.createElement(JW,{location:n.location,revalidation:n.revalidation,component:d,error:u,children:p(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):p()},null)}var AP=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(AP||{}),Ad=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ad||{});function nH(e){let t=y.useContext(Ky);return t||rt(!1),t}function rH(e){let t=y.useContext(EP);return t||rt(!1),t}function oH(e){let t=y.useContext(Dr);return t||rt(!1),t}function $P(e){let t=oH(),n=t.matches[t.matches.length-1];return n.route.id||rt(!1),n.route.id}function iH(){var e;let t=y.useContext(TP),n=rH(Ad.UseRouteError),r=$P(Ad.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function sH(){let{router:e}=nH(AP.UseNavigateStable),t=$P(Ad.UseNavigateStable),n=y.useRef(!1);return PP(()=>{n.current=!0}),y.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Rd({fromRouteId:t},i)))},[e,t])}function aH(e){return KW(e.context)}function In(e){rt(!1)}function lH(e){let{basename:t="/",children:n=null,location:r,navigationType:o=io.Pop,navigator:i,static:s=!1}=e;uc()&&rt(!1);let a=t.replace(/^\/*/,"/"),l=y.useMemo(()=>({basename:a,navigator:i,static:s}),[a,i,s]);typeof r=="string"&&(r=sa(r));let{pathname:c="/",search:u="",hash:d="",state:f=null,key:p="default"}=r,g=y.useMemo(()=>{let m=qy(c,a);return m==null?null:{location:{pathname:m,search:u,hash:d,state:f,key:p},navigationType:o}},[a,c,u,d,f,p,o]);return g==null?null:y.createElement($i.Provider,{value:l},y.createElement(Xf.Provider,{children:n,value:g}))}function cH(e){let{children:t,location:n}=e;return ZW(Cg(t),n)}new Promise(()=>{});function Cg(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,o)=>{if(!y.isValidElement(r))return;let i=[...t,o];if(r.type===y.Fragment){n.push.apply(n,Cg(r.props.children,i));return}r.type!==In&&rt(!1),!r.props.index||!r.props.children||rt(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Cg(r.props.children,i)),n.push(s)}),n}/** - * React Router DOM v6.15.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function uH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dH(e,t){return e.button===0&&(!t||t==="_self")&&!uH(e)}function Eg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function fH(e,t){let n=Eg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const hH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],pH=["aria-current","caseSensitive","className","end","style","to","children"],mH="startTransition",Cx=Up[mH];function gH(e){let{basename:t,children:n,future:r,window:o}=e,i=y.useRef();i.current==null&&(i.current=wW({window:o,v5Compat:!0}));let s=i.current,[a,l]=y.useState({action:s.action,location:s.location}),{v7_startTransition:c}=r||{},u=y.useCallback(d=>{c&&Cx?Cx(()=>l(d)):l(d)},[l,c]);return y.useLayoutEffect(()=>s.listen(u),[s,u]),y.createElement(lH,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s})}const vH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tg=y.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:c,preventScrollReset:u}=t,d=OP(t,hH),{basename:f}=y.useContext($i),p,g=!1;if(typeof c=="string"&&yH.test(c)&&(p=c,vH))try{let v=new URL(window.location.href),w=c.startsWith("//")?new URL(v.protocol+c):new URL(c),S=qy(w.pathname,f);w.origin===v.origin&&S!=null?c=S+w.search+w.hash:g=!0}catch{}let m=HW(c,{relative:o}),x=bH(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:o});function b(v){r&&r(v),v.defaultPrevented||x(v)}return y.createElement("a",$d({},d,{href:p||m,onClick:g||i?r:b,ref:n,target:l}))}),Pg=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,children:c}=t,u=OP(t,pH),d=Zy(l,{relative:u.relative}),f=aa(),p=y.useContext(EP),{navigator:g}=y.useContext($i),m=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,x=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;o||(x=x.toLowerCase(),b=b?b.toLowerCase():null,m=m.toLowerCase());let v=x===m||!s&&x.startsWith(m)&&x.charAt(m.length)==="/",w=b!=null&&(b===m||!s&&b.startsWith(m)&&b.charAt(m.length)==="/"),S=v?r:void 0,k;typeof i=="function"?k=i({isActive:v,isPending:w}):k=[i,v?"active":null,w?"pending":null].filter(Boolean).join(" ");let T=typeof a=="function"?a({isActive:v,isPending:w}):a;return y.createElement(Tg,$d({},u,{"aria-current":S,className:k,ref:n,style:T,to:l}),typeof c=="function"?c({isActive:v,isPending:w}):c)});var Ex;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(Ex||(Ex={}));var Tx;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Tx||(Tx={}));function bH(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s}=t===void 0?{}:t,a=_P(),l=aa(),c=Zy(e,{relative:s});return y.useCallback(u=>{if(dH(u,n)){u.preventDefault();let d=r!==void 0?r:_d(l)===_d(c);a(e,{replace:d,state:o,preventScrollReset:i,relative:s})}},[l,a,c,r,o,n,e,i,s])}function jP(e){let t=y.useRef(Eg(e)),n=y.useRef(!1),r=aa(),o=y.useMemo(()=>fH(r.search,n.current?null:t.current),[r.search]),i=_P(),s=y.useCallback((a,l)=>{const c=Eg(typeof a=="function"?a(o):a);n.current=!0,i("?"+c,l)},[i,o]);return[o,s]}let wH=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var Wl={};Object.defineProperty(Wl,"__esModule",{value:!0});Wl.bech32m=Dn=Wl.bech32=void 0;const Od="qpzry9x8gf2tvdw0s3jn54khce6mua7l",IP={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function Px(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=$s(t)^r>>5}t=$s(t);for(let n=0;n=n;)i-=n,a.push(o>>i&s);if(r)i>0&&a.push(o<=t)return"Excess padding";if(o<l)throw new TypeError("Exceeds length limit");s=s.toLowerCase();let c=Px(s);if(typeof c=="string")throw new Error(c);let u=s+"1";for(let d=0;d>5)throw new Error("Non 5-bit word");c=$s(c)^f,u+=Od.charAt(f)}for(let d=0;d<6;++d)c=$s(c);c^=t;for(let d=0;d<6;++d){const f=c>>(5-d)*5&31;u+=Od.charAt(f)}return u}function r(s,a){if(a=a||90,s.length<8)return s+" too short";if(s.length>a)return"Exceeds length limit";const l=s.toLowerCase(),c=s.toUpperCase();if(s!==l&&s!==c)return"Mixed-case string "+s;s=l;const u=s.lastIndexOf("1");if(u===-1)return"No separator character for "+s;if(u===0)return"Missing prefix for "+s;const d=s.slice(0,u),f=s.slice(u+1);if(f.length<6)return"Data too short";let p=Px(d);if(typeof p=="string")return p;const g=[];for(let m=0;m=f.length)&&g.push(b)}return p!==t?"Invalid checksum for "+s:{prefix:d,words:g}}function o(s,a){const l=r(s,a);if(typeof l=="object")return l}function i(s,a){const l=r(s,a);if(typeof l=="object")return l;throw new Error(l)}return{decodeUnsafe:o,decode:i,encode:n,toWords:xH,fromWordsUnsafe:SH,fromWords:kH}}var Dn=Wl.bech32=LP("bech32");Wl.bech32m=LP("bech32m");var MP={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(P){if(!Number.isSafeInteger(P))throw new Error(`Wrong integer: ${P}`)}e.assertNumber=t;function n(...P){const j=($,O)=>F=>$(O(F)),I=Array.from(P).reverse().reduce(($,O)=>$?j($,O.encode):O.encode,void 0),V=P.reduce(($,O)=>$?j($,O.decode):O.decode,void 0);return{encode:I,decode:V}}function r(P){return{encode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return j.map(I=>{if(t(I),I<0||I>=P.length)throw new Error(`Digit index outside alphabet: ${I} (alphabet: ${P.length})`);return P[I]})},decode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="string")throw new Error("alphabet.decode input should be array of strings");return j.map(I=>{if(typeof I!="string")throw new Error(`alphabet.decode: not string element=${I}`);const V=P.indexOf(I);if(V===-1)throw new Error(`Unknown letter: "${I}". Allowed: ${P}`);return V})}}}function o(P=""){if(typeof P!="string")throw new Error("join separator should be string");return{encode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="string")throw new Error("join.encode input should be array of strings");for(let I of j)if(typeof I!="string")throw new Error(`join.encode: non-string input=${I}`);return j.join(P)},decode:j=>{if(typeof j!="string")throw new Error("join.decode input should be string");return j.split(P)}}}function i(P,j="="){if(t(P),typeof j!="string")throw new Error("padding chr should be string");return{encode(I){if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("padding.encode input should be array of strings");for(let V of I)if(typeof V!="string")throw new Error(`padding.encode: non-string input=${V}`);for(;I.length*P%8;)I.push(j);return I},decode(I){if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("padding.encode input should be array of strings");for(let $ of I)if(typeof $!="string")throw new Error(`padding.decode: non-string input=${$}`);let V=I.length;if(V*P%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;V>0&&I[V-1]===j;V--)if(!((V-1)*P%8))throw new Error("Invalid padding: string has too much padding");return I.slice(0,V)}}}function s(P){if(typeof P!="function")throw new Error("normalize fn should be function");return{encode:j=>j,decode:j=>P(j)}}function a(P,j,I){if(j<2)throw new Error(`convertRadix: wrong from=${j}, base cannot be less than 2`);if(I<2)throw new Error(`convertRadix: wrong to=${I}, base cannot be less than 2`);if(!Array.isArray(P))throw new Error("convertRadix: data should be array");if(!P.length)return[];let V=0;const $=[],O=Array.from(P);for(O.forEach(F=>{if(t(F),F<0||F>=j)throw new Error(`Wrong integer: ${F}`)});;){let F=0,B=!0;for(let D=V;Dj?l(j,P%j):P,c=(P,j)=>P+(j-l(P,j));function u(P,j,I,V){if(!Array.isArray(P))throw new Error("convertRadix2: data should be array");if(j<=0||j>32)throw new Error(`convertRadix2: wrong from=${j}`);if(I<=0||I>32)throw new Error(`convertRadix2: wrong to=${I}`);if(c(j,I)>32)throw new Error(`convertRadix2: carry overflow from=${j} to=${I} carryBits=${c(j,I)}`);let $=0,O=0;const F=2**I-1,B=[];for(const D of P){if(t(D),D>=2**j)throw new Error(`convertRadix2: invalid data word=${D} from=${j}`);if($=$<32)throw new Error(`convertRadix2: carry overflow pos=${O} from=${j}`);for(O+=j;O>=I;O-=I)B.push(($>>O-I&F)>>>0);$&=2**O-1}if($=$<=j)throw new Error("Excess padding");if(!V&&$)throw new Error(`Non-zero padding: ${$}`);return V&&O>0&&B.push($>>>0),B}function d(P){return t(P),{encode:j=>{if(!(j instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return a(Array.from(j),2**8,P)},decode:j=>{if(!Array.isArray(j)||j.length&&typeof j[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(a(j,P,2**8))}}}function f(P,j=!1){if(t(P),P<=0||P>32)throw new Error("radix2: bits should be in (0..32]");if(c(8,P)>32||c(P,8)>32)throw new Error("radix2: carry overflow");return{encode:I=>{if(!(I instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return u(Array.from(I),8,P,!j)},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(u(I,P,8,j))}}}function p(P){if(typeof P!="function")throw new Error("unsafeWrapper fn should be function");return function(...j){try{return P.apply(null,j)}catch{}}}function g(P,j){if(t(P),typeof j!="function")throw new Error("checksum fn should be function");return{encode(I){if(!(I instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const V=j(I).slice(0,P),$=new Uint8Array(I.length+P);return $.set(I),$.set(V,I.length),$},decode(I){if(!(I instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const V=I.slice(0,-P),$=j(V).slice(0,P),O=I.slice(-P);for(let F=0;FP.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(f(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),o("")),e.base64url=n(f(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),o(""));const m=P=>n(d(58),r(P),o(""));e.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const x=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(P){let j="";for(let I=0;In(g(4,j=>P(P(j))),e.base58);e.base58check=b;const v=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),w=[996825010,642813549,513874426,1027748829,705979059];function S(P){const j=P>>25;let I=(P&33554431)<<5;for(let V=0;V>V&1)===1&&(I^=w[V]);return I}function k(P,j,I=1){const V=P.length;let $=1;for(let O=0;O126)throw new Error(`Invalid prefix (${P})`);$=S($)^F>>5}$=S($);for(let O=0;ON)throw new TypeError(`Length ${G} exceeds limit ${N}`);return U=U.toLowerCase(),`${U}1${v.encode(q)}${k(U,q,j)}`}function B(U,q=90){if(typeof U!="string")throw new Error(`bech32.decode input should be string, not ${typeof U}`);if(U.length<8||q!==!1&&U.length>q)throw new TypeError(`Wrong string length: ${U.length} (${U}). Expected (8..${q})`);const N=U.toLowerCase();if(U!==N&&U!==U.toUpperCase())throw new Error("String must be lowercase or uppercase");U=N;const G=U.lastIndexOf("1");if(G===0||G===-1)throw new Error('Letter "1" must be present between prefix and data only');const J=U.slice(0,G),te=U.slice(G+1);if(te.length<6)throw new Error("Data must be at least 6 characters long");const ne=v.decode(te).slice(0,-6),ue=k(J,ne,j);if(!te.endsWith(ue))throw new Error(`Invalid checksum in ${U}: expected "${ue}"`);return{prefix:J,words:ne}}const D=p(B);function H(U){const{prefix:q,words:N}=B(U,!1);return{prefix:q,words:N,bytes:V(N)}}return{encode:F,decode:B,decodeToBytes:H,decodeUnsafe:D,fromWords:V,fromWordsUnsafe:O,toWords:$}}e.bech32=T("bech32"),e.bech32m=T("bech32m"),e.utf8={encode:P=>new TextDecoder().decode(P),decode:P=>new TextEncoder().encode(P)},e.hex=n(f(4),r("0123456789abcdef"),o(""),s(P=>{if(typeof P!="string"||P.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof P} with length ${P.length}`);return P.toLowerCase()}));const E={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},_=`Invalid encoding type. Available types: ${Object.keys(E).join(", ")}`,z=(P,j)=>{if(typeof P!="string"||!E.hasOwnProperty(P))throw new TypeError(_);if(!(j instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return E[P].encode(j)};e.bytesToString=z,e.str=e.bytesToString;const L=(P,j)=>{if(!E.hasOwnProperty(P))throw new TypeError(_);if(typeof j!="string")throw new TypeError("stringToBytes() expects string");return E[P].decode(j)};e.stringToBytes=L,e.bytes=e.stringToBytes})(MP);const{bech32:nr,hex:Fn,utf8:CH}=MP,_x={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},Rx={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},Ax={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},$x={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},nu=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],EH={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},TH=BigInt("2100000000000000000"),Ox=BigInt(1e11),_g={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},BP={};for(let e=0,t=Object.keys(_g);eFn.encode(nr.fromWordsUnsafe(e)),16:e=>Fn.encode(nr.fromWordsUnsafe(e)),13:e=>CH.encode(nr.fromWordsUnsafe(e)),19:e=>Fn.encode(nr.fromWordsUnsafe(e)),23:e=>Fn.encode(nr.fromWordsUnsafe(e)),27:e=>Fn.encode(nr.fromWordsUnsafe(e)),6:jd,24:jd,3:RH,5:AH};function _H(e){return t=>({tagCode:parseInt(e),words:nr.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function jd(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function RH(e){const t=[];let n,r,o,i,s,a=nr.fromWordsUnsafe(e);for(;a.length>0;)n=Fn.encode(a.slice(0,33)),r=Fn.encode(a.slice(33,41)),o=parseInt(Fn.encode(a.slice(41,45)),16),i=parseInt(Fn.encode(a.slice(45,49)),16),s=parseInt(Fn.encode(a.slice(49,51)),16),a=a.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:o,fee_proportional_millionths:i,cltv_expiry_delta:s});return t}function AH(e){const t=e.slice().reverse().map(o=>[!!(o&1),!!(o&2),!!(o&4),!!(o&8),!!(o&16)]).reduce((o,i)=>o.concat(i),[]);for(;t.length{let s;t[i*2]?s="required":t[i*2+1]?s="supported":s="unsupported",n[o]=s});const r=t.slice(nu.length*2);return n.extra_bits={start_bit:nu.length*2,bits:r,has_required:r.reduce((o,i,s)=>s%2!==0?o||!1:o||i,!1)},n}function zP(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const o=BigInt(r),i=n?o*Ox/EH[n]:o*Ox;if(n==="p"&&o%BigInt(10)!==BigInt(0)||i>TH)throw new Error("Amount is outside of valid range");return t?i.toString():i}function $H(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=nr.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const o=r.prefix;let i=r.words,s=e.slice(o.length+1),a=i.slice(-104);i=i.slice(0,-104);let l=o.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=o.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const c=l[1];let u;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");u=t}else switch(c){case _x.bech32:u=_x;break;case Rx.bech32:u=Rx;break;case Ax.bech32:u=Ax;break;case $x.bech32:u=$x;break}if(!u||u.bech32!==c)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:c,value:u});const d=l[2];let f;if(d){const S=l[3];f=zP(d+S,!0),n.push({name:"amount",letters:l[2]+l[3],value:f})}else f=null;n.push({name:"separator",letters:"1"});const p=jd(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:s.slice(0,7),value:p}),s=s.slice(7);let g,m,x,b;for(;i.length>0;){const S=i[0].toString();g=BP[S]||"unknown_tag",m=PH[S]||_H(S),i=i.slice(1),x=jd(i.slice(0,2)),i=i.slice(2),b=i.slice(0,x),i=i.slice(x),n.push({name:g,tag:s[0],letters:s.slice(0,1+2+x),value:m(b)}),s=s.slice(1+2+x)}n.push({name:"signature",letters:s.slice(0,104),value:Fn.encode(nr.fromWordsUnsafe(a))}),s=s.slice(104),n.push({name:"checksum",letters:s});let v={paymentRequest:e,sections:n,get expiry(){let S=n.find(k=>k.name==="expiry");if(S)return w("timestamp")+S.value},get route_hints(){return n.filter(S=>S.name==="route_hint").map(S=>S.value)}};for(let S in _g)S!=="route_hint"&&Object.defineProperty(v,S,{get(){return w(S)}});return v;function w(S){let k=n.find(T=>T.name===S);return k?k.value:void 0}}var OH={decode:$H,hrpToMillisat:zP};function Rg(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function jH(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function FP(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function IH(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Rg(e.outputLen),Rg(e.blockLen)}function LH(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function MH(e,t){FP(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,$p=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Yn=(e,t)=>e<<32-t|e>>>t,BH=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!BH)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function zH(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Qy(e){if(typeof e=="string"&&(e=zH(e)),!NP(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function FH(...e){const t=new Uint8Array(e.reduce((r,o)=>r+o.length,0));let n=0;return e.forEach(r=>{if(!NP(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class DP{clone(){return this._cloneInto()}}function UP(e){const t=r=>e().update(Qy(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function VP(e=32){if(Ap&&typeof Ap.getRandomValues=="function")return Ap.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function NH(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),s=Number(n>>o&i),a=Number(n&i),l=r?4:0,c=r?0:4;e.setUint32(t+l,s,r),e.setUint32(t+c,a,r)}class DH extends DP{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=$p(this.buffer)}update(t){Zo.exists(this);const{view:n,buffer:r,blockLen:o}=this;t=Qy(t);const i=t.length;for(let s=0;so-s&&(this.process(r,0),s=0);for(let d=s;du.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;de&t^~e&n,VH=(e,t,n)=>e&t^e&n^t&n,WH=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Kr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Zr=new Uint32Array(64);class WP extends DH{constructor(){super(64,32,8,!1),this.A=Kr[0]|0,this.B=Kr[1]|0,this.C=Kr[2]|0,this.D=Kr[3]|0,this.E=Kr[4]|0,this.F=Kr[5]|0,this.G=Kr[6]|0,this.H=Kr[7]|0}get(){const{A:t,B:n,C:r,D:o,E:i,F:s,G:a,H:l}=this;return[t,n,r,o,i,s,a,l]}set(t,n,r,o,i,s,a,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=s|0,this.G=a|0,this.H=l|0}process(t,n){for(let d=0;d<16;d++,n+=4)Zr[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const f=Zr[d-15],p=Zr[d-2],g=Yn(f,7)^Yn(f,18)^f>>>3,m=Yn(p,17)^Yn(p,19)^p>>>10;Zr[d]=m+Zr[d-7]+g+Zr[d-16]|0}let{A:r,B:o,C:i,D:s,E:a,F:l,G:c,H:u}=this;for(let d=0;d<64;d++){const f=Yn(a,6)^Yn(a,11)^Yn(a,25),p=u+f+UH(a,l,c)+WH[d]+Zr[d]|0,m=(Yn(r,2)^Yn(r,13)^Yn(r,22))+VH(r,o,i)|0;u=c,c=l,l=a,a=s+p|0,s=i,i=o,o=r,r=p+m|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,o,i,s,a,l,c,u)}roundClean(){Zr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class HH extends WP{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const Id=UP(()=>new WP);UP(()=>new HH);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const HP=BigInt(0),Jf=BigInt(1),GH=BigInt(2),eh=e=>e instanceof Uint8Array,qH=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function pr(e){if(!eh(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+o.length,0));let n=0;return e.forEach(r=>{if(!eh(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function ZH(e,t){if(e.length!==t.length)return!1;for(let n=0;nHP;e>>=Jf,t+=1);return t}function XH(e,t){return e>>BigInt(t)&Jf}const JH=(e,t,n)=>e|(n?Jf:HP)<(GH<new Uint8Array(e),jx=e=>Uint8Array.from(e);function KP(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Op(e),o=Op(e),i=0;const s=()=>{r.fill(1),o.fill(0),i=0},a=(...d)=>n(o,r,...d),l=(d=Op())=>{o=a(jx([0]),d),r=a(),d.length!==0&&(o=a(jx([1]),d),r=a())},c=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d{s(),l(d);let p;for(;!(p=f(c()));)l();return s(),p}}const eG={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function dc(e,t,n={}){const r=(o,i,s)=>{const a=eG[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=e[o];if(!(s&&l===void 0)&&!a(l,e))throw new Error(`Invalid param ${String(o)}=${l} (${typeof l}), expected ${i}`)};for(const[o,i]of Object.entries(t))r(o,i,!1);for(const[o,i]of Object.entries(n))r(o,i,!0);return e}const tG=Object.freeze(Object.defineProperty({__proto__:null,bitGet:XH,bitLen:QH,bitMask:e0,bitSet:JH,bytesToHex:pr,bytesToNumberBE:Qt,bytesToNumberLE:Jy,concatBytes:xi,createHmacDrbg:KP,ensureBytes:gt,equalBytes:ZH,hexToBytes:Ys,hexToNumber:Xy,numberToBytesBE:yo,numberToBytesLE:qP,numberToHexUnpadded:GP,numberToVarBytesBE:KH,utf8ToBytes:YH,validateObject:dc},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ct=BigInt(0),Ye=BigInt(1),Uo=BigInt(2),nG=BigInt(3),Ag=BigInt(4),Ix=BigInt(5),Lx=BigInt(8);BigInt(9);BigInt(16);function yt(e,t){const n=e%t;return n>=ct?n:t+n}function rG(e,t,n){if(n<=ct||t 0");if(n===Ye)return ct;let r=Ye;for(;t>ct;)t&Ye&&(r=r*e%n),e=e*e%n,t>>=Ye;return r}function wn(e,t,n){let r=e;for(;t-- >ct;)r*=r,r%=n;return r}function $g(e,t){if(e===ct||t<=ct)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=yt(e,t),r=t,o=ct,i=Ye;for(;n!==ct;){const a=r/n,l=r%n,c=o-i*a;r=n,n=l,o=i,i=c}if(r!==Ye)throw new Error("invert: does not exist");return yt(o,t)}function oG(e){const t=(e-Ye)/Uo;let n,r,o;for(n=e-Ye,r=0;n%Uo===ct;n/=Uo,r++);for(o=Uo;o(r[o]="function",r),t);return dc(e,n)}function lG(e,t,n){if(n 0");if(n===ct)return e.ONE;if(n===Ye)return t;let r=e.ONE,o=t;for(;n>ct;)n&Ye&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Ye;return r}function cG(e,t){const n=new Array(t.length),r=t.reduce((i,s,a)=>e.is0(s)?i:(n[a]=i,e.mul(i,s)),e.ONE),o=e.inv(r);return t.reduceRight((i,s,a)=>e.is0(s)?i:(n[a]=e.mul(i,n[a]),e.mul(i,s)),o),n}function t0(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function uG(e,t,n=!1,r={}){if(e<=ct)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:i}=t0(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=iG(e),a=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:e0(o),ZERO:ct,ONE:Ye,create:l=>yt(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return ct<=l&&ll===ct,isOdd:l=>(l&Ye)===Ye,neg:l=>yt(-l,e),eql:(l,c)=>l===c,sqr:l=>yt(l*l,e),add:(l,c)=>yt(l+c,e),sub:(l,c)=>yt(l-c,e),mul:(l,c)=>yt(l*c,e),pow:(l,c)=>lG(a,l,c),div:(l,c)=>yt(l*$g(c,e),e),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>$g(l,e),sqrt:r.sqrt||(l=>s(a,l)),invertBatch:l=>cG(a,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?qP(l,i):yo(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?Jy(l):Qt(l)}});return Object.freeze(a)}function dG(e,t,n=!1){e=gt("privateHash",e);const r=e.length,o=t0(t).nByteLength+8;if(o<24||r1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${r}`);const i=n?Jy(e):Qt(e);return yt(i,t-Ye)+Ye}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fG=BigInt(0),jp=BigInt(1);function hG(e,t){const n=(o,i)=>{const s=i.negate();return o?s:i},r=o=>{const i=Math.ceil(t/o)+1,s=2**(o-1);return{windows:i,windowSize:s}};return{constTimeNegate:n,unsafeLadder(o,i){let s=e.ZERO,a=o;for(;i>fG;)i&jp&&(s=s.add(a)),a=a.double(),i>>=jp;return s},precomputeWindow(o,i){const{windows:s,windowSize:a}=r(i),l=[];let c=o,u=c;for(let d=0;d>=p,x>l&&(x-=f,s+=jp);const b=m,v=m+Math.abs(x)-1,w=g%2!==0,S=x<0;x===0?u=u.add(n(w,i[b])):c=c.add(n(S,i[v]))}return{p:c,f:u}},wNAFCached(o,i,s,a){const l=o._WINDOW_SIZE||1;let c=i.get(o);return c||(c=this.precomputeWindow(o,l),l!==1&&i.set(o,a(c))),this.wNAF(l,c,s)}}}function ZP(e){return aG(e.Fp),dc(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...t0(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function pG(e){const t=ZP(e);dc(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:mG,hexToBytes:gG}=tG,Yo={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Yo;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:mG(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Yo,n=typeof e=="string"?gG(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:o,l:i}=Yo._parseInt(n.subarray(2)),{d:s,l:a}=Yo._parseInt(i);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s}},hexFromSig(e){const t=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,s=o.length/2,a=n(i),l=n(s);return`30${n(s+i+4)}02${l}${o}02${a}${r}`}},Sr=BigInt(0),Sn=BigInt(1);BigInt(2);const Mx=BigInt(3);BigInt(4);function vG(e){const t=pG(e),{Fp:n}=t,r=t.toBytes||((g,m,x)=>{const b=m.toAffine();return xi(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),o=t.fromBytes||(g=>{const m=g.subarray(1),x=n.fromBytes(m.subarray(0,n.BYTES)),b=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x,y:b}});function i(g){const{a:m,b:x}=t,b=n.sqr(g),v=n.mul(b,g);return n.add(n.add(v,n.mul(g,m)),x)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function s(g){return typeof g=="bigint"&&Srn.eql(w,n.ZERO);return v(x)&&v(b)?d.ZERO:new d(x,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const x=n.invertBatch(m.map(b=>b.pz));return m.map((b,v)=>b.toAffine(x[v])).map(d.fromAffine)}static fromHex(m){const x=d.fromAffine(o(gt("pointHex",m)));return x.assertValidity(),x}static fromPrivateKey(m){return d.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,c.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:m,y:x}=this.toAffine();if(!n.isValid(m)||!n.isValid(x))throw new Error("bad point: x or y not FE");const b=n.sqr(x),v=i(m);if(!n.eql(b,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){u(m);const{px:x,py:b,pz:v}=this,{px:w,py:S,pz:k}=m,T=n.eql(n.mul(x,k),n.mul(w,v)),E=n.eql(n.mul(b,k),n.mul(S,v));return T&&E}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:x}=t,b=n.mul(x,Mx),{px:v,py:w,pz:S}=this;let k=n.ZERO,T=n.ZERO,E=n.ZERO,_=n.mul(v,v),z=n.mul(w,w),L=n.mul(S,S),P=n.mul(v,w);return P=n.add(P,P),E=n.mul(v,S),E=n.add(E,E),k=n.mul(m,E),T=n.mul(b,L),T=n.add(k,T),k=n.sub(z,T),T=n.add(z,T),T=n.mul(k,T),k=n.mul(P,k),E=n.mul(b,E),L=n.mul(m,L),P=n.sub(_,L),P=n.mul(m,P),P=n.add(P,E),E=n.add(_,_),_=n.add(E,_),_=n.add(_,L),_=n.mul(_,P),T=n.add(T,_),L=n.mul(w,S),L=n.add(L,L),_=n.mul(L,P),k=n.sub(k,_),E=n.mul(L,z),E=n.add(E,E),E=n.add(E,E),new d(k,T,E)}add(m){u(m);const{px:x,py:b,pz:v}=this,{px:w,py:S,pz:k}=m;let T=n.ZERO,E=n.ZERO,_=n.ZERO;const z=t.a,L=n.mul(t.b,Mx);let P=n.mul(x,w),j=n.mul(b,S),I=n.mul(v,k),V=n.add(x,b),$=n.add(w,S);V=n.mul(V,$),$=n.add(P,j),V=n.sub(V,$),$=n.add(x,v);let O=n.add(w,k);return $=n.mul($,O),O=n.add(P,I),$=n.sub($,O),O=n.add(b,v),T=n.add(S,k),O=n.mul(O,T),T=n.add(j,I),O=n.sub(O,T),_=n.mul(z,$),T=n.mul(L,I),_=n.add(T,_),T=n.sub(j,_),_=n.add(j,_),E=n.mul(T,_),j=n.add(P,P),j=n.add(j,P),I=n.mul(z,I),$=n.mul(L,$),j=n.add(j,I),I=n.sub(P,I),I=n.mul(z,I),$=n.add($,I),P=n.mul(j,$),E=n.add(E,P),P=n.mul(O,$),T=n.mul(V,T),T=n.sub(T,P),P=n.mul(V,j),_=n.mul(O,_),_=n.add(_,P),new d(T,E,_)}subtract(m){return this.add(m.negate())}is0(){return this.equals(d.ZERO)}wNAF(m){return p.wNAFCached(this,c,m,x=>{const b=n.invertBatch(x.map(v=>v.pz));return x.map((v,w)=>v.toAffine(b[w])).map(d.fromAffine)})}multiplyUnsafe(m){const x=d.ZERO;if(m===Sr)return x;if(a(m),m===Sn)return this;const{endo:b}=t;if(!b)return p.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:S,k2:k}=b.splitScalar(m),T=x,E=x,_=this;for(;w>Sr||k>Sr;)w&Sn&&(T=T.add(_)),k&Sn&&(E=E.add(_)),_=_.double(),w>>=Sn,k>>=Sn;return v&&(T=T.negate()),S&&(E=E.negate()),E=new d(n.mul(E.px,b.beta),E.py,E.pz),T.add(E)}multiply(m){a(m);let x=m,b,v;const{endo:w}=t;if(w){const{k1neg:S,k1:k,k2neg:T,k2:E}=w.splitScalar(x);let{p:_,f:z}=this.wNAF(k),{p:L,f:P}=this.wNAF(E);_=p.constTimeNegate(S,_),L=p.constTimeNegate(T,L),L=new d(n.mul(L.px,w.beta),L.py,L.pz),b=_.add(L),v=z.add(P)}else{const{p:S,f:k}=this.wNAF(x);b=S,v=k}return d.normalizeZ([b,v])[0]}multiplyAndAddUnsafe(m,x,b){const v=d.BASE,w=(k,T)=>T===Sr||T===Sn||!k.equals(v)?k.multiplyUnsafe(T):k.multiply(T),S=w(this,x).add(w(m,b));return S.is0()?void 0:S}toAffine(m){const{px:x,py:b,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const S=n.mul(x,m),k=n.mul(b,m),T=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(T,n.ONE))throw new Error("invZ was invalid");return{x:S,y:k}}isTorsionFree(){const{h:m,isTorsionFree:x}=t;if(m===Sn)return!0;if(x)return x(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:x}=t;return m===Sn?this:x?x(d,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),r(d,this,m)}toHex(m=!0){return pr(this.toRawBytes(m))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const f=t.nBitLength,p=hG(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:s}}function yG(e){const t=ZP(e);return dc(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function bG(e){const t=yG(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function s($){return Sr<$&&$pr(yo($,t.nByteLength));function g($){const O=r>>Sn;return $>O}function m($){return g($)?a(-$):$}const x=($,O,F)=>Qt($.slice(O,F));class b{constructor(O,F,B){this.r=O,this.s=F,this.recovery=B,this.assertValidity()}static fromCompact(O){const F=t.nByteLength;return O=gt("compactSignature",O,F*2),new b(x(O,0,F),x(O,F,2*F))}static fromDER(O){const{r:F,s:B}=Yo.toSig(gt("DER",O));return new b(F,B)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(O){return new b(this.r,this.s,O)}recoverPublicKey(O){const{r:F,s:B,recovery:D}=this,H=E(gt("msgHash",O));if(D==null||![0,1,2,3].includes(D))throw new Error("recovery id invalid");const U=D===2||D===3?F+t.n:F;if(U>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const q=D&1?"03":"02",N=c.fromHex(q+p(U)),G=l(U),J=a(-H*G),te=a(B*G),ne=c.BASE.multiplyAndAddUnsafe(N,J,te);if(!ne)throw new Error("point at infinify");return ne.assertValidity(),ne}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Ys(this.toDERHex())}toDERHex(){return Yo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ys(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const v={isValidPrivateKey($){try{return u($),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const $=t.randomBytes(n.BYTES+8),O=dG($,r);return yo(O,t.nByteLength)},precompute($=8,O=c.BASE){return O._setWindowSize($),O.multiply(BigInt(3)),O}};function w($,O=!0){return c.fromPrivateKey($).toRawBytes(O)}function S($){const O=$ instanceof Uint8Array,F=typeof $=="string",B=(O||F)&&$.length;return O?B===o||B===i:F?B===2*o||B===2*i:$ instanceof c}function k($,O,F=!0){if(S($))throw new Error("first arg must be private key");if(!S(O))throw new Error("second arg must be public key");return c.fromHex(O).multiply(u($)).toRawBytes(F)}const T=t.bits2int||function($){const O=Qt($),F=$.length*8-t.nBitLength;return F>0?O>>BigInt(F):O},E=t.bits2int_modN||function($){return a(T($))},_=e0(t.nBitLength);function z($){if(typeof $!="bigint")throw new Error("bigint expected");if(!(Sr<=$&&$<_))throw new Error(`bigint expected < 2^${t.nBitLength}`);return yo($,t.nByteLength)}function L($,O,F=P){if(["recovered","canonical"].some(he=>he in F))throw new Error("sign() legacy options not supported");const{hash:B,randomBytes:D}=t;let{lowS:H,prehash:U,extraEntropy:q}=F;H==null&&(H=!0),$=gt("msgHash",$),U&&($=gt("prehashed msgHash",B($)));const N=E($),G=u(O),J=[z(G),z(N)];if(q!=null){const he=q===!0?D(n.BYTES):q;J.push(gt("extraEntropy",he,n.BYTES))}const te=xi(...J),ne=N;function ue(he){const Ae=T(he);if(!f(Ae))return;const ze=l(Ae),le=c.BASE.multiply(Ae).toAffine(),ve=a(le.x);if(ve===Sr)return;const xt=a(ze*a(ne+ve*G));if(xt===Sr)return;let K=(le.x===ve?0:2)|Number(le.y&Sn),ye=xt;return H&&g(xt)&&(ye=m(xt),K^=1),new b(ve,ye,K)}return{seed:te,k2sig:ue}}const P={lowS:t.lowS,prehash:!1},j={lowS:t.lowS,prehash:!1};function I($,O,F=P){const{seed:B,k2sig:D}=L($,O,F),H=t;return KP(H.hash.outputLen,H.nByteLength,H.hmac)(B,D)}c.BASE._setWindowSize(8);function V($,O,F,B=j){var le;const D=$;if(O=gt("msgHash",O),F=gt("publicKey",F),"strict"in B)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:U}=B;let q,N;try{if(typeof D=="string"||D instanceof Uint8Array)try{q=b.fromDER(D)}catch(ve){if(!(ve instanceof Yo.Err))throw ve;q=b.fromCompact(D)}else if(typeof D=="object"&&typeof D.r=="bigint"&&typeof D.s=="bigint"){const{r:ve,s:xt}=D;q=new b(ve,xt)}else throw new Error("PARSE");N=c.fromHex(F)}catch(ve){if(ve.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&q.hasHighS())return!1;U&&(O=t.hash(O));const{r:G,s:J}=q,te=E(O),ne=l(J),ue=a(te*ne),he=a(G*ne),Ae=(le=c.BASE.multiplyAndAddUnsafe(N,ue,he))==null?void 0:le.toAffine();return Ae?a(Ae.x)===G:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:k,sign:I,verify:V,ProjectivePoint:c,Signature:b,utils:v}}class YP extends DP{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Zo.hash(t);const r=Qy(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let s=0;snew YP(e,t).update(n).digest();QP.create=(e,t)=>new YP(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function wG(e){return{hash:e,hmac:(t,...n)=>QP(e,t,FH(...n)),randomBytes:VP}}function xG(e,t){const n=r=>bG({...e,...wG(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const th=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ld=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),XP=BigInt(1),Md=BigInt(2),Bx=(e,t)=>(e+t/Md)/t;function JP(e){const t=th,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),c=e*e*e%t,u=c*c*e%t,d=wn(u,n,t)*u%t,f=wn(d,n,t)*u%t,p=wn(f,Md,t)*c%t,g=wn(p,o,t)*p%t,m=wn(g,i,t)*g%t,x=wn(m,a,t)*m%t,b=wn(x,l,t)*x%t,v=wn(b,a,t)*m%t,w=wn(v,n,t)*u%t,S=wn(w,s,t)*g%t,k=wn(S,r,t)*c%t,T=wn(k,Md,t);if(!Og.eql(Og.sqr(T),e))throw new Error("Cannot find square root");return T}const Og=uG(th,void 0,void 0,{sqrt:JP}),n0=xG({a:BigInt(0),b:BigInt(7),Fp:Og,n:Ld,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ld,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-XP*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,s=BigInt("0x100000000000000000000000000000000"),a=Bx(i*e,t),l=Bx(-r*e,t);let c=yt(e-a*n-l*o,t),u=yt(-a*r-l*i,t);const d=c>s,f=u>s;if(d&&(c=t-c),f&&(u=t-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:f,k2:u}}}},Id),nh=BigInt(0),e_=e=>typeof e=="bigint"&&nhtypeof e=="bigint"&&nho.charCodeAt(0)));n=xi(r,r),zx[e]=n}return Id(xi(n,...t))}const r0=e=>e.toRawBytes(!0).slice(1),jg=e=>yo(e,32),Ip=e=>yt(e,th),Hl=e=>yt(e,Ld),o0=n0.ProjectivePoint,kG=(e,t,n)=>o0.BASE.multiplyAndAddUnsafe(e,t,n);function Ig(e){let t=n0.utils.normPrivateKeyToScalar(e),n=o0.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Hl(-t),bytes:r0(n)}}function t_(e){if(!e_(e))throw new Error("bad x: need 0 < x < p");const t=Ip(e*e),n=Ip(t*e+BigInt(7));let r=JP(n);r%Md!==nh&&(r=Ip(-r));const o=new o0(e,r,XP);return o.assertValidity(),o}function n_(...e){return Hl(Qt(Bd("BIP0340/challenge",...e)))}function CG(e){return Ig(e).bytes}function EG(e,t,n=VP(32)){const r=gt("message",e),{bytes:o,scalar:i}=Ig(t),s=gt("auxRand",n,32),a=jg(i^Qt(Bd("BIP0340/aux",s))),l=Bd("BIP0340/nonce",a,o,r),c=Hl(Qt(l));if(c===nh)throw new Error("sign failed: k is zero");const{bytes:u,scalar:d}=Ig(c),f=n_(u,o,r),p=new Uint8Array(64);if(p.set(u,0),p.set(jg(Hl(d+f*i)),32),!r_(p,r,o))throw new Error("sign: Invalid signature produced");return p}function r_(e,t,n){const r=gt("signature",e,64),o=gt("message",t),i=gt("publicKey",n,32);try{const s=t_(Qt(i)),a=Qt(r.subarray(0,32));if(!e_(a))return!1;const l=Qt(r.subarray(32,64));if(!SG(l))return!1;const c=n_(jg(a),r0(s),o),u=kG(s,l,Hl(-c));return!(!u||!u.hasEvenY()||u.toAffine().x!==a)}catch{return!1}}const Lg=(()=>({getPublicKey:CG,sign:EG,verify:r_,utils:{randomPrivateKey:n0.utils.randomPrivateKey,lift_x:t_,pointToBytes:r0,numberToBytesBE:yo,bytesToNumberBE:Qt,taggedHash:Bd,mod:yt}}))();var fc=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(fc||{}),fn=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(fn||{}),o_=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(o_||{}),za=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(za||{});function i_(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function TG(e){const t=[];for(const i of e){const s=new Uint8Array([i.type]);let a;i.type===1?a=new TextEncoder().encode(i.value):i.type===3?a=new Uint32Array([i.value]):a=i_(i.value);const l=new Uint8Array([a.length]);t.push(s),t.push(l),t.push(a)}let n=t.reduce((i,s)=>i+s.length,0);const r=new Uint8Array(n);let o=0;for(const i of t)r.set(i,o),o+=i.length;return r}function PG(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=s_(t.value),{type:t.type,value:n}})}function RG(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=i_(t[0].value):n=TG(t);const r=Dn.toWords(new Uint8Array(n.buffer));return Dn.encode(e,r,1023)}function AG(e){const{prefix:t,words:n}=Dn.decode(e,1023),r=new Uint8Array(Dn.fromWords(n));let o;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")o=[{type:0,value:s_(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=PG(r);o=_G(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:o}}function $G(e){return OH.decode(e)}function OG(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function jG(e){return["amount",e]}function a_(e){let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"&&(n=r[1]),r.length===3&&r[2]==="content-warning"&&r[0]==="l"&&(n=r[1]));return t?n:void 0}var IG=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/,LG=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g;function l_(e){if(typeof e!="string")return null;const t=e.match(IG);return t&&t.length===3?{prefix:t[1],bech32:`${t[1]}${t[2]}`}:null}function MG(e){return l_(e)!==null}function BG(e){const t=l_(e);return t===null?null:AG(t.bech32)}function zG(e,t){return`nostr:${RG(e,t)}`}function FG(e){return zG("npub",[{type:0,value:e}])}function i0(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function NG(e,t){if(!c_(e,t).isValid)return;const r=/(.*)?(wss:\/\/[a-zA-Z0-9.-]+)/,o={message:void 0,relayUrl:void 0,nurls:[]},i=r.exec(e);if(i)return o.message=i[1]?i[1].trim():void 0,o.relayUrl=i[2],o;const s=[],a=[];let l,c;const u=[];for(;(c=LG.exec(e))!==null;){const f=c[0];if(MG(f)){const p=BG(f);if(l=p.prefix,l==="npub"&&p.tlvItems.length>0){const g=p.tlvItems.filter(x=>x.type===0);if(g.length===0)continue;const m=g[0].value;s.push(m),u.push({index:c.index,length:f.length,replaceWith:m})}else if(l==="nprofile"){const g=p.tlvItems.filter(b=>b.type===0);if(g.length===0)continue;const m=g[0].value;s.push(m),u.push({index:c.index,length:f.length,replaceWith:m});const x=p.tlvItems.filter(b=>b.type===1);if(x.length===0)continue;for(const b of x)i0(b.value)?a.push(b.value):console.error(`Invalid relay url ${b.value}`)}}}let d=0;for(const{index:f,length:p,replaceWith:g}of u){const m=f+d;e=e.slice(0,m)+g+e.slice(m+p),d+=g.length-p}if(s.length>0&&l)return o.message=e.trim(),o.nurls=[{type:"npub",publicKeys:s,relayUrls:a}],o}function DG(e){if(!e)return"";let t=e.message?`${e.message} `:"";if(e.relayUrl)return`${t} ${e.relayUrl}`.trim();if(!e.nurls||e.nurls.length===0)return t.trim();for(const n of e.nurls)if(n.type==="npub")t+=`${FG(n.publicKeys[0])} `;else throw new Error(`Unsupported nurl type ${n.type}`);return t.trim()}function c_(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!i0(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return UG(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function UG(e){return/<[^>]*>/.test(e)}function VG(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let o=r[0],i=r[1],s=r[2],a;n.length===3&&(a=n[2]),t.push({kind:o,pubkey:i,identifier:s,relay:a})}if(t.length!==0)return t}function WG(e){const t=VG(e.tags);if(t)return t}function HG(e){const{kind:t,pubkey:n,identifier:r,relay:o}=e;return o?[`a:${t}:${n}:${r}, ${o}`]:[`a:${t}:${n}:${r}`]}function GG(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function qG(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function KG(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function ZG(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function YG(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let o=r[1]||"";t.includes(o)||t.push(o)}return t&&t.length>0?t:void 0}}function QG(e){return["d",e]}function XG(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function JG(e){return["lnurl",e]}function eq(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function tq(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function nq(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function rq(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function oq(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function iq(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(a=>a[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(a=>a[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let o;t[0].length===3?o=t[0][2]:r.length>0&&r[0].length===3&&(o=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!o||!i?void 0:{eventId:n,kind:o,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function sq(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const o=[];return t?(o.push(["e",t,n]),r&&o.push(["p",r])):r&&o.push(["p",r,n]),o}function aq(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function u_(e){return e?e.startsWith("Re:"):!1}function lq(e){return u_(e)?e:`Re: ${e}`}function cq(){const e=Lg.utils.randomPrivateKey(),t=Lg.getPublicKey(e);return{privateKey:pr(e),publicKey:pr(t)}}function uq(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var dq=new TextEncoder;new TextDecoder("utf-8");function d_(e){const t=Id(dq.encode(e));return pr(t)}function fq({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function hq(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function pq(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const o=$G(t.pr);let i;const s=o.sections.find(a=>a.name==="amount");if(s)i=s.value;else return!1;return!(n&&n.toString()!==i)}function mq(e){const t=new en(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],o=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:o};return JSON.stringify(i)}var gq=new TextEncoder,Fx=new TextDecoder;function vq(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function yq(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=Dn.decode(e,2e4),n=new Uint8Array(Dn.fromWords(t));return Fx.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=vq(e);if(t){const{words:n}=Dn.decode(t,2e4),r=new Uint8Array(Dn.fromWords(n));return Fx.decode(r)}return e}throw new Error(`invalid url ${e}`)}function bq(e){const t=gq.encode(e),n=Dn.toWords(new Uint8Array(t));return Dn.encode("lnurl",n,2e4)}function f_(e){return e.endsWith(".onion")}function wq(e){const[t,n]=e.split("@");return`${f_(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function xq(e){const[t,n]=e.split("@");return`${f_(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function Sq(e){let t=0;for(let n=0;nl[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),o]);const s=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=d_(s),Sq(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(l=>l[0]!=="nonce"),e.tags.push(["nonce",r.toString(),o]),e;if(n&&r>=n)return;r++}}function s0(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function Cq(e){return e.toLowerCase()}function Eq(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=Lg.sign(e,t);return pr(n)}function Tq(e){return e?JSON.stringify(e):""}function Pq(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var _q=class{constructor(e){if(e){if(!s0(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=Cq(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(h_(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function h_(e){return!(e.length!==3||!Object.values(o_).includes(e[1].split(":")[0])||!s0(e[1].split(":")[1]))}function p_(e){const t=e.tags.filter(r=>r[0]==="i"&&h_(r));if(t.length===0)return;const n=[];for(const r of t){const o=new _q;o.fromTag(r),n.push(o)}return n}var en=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=uq(this.ToObj());this.id=d_(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,console.log(`Signing event ${this.id} with ${e.publicKey}`),this.sig=Eq(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=kq(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}mentionUsers(e){if(!this.extractContent())this.content=DG({message:this.content,nurls:[{type:"npub",publicKeys:e}]});else throw new Error("Already has motified content")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t[0].publicKeys:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return NG(this.content,this.kind)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return KG(this)?qG(this):GG(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return rq(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return oq(this)}addEventCoordinatesTag(e){this.addTag(HG(e))}hasEventCoordinatesTags(){return WG(this)}addIdentifierTag(e){this.addTag(QG(e))}hasIdentifierTags(){return YG(this)}addLnurlTag(e){this.addTag(JG(e))}hasLnurlTags(){return XG(this)}addAmountTag(e){this.addTag(jG(e))}hasAmountTags(){return OG(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return ZG(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return aq(this)}addNonceTag(e){const t=tq(this,e);this.tags=t.tags}hasNonceTag(){return eq(this)}replaceNonceTag(e){const t=nq(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return a_(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return p_(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");sq(e).forEach(n=>this.addTag(n))}hasReportTags(){return iq(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return zq({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=c_(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function Rq(e){const t=new en({content:e.text,kind:1});return e.subject&&t.addSubjectTag(e.subject),t}function Aq(e){const t=new en({content:e.text,kind:e.isDraft?30024:30023});return e.identifier&&t.addEventTag({eventId:e.identifier}),t}function $q(e){const t=new en({content:e.text,kind:1}),n=new en(e.inResponseTo);if(n.kind!==1)throw new Error("Event you are responding to be SHORT_TEXT_NOTE");const r=n.hasSubjectTag();r?u_(r)?t.addSubjectTag(r):t.addSubjectTag(lq(r)):console.log("Event you are responding to does not have a subject.");const o=n.hasEventTags(),i=o?o.find(l=>l.marker==="root"):void 0;i?(t.addEventTag({eventId:i.eventId,relayUrl:e.relayUrl,marker:"root"}),t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"reply"})):t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"root"});const s=n.hasPublicKeyTags(),a=[];s&&a.push(s),a.push([n.pubkey,e.relayUrl]);for(const l of a)t.addPublicKeyTag(l[0],l[1]);return t}function Oq(e){if(e.text!=="+"&&e.text!=="-")throw new Error("Reaction must be either '+' or '-'");const t=new en({content:e.text,kind:7,tags:[]});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function jq(e){const t=new en({content:JSON.stringify({...e.inResponseTo,relay:e.relayUrl}),kind:6});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function Iq(e){const t=new en({content:Tq(e.userMetadata),kind:0,tags:[]});if(e.claims)for(const n of e.claims)s0(n.identity)?t.addExternalIdentityClaimTag(n):console.log("Invalid provider name",n.identity);return e.mastodonUrl&&t.addTag(["mostr",e.mastodonUrl]),t}function Lq(e){if(!i0(e.relayUrl))throw new Error("Invalid server URL");const t=new en({content:e.relayUrl,kind:2});return e.nonce&&t.addNonceTag(e.nonce),t}function Mq(e){const t=new en({content:"",kind:9734});return t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function Bq(e,t,n){const r=Mq(e);r.signAndGenerateId(n);const o=r.toURI();return{event:r,eventUri:o,invoiceUrl:fq({callback:t,amount:e.amount,event:o,lnurl:e.lnurl})}}function zq(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=mq(e.zapRequest),o=new en({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&o.addEventTag({eventId:n[1]}),e.preimage&&o.addTag(["preimage",e.preimage]),o}var Si=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},Fq=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new en(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const o=Pq(n.content);o&&(this.data=o)}const r=p_(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return xq(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return wq(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return yq(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new Si;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}};/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const m_=Symbol("Comlink.proxy"),Nq=Symbol("Comlink.endpoint"),Dq=Symbol("Comlink.releaseProxy"),Lp=Symbol("Comlink.finalizer"),Lu=Symbol("Comlink.thrown"),g_=e=>typeof e=="object"&&e!==null||typeof e=="function",Uq={canHandle:e=>g_(e)&&e[m_],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y_(e,t),[n,[n]]},deserialize(e){return e.start(),w_(e)}},Vq={canHandle:e=>g_(e)&&Lu in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},v_=new Map([["proxy",Uq],["throw",Vq]]);function Wq(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function y_(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!Wq(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:i,type:s,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(Vo);let c;try{const u=a.slice(0,-1).reduce((f,p)=>f[p],e),d=a.reduce((f,p)=>f[p],e);switch(s){case"GET":c=d;break;case"SET":u[a.slice(-1)[0]]=Vo(o.data.value),c=!0;break;case"APPLY":c=d.apply(u,l);break;case"CONSTRUCT":{const f=new d(...l);c=Yq(f)}break;case"ENDPOINT":{const{port1:f,port2:p}=new MessageChannel;y_(e,p),c=Zq(f,[f])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[Lu]:0}}Promise.resolve(c).catch(u=>({value:u,[Lu]:0})).then(u=>{const[d,f]=Nd(u);t.postMessage(Object.assign(Object.assign({},d),{id:i}),f),s==="RELEASE"&&(t.removeEventListener("message",r),b_(t),Lp in e&&typeof e[Lp]=="function"&&e[Lp]())}).catch(u=>{const[d,f]=Nd({value:new TypeError("Unserializable return value"),[Lu]:0});t.postMessage(Object.assign(Object.assign({},d),{id:i}),f)})}),t.start&&t.start()}function Hq(e){return e.constructor.name==="MessagePort"}function b_(e){Hq(e)&&e.close()}function w_(e,t){return Mg(e,[],t)}function ru(e){if(e)throw new Error("Proxy has been released and is not useable")}function x_(e){return Hi(e,{type:"RELEASE"}).then(()=>{b_(e)})}const zd=new WeakMap,Fd="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(zd.get(e)||0)-1;zd.set(e,t),t===0&&x_(e)});function Gq(e,t){const n=(zd.get(t)||0)+1;zd.set(t,n),Fd&&Fd.register(e,t,e)}function qq(e){Fd&&Fd.unregister(e)}function Mg(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(i,s){if(ru(r),s===Dq)return()=>{qq(o),x_(e),r=!0};if(s==="then"){if(t.length===0)return{then:()=>o};const a=Hi(e,{type:"GET",path:t.map(l=>l.toString())}).then(Vo);return a.then.bind(a)}return Mg(e,[...t,s])},set(i,s,a){ru(r);const[l,c]=Nd(a);return Hi(e,{type:"SET",path:[...t,s].map(u=>u.toString()),value:l},c).then(Vo)},apply(i,s,a){ru(r);const l=t[t.length-1];if(l===Nq)return Hi(e,{type:"ENDPOINT"}).then(Vo);if(l==="bind")return Mg(e,t.slice(0,-1));const[c,u]=Nx(a);return Hi(e,{type:"APPLY",path:t.map(d=>d.toString()),argumentList:c},u).then(Vo)},construct(i,s){ru(r);const[a,l]=Nx(s);return Hi(e,{type:"CONSTRUCT",path:t.map(c=>c.toString()),argumentList:a},l).then(Vo)}});return Gq(o,e),o}function Kq(e){return Array.prototype.concat.apply([],e)}function Nx(e){const t=e.map(Nd);return[t.map(n=>n[0]),Kq(t.map(n=>n[1]))]}const S_=new WeakMap;function Zq(e,t){return S_.set(e,t),e}function Yq(e){return Object.assign(e,{[m_]:!0})}function Nd(e){for(const[t,n]of v_)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},S_.get(e)||[]]}function Vo(e){switch(e.type){case"HANDLER":return v_.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Hi(e,t,n){return new Promise(r=>{const o=Qq();e.addEventListener("message",function i(s){!s.data||!s.data.id||s.data.id!==o||(e.removeEventListener("message",i),r(s.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function Qq(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const Dx=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,d))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,a),a},Xq=e=>e?Dx(e):Dx;var k_={exports:{}},C_={},E_={exports:{}},T_={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Qs=y;function Jq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var eK=typeof Object.is=="function"?Object.is:Jq,tK=Qs.useState,nK=Qs.useEffect,rK=Qs.useLayoutEffect,oK=Qs.useDebugValue;function iK(e,t){var n=t(),r=tK({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return rK(function(){o.value=n,o.getSnapshot=t,Mp(o)&&i({inst:o})},[e,n,t]),nK(function(){return Mp(o)&&i({inst:o}),e(function(){Mp(o)&&i({inst:o})})},[e]),oK(n),n}function Mp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!eK(e,n)}catch{return!0}}function sK(e,t){return t()}var aK=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sK:iK;T_.useSyncExternalStore=Qs.useSyncExternalStore!==void 0?Qs.useSyncExternalStore:aK;E_.exports=T_;var lK=E_.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var rh=y,cK=lK;function uK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dK=typeof Object.is=="function"?Object.is:uK,fK=cK.useSyncExternalStore,hK=rh.useRef,pK=rh.useEffect,mK=rh.useMemo,gK=rh.useDebugValue;C_.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=hK(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=mK(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),o!==void 0&&s.hasValue){var g=s.value;if(o(g,p))return d=g}return d=p}if(g=d,dK(u,p))return g;var m=r(p);return o!==void 0&&o(g,m)?g:(u=p,d=m)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=fK(e,i[0],i[1]);return pK(function(){s.hasValue=!0,s.value=a},[a]),gK(a),a};k_.exports=C_;var vK=k_.exports;const yK=Xe(vK),{useSyncExternalStoreWithSelector:bK}=yK;function wK(e,t=e.getState,n){const r=bK(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return y.useDebugValue(r),r}const Ux=e=>{const t=typeof e=="function"?Xq(e):e,n=(r,o)=>wK(t,r,o);return Object.assign(n,t),n},xK=e=>e?Ux(e):Ux,bo=25,P_={"wss://relay.shitforce.one":{read:!0,write:!0},"wss://relay.nostr.band":{read:!0,write:!0}};function SK(){const e=localStorage.getItem("nostr-client:keystore:keystore");if(e)if(e==="localstore"){const t=localStorage.getItem("nostr-client:keystore:public-key"),n=localStorage.getItem("nostr-client:keystore:private-key");if(t&&n)return{keystore:"localstore",publicKey:t,privateKey:n}}else{if(e==="nos2x")return{keystore:"nos2x",publicKey:void 0,privateKey:void 0};if(e==="download")return{keystore:"download",publicKey:void 0,privateKey:void 0}}return{keystore:"none",publicKey:void 0,privateKey:void 0}}function Bp(e){localStorage.setItem("nostr-client:keystore:keystore",e.keystore),e.keystore==="localstore"&&e.publicKey&&e.privateKey?(localStorage.setItem("nostr-client:keystore:public-key",e.publicKey),localStorage.setItem("nostr-client:keystore:private-key",e.privateKey)):e.keystore==="nos2x"||e.keystore}const Vx=new Worker(new URL("/nostr-ts/assets/worker-fa83cfed.js",self.location),{type:"module"});function kK(e,t){let n=null,r=[];return function(o){r.push(o),n||(n=setTimeout(()=>{e(r),r=[],n=null},t))}}const Y=xK((e,t)=>({store:w_(Vx),init:async n=>{await t().loadKeyStore(),await t().store.init(n);const o=kK(s=>{s.forEach(a=>{const l=a.data;if(l.type==="event:new"||l.type==="event:update"){const c=l.data;l.type==="event:new"?t().addEvent(c):l.type==="event:update"&&t().updateEvent(c)}else if(l.type==="relay:message"){const c=l.data;e({relayEvents:[...t().relayEvents,c]})}else l.type==="event:queue:update"&&t().updateQueueItem(l.data)})},100);Vx.addEventListener("message",o);const i=await t().store.getAllUsersFollowing();i&&e({followingUserIds:i.map(s=>s.user.pubkey)})},connected:!1,connect:async n=>{t().connected||(await t().store.connect(n),e({connected:!0}))},disconnect:async()=>{await t().store.disconnect(),e({connected:!1})},getRelays:async()=>t().store.getRelays(),updateRelay:async(n,r)=>t().store.updateRelay(n,r),relayEvents:[],getSubscriptions:async()=>t().store.getSubscriptions(),subscribe:async n=>t().store.subscribe(n),unsubscribe:async n=>(console.log(`Unsubscribing ${n}`),t().store.unsubscribe(n)),unsubscribeAll:async()=>(console.log("Unsubscribing all"),t().store.unsubscribeAll()),keystore:"none",loadKeyStore:()=>{const n=SK();e({keystore:n.keystore}),n.keystore==="localstore"&&n.publicKey&&n.privateKey&&e({keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0})},saveKeyStore:()=>{const n=t().keystore;if(n==="localstore"){const r=t().keypair;Bp(r?{keystore:n,publicKey:r.publicKey,privateKey:r.privateKey}:{keystore:n})}},resetKeyStore:()=>{Bp({keystore:"none"}),e({keystore:"none",keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1})},setKeyStore:n=>{n.keystore==="localstore"?(console.log(`Setting keystore for ${n.keystore}`,n),n.publicKey&&n.privateKey&&(e({keystore:n.keystore,keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().saveKeyStore())):n.keystore==="nos2x"?e({keystore:n.keystore,keypair:{publicKey:n.publicKey||""}}):console.error(`Unknown keystore ${n.keystore}`)},keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1,newEvent:new en({kind:fn.SHORT_TEXT_NOTE}),setNewEvent:n=>{e({newEvent:n})},newEventName:"NewShortTextNote",setNewEventName:n=>{e({newEventName:n})},setNewEventContent:n=>{e({newEvent:t().newEvent.setContentWithoutChecks(n)})},count:async n=>t().store.count(n),events:[],addEvent:n=>{e({events:[...t().events,n]})},updateEvent:n=>{const r=t().events.findIndex(o=>o.event.id===n.event.id);if(r!==-1){const o=[...t().events];o[r]=n,e({events:o})}},maxEvents:bo,setMaxEvents:async n=>{await t().store.setMaxEvents(n),e({maxEvents:n})},determineApplicableRelays:async n=>{const r=await t().getRelays();return{relays:(n.relayUrls&&n.relayUrls.length>0?r.filter(i=>{var s;return(s=n.relayUrls)==null?void 0:s.includes(i.url)}):r).filter(i=>i.isReady&&i.write===!0),pow:0}},generateQueueItems:async n=>{let r=[];const{relays:o}=await t().determineApplicableRelays(n);if(n.relayUrls&&n.relayUrls.length>0?r=o.filter(s=>{var a;return(a=n.relayUrls)==null?void 0:a.includes(s.url)}):r=o,r.length===0)return;const i=[];for(const s of r)if(s.isReady&&s.write){const{relayUrls:a,...l}=n,c={...l,id:wH(),relayUrl:s.url,send:!1};i.push(c)}return i},addQueueItems:n=>{e({eventsPublishingQueue:[...t().eventsPublishingQueue,...n]})},updateQueueItem:async n=>{const r=t().eventsPublishingQueue,o=r.findIndex(i=>i.event.id===n.event.id);if(o!==-1){const i=[...r];i[o]=n,e({eventsPublishingQueue:i})}},getUser:async n=>t().store.getUser(n),addUser:async n=>t().store.addUser(n),updateUser:async n=>t().store.updateUser(n),countUsers:async()=>t().store.countUsers(),getEventById:n=>t().store.getEventById(n),eventProofOfWork:async(n,r)=>new Promise(o=>{const i=new Worker(new URL("/nostr-ts/assets/pow-worker-2b80afb9.js",self.location),{type:"module"});i.onmessage=function(s){o(s.data.result),i.terminate()},i.postMessage({event:n,bits:r})}),sendEvent:async n=>t().store.sendEvent(n),signAndSendEvent:async n=>{var f,p,g,m;const r=t().keypair;if(!r)throw new Error("Keypair not initialized");const o=t().keystore;let i=n.event;i.pubkey=r.publicKey,i.generateId();let s=n.relayUrls;const{relays:a,pow:l}=await t().determineApplicableRelays(n);if(a.length===0)throw(s==null?void 0:s.length)===0?new Error(`None of the required relays are available: ${s.join(", ")}.`):new Error("No write-enabled relays available.");s=a.map(x=>x.url);let c=n.pow;const u=l;if(c&&c!==0){if(c0){const x=await t().generateQueueItems({...n,relayUrls:s,pow:c});x&&(d=x),(p=(f=t()).addQueueItems)==null||p.call(f,d);const b=await t().eventProofOfWork(n.event,c);i=new en(b);for(const v of d)v.event=i,v.powDone=Date.now()}if(o==="localstore")i.sign({privateKey:r.privateKey||"",publicKey:r.publicKey});else if(o==="nos2x")if(window.nostr&&window.nostr.signEvent){const x=await window.nostr.signEvent(i.ToObj());if(!x.sig)throw new Error("No signature");i.sig=x.sig}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore");if(i.isReadyToPublishOrThrow(),d.length===0){const x=await t().generateQueueItems({...n,relayUrls:s,pow:c,event:i});x&&(d=x),(m=(g=t()).addQueueItems)==null||m.call(g,d)}else for(const x of d)x.event=i,t().updateQueueItem(x);return await t().store.sendQueueItems(d),i.id},eventsPublishingQueue:[],clearEvents:async()=>{await t().store.clearEvents(),e({events:[]})},followUser:async n=>{await t().store.followUser(n);const r=await t().store.getAllUsersFollowing();r&&e({followingUserIds:r.map(o=>o.user.pubkey)})},unfollowUser:async n=>{await t().store.unfollowUser(n);const r=await t().store.getAllUsersFollowing();r&&e({followingUserIds:r.map(o=>o.user.pubkey)})},followingUser:async n=>t().store.followingUser(n),followingUserIds:[],getAllUsersFollowing:async()=>t().store.getAllUsersFollowing(),updateUserFollowing:async n=>t().store.updateUserFollowing(n),requestInformation:(n,r)=>t().store.requestInformation(n,r),hasSubscriptionForEventIds:async(n,r)=>t().store.hasSubscriptionForEventIds(n,r),hasViewSubscription:async n=>(await t().getSubscriptions()).some(o=>o.options&&o.options.view===n),setViewSubscription:async(n,r)=>{const o=await t().getSubscriptions(),i=[];for(const l of o)l.options&&l.options.view&&i.push(l.id);i.length>0&&await t().unsubscribe(i);const s=await t().getRelays();await t().subscribe({type:fc.REQ,filters:{...r,limit:r.limit?Math.round(r.limit/s.length):void 0},options:{view:n,timeoutIn:15e3}});const a=async()=>{var m,x;const l=[],c=[];for(const b of t().events)(m=b.event)!=null&&m.pubkey&&!((x=b.user)!=null&&x.pubkey)&&l.push({pubkey:b.event.pubkey,relayUrls:b.eventRelayUrls}),b.reactions||c.push({id:b.event.id,relayUrls:b.eventRelayUrls});const u={};for(const b of l)for(const v of b.relayUrls)u[v]||(u[v]=new Set),u[v].add(b.pubkey);const d=Object.entries(u).map(([b,v])=>({source:"users",relayUrl:b,idsOrKeys:[...v]})),f={};for(const b of c)for(const v of b.relayUrls)f[v]||(f[v]=new Set),f[v].add(b.id);const p=Object.entries(f).map(([b,v])=>({source:"events:related",relayUrl:b,idsOrKeys:[...v]})),g=[];for(const b of[...d,...p])g.push(await t().requestInformation(b,{timeoutIn:6e4,view:n}))};setTimeout(a,1e3),setTimeout(a,6e3)},removeViewSubscription:async n=>{const r=await t().getSubscriptions();console.log(`Remove view subscription ${n}`);const o=r.filter(i=>i.options&&i.options.view===n);o.length===0&&await t().unsubscribe(o.map(i=>i.id))}}));function CK(){const[e]=Y(d=>[d.keystore]),[t]=Y(d=>[d.keypairIsLoaded]),[n]=Y(d=>[d.keypair]),[r]=Y(d=>{var f;return[((f=d==null?void 0:d.keypair)==null?void 0:f.publicKey)||""]}),[o,i]=y.useState(!1),s=Ri(),[a,l]=y.useState(!1),c=()=>{const d=cq();Y.getState().setKeyStore({keystore:"localstore",publicKey:d.publicKey,privateKey:d.privateKey})},u=async d=>{if(l(!0),window.nostr)try{const f=await window.nostr.getPublicKey();console.log(f),Y.getState().setKeyStore({keystore:"nos2x",publicKey:f,privateKey:""}),l(!1)}catch(f){console.error("Error loading public key:",f),l(!1)}else{console.log(`Nostr extention not ready, retry ${d}`);const f=d?d+1:1;if(f>2){s({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),l(!1);return}setTimeout(()=>u(f),1e3)}};return h.jsxs(ae,{children:[h.jsx(Ot,{size:"lg",children:"Account"}),t?h.jsxs(ce,{fontWeight:"bold",children:["Keypair loaded from ",e,"."]}):h.jsxs(h.Fragment,{children:[h.jsx(ce,{fontWeight:"bold",marginBottom:2,children:"Keypair is not loaded."}),h.jsx(ce,{marginBottom:2,children:"If you generate a new keypair, it will be stored in the browser local store (insecure). Alternatively get nos2x for Chrome, or nos2x-fox for Firefox, and store your keys in the extention (less insecure)."})]}),h.jsx(Wt,{marginTop:4,children:!e||(e==="none"?h.jsxs(h.Fragment,{children:[h.jsx(Te,{onClick:c,children:"Generate new keypair"}),h.jsx(Te,{isLoading:a,onClick:()=>u(),children:"Load from nos2x"})]}):h.jsx(Te,{onClick:()=>Y.getState().resetKeyStore(),children:"Reset"}))}),n&&h.jsxs(ae,{mt:4,children:[h.jsxs(Pt,{marginBottom:4,children:[h.jsx(_t,{children:"Public key:"}),h.jsx(mt,{type:"text",value:r,isReadOnly:!0})]}),e==="localstore"&&h.jsxs(Pt,{marginBottom:4,children:[h.jsx(_t,{children:"Private key:"}),h.jsxs(Wt,{spacing:2,children:[h.jsx(mt,{type:o?"text":"password",value:n.privateKey,isReadOnly:!0}),h.jsx(Te,{size:"sm",onClick:()=>i(!o),children:o?"Hide":"Show"})]})]})]})]})}function ki(e,t){return e.length<=t?e:e?e.substring(0,t)+"...":"..."}function EK(){const[e,t]=y.useState(0),[n,r,o]=Y(p=>[p.events.length,p.maxEvents,p.relayEvents]),[i,s]=y.useState(0),[a,l]=y.useState(0),[c,u]=y.useState(0),d=Ri(),f=async()=>{const p=await Y.getState().countUsers();p&&t(p);const g=await Y.getState().getSubscriptions();g&&l(g.length);const m=await Y.getState().getRelays();m&&u(m.length)};return y.useEffect(()=>{const p=setInterval(f,1e3);return()=>clearInterval(p)},[]),y.useEffect(()=>{const p=o.length;if(p>0){const g=p-i;if(g>0){s(p);const m=o.slice(-g);for(const x of m){let b="",v=!0;if(x.data[0]===za.NOTICE)b=x.data[1];else if(x.data[0]===za.OK)b=`Event ${ki(x.data[1],5)}: ${x.data[3]}`,v=x.data[2];else{if(x.data[0]===za.EOSE)return;x.data[0]===za.COUNT&&(b=`Relay ${x.data[1]}: ${JSON.stringify(x.data[2])} events`)}b!==""&&d({title:`Relay ${x.data[0]}`,position:"top-right",description:b,status:v?"info":"error",duration:5e3,isClosable:!0})}}}},[o]),h.jsx(ae,{position:"fixed",bottom:0,left:0,right:0,p:3,backgroundColor:"gray.100",children:h.jsx(Wt,{spacing:4,children:h.jsxs(h.Fragment,{children:[h.jsxs(Wt,{spacing:2,children:[h.jsx(ce,{fontSize:"sm",children:"Events:"}),h.jsxs(ce,{fontSize:"xl",marginLeft:1,children:[n," (max ",r,")"]})]}),h.jsxs(Wt,{spacing:2,children:[h.jsx(ce,{fontSize:"sm",children:"Users:"}),h.jsx(ce,{fontSize:"xl",children:e})]}),h.jsx(Nl,{as:Pg,to:"/relays",children:h.jsxs(Wt,{spacing:2,children:[h.jsx(ce,{fontSize:"sm",children:"Relays:"}),h.jsx(ce,{fontSize:"xl",children:c})]})}),h.jsx(Nl,{as:Pg,to:"/subscriptions",children:h.jsxs(Wt,{spacing:2,children:[h.jsx(ce,{fontSize:"sm",children:"Subscriptions:"}),h.jsx(ce,{fontSize:"xl",children:a})]})})]})})})}function Pa({label:e,value:t,to:n,leftIcon:r}){return h.jsx(NU,{as:Pg,to:n,w:"100%",padding:2,border:"1px solid",borderColor:"gray.200",borderRadius:2,backgroundColor:"gray.100",_hover:{backgroundColor:"gray.300"},_activeLink:{backgroundColor:"gray.300"},children:h.jsxs(Wt,{children:[r,h.jsx(ce,{fontSize:"md",fontWeight:"bold",children:e}),t&&h.jsx(ce,{fontSize:"md",children:t})]})})}function TK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Dd=TK(y),PK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Wx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=_K(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Dd.createElement("svg",PK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Dd.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,13V18L3,20H10V18H5V13H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M14,15H20V19H14V15Z"}))},RK=Dd.memo?Dd.memo(Wx):Wx,AK=RK;const $K=Xe(AK);function OK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Ud=OK(y),jK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Hx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=IK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Ud.createElement("svg",jK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Ud.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"}))},LK=Ud.memo?Ud.memo(Hx):Hx,MK=LK;const BK=Xe(MK);function zK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Vd=zK(y),FK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Gx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=NK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Vd.createElement("svg",FK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Vd.createElement("path",{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}))},DK=Vd.memo?Vd.memo(Gx):Gx,UK=DK;const VK=Xe(UK);function WK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Wd=WK(y),HK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},qx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=GK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Wd.createElement("svg",HK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Wd.createElement("path",{d:"M11 10V12H9V14H7V12H5.8C5.4 13.2 4.3 14 3 14C1.3 14 0 12.7 0 11S1.3 8 3 8C4.3 8 5.4 8.8 5.8 10H11M3 10C2.4 10 2 10.4 2 11S2.4 12 3 12 4 11.6 4 11 3.6 10 3 10M16 14C18.7 14 24 15.3 24 18V20H8V18C8 15.3 13.3 14 16 14M16 12C13.8 12 12 10.2 12 8S13.8 4 16 4 20 5.8 20 8 18.2 12 16 12Z"}))},qK=Wd.memo?Wd.memo(qx):qx,KK=qK;const ZK=Xe(KK);function YK(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Hd=YK(y),QK=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Kx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=XK(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Hd.createElement("svg",QK({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Hd.createElement("path",{d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"}))},JK=Hd.memo?Hd.memo(Kx):Kx,eZ=JK;const tZ=Xe(eZ);function nZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Gd=nZ(y),rZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Zx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=oZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Gd.createElement("svg",rZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Gd.createElement("path",{d:"M18 5H6V7H18M6 9H18V11H6M2 12H4V17H20V12H22V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17M18 13H6V15H18Z"}))},iZ=Gd.memo?Gd.memo(Zx):Zx,sZ=iZ;const aZ=Xe(sZ);function lZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var qd=lZ(y),cZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Yx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=uZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return qd.createElement("svg",cZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),qd.createElement("path",{d:"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z"}))},dZ=qd.memo?qd.memo(Yx):Yx,fZ=dZ;const hZ=Xe(fZ);function Qx(e){return Object.entries(e).map(([t,{read:n,write:r}])=>({url:t,read:n,write:r}))}function pZ({isOpen:e,onClose:t}){const[n,r]=y.useState(Qx(P_)),[o,i]=y.useState(""),[s,a]=y.useState(!1),[l,c]=y.useState(!1),u=Ri(),d=async p=>{if(a(!0),window.nostr&&window.nostr.getRelays)try{const g=await window.nostr.getRelays();r(Qx(g)),a(!1)}catch(g){console.error("Error loading relays:",g);let m="Unknown error";g instanceof Error&&(m=g.message),u({title:"Error loading relays",description:m,status:"error",duration:5e3,isClosable:!0}),a(!1)}else{console.log(`Nostr extention not ready, retry ${p}`);const g=p?p+1:1;if(g>2){u({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),a(!1);return}setTimeout(()=>d(g),1e3)}};y.useEffect(()=>{const p=localStorage.getItem("nostr-client:relays");p&&r(JSON.parse(p))},[]);const f=async()=>{c(!0),localStorage.setItem("nostr-client:relays",JSON.stringify(n)),await Y.getState().connect(n),c(!1),t()};return h.jsxs(gi,{isOpen:e,onClose:t,children:[h.jsx(bi,{}),h.jsxs(vi,{children:[h.jsx(yi,{children:"Connect to Relay(s)"}),h.jsx(ia,{}),h.jsxs(wi,{children:[h.jsxs(ce,{children:["You can find a list of relays in the nostr-ts repository",h.jsx(Nl,{marginLeft:1,href:"https://github.com/franzos/nostr-ts/blob/master/discovered-relays.json",isExternal:!0,color:"blue.500",children:"github.com/franzos/nostr-ts"}),",",h.jsx(Nl,{marginLeft:1,marginRight:1,href:"https://nostr.info/relays/",isExternal:!0,color:"blue.500",children:"nostr.info"}),"and elsewhere."]}),h.jsx(ol,{spacing:3,width:"100%",children:n&&n.map(p=>h.jsxs(Td,{width:"100%",alignItems:"center",borderBottom:"1px solid",borderColor:"gray.200",py:2,children:[h.jsx(ce,{flex:"1",marginLeft:"2",children:p.url}),h.jsx(Te,{ml:"auto",onClick:()=>{const g=n.filter(m=>m.url!==p.url);r(g)},children:"Remove"})]},p.url))}),h.jsxs(Td,{direction:"row",alignItems:"center",children:[h.jsx(mt,{flex:"1",value:o,onChange:p=>i(p.target.value),placeholder:"Enter new relay URL"}),h.jsx(Te,{ml:2,onClick:()=>{o.trim()!==""&&(r([...n,{url:o,read:!0,write:!0}]),i(""))},children:"Add"})]}),h.jsx(Te,{isLoading:s,onClick:()=>d(),size:"xs",marginTop:2,children:"Load from nos2x"})]}),h.jsx(Uy,{children:h.jsx(Te,{colorScheme:"green",isDisabled:n.length===0,isLoading:l,onClick:f,children:"Connect"})})]})]})}function mZ(){const[e,t,n,r]=Y(d=>{var f;return[d.connected,d.keystore,d.eventsPublishingQueue.length,((f=d.keypair)==null?void 0:f.publicKey)||""]}),[o,i]=y.useState([]),{isOpen:s,onOpen:a,onClose:l}=Ws(),c=async()=>{const d=await Y.getState().getAllUsersFollowing();d&&i(d)};y.useEffect(()=>{const d=setInterval(c,1e3);return()=>clearInterval(d)},[]);const u=h.jsxs(ol,{align:"start",spacing:5,w:"100%",children:[h.jsx(Pa,{label:"Home",to:"/",leftIcon:h.jsx(Me,{as:VK,marginRight:1})}),e&&h.jsxs(h.Fragment,{children:[h.jsx(Pa,{label:"Following",value:o.length,to:"/following",leftIcon:h.jsx(Me,{as:tZ,marginRight:1})}),h.jsx(Pa,{label:"Queue",value:n,to:"/queue",leftIcon:h.jsx(Me,{as:aZ,marginRight:1})}),r&&r!==""&&h.jsx(Pa,{label:"Profile",to:"/profile",leftIcon:h.jsx(Me,{as:hZ,marginRight:1})})]}),h.jsx(Pa,{label:"Account",value:t,to:"/account",leftIcon:h.jsx(Me,{as:ZK,marginRight:1})}),e?h.jsxs(Te,{w:"100%",colorScheme:"red",onClick:Y.getState().disconnect,children:[h.jsx(Me,{as:BK,marginRight:1}),"Disconnect"]}):h.jsx(Te,{w:"100%",colorScheme:"green",onClick:a,leftIcon:h.jsx(Me,{as:$K}),children:"Connect to relay(s)"})]});return h.jsxs(h.Fragment,{children:[h.jsxs(HT,{maxW:"8xl",p:5,marginBottom:14,children:[h.jsxs(ol,{spacing:5,align:"stretch",children:[h.jsx(ol,{spacing:1,align:"start",children:h.jsx(Ot,{as:"h1",size:"lg",children:"Nostr Client"})}),h.jsxs(ic,{templateColumns:["1fr","1fr 4fr"],gap:20,children:[u,h.jsx(ae,{children:h.jsx(aH,{})})]})]}),pZ({isOpen:s,onOpen:a,onClose:l})]}),h.jsx(EK,{})]})}function gZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Kd=gZ(y),vZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Xx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=yZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Kd.createElement("svg",vZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Kd.createElement("path",{d:"M23,10C23,8.89 22.1,8 21,8H14.68L15.64,3.43C15.66,3.33 15.67,3.22 15.67,3.11C15.67,2.7 15.5,2.32 15.23,2.05L14.17,1L7.59,7.58C7.22,7.95 7,8.45 7,9V19A2,2 0 0,0 9,21H18C18.83,21 19.54,20.5 19.84,19.78L22.86,12.73C22.95,12.5 23,12.26 23,12V10M1,21H5V9H1V21Z"}))},bZ=Kd.memo?Kd.memo(Xx):Xx,wZ=bZ;const xZ=Xe(wZ);function SZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Zd=SZ(y),kZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Jx=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=CZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Zd.createElement("svg",kZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Zd.createElement("path",{d:"M19,15H23V3H19M15,3H6C5.17,3 4.46,3.5 4.16,4.22L1.14,11.27C1.05,11.5 1,11.74 1,12V14A2,2 0 0,0 3,16H9.31L8.36,20.57C8.34,20.67 8.33,20.77 8.33,20.88C8.33,21.3 8.5,21.67 8.77,21.94L9.83,23L16.41,16.41C16.78,16.05 17,15.55 17,15V5C17,3.89 16.1,3 15,3Z"}))},EZ=Zd.memo?Zd.memo(Jx):Jx,TZ=EZ;const PZ=Xe(TZ);function _Z(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Yd=_Z(y),RZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},eS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=AZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Yd.createElement("svg",RZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Yd.createElement("path",{d:"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z"}))},$Z=Yd.memo?Yd.memo(eS):eS,OZ=$Z;const Bg=Xe(OZ),jZ=e=>{const t=new Date,n=new Date(e*1e3),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),i=Math.floor(o/60),s=Math.floor(i/60);return o<60?`${o} seconds ago`:i<60?`${i} minutes ago`:s<24?`${s} hours ago`:`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`};function __({user:{pubkey:e,data:t},opts:{showAbout:n,showBanner:r,following:o,showFollowing:i,relayUrls:s}}){const a=t&&t.name?t.name:"Anonymous",l=t&&t.display_name?t.display_name:"Anonymous",c=t&&t.picture?t.picture:"",u=t&&t.banner?t.banner:void 0,d=t&&t.about?t.about:void 0,f=`/p/${e}?relays=${s.join(",")}`;return h.jsxs(h.Fragment,{children:[r&&u&&h.jsx(ae,{marginBottom:2,children:h.jsx(ps,{src:u,alt:"banner"})}),h.jsxs(Td,{children:[h.jsx(ae,{mr:"3",children:h.jsx(Tg,{to:f,children:h.jsx(Sd,{size:"sm",src:c})})}),h.jsxs(ae,{overflowWrap:"anywhere",children:[h.jsxs(Tg,{to:f,children:[h.jsx(Ot,{size:"sm",children:l}),h.jsx(ce,{fontSize:"sm",children:a})]}),n&&d&&h.jsx(ce,{fontSize:"sm",children:d})]}),h.jsx(jy,{}),i&&h.jsx(Te,{variant:"outline",colorScheme:o?"red":"green",onClick:()=>o?Y.getState().unfollowUser(e):Y.getState().followUser({pubkey:e,relayUrls:s}),children:o?"Unfollow":"Follow"})]})]})}function zp({user:e,options:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:s,avatarSize:a}}){const[l]=Y(u=>[u.followingUserIds.find(d=>d===e.pubkey)]),c=e.data&&e.data.picture?e.data.picture:"";return h.jsx(h.Fragment,{children:h.jsxs(pP,{children:[h.jsx(hP,{children:s?h.jsxs(ae,{position:"relative",children:[h.jsx(Sd,{size:a,src:c}),h.jsx(ae,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(255, 255, 255, 0.5)"}),h.jsx(ce,{position:"absolute",right:"0",bottom:"0",backgroundColor:"white",height:15,width:15,textAlign:"center",borderRadius:10,fontSize:12,children:s})]}):h.jsx(Sd,{size:a,src:c})}),h.jsxs(bP,{children:[h.jsx(mP,{}),h.jsx(vP,{}),h.jsx(fP,{children:i}),h.jsx(gP,{children:h.jsx(__,{user:e,opts:{showAbout:t,showBanner:n,following:!!l,showFollowing:r,relayUrls:o,title:i,reaction:s,avatarSize:a}})})]})]})})}function R_({userComponent:e,event:t,reactions:n,reposts:r,mentions:o,replies:i,eventRelayUrls:s}){var q;const[a]=Y(N=>[N.connected&&N.keystore!=="none"]),l=Ri(),[c,u]=y.useState(0),[d,f]=y.useState(0),[p,g]=y.useState(0),[m,x]=y.useState({});y.useEffect(()=>{f((n==null?void 0:n.filter(N=>N.event.content==="-").length)||0),u((n==null?void 0:n.filter(N=>N.event.content==="+").length)||0),g((r==null?void 0:r.length)||0),x((n==null?void 0:n.filter(N=>N.event.content!=="+"&&N.event.content!=="-").reduce((N,G)=>{var te;const J=(te=G.event)!=null&&te.content?G.event.content:void 0;return J&&N[J]?N[J]+=1:J&&(N[J]=1),N},{}))||{})},[n]);const b=a_(t),[v,w]=y.useState(b==null),S=(q=t==null?void 0:t.content)==null?void 0:q.match(/\bhttps?:\/\/\S+?\.(?:jpg|jpeg|png|gif)\b/gi),{isOpen:k,onOpen:T,onClose:E}=Ws(),{isOpen:_,onOpen:z,onClose:L}=Ws(),[P,j]=y.useState(null),I=N=>{j(N),T()},V=async()=>{const G=(await Y.getState().getRelays()).find(J=>s.includes(J.url));if(G)return G;l({title:"Error",description:`None of the required relays are active ${s.join(", ")}.`,status:"error",duration:5e3,isClosable:!0})},$=async()=>{const N=await V();if(!N)return;const G=$q({text:"",inResponseTo:{id:t.id,pubkey:t.pubkey},relayUrl:N.url});Y.getState().setNewEvent(G),Y.getState().setNewEventName("NewShortTextNoteResponse")},O=async(N,G)=>{const J=await V();if(!J)return;let te;switch(N){case"quote":te=jq({inResponseTo:t,relayUrl:J.url});break;case"reaction":if(!G)throw new Error("Reaction is required");te=Oq({text:G,inResponseTo:{id:t.id,pubkey:t.pubkey},relayUrl:J.url});break;default:return}try{const ne=await Y.getState().signAndSendEvent({event:te,relayUrls:[J.url]});ne&&(l({title:"Success",description:`Event ${ki(ne,5)} submitted`,status:"success",duration:5e3,isClosable:!0}),Y.getState().requestInformation({source:"events",idsOrKeys:[ne],relayUrl:s[0]},{timeoutIn:1e4}))}catch(ne){let ue="";ne instanceof Error?ue=ne.message:ue=ne?ne.toString():"Unknown error",l({title:"Error",description:ue,status:"error",duration:5e3,isClosable:!0});return}},F=()=>h.jsxs(Wt,{children:[h.jsx(Te,{size:"sm",variant:"solid",colorScheme:"blue",onClick:()=>$(),isDisabled:!a,children:"Reply"}),h.jsx(Te,{size:"sm","aria-label":"Upvote",leftIcon:h.jsx(Me,{as:xZ}),onClick:()=>O("reaction","+"),isDisabled:!a,children:c}),h.jsx(Te,{size:"sm","aria-label":"Downvote",leftIcon:h.jsx(Me,{as:PZ}),onClick:()=>O("reaction","-"),isDisabled:!a,children:d}),h.jsx(Te,{size:"sm","aria-label":"Repost",leftIcon:h.jsx(Me,{as:Bg}),onClick:()=>O("quote"),isDisabled:!a,children:p}),m&&Object.keys(m).slice(0,2).map(N=>h.jsxs(Te,{size:"sm","aria-label":"Repost",isDisabled:!0,children:[N," ",m[N]]},N))]}),B=h.jsxs(gi,{isOpen:_,onClose:L,size:"xl",children:[h.jsx(bi,{}),h.jsxs(vi,{maxHeight:"80vh",maxWidth:"80vw",children:[h.jsx(yi,{children:"Event"}),h.jsx(ia,{}),h.jsx(wi,{overflowY:"auto",children:h.jsx("pre",{children:h.jsx("code",{children:JSON.stringify(t,null,2)})})})]})]}),D=h.jsxs(gi,{isOpen:k,onClose:E,size:"full",closeOnOverlayClick:!0,children:[h.jsx(bi,{}),h.jsxs(vi,{children:[h.jsx(yi,{children:e&&e}),h.jsx(wi,{children:h.jsx(ps,{src:P||"",fallback:h.jsx(ps,{src:"/no-image.png"}),fallbackStrategy:"onError",alt:"Enlarged view",height:"80vh",marginLeft:"auto",marginRight:"auto"})}),h.jsxs(Uy,{children:[h.jsx(F,{}),h.jsx(Te,{marginLeft:4,onClick:E,children:"Close"})]})]})]});function H(N){if(!N)return"";const G=/(https?:\/\/[^\s]+)/g;return N.replace(G,J=>`${ki(J,20)}`)}const U=h.jsxs(HD,{border:"1px solid #e1e1e1",style:{overflowWrap:"break-word",wordWrap:"break-word"},children:[h.jsx(WD,{p:0,children:h.jsxs(ae,{children:[v?S&&S.length>0&&h.jsx(ae,{className:"image-container",marginBottom:4,children:S.map((N,G)=>h.jsx(ps,{src:N,fallback:h.jsx(ps,{src:"/no-image.png"}),fallbackStrategy:"onError",alt:"",onClick:()=>I(N)},G))}):h.jsxs(Te,{size:"sm",width:"100%",onClick:()=>w(!0),children:["Show Content (",b,")"]}),h.jsx(ae,{p:4,paddingBottom:0,children:e&&e})]})}),h.jsxs(UD,{p:4,children:[h.jsx(ae,{style:{overflowWrap:"anywhere"},dangerouslySetInnerHTML:{__html:H(t.content)}}),h.jsx(ce,{fontWeight:"bold",fontSize:12,marginTop:2,children:jZ(t.created_at)})]}),h.jsx(VD,{p:4,children:h.jsxs(Wt,{width:"100%",children:[h.jsx(F,{}),h.jsx(jy,{}),h.jsx(ce,{children:s[0]}),h.jsx(Te,{size:"sm",variant:"outline",onClick:()=>{z()},children:"Details"})]})})]});return h.jsxs(h.Fragment,{children:[U,h.jsxs(Wt,{padding:2,flexWrap:"wrap",children:[n&&h.jsxs(h.Fragment,{children:[h.jsx(ce,{children:"Reactions"}),n.map((N,G)=>{const J=N.user||{pubkey:N.event.pubkey};return h.jsx(ae,{children:h.jsx(zp,{user:J,options:{title:"Reaction",showAbout:!0,showBanner:!0,relayUrls:s,reaction:N.event.content,avatarSize:"xs"}})},`${G}_${N.event.id}_${J.pubkey}_reactions`)})]}),r&&h.jsxs(h.Fragment,{children:[h.jsx(ce,{children:"Reposts"}),r.map(N=>{const G=N.user?N.user:{pubkey:N.event.pubkey};return h.jsxs(ae,{children:[h.jsx(zp,{user:G,options:{title:"Repost",showAbout:!0,showBanner:!0,relayUrls:s,avatarSize:"xs"}}),h.jsx(Me,{as:Bg})]},`${N.event.id}_${G.pubkey}_reposts`)})]}),o&&h.jsxs(h.Fragment,{children:[h.jsx(ce,{children:"Mentions"}),o.map(N=>h.jsx(ae,{children:h.jsx(zp,{user:N,options:{title:"Mentioned",showAbout:!0,showBanner:!0,relayUrls:s,avatarSize:"xs"}})},`${t.id}_${N.pubkey}_mention`))]})]}),i&&i.map(N=>{const G=N.user?N.user:{pubkey:N.event.pubkey};return h.jsx(ae,{marginLeft:10,children:h.jsx(R_,{event:N.event,userComponent:e,eventRelayUrls:s})},`${N.event.id}_${G.pubkey}_replies`)}),D,B]})}function a0(e){const[t,n]=Y(f=>[f.events,f.maxEvents]),[r,o]=y.useState(0),[i,s]=y.useState(!1),[a,l]=y.useState(e.filters);y.useEffect(()=>{const f=setTimeout(()=>{s(!0)},5e3);return()=>{clearTimeout(f)}},[]);const c=async()=>{r===0&&o(r+1),await Y.getState().setMaxEvents(n+bo),e&&await Y.getState().setViewSubscription(e.view,a)},u=async()=>{o(0),l(e.filters),await Y.getState().setMaxEvents(bo),await Y.getState().clearEvents(),await Y.getState().setViewSubscription(e.view,a),s(!1)},d=t.length>=n||i;return h.jsxs(ae,{style:{overflowWrap:"break-word",wordWrap:"break-word"},children:[t.map(f=>h.jsx(ae,{padding:2,children:h.jsx(R_,{event:f.event,user:f.user,reactions:f.reactions,reposts:f.reposts,mentions:f.mentions,replies:f.replies,eventRelayUrls:f.eventRelayUrls,userComponent:e&&e.userComponent?f.user&&f.user.pubkey?h.jsx(e.userComponent,{user:f.user,options:{showFollowing:!0,relayUrls:f.eventRelayUrls}}):h.jsx(e.userComponent,{user:{pubkey:f.event.pubkey},options:{relayUrls:f.eventRelayUrls}}):void 0},f.event.id)},f.event.id)),t.length===0&&h.jsx(ce,{children:"Waiting for fresh content ... hold on."}),d&&h.jsxs(ae,{display:"flex",justifyContent:"space-between",padding:2,children:[h.jsxs(Te,{flex:"1",marginRight:2,onClick:c,children:["Load ",bo," more"]}),h.jsx(Te,{flex:"1",marginLeft:2,onClick:u,children:"Reset and load new (performance)"})]})]})}function Ci({user:e,options:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o}}){const[i]=Y(s=>[s.followingUserIds.find(a=>a===e.pubkey)]);return h.jsx(__,{user:e,opts:{showAbout:t,showBanner:n,following:!!i,showFollowing:r,relayUrls:o}})}function IZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Qd=IZ(y),LZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},tS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=MZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Qd.createElement("svg",LZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Qd.createElement("path",{d:"M2,21L23,12L2,3V10L17,12L2,14V21Z"}))},BZ=Qd.memo?Qd.memo(tS):tS,zZ=BZ;const FZ=Xe(zZ);function NZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Xd=NZ(y),DZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},nS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=UZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Xd.createElement("svg",DZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Xd.createElement("path",{d:"M4,9H20V11H4V9M4,13H14V15H4V13Z"}))},VZ=Xd.memo?Xd.memo(nS):nS,WZ=VZ;const HZ=Xe(WZ);function GZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Jd=GZ(y),qZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},rS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=KZ(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return Jd.createElement("svg",qZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Jd.createElement("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"}))},ZZ=Jd.memo?Jd.memo(rS):rS,YZ=ZZ;const QZ=Xe(YZ);function XZ(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var ef=XZ(y),JZ=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},oS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=eY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return ef.createElement("svg",JZ({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),ef.createElement("path",{d:"M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"}))},tY=ef.memo?ef.memo(oS):oS,nY=tY;const rY=Xe(nY);function oY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var tf=oY(y),iY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},iS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=sY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return tf.createElement("svg",iY({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),tf.createElement("path",{d:"M12,6C8.6,6 5.5,7.1 3,9L1.2,6.6C4.2,4.3 8,3 12,3C16,3 19.8,4.3 22.8,6.6L21,9C18.5,7.1 15.4,6 12,6M13,19C13,17.7 13.4,16.4 14.2,15.4C13.5,15.2 12.8,15 12,15C10.7,15 9.4,15.5 8.4,16.2L12,21L13,19.6C13,19.4 13,19.2 13,19M16.8,13.4C17.1,13.3 17.5,13.2 17.9,13.1L19.2,11.4C17.2,9.9 14.7,9 12,9C9.3,9 6.8,9.9 4.8,11.4L6.6,13.8C8.1,12.7 10,12 12,12C13.8,12 15.4,12.5 16.8,13.4M16.5,22.6L17.2,19.8L15,17.9L17.9,17.7L19,15L20.1,17.6L23,17.8L20.8,19.7L21.5,22.5L19,21.1L16.5,22.6Z"}))},aY=tf.memo?tf.memo(iS):iS,lY=aY;const cY=Xe(lY);async function Fp(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((o,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}var l0=class extends Fq{constructor(e){super(e)}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{if(!this.hasZapInfo()){const s=await Fp(n.url);if(!hq(s))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");this.lightningZapInfo=s}console.log("LnurlEndpointResponse",this.lightningZapInfo);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?bq(this.getLud16()):this.getLud06()},o=Bq(r,this.lightningZapInfo.callback,t),i=await Fp(o.invoiceUrl);if(!pq(r,i))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",i),{...i,event:o.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await Fp(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}};const c0=()=>{var S;const[e]=Y(k=>[k.connected&&k.keystore!=="none"]),[t,n]=y.useState([]),[r,o]=y.useState([]),[i]=Y(k=>{var T;return[(T=k.newEvent)==null?void 0:T.hasPublicKeyTags()]}),[s,a]=y.useState(!1),[l,c,u,d,f]=Y(k=>{var T;return[k.keystore,k.keypair,((T=k.newEvent)==null?void 0:T.kind)||0,k.newEventName,k.newEvent]}),[p,g]=y.useState([]),m=Ri(),x=y.useRef(void 0);y.useEffect(()=>{(async()=>{var z;if(d!=="NewShortTextNoteResponse")return;const T=(z=Y.getState().newEvent)==null?void 0:z.pubkey;if(!T||x.current===T)return;x.current=T;const E=[],_=[];if(i)for(const L of i){let P;L.length===2&&(P=L[1],_.push(L[1]));const j=L[0],I=await Y.getState().getUser(j);I?E.push({user:I.user,relayUrls:I.relayUrls?I.relayUrls:P?[P]:[]}):E.push({user:new l0({pubkey:j}),relayUrls:P?[P]:[]})}E.length>0&&o(E),_.length>0&&g(_),w(d,!0)})()},[i,d]);const b=async()=>{if(a(!0),n([]),!f){n(["Event is required"]),m({title:"Error",description:"Event is required",status:"error",duration:5e3,isClosable:!0});return}if(l&&l==="none"){n(["Keystore is required"]),m({title:"Error",description:"Keystore is required",status:"error",duration:5e3,isClosable:!0});return}if(!c){n(["Keypair is required"]),m({title:"Error",description:"Keypair is required",status:"error",duration:5e3,isClosable:!0});return}if(!f.content){n(["Event content is required"]),m({title:"Error",description:"Event content is required",status:"error",duration:5e3,isClosable:!0});return}try{const k=await Y.getState().signAndSendEvent({event:f,relayUrls:p});k&&(m({title:"Success",description:`Event ${ki(k,5)} submitted`,status:"success",duration:5e3,isClosable:!0}),w("NewShortTextNote",!0,!0),a(!1))}catch(k){let T="";k instanceof Error?T=k.message:T=k?k.toString():"Unknown error",n([T]),m({title:"Error",description:T,status:"error",duration:5e3,isClosable:!0}),a(!1);return}},v=k=>{switch(k){case"NewShortTextNote":return"Short Text Note";case"NewRecommendRelay":return"Recommend Relay";case"NewLongFormContent":return"Long Form Content";case"NewShortTextNoteResponse":return"Short Text Note Response";case"NewQuoteRepost":return"Quote Repost";default:return""}},w=(k,T=!1,E=!1)=>{let _;if(!T&&k===d){console.log(`Already set to ${k}`);return}switch(k){case"NewShortTextNote":_=Rq({text:""}),k="NewShortTextNote";break;case"NewRecommendRelay":_=Lq({relayUrl:Object.keys(P_)[0]}),k="NewRecommendRelay";break;case"NewLongFormContent":_=Aq({text:""}),k="NewLongFormContent";break;case"NewShortTextNoteResponse":_=Y.getState().newEvent;break;default:n(["Invalid event type"]);return}Y.getState().setNewEvent(_),Y.getState().setNewEventName(k),n([]),E&&o([])};return h.jsxs(ae,{width:"100%",children:[h.jsxs(Pt,{marginBottom:4,children:[h.jsxs(_t,{children:["Type: ",v(d)]}),r.map(k=>h.jsx(Ci,{user:k.user,options:{relayUrls:k.relayUrls}},k.user.pubkey))]}),h.jsxs(Pt,{marginBottom:4,children:[h.jsx(_t,{children:"Content"}),h.jsx(mt,{type:"text",as:u===fn.LONG_FORM_CONTENT?Hy:mt,value:((S=Y.getState().newEvent)==null?void 0:S.content)||"",onChange:k=>Y.getState().setNewEventContent(k.target.value),placeholder:"Enter event content"})]}),h.jsxs(Wt,{marginBottom:4,children:[h.jsx(Wi,{"aria-label":"Short Text Note",icon:h.jsx(Me,{as:HZ}),onClick:()=>w("NewShortTextNote"),isActive:d==="NewShortTextNote"}),h.jsx(Wi,{"aria-label":"NewLongFormContent",icon:h.jsx(Me,{as:QZ}),onClick:()=>w("NewLongFormContent"),isActive:d==="NewLongFormContent"}),h.jsx(Wi,{"aria-label":"NewShortTextNoteResponse",icon:h.jsx(Me,{as:rY}),onClick:()=>w("NewShortTextNoteResponse"),isActive:d==="NewShortTextNoteResponse",isDisabled:d!=="NewShortTextNoteResponse"}),h.jsx(Wi,{"aria-label":"NewRecommendRelay",icon:h.jsx(Me,{as:cY}),onClick:()=>w("NewRecommendRelay"),isActive:d==="NewRecommendRelay"}),h.jsx(Wi,{"aria-label":"NewQuoteRepost",icon:h.jsx(Me,{as:Bg}),onClick:()=>w("NewQuoteRepost"),isActive:d==="NewQuoteRepost",isDisabled:d!=="NewQuoteRepost"})]}),t.map((k,T)=>h.jsx(ae,{color:"red.500",children:k},T)),h.jsx(Te,{type:"submit",colorScheme:"blue",onClick:b,leftIcon:h.jsx(Me,{as:FZ}),isDisabled:!e,isLoading:s,children:"Send"})]})};function uY(){const[e,t]=Y(i=>[i.connected,i.events.length>=i.maxEvents]),n=new Si({kinds:[fn.SHORT_TEXT_NOTE,fn.LONG_FORM_CONTENT],limit:bo}),r=y.useRef(!1),o=async()=>{!e||r.current||(r.current=!0,await Y.getState().clearEvents(),await Y.getState().setViewSubscription("welcome",n))};return y.useEffect(()=>{o()},[]),y.useEffect(()=>{setTimeout(()=>{o()},500)},[e]),y.useEffect(()=>{t&&(async()=>{e&&await Y.getState().removeViewSubscription("welcome")})()},[t]),h.jsxs(ic,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[h.jsx(ae,{children:e?h.jsx(a0,{userComponent:Ci,view:"welcome",filters:n,connected:e}):h.jsxs(ae,{maxWidth:600,children:[h.jsx(Ot,{size:"lg",children:"About Nostr"}),h.jsx(ce,{marginBottom:2,fontWeight:"bold",children:"Tldr: Nostr is a decentralized social network."}),h.jsx(ce,{marginBottom:4,children:"Nostr is anything you can imagine. A new reddit, Twitter, Facebook, Mastodon - Craigstslist or Ebay? It's only a matter of what the interface looks like, the underlying network is the same, and so is your identity - so you get to access it all, without giving up yourself."}),h.jsx(Ot,{size:"md",children:"Connect to get started"}),h.jsx(ce,{marginBottom:2,children:"You don't need an account to browse or follow users. All data is saved in your browser. To interact with events, generate or supply a keypair."}),h.jsx(ce,{children:"nos2x and nos2x-fox should be working too."})]})}),h.jsxs(ae,{display:"flex",flexDirection:"column",children:[h.jsx(Ot,{as:"h2",size:"md",marginBottom:4,children:"Broadcast to the Network"}),h.jsx(c0,{})]})]})}function dY(){const[e,t]=y.useState([]),n=y.useRef(!1);return y.useEffect(()=>{(async()=>{if(n.current)return;n.current=!0;const o=await Y.getState().getAllUsersFollowing();o&&t(o)})()},[]),h.jsxs(ae,{children:[h.jsx(Ot,{size:"lg",children:"Following"}),e.length>0?h.jsx(h.Fragment,{children:e.map(r=>h.jsx(ae,{mb:"3",children:h.jsx(Ci,{user:r.user,options:{showFollowing:!0,relayUrls:r.relayUrls}},r.user.pubkey)},r.user.pubkey))}):h.jsxs(h.Fragment,{children:[h.jsx(ce,{children:"Follow users to subscribe to their messages. The subscription is stored in your browser and not shared with relays."}),h.jsx(ce,{fontWeight:"bold",children:"You are not following anyone."})]})]})}const A_=Object.keys(fn).map(e=>({name:e,value:fn[e]})),fY=e=>{const t=A_.find(n=>n.value===e);return t?t.name:"Unknown"},hY=e=>e.map(fY).join(", ");function pY(){const[e,t]=y.useState([]),[n,r]=y.useState(null),{isOpen:o,onOpen:i,onClose:s}=Ws(),a=async()=>{const u=await Y.getState().getSubscriptions();u&&t(u)};y.useEffect(()=>{(async()=>{await a()})();const d=setInterval(a,1e3);return()=>clearInterval(d)},[]);const l=h.jsxs(gi,{isOpen:o,onClose:s,size:"xl",children:[" ",h.jsx(bi,{}),h.jsxs(vi,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",h.jsx(yi,{children:"Filters"}),h.jsx(ia,{}),h.jsxs(wi,{overflowY:"auto",children:[" ",h.jsx("pre",{children:n})]})]})]}),c=u=>{const d=u.options&&u.options.view?u.options.view:"";return h.jsxs(Zs,{children:[h.jsx(At,{children:h.jsx(al,{label:u.id,children:ki(u.id,5)})}),h.jsx(At,{children:h.jsx(al,{label:u.relayUrl,children:u.relayUrl.substring(6)})}),h.jsx(At,{children:h.jsx(ce,{fontSize:"sm",children:u.filters&&u.filters.kinds&&hY(u.filters.kinds)})}),h.jsx(At,{children:h.jsx(Te,{size:"sm",onClick:()=>{r(JSON.stringify(u.filters,null,2)),i()},children:"Show"})}),h.jsx(At,{children:h.jsx(al,{label:d,children:ki(d,5)})}),h.jsx(At,{children:h.jsx(Te,{size:"sm",onClick:()=>Y.getState().unsubscribe([u.id]),children:"Unsubscribe"})})]},u.id)};return h.jsxs(ae,{children:[h.jsx(Ot,{size:"lg",children:"Subscriptions"}),h.jsxs(Qf,{variant:"simple",marginBottom:4,children:[h.jsx(Vy,{children:h.jsxs(Zs,{children:[h.jsx($t,{children:"ID"}),h.jsx($t,{children:"Relay"}),h.jsx($t,{children:"Kind"}),h.jsx($t,{children:"Filter"}),h.jsx($t,{children:"View"}),h.jsx($t,{children:"Action"})]})}),h.jsx(Wy,{children:e.map(u=>c(u))})]}),h.jsx(Ot,{size:"md",marginBottom:2,children:"Legend"}),A_.map(u=>h.jsxs(ce,{children:[u.name," - ",u.value]},u.name)),l]})}function mY(){const[e,t]=Y(f=>[f.connected,f.events.length>=f.maxEvents]),[n,r]=y.useState(null),[o,i]=y.useState([]),[s]=jP(),l=RP().pubkey||"",c=`profile-${l}`,u=new Si({limit:bo,authors:[l],kinds:[fn.SHORT_TEXT_NOTE,fn.LONG_FORM_CONTENT]}),d=async()=>{if(e){if(!n||n.user.pubkey!==l){await Y.getState().clearEvents(),await Y.getState().setViewSubscription(c,u);const f=await Y.getState().getUser(l);if(f)r(f),i(f.relayUrls);else{r({user:new l0({pubkey:l}),relayUrls:o});for(const p of s.entries())p[0]==="relays"&&i(p[1].split(","))}}await Y.getState().count({type:fc.COUNT,filters:new Si({kinds:[3],"#p":[l]}),options:{timeoutIn:1e4}})}};return y.useEffect(()=>{d()},[]),y.useEffect(()=>{d()},[l]),y.useEffect(()=>{t&&(async()=>{e&&await Y.getState().removeViewSubscription(c)})()},[t]),h.jsxs(ic,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[h.jsxs(ae,{maxHeight:"80vh",overflowY:"auto",children:[h.jsx(ae,{children:n&&h.jsx(Ci,{user:n.user,options:{showAbout:!0,showBanner:!0,showFollowing:!0,relayUrls:n.relayUrls}})}),h.jsx(ae,{children:e?h.jsx(a0,{view:c,filters:u,connected:e}):h.jsx(ce,{children:"Not connected."})})]}),h.jsxs(ae,{display:"flex",flexDirection:"column",children:[h.jsx(Ot,{as:"h2",size:"md",marginBottom:4,children:"Broadcast to the Network"}),h.jsx(c0,{})]})]})}function gY(){const[e,t]=y.useState([]),[n,r]=y.useState(null),[o,i]=y.useState(!1),{isOpen:s,onOpen:a,onClose:l}=Ws(),c=async()=>{const g=await Y.getState().getRelays();g&&t(g)};y.useEffect(()=>{(async()=>{await c()})();const m=setInterval(c,2e3);return()=>clearInterval(m)},[]);const u=async g=>{i(!0);const m=!g.read;await Y.getState().updateRelay(g.url,{read:m}),await c(),i(!1)},d=async g=>{i(!0);const m=!g.write;await Y.getState().updateRelay(g.url,{write:m}),await c(),i(!1)},f=h.jsxs(gi,{isOpen:s,onClose:l,size:"xl",children:[h.jsx(bi,{}),h.jsxs(vi,{maxHeight:"80vh",maxWidth:"80vw",children:[h.jsx(yi,{children:"Relay"}),h.jsx(ia,{}),h.jsx(wi,{overflowY:"auto",children:n&&n.info&&h.jsx("pre",{children:h.jsx("code",{children:JSON.stringify(n.info,null,2)})})})]})]}),p=g=>h.jsxs(Zs,{children:[h.jsx(At,{children:g.url}),h.jsx(At,{children:g.isReady?"Ready":"Not Ready"}),h.jsx(At,{children:h.jsx(Te,{size:"sm",onClick:()=>{r(g),a()},children:"Show"})}),h.jsx(At,{children:h.jsx(wg,{isChecked:g.read,onChange:()=>u(g),isDisabled:o})}),h.jsx(At,{children:h.jsx(wg,{isChecked:g.write,onChange:()=>d(g),isDisabled:o})})]},g.url);return h.jsxs(ae,{children:[h.jsx(Ot,{size:"lg",children:"Relays"}),h.jsxs(Qf,{variant:"simple",marginBottom:4,children:[h.jsx(Vy,{children:h.jsxs(Zs,{children:[h.jsx($t,{children:"Ready"}),h.jsx($t,{children:"Url"}),h.jsx($t,{children:"Info"}),h.jsx($t,{children:"Read"}),h.jsx($t,{children:"Write"})]})}),h.jsx(Wy,{children:e.map(g=>p(g))})]}),f]})}function vY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var nf=vY(y),yY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},sS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=bY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return nf.createElement("svg",yY({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),nf.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"}))},wY=nf.memo?nf.memo(sS):sS,xY=wY;const Np=Xe(xY);function SY(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var rf=SY(y),kY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},aS=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var s=CY(t,["color","size","children"]),a="mdi-icon "+(s.className||"");return rf.createElement("svg",kY({},s,{className:a,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),rf.createElement("path",{d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}))},EY=rf.memo?rf.memo(aS):aS,TY=EY;const Dp=Xe(TY);function PY(){const[e]=Y(u=>[u.eventsPublishingQueue]),[t,n]=y.useState(null),r=u=>!!u.error,o=u=>u.error?u.error:"",{isOpen:i,onOpen:s,onClose:a}=Ws(),l=h.jsxs(gi,{isOpen:i,onClose:a,size:"xl",children:[h.jsx(bi,{}),h.jsxs(vi,{maxHeight:"80vh",maxWidth:"80vw",children:[h.jsx(yi,{children:"Queue Item Detail"}),h.jsx(ia,{}),h.jsx(wi,{overflowY:"auto",children:t&&h.jsx("pre",{children:h.jsx("code",{children:JSON.stringify(t,null,2)})})})]})]}),c=u=>{const d=u.event.id||"";return h.jsxs(Zs,{children:[h.jsx(At,{children:h.jsx(al,{label:d,children:ki(d,5)})}),h.jsx(At,{children:h.jsxs(Wt,{children:[u.pow?h.jsx(ce,{children:u.pow}):h.jsx(ce,{children:"0"}),h.jsx(ce,{children:"/"}),h.jsx(Me,{as:u.powDone?Np:Dp})]})}),h.jsx(At,{children:h.jsx(Te,{size:"sm",onClick:()=>{n(u),s()},children:"Show"})}),h.jsx(At,{children:h.jsx(Me,{as:u.send?Np:Dp,marginRight:1})}),h.jsxs(At,{children:[h.jsx(Me,{as:u.accepted?Np:Dp}),r(u)&&h.jsx(ce,{color:"red.500",children:o(u)})]})]},d)};return h.jsxs(ae,{children:[h.jsx(Ot,{size:"lg",children:"Queue"}),h.jsxs(Qf,{variant:"simple",marginBottom:4,children:[h.jsx(Vy,{children:h.jsxs(Zs,{children:[h.jsx($t,{children:"Event ID"}),h.jsx($t,{children:"POW / Done"}),h.jsx($t,{children:"Info"}),h.jsx($t,{children:"Send"}),h.jsx($t,{children:"Accepted"})]})}),h.jsx(Wy,{children:e.map(u=>c(u))})]}),l]})}function _Y(){const[e,t]=Y(d=>[d.connected,d.events.length>=d.maxEvents]),[n,r]=y.useState(null),[o,i]=y.useState([]),[s]=jP(),l=RP().pubkey||"",c=`mentions-${l}`,u=new Si({limit:bo,authors:[l],kinds:[fn.SHORT_TEXT_NOTE,fn.LONG_FORM_CONTENT],"#p":[l]});return y.useEffect(()=>{(async()=>{if(e&&(await Y.getState().clearEvents(),await Y.getState().setViewSubscription(c,u),!n)){const f=await Y.getState().getUser(l);if(f)r(f),i(f.relayUrls);else{r({user:new l0({pubkey:l}),relayUrls:o});for(const p of s.entries())p[0]==="relays"&&i(p[1].split(","))}}})()},[]),y.useEffect(()=>{t&&(async()=>{e&&await Y.getState().removeViewSubscription(c)})()},[t]),h.jsxs(ic,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[h.jsxs(ae,{maxHeight:"80vh",overflowY:"auto",children:[h.jsxs(ae,{children:[h.jsx(Ot,{size:"lg",children:"Profile"}),n&&h.jsx(Ci,{user:n.user,options:{relayUrls:n.relayUrls}})]}),h.jsx(ae,{children:e?h.jsx(a0,{userComponent:Ci,view:c,filters:u,connected:e}):h.jsx(ce,{children:"Not connected."})})]}),h.jsxs(ae,{display:"flex",flexDirection:"column",children:[h.jsx(Ot,{as:"h2",size:"md",marginBottom:4,children:"Broadcast to the Network"}),h.jsx(c0,{})]})]})}function RY({props:e}){const[t,n]=y.useState({name:"",display_name:"",picture:"",banner:"",nip05:"",website:"",about:"",image:"",lud16:"",lud06:""}),[r,o]=y.useState(""),[i,s]=y.useState(!1),a=y.useRef(!1),l=Ri();y.useEffect(()=>{e.metadata&&!a.current&&n(Object.assign(t,e.metadata))},[e.metadata]);const c=async()=>{s(!0);const d={};for(const[p,g]of Object.entries(t))g&&g!==""&&(d[p]=g);const f=Iq({userMetadata:d,mastodonUrl:r});if(Object.keys(d).length===0){l({title:"No changes",description:"No changes to update.",status:"info",duration:5e3,isClosable:!0}),s(!1);return}try{await Y.getState().signAndSendEvent({event:f}),s(!1),await Y.getState().subscribe({type:fc.REQ,filters:new Si({authors:[e.pubkey],kinds:[fn.METADATA]}),options:{timeoutIn:1e4}})}catch(p){console.error(p),s(!1)}},u=d=>{const{name:f,value:p}=d.target;n(g=>({...g,[f]:p})),a.current=!0};return h.jsxs(ae,{marginBottom:10,children:[h.jsxs(Pt,{id:"name",mb:4,children:[h.jsx(_t,{children:"Name"}),h.jsx(mt,{name:"name",value:t.name,onChange:u})]}),h.jsxs(Pt,{id:"display_name",mb:4,children:[h.jsx(_t,{children:"Display Name"}),h.jsx(mt,{name:"display_name",value:t.display_name||"",onChange:u})]}),h.jsxs(Pt,{id:"website",mb:4,children:[h.jsx(_t,{children:"Website"}),h.jsx(mt,{name:"website",value:t.website||"",onChange:u})]}),h.jsxs(Pt,{id:"about",mb:4,children:[h.jsx(_t,{children:"About"}),h.jsx(Hy,{name:"about",value:t.about||"",onChange:u})]}),h.jsxs(Pt,{id:"picture",mb:4,children:[h.jsx(_t,{children:"Picture URL"}),h.jsx(mt,{name:"picture",value:t.picture||"",onChange:u}),h.jsx(Fo,{children:"URL for your profile picture."})]}),h.jsxs(Pt,{id:"banner",mb:4,children:[h.jsx(_t,{children:"Banner URL"}),h.jsx(mt,{name:"banner",value:t.banner||"",onChange:u}),h.jsx(Fo,{children:"URL for your profile banner."})]}),h.jsxs(Pt,{id:"image",mb:4,children:[h.jsx(_t,{children:"Image URL"}),h.jsx(mt,{name:"image",value:t.image||"",onChange:u}),h.jsx(Fo,{children:"URL for an additional image."})]}),h.jsxs(Pt,{id:"nip05",mb:4,children:[h.jsx(_t,{children:"NIP05"}),h.jsx(mt,{name:"nip05",value:t.nip05||"",onChange:u}),h.jsx(Fo,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),h.jsxs(Pt,{id:"lud16",mb:4,children:[h.jsx(_t,{children:"LUD16"}),h.jsx(mt,{name:"lud16",value:t.lud16||"",onChange:u}),h.jsx(Fo,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),h.jsxs(Pt,{id:"lud06",mb:4,children:[h.jsx(_t,{children:"LUD06"}),h.jsx(mt,{name:"lud06",value:t.lud06||"",onChange:u}),h.jsx(Fo,{children:"bech32 encoded lnurl"})]}),h.jsxs(Pt,{id:"mastodonUrl",mb:4,children:[h.jsx(_t,{children:"Mastodon URL"}),h.jsx(mt,{name:"mastodonUrl",value:r,onChange:d=>o(d.target.value)})]}),h.jsxs(eT,{children:[h.jsx(Te,{colorScheme:"blue",type:"submit",isLoading:i,onClick:c,children:"Send update"}),h.jsx(Te,{isDisabled:!a.current,onClick:()=>a.current=!1,children:"Reset"})]})]})}function AY(){const[e,t]=Y(c=>{var u;return[((u=c.keypair)==null?void 0:u.publicKey)||"",c.connected]}),[n,r]=y.useState(null),[o,i]=y.useState([]),s=Ri(),a=async()=>{if(!e||e==="")return;const c=await Y.getState().getUser(e);c&&(r(c.user),i(c.relayUrls))},l=async()=>{if(!e||e===""){s({title:"Not found",description:"No user data found yet. Did you publish your profile to one of the connected relays?",status:"error",duration:5e3,isClosable:!0});return}await Y.getState().subscribe({type:fc.REQ,filters:new Si({authors:[e],kinds:[fn.METADATA]}),options:{timeoutIn:1e4}}),s({title:"Refreshing ...",description:"Requesting information from the network.",status:"info",duration:5e3,isClosable:!0})};return y.useEffect(()=>{const c=setInterval(()=>{a()},1e3);return()=>{clearInterval(c)}},[]),h.jsxs(ae,{children:[n?h.jsx(Ci,{user:n,options:{relayUrls:o}}):h.jsxs(h.Fragment,{children:[h.jsx(ce,{children:'"No user data found yet. Did you publish your profile to one of the connected relays?".'}),t&&h.jsx(Te,{onClick:l,children:"Try again"})]}),h.jsx(Ot,{as:"h2",size:"lg",mb:4,mt:4,children:"Update your profile"}),h.jsx(RY,{props:{pubkey:e,metadata:n==null?void 0:n.data}})]})}const $Y=async()=>{await Y.getState().init({maxEvents:bo})};$Y();Sg.createRoot(document.getElementById("root")).render(h.jsx(si.StrictMode,{children:h.jsx(wD,{children:h.jsx(gH,{basename:"/nostr-ts/",children:h.jsx(cH,{children:h.jsxs(In,{element:h.jsx(mZ,{}),children:[h.jsx(In,{path:"/",element:h.jsx(uY,{})}),h.jsx(In,{path:"/account",element:h.jsx(CK,{})}),h.jsx(In,{path:"/profile",element:h.jsx(AY,{})}),h.jsx(In,{path:"/following",element:h.jsx(dY,{})}),h.jsx(In,{path:"/mentions/:pubkey",element:h.jsx(_Y,{})}),h.jsx(In,{path:"/subscriptions",element:h.jsx(pY,{})}),h.jsx(In,{path:"/relays",element:h.jsx(gY,{})}),h.jsx(In,{path:"/queue",element:h.jsx(PY,{})}),h.jsx(In,{path:"/p/:pubkey",element:h.jsx(mY,{})})]})})})})})); diff --git a/assets/worker-99c26521.js b/assets/worker-99c26521.js new file mode 100644 index 0000000..434b868 --- /dev/null +++ b/assets/worker-99c26521.js @@ -0,0 +1,9 @@ +var xi=Object.defineProperty;var Ii=(X,Q,ae)=>Q in X?xi(X,Q,{enumerable:!0,configurable:!0,writable:!0,value:ae}):X[Q]=ae;var N=(X,Q,ae)=>(Ii(X,typeof Q!="symbol"?Q+"":Q,ae),ae);(function(){"use strict";var X={};Object.defineProperty(X,"__esModule",{value:!0}),X.bech32m=Y=X.bech32=void 0;const Q="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ae={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function xt(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=Ae(t)^r>>5}t=Ae(t);for(let n=0;n=n;)i-=n,c.push(s>>i&o);if(r)i>0&&c.push(s<=t)return"Excess padding";if(s<a)throw new TypeError("Exceeds length limit");o=o.toLowerCase();let u=xt(o);if(typeof u=="string")throw new Error(u);let l=o+"1";for(let f=0;f>5)throw new Error("Non 5-bit word");u=Ae(u)^g,l+=Q.charAt(g)}for(let f=0;f<6;++f)u=Ae(u);u^=t;for(let f=0;f<6;++f){const g=u>>(5-f)*5&31;l+=Q.charAt(g)}return l}function r(o,c){if(c=c||90,o.length<8)return o+" too short";if(o.length>c)return"Exceeds length limit";const a=o.toLowerCase(),u=o.toUpperCase();if(o!==a&&o!==u)return"Mixed-case string "+o;o=a;const l=o.lastIndexOf("1");if(l===-1)return"No separator character for "+o;if(l===0)return"Missing prefix for "+o;const f=o.slice(0,l),g=o.slice(l+1);if(g.length<6)return"Data too short";let E=xt(f);if(typeof E=="string")return E;const T=[];for(let w=0;w=g.length)&&T.push(v)}return E!==t?"Invalid checksum for "+o:{prefix:f,words:T}}function s(o,c){const a=r(o,c);if(typeof a=="object")return a}function i(o,c){const a=r(o,c);if(typeof a=="object")return a;throw new Error(a)}return{decodeUnsafe:s,decode:i,encode:n,toWords:Pn,fromWordsUnsafe:Mn,fromWords:Hn}}var Y=X.bech32=It("bech32");X.bech32m=It("bech32m");var Ut={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(d){if(!Number.isSafeInteger(d))throw new Error(`Wrong integer: ${d}`)}e.assertNumber=t;function n(...d){const p=(h,y)=>A=>h(y(A)),b=Array.from(d).reverse().reduce((h,y)=>h?p(h,y.encode):y.encode,void 0),I=d.reduce((h,y)=>h?p(h,y.decode):y.decode,void 0);return{encode:b,decode:I}}function r(d){return{encode:p=>{if(!Array.isArray(p)||p.length&&typeof p[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return p.map(b=>{if(t(b),b<0||b>=d.length)throw new Error(`Digit index outside alphabet: ${b} (alphabet: ${d.length})`);return d[b]})},decode:p=>{if(!Array.isArray(p)||p.length&&typeof p[0]!="string")throw new Error("alphabet.decode input should be array of strings");return p.map(b=>{if(typeof b!="string")throw new Error(`alphabet.decode: not string element=${b}`);const I=d.indexOf(b);if(I===-1)throw new Error(`Unknown letter: "${b}". Allowed: ${d}`);return I})}}}function s(d=""){if(typeof d!="string")throw new Error("join separator should be string");return{encode:p=>{if(!Array.isArray(p)||p.length&&typeof p[0]!="string")throw new Error("join.encode input should be array of strings");for(let b of p)if(typeof b!="string")throw new Error(`join.encode: non-string input=${b}`);return p.join(d)},decode:p=>{if(typeof p!="string")throw new Error("join.decode input should be string");return p.split(d)}}}function i(d,p="="){if(t(d),typeof p!="string")throw new Error("padding chr should be string");return{encode(b){if(!Array.isArray(b)||b.length&&typeof b[0]!="string")throw new Error("padding.encode input should be array of strings");for(let I of b)if(typeof I!="string")throw new Error(`padding.encode: non-string input=${I}`);for(;b.length*d%8;)b.push(p);return b},decode(b){if(!Array.isArray(b)||b.length&&typeof b[0]!="string")throw new Error("padding.encode input should be array of strings");for(let h of b)if(typeof h!="string")throw new Error(`padding.decode: non-string input=${h}`);let I=b.length;if(I*d%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;I>0&&b[I-1]===p;I--)if(!((I-1)*d%8))throw new Error("Invalid padding: string has too much padding");return b.slice(0,I)}}}function o(d){if(typeof d!="function")throw new Error("normalize fn should be function");return{encode:p=>p,decode:p=>d(p)}}function c(d,p,b){if(p<2)throw new Error(`convertRadix: wrong from=${p}, base cannot be less than 2`);if(b<2)throw new Error(`convertRadix: wrong to=${b}, base cannot be less than 2`);if(!Array.isArray(d))throw new Error("convertRadix: data should be array");if(!d.length)return[];let I=0;const h=[],y=Array.from(d);for(y.forEach(A=>{if(t(A),A<0||A>=p)throw new Error(`Wrong integer: ${A}`)});;){let A=0,_=!0;for(let B=I;Bp?a(p,d%p):d,u=(d,p)=>d+(p-a(d,p));function l(d,p,b,I){if(!Array.isArray(d))throw new Error("convertRadix2: data should be array");if(p<=0||p>32)throw new Error(`convertRadix2: wrong from=${p}`);if(b<=0||b>32)throw new Error(`convertRadix2: wrong to=${b}`);if(u(p,b)>32)throw new Error(`convertRadix2: carry overflow from=${p} to=${b} carryBits=${u(p,b)}`);let h=0,y=0;const A=2**b-1,_=[];for(const B of d){if(t(B),B>=2**p)throw new Error(`convertRadix2: invalid data word=${B} from=${p}`);if(h=h<32)throw new Error(`convertRadix2: carry overflow pos=${y} from=${p}`);for(y+=p;y>=b;y-=b)_.push((h>>y-b&A)>>>0);h&=2**y-1}if(h=h<=p)throw new Error("Excess padding");if(!I&&h)throw new Error(`Non-zero padding: ${h}`);return I&&y>0&&_.push(h>>>0),_}function f(d){return t(d),{encode:p=>{if(!(p instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(p),2**8,d)},decode:p=>{if(!Array.isArray(p)||p.length&&typeof p[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(c(p,d,2**8))}}}function g(d,p=!1){if(t(d),d<=0||d>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,d)>32||u(d,8)>32)throw new Error("radix2: carry overflow");return{encode:b=>{if(!(b instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(b),8,d,!p)},decode:b=>{if(!Array.isArray(b)||b.length&&typeof b[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(l(b,d,8,p))}}}function E(d){if(typeof d!="function")throw new Error("unsafeWrapper fn should be function");return function(...p){try{return d.apply(null,p)}catch{}}}function T(d,p){if(t(d),typeof p!="function")throw new Error("checksum fn should be function");return{encode(b){if(!(b instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const I=p(b).slice(0,d),h=new Uint8Array(b.length+d);return h.set(b),h.set(I,b.length),h},decode(b){if(!(b instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const I=b.slice(0,-d),h=p(I).slice(0,d),y=b.slice(-d);for(let A=0;Ad.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(g(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),s("")),e.base64url=n(g(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),s(""));const w=d=>n(f(58),r(d),s(""));e.base58=w("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=w("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=w("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const m=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(d){let p="";for(let b=0;bn(T(4,p=>d(d(p))),e.base58);e.base58check=v;const U=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),k=[996825010,642813549,513874426,1027748829,705979059];function S(d){const p=d>>25;let b=(d&33554431)<<5;for(let I=0;I>I&1)===1&&(b^=k[I]);return b}function C(d,p,b=1){const I=d.length;let h=1;for(let y=0;y126)throw new Error(`Invalid prefix (${d})`);h=S(h)^A>>5}h=S(h);for(let y=0;yz)throw new TypeError(`Length ${Z} exceeds limit ${z}`);return O=O.toLowerCase(),`${O}1${U.encode($)}${C(O,$,p)}`}function _(O,$=90){if(typeof O!="string")throw new Error(`bech32.decode input should be string, not ${typeof O}`);if(O.length<8||$!==!1&&O.length>$)throw new TypeError(`Wrong string length: ${O.length} (${O}). Expected (8..${$})`);const z=O.toLowerCase();if(O!==z&&O!==O.toUpperCase())throw new Error("String must be lowercase or uppercase");O=z;const Z=O.lastIndexOf("1");if(Z===0||Z===-1)throw new Error('Letter "1" must be present between prefix and data only');const oe=O.slice(0,Z),ce=O.slice(Z+1);if(ce.length<6)throw new Error("Data must be at least 6 characters long");const te=U.decode(ce).slice(0,-6),xe=C(oe,te,p);if(!ce.endsWith(xe))throw new Error(`Invalid checksum in ${O}: expected "${xe}"`);return{prefix:oe,words:te}}const B=E(_);function M(O){const{prefix:$,words:z}=_(O,!1);return{prefix:$,words:z,bytes:I(z)}}return{encode:A,decode:_,decodeToBytes:M,decodeUnsafe:B,fromWords:I,fromWordsUnsafe:y,toWords:h}}e.bech32=x("bech32"),e.bech32m=x("bech32m"),e.utf8={encode:d=>new TextDecoder().decode(d),decode:d=>new TextEncoder().encode(d)},e.hex=n(g(4),r("0123456789abcdef"),s(""),o(d=>{if(typeof d!="string"||d.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof d} with length ${d.length}`);return d.toLowerCase()}));const R={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},L=`Invalid encoding type. Available types: ${Object.keys(R).join(", ")}`,D=(d,p)=>{if(typeof d!="string"||!R.hasOwnProperty(d))throw new TypeError(L);if(!(p instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return R[d].encode(p)};e.bytesToString=D,e.str=e.bytesToString;const P=(d,p)=>{if(!R.hasOwnProperty(d))throw new TypeError(L);if(typeof p!="string")throw new TypeError("stringToBytes() expects string");return R[d].decode(p)};e.stringToBytes=P,e.bytes=e.stringToBytes})(Ut);const{bech32:re,hex:K,utf8:Wn}=Ut,Rt={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},kt={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},Ot={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},Bt={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},Ce=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],qn={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},zn=BigInt("2100000000000000000"),Ct=BigInt(1e11),Ve={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},Lt={};for(let e=0,t=Object.keys(Ve);eK.encode(re.fromWordsUnsafe(e)),16:e=>K.encode(re.fromWordsUnsafe(e)),13:e=>Wn.encode(re.fromWordsUnsafe(e)),19:e=>K.encode(re.fromWordsUnsafe(e)),23:e=>K.encode(re.fromWordsUnsafe(e)),27:e=>K.encode(re.fromWordsUnsafe(e)),6:Le,24:Le,3:Zn,5:Gn};function Fn(e){return t=>({tagCode:parseInt(e),words:re.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function Le(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function Zn(e){const t=[];let n,r,s,i,o,c=re.fromWordsUnsafe(e);for(;c.length>0;)n=K.encode(c.slice(0,33)),r=K.encode(c.slice(33,41)),s=parseInt(K.encode(c.slice(41,45)),16),i=parseInt(K.encode(c.slice(45,49)),16),o=parseInt(K.encode(c.slice(49,51)),16),c=c.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:s,fee_proportional_millionths:i,cltv_expiry_delta:o});return t}function Gn(e){const t=e.slice().reverse().map(s=>[!!(s&1),!!(s&2),!!(s&4),!!(s&8),!!(s&16)]).reduce((s,i)=>s.concat(i),[]);for(;t.length{let o;t[i*2]?o="required":t[i*2+1]?o="supported":o="unsupported",n[s]=o});const r=t.slice(Ce.length*2);return n.extra_bits={start_bit:Ce.length*2,bits:r,has_required:r.reduce((s,i,o)=>o%2!==0?s||!1:s||i,!1)},n}function _t(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const s=BigInt(r),i=n?s*Ct/qn[n]:s*Ct;if(n==="p"&&s%BigInt(10)!==BigInt(0)||i>zn)throw new Error("Amount is outside of valid range");return t?i.toString():i}function Dn(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=re.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const s=r.prefix;let i=r.words,o=e.slice(s.length+1),c=i.slice(-104);i=i.slice(0,-104);let a=s.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(a&&!a[2]&&(a=s.match(/^ln(\S+)$/)),!a)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=a[1];let l;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");l=t}else switch(u){case Rt.bech32:l=Rt;break;case kt.bech32:l=kt;break;case Ot.bech32:l=Ot;break;case Bt.bech32:l=Bt;break}if(!l||l.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:l});const f=a[2];let g;if(f){const S=a[3];g=_t(f+S,!0),n.push({name:"amount",letters:a[2]+a[3],value:g})}else g=null;n.push({name:"separator",letters:"1"});const E=Le(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:o.slice(0,7),value:E}),o=o.slice(7);let T,w,m,v;for(;i.length>0;){const S=i[0].toString();T=Lt[S]||"unknown_tag",w=jn[S]||Fn(S),i=i.slice(1),m=Le(i.slice(0,2)),i=i.slice(2),v=i.slice(0,m),i=i.slice(m),n.push({name:T,tag:o[0],letters:o.slice(0,1+2+m),value:w(v)}),o=o.slice(1+2+m)}n.push({name:"signature",letters:o.slice(0,104),value:K.encode(re.fromWordsUnsafe(c))}),o=o.slice(104),n.push({name:"checksum",letters:o});let U={paymentRequest:e,sections:n,get expiry(){let S=n.find(C=>C.name==="expiry");if(S)return k("timestamp")+S.value},get route_hints(){return n.filter(S=>S.name==="route_hint").map(S=>S.value)}};for(let S in Ve)S!=="route_hint"&&Object.defineProperty(U,S,{get(){return k(S)}});return U;function k(S){let C=n.find(x=>x.name===S);return C?C.value:void 0}}var Nn={decode:Dn,hrpToMillisat:_t};function Xe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Qn(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function $t(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Jn(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Xe(e.outputLen),Xe(e.blockLen)}function Vn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Xn(e,t){$t(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,Ke=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),se=(e,t)=>e<<32-t|e>>>t;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Yn(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function et(e){if(typeof e=="string"&&(e=Yn(e)),!Pt(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Kn(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!Pt(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class Mt{clone(){return this._cloneInto()}}function Ht(e){const t=r=>e().update(et(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Wt(e=32){if(Ye&&typeof Ye.getRandomValues=="function")return Ye.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function er(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),c=Number(n&i),a=r?4:0,u=r?0:4;e.setUint32(t+a,o,r),e.setUint32(t+u,c,r)}class tr extends Mt{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ke(this.buffer)}update(t){pe.exists(this);const{view:n,buffer:r,blockLen:s}=this;t=et(t);const i=t.length;for(let o=0;os-o&&(this.process(r,0),o=0);for(let f=o;fl.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,rr=(e,t,n)=>e&t^e&n^t&n,sr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ue=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),le=new Uint32Array(64);class qt extends tr{constructor(){super(64,32,8,!1),this.A=ue[0]|0,this.B=ue[1]|0,this.C=ue[2]|0,this.D=ue[3]|0,this.E=ue[4]|0,this.F=ue[5]|0,this.G=ue[6]|0,this.H=ue[7]|0}get(){const{A:t,B:n,C:r,D:s,E:i,F:o,G:c,H:a}=this;return[t,n,r,s,i,o,c,a]}set(t,n,r,s,i,o,c,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=c|0,this.H=a|0}process(t,n){for(let f=0;f<16;f++,n+=4)le[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const g=le[f-15],E=le[f-2],T=se(g,7)^se(g,18)^g>>>3,w=se(E,17)^se(E,19)^E>>>10;le[f]=w+le[f-7]+T+le[f-16]|0}let{A:r,B:s,C:i,D:o,E:c,F:a,G:u,H:l}=this;for(let f=0;f<64;f++){const g=se(c,6)^se(c,11)^se(c,25),E=l+g+nr(c,a,u)+sr[f]+le[f]|0,w=(se(r,2)^se(r,13)^se(r,22))+rr(r,s,i)|0;l=u,u=a,a=c,c=o+E|0,o=i,i=s,s=r,r=E+w|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,c=c+this.E|0,a=a+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,s,i,o,c,a,u,l)}roundClean(){le.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class ir extends qt{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const _e=Ht(()=>new qt);Ht(()=>new ir);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zt=BigInt(0),$e=BigInt(1),or=BigInt(2),Pe=e=>e instanceof Uint8Array,cr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fe(e){if(!Pe(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+s.length,0));let n=0;return e.forEach(r=>{if(!Pe(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function ur(e,t){if(e.length!==t.length)return!1;for(let n=0;nzt;e>>=$e,t+=1);return t}function dr(e,t){return e>>BigInt(t)&$e}const hr=(e,t,n)=>e|(n?$e:zt)<(or<new Uint8Array(e),Zt=e=>Uint8Array.from(e);function Gt(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=st(e),s=st(e),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},c=(...f)=>n(s,r,...f),a=(f=st())=>{s=c(Zt([0]),f),r=c(),f.length!==0&&(s=c(Zt([1]),f),r=c())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const g=[];for(;f{o(),a(f);let E;for(;!(E=g(u()));)a();return o(),E}}const gr={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function ke(e,t,n={}){const r=(s,i,o)=>{const c=gr[i];if(typeof c!="function")throw new Error(`Invalid validator "${i}", expected function`);const a=e[s];if(!(o&&a===void 0)&&!c(a,e))throw new Error(`Invalid param ${String(s)}=${a} (${typeof a}), expected ${i}`)};for(const[s,i]of Object.entries(t))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return e}var pr=Object.freeze({__proto__:null,bitGet:dr,bitLen:fr,bitMask:rt,bitSet:hr,bytesToHex:fe,bytesToNumberBE:G,bytesToNumberLE:nt,concatBytes:ye,createHmacDrbg:Gt,ensureBytes:j,equalBytes:ur,hexToBytes:Te,hexToNumber:tt,numberToBytesBE:de,numberToBytesLE:Ft,numberToHexUnpadded:jt,numberToVarBytesBE:ar,utf8ToBytes:lr,validateObject:ke});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const q=BigInt(0),H=BigInt(1),we=BigInt(2),yr=BigInt(3),it=BigInt(4),Dt=BigInt(5),Nt=BigInt(8);BigInt(9),BigInt(16);function F(e,t){const n=e%t;return n>=q?n:t+n}function wr(e,t,n){if(n<=q||t 0");if(n===H)return q;let r=H;for(;t>q;)t&H&&(r=r*e%n),e=e*e%n,t>>=H;return r}function J(e,t,n){let r=e;for(;t-- >q;)r*=r,r%=n;return r}function ot(e,t){if(e===q||t<=q)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=F(e,t),r=t,s=q,i=H;for(;n!==q;){const c=r/n,a=r%n,u=s-i*c;r=n,n=a,s=i,i=u}if(r!==H)throw new Error("invert: does not exist");return F(s,t)}function br(e){const t=(e-H)/we;let n,r,s;for(n=e-H,r=0;n%we===q;n/=we,r++);for(s=we;s(r[s]="function",r),t);return ke(e,n)}function Ar(e,t,n){if(n 0");if(n===q)return e.ONE;if(n===H)return t;let r=e.ONE,s=t;for(;n>q;)n&H&&(r=e.mul(r,s)),s=e.sqr(s),n>>=H;return r}function Tr(e,t){const n=new Array(t.length),r=t.reduce((i,o,c)=>e.is0(o)?i:(n[c]=i,e.mul(i,o)),e.ONE),s=e.inv(r);return t.reduceRight((i,o,c)=>e.is0(o)?i:(n[c]=e.mul(i,n[c]),e.mul(i,o)),s),n}function ct(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Sr(e,t,n=!1,r={}){if(e<=q)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=ct(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=mr(e),c=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:rt(s),ZERO:q,ONE:H,create:a=>F(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);return q<=a&&aa===q,isOdd:a=>(a&H)===H,neg:a=>F(-a,e),eql:(a,u)=>a===u,sqr:a=>F(a*a,e),add:(a,u)=>F(a+u,e),sub:(a,u)=>F(a-u,e),mul:(a,u)=>F(a*u,e),pow:(a,u)=>Ar(c,a,u),div:(a,u)=>F(a*ot(u,e),e),sqrN:a=>a*a,addN:(a,u)=>a+u,subN:(a,u)=>a-u,mulN:(a,u)=>a*u,inv:a=>ot(a,e),sqrt:r.sqrt||(a=>o(c,a)),invertBatch:a=>Tr(c,a),cmov:(a,u,l)=>l?u:a,toBytes:a=>n?Ft(a,i):de(a,i),fromBytes:a=>{if(a.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${a.length}`);return n?nt(a):G(a)}});return Object.freeze(c)}function xr(e,t,n=!1){e=j("privateHash",e);const r=e.length,s=ct(t).nByteLength+8;if(s<24||r1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${r}`);const i=n?nt(e):G(e);return F(i,t-H)+H}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ir=BigInt(0),at=BigInt(1);function Ur(e,t){const n=(s,i)=>{const o=i.negate();return s?o:i},r=s=>{const i=Math.ceil(t/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,i){let o=e.ZERO,c=s;for(;i>Ir;)i&at&&(o=o.add(c)),c=c.double(),i>>=at;return o},precomputeWindow(s,i){const{windows:o,windowSize:c}=r(i),a=[];let u=s,l=u;for(let f=0;f>=E,m>a&&(m-=g,o+=at);const v=w,U=w+Math.abs(m)-1,k=T%2!==0,S=m<0;m===0?l=l.add(n(k,i[v])):u=u.add(n(S,i[U]))}return{p:u,f:l}},wNAFCached(s,i,o,c){const a=s._WINDOW_SIZE||1;let u=i.get(s);return u||(u=this.precomputeWindow(s,a),a!==1&&i.set(s,c(u))),this.wNAF(a,u,o)}}}function Qt(e){return vr(e.Fp),ke(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ct(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Rr(e){const t=Qt(e);ke(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:kr,hexToBytes:Or}=pr,be={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=be;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:kr(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=be,n=typeof e=="string"?Or(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:i}=be._parseInt(n.subarray(2)),{d:o,l:c}=be._parseInt(i);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const l=u.toString(16);return l.length&1?`0${l}`:l},r=t(n(e.s)),s=t(n(e.r)),i=r.length/2,o=s.length/2,c=n(i),a=n(o);return`30${n(o+i+4)}02${a}${s}02${c}${r}`}},ie=BigInt(0),V=BigInt(1);BigInt(2);const Jt=BigInt(3);BigInt(4);function Br(e){const t=Rr(e),{Fp:n}=t,r=t.toBytes||((T,w,m)=>{const v=w.toAffine();return ye(Uint8Array.from([4]),n.toBytes(v.x),n.toBytes(v.y))}),s=t.fromBytes||(T=>{const w=T.subarray(1),m=n.fromBytes(w.subarray(0,n.BYTES)),v=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:m,y:v}});function i(T){const{a:w,b:m}=t,v=n.sqr(T),U=n.mul(v,T);return n.add(n.add(U,n.mul(T,w)),m)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function o(T){return typeof T=="bigint"&&ien.eql(k,n.ZERO);return U(m)&&U(v)?f.ZERO:new f(m,v,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const m=n.invertBatch(w.map(v=>v.pz));return w.map((v,U)=>v.toAffine(m[U])).map(f.fromAffine)}static fromHex(w){const m=f.fromAffine(s(j("pointHex",w)));return m.assertValidity(),m}static fromPrivateKey(w){return f.BASE.multiply(a(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:w,y:m}=this.toAffine();if(!n.isValid(w)||!n.isValid(m))throw new Error("bad point: x or y not FE");const v=n.sqr(m),U=i(w);if(!n.eql(v,U))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){l(w);const{px:m,py:v,pz:U}=this,{px:k,py:S,pz:C}=w,x=n.eql(n.mul(m,C),n.mul(k,U)),R=n.eql(n.mul(v,C),n.mul(S,U));return x&&R}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:m}=t,v=n.mul(m,Jt),{px:U,py:k,pz:S}=this;let C=n.ZERO,x=n.ZERO,R=n.ZERO,L=n.mul(U,U),D=n.mul(k,k),P=n.mul(S,S),d=n.mul(U,k);return d=n.add(d,d),R=n.mul(U,S),R=n.add(R,R),C=n.mul(w,R),x=n.mul(v,P),x=n.add(C,x),C=n.sub(D,x),x=n.add(D,x),x=n.mul(C,x),C=n.mul(d,C),R=n.mul(v,R),P=n.mul(w,P),d=n.sub(L,P),d=n.mul(w,d),d=n.add(d,R),R=n.add(L,L),L=n.add(R,L),L=n.add(L,P),L=n.mul(L,d),x=n.add(x,L),P=n.mul(k,S),P=n.add(P,P),L=n.mul(P,d),C=n.sub(C,L),R=n.mul(P,D),R=n.add(R,R),R=n.add(R,R),new f(C,x,R)}add(w){l(w);const{px:m,py:v,pz:U}=this,{px:k,py:S,pz:C}=w;let x=n.ZERO,R=n.ZERO,L=n.ZERO;const D=t.a,P=n.mul(t.b,Jt);let d=n.mul(m,k),p=n.mul(v,S),b=n.mul(U,C),I=n.add(m,v),h=n.add(k,S);I=n.mul(I,h),h=n.add(d,p),I=n.sub(I,h),h=n.add(m,U);let y=n.add(k,C);return h=n.mul(h,y),y=n.add(d,b),h=n.sub(h,y),y=n.add(v,U),x=n.add(S,C),y=n.mul(y,x),x=n.add(p,b),y=n.sub(y,x),L=n.mul(D,h),x=n.mul(P,b),L=n.add(x,L),x=n.sub(p,L),L=n.add(p,L),R=n.mul(x,L),p=n.add(d,d),p=n.add(p,d),b=n.mul(D,b),h=n.mul(P,h),p=n.add(p,b),b=n.sub(d,b),b=n.mul(D,b),h=n.add(h,b),d=n.mul(p,h),R=n.add(R,d),d=n.mul(y,h),x=n.mul(I,x),x=n.sub(x,d),d=n.mul(I,p),L=n.mul(y,L),L=n.add(L,d),new f(x,R,L)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return E.wNAFCached(this,u,w,m=>{const v=n.invertBatch(m.map(U=>U.pz));return m.map((U,k)=>U.toAffine(v[k])).map(f.fromAffine)})}multiplyUnsafe(w){const m=f.ZERO;if(w===ie)return m;if(c(w),w===V)return this;const{endo:v}=t;if(!v)return E.unsafeLadder(this,w);let{k1neg:U,k1:k,k2neg:S,k2:C}=v.splitScalar(w),x=m,R=m,L=this;for(;k>ie||C>ie;)k&V&&(x=x.add(L)),C&V&&(R=R.add(L)),L=L.double(),k>>=V,C>>=V;return U&&(x=x.negate()),S&&(R=R.negate()),R=new f(n.mul(R.px,v.beta),R.py,R.pz),x.add(R)}multiply(w){c(w);let m=w,v,U;const{endo:k}=t;if(k){const{k1neg:S,k1:C,k2neg:x,k2:R}=k.splitScalar(m);let{p:L,f:D}=this.wNAF(C),{p:P,f:d}=this.wNAF(R);L=E.constTimeNegate(S,L),P=E.constTimeNegate(x,P),P=new f(n.mul(P.px,k.beta),P.py,P.pz),v=L.add(P),U=D.add(d)}else{const{p:S,f:C}=this.wNAF(m);v=S,U=C}return f.normalizeZ([v,U])[0]}multiplyAndAddUnsafe(w,m,v){const U=f.BASE,k=(C,x)=>x===ie||x===V||!C.equals(U)?C.multiplyUnsafe(x):C.multiply(x),S=k(this,m).add(k(w,v));return S.is0()?void 0:S}toAffine(w){const{px:m,py:v,pz:U}=this,k=this.is0();w==null&&(w=k?n.ONE:n.inv(U));const S=n.mul(m,w),C=n.mul(v,w),x=n.mul(U,w);if(k)return{x:n.ZERO,y:n.ZERO};if(!n.eql(x,n.ONE))throw new Error("invZ was invalid");return{x:S,y:C}}isTorsionFree(){const{h:w,isTorsionFree:m}=t;if(w===V)return!0;if(m)return m(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:m}=t;return w===V?this:m?m(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return fe(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const g=t.nBitLength,E=Ur(f,t.endo?Math.ceil(g/2):g);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:a,weierstrassEquation:i,isWithinCurveOrder:o}}function Cr(e){const t=Qt(e);return ke(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Lr(e){const t=Cr(e),{Fp:n,n:r}=t,s=n.BYTES+1,i=2*n.BYTES+1;function o(h){return iefe(de(h,t.nByteLength));function T(h){const y=r>>V;return h>y}function w(h){return T(h)?c(-h):h}const m=(h,y,A)=>G(h.slice(y,A));class v{constructor(y,A,_){this.r=y,this.s=A,this.recovery=_,this.assertValidity()}static fromCompact(y){const A=t.nByteLength;return y=j("compactSignature",y,A*2),new v(m(y,0,A),m(y,A,2*A))}static fromDER(y){const{r:A,s:_}=be.toSig(j("DER",y));return new v(A,_)}assertValidity(){if(!g(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!g(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(y){return new v(this.r,this.s,y)}recoverPublicKey(y){const{r:A,s:_,recovery:B}=this,M=R(j("msgHash",y));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const O=B===2||B===3?A+t.n:A;if(O>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const $=B&1?"03":"02",z=u.fromHex($+E(O)),Z=a(O),oe=c(-M*Z),ce=c(_*Z),te=u.BASE.multiplyAndAddUnsafe(z,oe,ce);if(!te)throw new Error("point at infinify");return te.assertValidity(),te}hasHighS(){return T(this.s)}normalizeS(){return this.hasHighS()?new v(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Te(this.toDERHex())}toDERHex(){return be.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Te(this.toCompactHex())}toCompactHex(){return E(this.r)+E(this.s)}}const U={isValidPrivateKey(h){try{return l(h),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const h=t.randomBytes(n.BYTES+8),y=xr(h,r);return de(y,t.nByteLength)},precompute(h=8,y=u.BASE){return y._setWindowSize(h),y.multiply(BigInt(3)),y}};function k(h,y=!0){return u.fromPrivateKey(h).toRawBytes(y)}function S(h){const y=h instanceof Uint8Array,A=typeof h=="string",_=(y||A)&&h.length;return y?_===s||_===i:A?_===2*s||_===2*i:h instanceof u}function C(h,y,A=!0){if(S(h))throw new Error("first arg must be private key");if(!S(y))throw new Error("second arg must be public key");return u.fromHex(y).multiply(l(h)).toRawBytes(A)}const x=t.bits2int||function(h){const y=G(h),A=h.length*8-t.nBitLength;return A>0?y>>BigInt(A):y},R=t.bits2int_modN||function(h){return c(x(h))},L=rt(t.nBitLength);function D(h){if(typeof h!="bigint")throw new Error("bigint expected");if(!(ie<=h&&hve in A))throw new Error("sign() legacy options not supported");const{hash:_,randomBytes:B}=t;let{lowS:M,prehash:O,extraEntropy:$}=A;M==null&&(M=!0),h=j("msgHash",h),O&&(h=j("prehashed msgHash",_(h)));const z=R(h),Z=l(y),oe=[D(Z),D(z)];if($!=null){const ve=$===!0?B(n.BYTES):$;oe.push(j("extraEntropy",ve,n.BYTES))}const ce=ye(...oe),te=z;function xe(ve){const Ie=x(ve);if(!g(Ie))return;const Ln=a(Ie),Ue=u.BASE.multiply(Ie).toAffine(),ne=c(Ue.x);if(ne===ie)return;const Re=c(Ln*c(te+ne*Z));if(Re===ie)return;let _n=(Ue.x===ne?0:2)|Number(Ue.y&V),$n=Re;return M&&T(Re)&&($n=w(Re),_n^=1),new v(ne,$n,_n)}return{seed:ce,k2sig:xe}}const d={lowS:t.lowS,prehash:!1},p={lowS:t.lowS,prehash:!1};function b(h,y,A=d){const{seed:_,k2sig:B}=P(h,y,A),M=t;return Gt(M.hash.outputLen,M.nByteLength,M.hmac)(_,B)}u.BASE._setWindowSize(8);function I(h,y,A,_=p){var Ue;const B=h;if(y=j("msgHash",y),A=j("publicKey",A),"strict"in _)throw new Error("options.strict was renamed to lowS");const{lowS:M,prehash:O}=_;let $,z;try{if(typeof B=="string"||B instanceof Uint8Array)try{$=v.fromDER(B)}catch(ne){if(!(ne instanceof be.Err))throw ne;$=v.fromCompact(B)}else if(typeof B=="object"&&typeof B.r=="bigint"&&typeof B.s=="bigint"){const{r:ne,s:Re}=B;$=new v(ne,Re)}else throw new Error("PARSE");z=u.fromHex(A)}catch(ne){if(ne.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(M&&$.hasHighS())return!1;O&&(y=t.hash(y));const{r:Z,s:oe}=$,ce=R(y),te=a(oe),xe=c(ce*te),ve=c(Z*te),Ie=(Ue=u.BASE.multiplyAndAddUnsafe(z,xe,ve))==null?void 0:Ue.toAffine();return Ie?c(Ie.x)===Z:!1}return{CURVE:t,getPublicKey:k,getSharedSecret:C,sign:b,verify:I,ProjectivePoint:u,Signature:v,utils:U}}class Vt extends Mt{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,pe.hash(t);const r=et(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?t.create().update(r).digest():r);for(let o=0;onew Vt(e,t).update(n).digest();Xt.create=(e,t)=>new Vt(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function _r(e){return{hash:e,hmac:(t,...n)=>Xt(e,t,Kn(...n)),randomBytes:Wt}}function $r(e,t){const n=r=>Lr({...e,..._r(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Me=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),He=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Yt=BigInt(1),We=BigInt(2),Kt=(e,t)=>(e+t/We)/t;function en(e){const t=Me,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),c=BigInt(44),a=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=J(l,n,t)*l%t,g=J(f,n,t)*l%t,E=J(g,We,t)*u%t,T=J(E,s,t)*E%t,w=J(T,i,t)*T%t,m=J(w,c,t)*w%t,v=J(m,a,t)*m%t,U=J(v,c,t)*w%t,k=J(U,n,t)*l%t,S=J(k,o,t)*T%t,C=J(S,r,t)*u%t,x=J(C,We,t);if(!ut.eql(ut.sqr(x),e))throw new Error("Cannot find square root");return x}const ut=Sr(Me,void 0,void 0,{sqrt:en}),lt=$r({a:BigInt(0),b:BigInt(7),Fp:ut,n:He,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=He,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Yt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),c=Kt(i*e,t),a=Kt(-r*e,t);let u=F(e-c*n-a*s,t),l=F(-c*r-a*i,t);const f=u>o,g=l>o;if(f&&(u=t-u),g&&(l=t-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:g,k2:l}}}},_e),qe=BigInt(0),tn=e=>typeof e=="bigint"&&qetypeof e=="bigint"&&qes.charCodeAt(0)));n=ye(r,r),nn[e]=n}return _e(ye(n,...t))}const ft=e=>e.toRawBytes(!0).slice(1),dt=e=>de(e,32),ht=e=>F(e,Me),Oe=e=>F(e,He),gt=lt.ProjectivePoint,Mr=(e,t,n)=>gt.BASE.multiplyAndAddUnsafe(e,t,n);function pt(e){let t=lt.utils.normPrivateKeyToScalar(e),n=gt.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Oe(-t),bytes:ft(n)}}function rn(e){if(!tn(e))throw new Error("bad x: need 0 < x < p");const t=ht(e*e),n=ht(t*e+BigInt(7));let r=en(n);r%We!==qe&&(r=ht(-r));const s=new gt(e,r,Yt);return s.assertValidity(),s}function sn(...e){return Oe(G(ze("BIP0340/challenge",...e)))}function Hr(e){return pt(e).bytes}function Wr(e,t,n=Wt(32)){const r=j("message",e),{bytes:s,scalar:i}=pt(t),o=j("auxRand",n,32),c=dt(i^G(ze("BIP0340/aux",o))),a=ze("BIP0340/nonce",c,s,r),u=Oe(G(a));if(u===qe)throw new Error("sign failed: k is zero");const{bytes:l,scalar:f}=pt(u),g=sn(l,s,r),E=new Uint8Array(64);if(E.set(l,0),E.set(dt(Oe(f+g*i)),32),!on(E,r,s))throw new Error("sign: Invalid signature produced");return E}function on(e,t,n){const r=j("signature",e,64),s=j("message",t),i=j("publicKey",n,32);try{const o=rn(G(i)),c=G(r.subarray(0,32));if(!tn(c))return!1;const a=G(r.subarray(32,64));if(!Pr(a))return!1;const u=sn(dt(c),ft(o),s),l=Mr(o,a,Oe(-u));return!(!l||!l.hasEvenY()||l.toAffine().x!==c)}catch{return!1}}const qr=(()=>({getPublicKey:Hr,sign:Wr,verify:on,utils:{randomPrivateKey:lt.utils.randomPrivateKey,lift_x:rn,pointToBytes:ft,numberToBytesBE:de,bytesToNumberBE:G,taggedHash:ze,mod:F}}))();let cn=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var an=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(an||{}),W=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(W||{}),un=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(un||{}),ee=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(ee||{});function ln(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function zr(e){const t=[];for(const i of e){const o=new Uint8Array([i.type]);let c;i.type===1?c=new TextEncoder().encode(i.value):i.type===3?c=new Uint32Array([i.value]):c=ln(i.value);const a=new Uint8Array([c.length]);t.push(o),t.push(a),t.push(c)}let n=t.reduce((i,o)=>i+o.length,0);const r=new Uint8Array(n);let s=0;for(const i of t)r.set(i,s),s+=i.length;return r}function jr(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=fn(t.value),{type:t.type,value:n}})}function Zr(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=ln(t[0].value):n=zr(t);const r=Y.toWords(new Uint8Array(n.buffer));return Y.encode(e,r,1023)}function Gr(e){const{prefix:t,words:n}=Y.decode(e,1023),r=new Uint8Array(Y.fromWords(n));let s;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")s=[{type:0,value:fn(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=jr(r);s=Fr(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:s}}function Dr(e){return Nn.decode(e)}function Nr(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function Qr(e){return["amount",e]}function Jr(e){let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"&&(n=r[1]),r.length===3&&r[2]==="content-warning"&&r[0]==="l"&&(n=r[1]));return t?n:void 0}var Vr=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/,Xr=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g;function dn(e){if(typeof e!="string")return null;const t=e.match(Vr);return t&&t.length===3?{prefix:t[1],bech32:`${t[1]}${t[2]}`}:null}function Yr(e){return dn(e)!==null}function Kr(e){const t=dn(e);return t===null?null:Gr(t.bech32)}function es(e,t){return`nostr:${Zr(e,t)}`}function ts(e){return es("npub",[{type:0,value:e}])}function hn(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function ns(e,t){if(!gn(e,t).isValid)return;const r=/(.*)?(wss:\/\/[a-zA-Z0-9.-]+)/,s={message:void 0,relayUrl:void 0,nurls:[]},i=r.exec(e);if(i)return s.message=i[1]?i[1].trim():void 0,s.relayUrl=i[2],s;const o=[],c=[];let a,u;const l=[];for(;(u=Xr.exec(e))!==null;){const g=u[0];if(Yr(g)){const E=Kr(g);if(a=E.prefix,a==="npub"&&E.tlvItems.length>0){const T=E.tlvItems.filter(m=>m.type===0);if(T.length===0)continue;const w=T[0].value;o.push(w),l.push({index:u.index,length:g.length,replaceWith:w})}else if(a==="nprofile"){const T=E.tlvItems.filter(v=>v.type===0);if(T.length===0)continue;const w=T[0].value;o.push(w),l.push({index:u.index,length:g.length,replaceWith:w});const m=E.tlvItems.filter(v=>v.type===1);if(m.length===0)continue;for(const v of m)hn(v.value)?c.push(v.value):console.error(`Invalid relay url ${v.value}`)}}}let f=0;for(const{index:g,length:E,replaceWith:T}of l){const w=g+f;e=e.slice(0,w)+T+e.slice(w+E),f+=T.length-E}if(o.length>0&&a)return s.message=e.trim(),s.nurls=[{type:"npub",publicKeys:o,relayUrls:c}],s}function rs(e){if(!e)return"";let t=e.message?`${e.message} `:"";if(e.relayUrl)return`${t} ${e.relayUrl}`.trim();if(!e.nurls||e.nurls.length===0)return t.trim();for(const n of e.nurls)if(n.type==="npub")t+=`${ts(n.publicKeys[0])} `;else throw new Error(`Unsupported nurl type ${n.type}`);return t.trim()}function gn(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!hn(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return ss(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function ss(e){return/<[^>]*>/.test(e)}function is(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let s=r[0],i=r[1],o=r[2],c;n.length===3&&(c=n[2]),t.push({kind:s,pubkey:i,identifier:o,relay:c})}if(t.length!==0)return t}function os(e){const t=is(e.tags);if(t)return t}function cs(e){const{kind:t,pubkey:n,identifier:r,relay:s}=e;return s?[`a:${t}:${n}:${r}, ${s}`]:[`a:${t}:${n}:${r}`]}function as(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function us(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function ls(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function fs(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function ds(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let s=r[1]||"";t.includes(s)||t.push(s)}return t&&t.length>0?t:void 0}}function hs(e){return["d",e]}function gs(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function ps(e){return["lnurl",e]}function ys(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function ws(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function bs(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function ms(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function Es(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function vs(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(c=>c[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(c=>c[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let s;t[0].length===3?s=t[0][2]:r.length>0&&r[0].length===3&&(s=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!s||!i?void 0:{eventId:n,kind:s,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function As(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const s=[];return t?(s.push(["e",t,n]),r&&s.push(["p",r])):r&&s.push(["p",r,n]),s}function Ts(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function Ss(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var xs=new TextEncoder;new TextDecoder("utf-8");function pn(e){const t=_e(xs.encode(e));return fe(t)}function Is({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function Us(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function Rs(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const s=Dr(t.pr);let i;const o=s.sections.find(c=>c.name==="amount");if(o)i=o.value;else return!1;return!(n&&n.toString()!==i)}function ks(e){const t=new he(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],s=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:s};return JSON.stringify(i)}var Os=new TextEncoder,yn=new TextDecoder;function Bs(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function Cs(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=Y.decode(e,2e4),n=new Uint8Array(Y.fromWords(t));return yn.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=Bs(e);if(t){const{words:n}=Y.decode(t,2e4),r=new Uint8Array(Y.fromWords(n));return yn.decode(r)}return e}throw new Error(`invalid url ${e}`)}function Ls(e){const t=Os.encode(e),n=Y.toWords(new Uint8Array(t));return Y.encode("lnurl",n,2e4)}function wn(e){return e.endsWith(".onion")}function _s(e){const[t,n]=e.split("@");return`${wn(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function $s(e){const[t,n]=e.split("@");return`${wn(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function Ps(e){let t=0;for(let n=0;na[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),s]);const o=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=pn(o),Ps(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(a=>a[0]!=="nonce"),e.tags.push(["nonce",r.toString(),s]),e;if(n&&r>=n)return;r++}}function bn(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function Hs(e){return e.toLowerCase()}function Ws(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=qr.sign(e,t);return fe(n)}function qs(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var zs=class{constructor(e){if(e){if(!bn(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=Hs(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(mn(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function mn(e){return!(e.length!==3||!Object.values(un).includes(e[1].split(":")[0])||!bn(e[1].split(":")[1]))}function En(e){const t=e.tags.filter(r=>r[0]==="i"&&mn(r));if(t.length===0)return;const n=[];for(const r of t){const s=new zs;s.fromTag(r),n.push(s)}return n}var he=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=Ss(this.ToObj());this.id=pn(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,console.log(`Signing event ${this.id} with ${e.publicKey}`),this.sig=Ws(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=Ms(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}mentionUsers(e){if(!this.extractContent())this.content=rs({message:this.content,nurls:[{type:"npub",publicKeys:e}]});else throw new Error("Already has motified content")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t[0].publicKeys:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return ns(this.content,this.kind)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return ls(this)?us(this):as(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return ms(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return Es(this)}addEventCoordinatesTag(e){this.addTag(cs(e))}hasEventCoordinatesTags(){return os(this)}addIdentifierTag(e){this.addTag(hs(e))}hasIdentifierTags(){return ds(this)}addLnurlTag(e){this.addTag(ps(e))}hasLnurlTags(){return gs(this)}addAmountTag(e){this.addTag(Qr(e))}hasAmountTags(){return Nr(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return fs(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return Ts(this)}addNonceTag(e){const t=ws(this,e);this.tags=t.tags}hasNonceTag(){return ys(this)}replaceNonceTag(e){const t=bs(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return Jr(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return En(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");As(e).forEach(n=>this.addTag(n))}hasReportTags(){return vs(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return Zs({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=gn(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function js(e){const t=new he({content:"",kind:9734});return t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function Fs(e,t,n){const r=js(e);r.signAndGenerateId(n);const s=r.toURI();return{event:r,eventUri:s,invoiceUrl:Is({callback:t,amount:e.amount,event:s,lnurl:e.lnurl})}}function Zs(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=ks(e.zapRequest),s=new he({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&s.addEventTag({eventId:n[1]}),e.preimage&&s.addTag(["preimage",e.preimage]),s}var je=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},Gs=class{constructor(e){this.subscriptions=[],this.url=e.url,this.read=e.read,this.write=e.write,this.requiresPOW=0,this.info=e.info,this.isEnabled=!0}isConnected(){return this.ws!==void 0&&this.ws.isConnected()}isReady(e){if(!this.isConnected()||!this.isEnabled)return!1;switch(e){case"read":return this.read;case"write":return this.write;case"any":return this.read||this.write;default:return!1}}supportsEvent(e){var s;const t=e.determineRequiredNIP(),n=((s=this.info)==null?void 0:s.supported_nips)||[];return console.log(`Required NIP: ${t.join(", ")}`,`Supported NIP: ${n.join(", ")}`),t.every(i=>n.includes(i))}supportsEventOrThrow(e){if(!this.supportsEvent(e))throw new Error(`Event ${e.id} is not supported by relay ${this.url}`)}addSubscription(e){this.subscriptions.push(e)}updateSubscription(e){const t=this.subscriptions.findIndex(n=>n.id===e.id);t!==-1&&(this.subscriptions[t]=e)}removeSubscription(e){this.subscriptions=this.subscriptions.filter(t=>t.id!==e)}getSubscription(e){const t=this.subscriptions.find(n=>n.id===e);return t?{...t,relayUrl:this.url}:null}getSubscriptions(){return this.subscriptions.map(e=>({...e,relayUrl:this.url}))}getInfo(e){return e==="default"?{url:this.url,read:this.read,write:this.write,powRequired:this.requiresPOW,isReady:this.isReady("any")}:{url:this.url,read:this.read,write:this.write,powRequired:this.requiresPOW,info:this.info,isReady:this.isReady("any")}}},Ds=class{constructor(e){this.relays=[],this.addInitialRelays(e)}addInitialRelays(e){if(e&&(!this.relays||this.relays.length===0))for(const t of e)this.relays.push(new Gs(t))}sendSubscribe(e){var s;const t=[],n=e!=null&&e.relayUrls?this.relays.filter(i=>e.relayUrls.includes(i.url)):this.relays,r="read";for(const i of n)if(i.isReady(r)){const{relayUrls:o,...c}=e,a={...c,id:cn(),relayUrl:i.url,created:Date.now(),isActive:!0};let u,l;if(e.type==="REQ")l={type:"REQ",subscriptionId:a.id,filters:JSON.parse(JSON.stringify(a.filters))},u=JSON.stringify([l.type,l.subscriptionId,l.filters]);else if(e.type==="COUNT"){const f=(s=i.info)==null?void 0:s.supported_nips;if(f&&!f.includes(45)){console.warn(`Relay ${i.url} does not support count command.`),a.error=`Relay ${i.url} does not support count command.`;continue}l={type:"COUNT",subscriptionId:a.id,filters:JSON.parse(JSON.stringify(a.filters))},u=JSON.stringify([l.type,l.subscriptionId,l.filters])}else if(e.type==="AUTH")l={type:"AUTH",signedEvent:e.signedEvent},u=JSON.stringify([l.type,l.signedEvent]);else throw new Error("Invalid subscription type.");try{if(i.ws.sendMessage(u),i.addSubscription(a),e.type==="REQ"&&e.options){const f=e.options.timeoutIn;f&&(a.options={timeoutIn:f,timeoutAt:Date.now()+f,timeout:setTimeout(()=>{this.unsubscribe([a.id])},f)})}}catch(f){console.error(f)}}else console.warn(`Relay ${i.url} is not ready for ${r} operations. Skipping...`);return t}subscribe(e){return this.sendSubscribe(e)}count(e){if(e.type!=="COUNT")throw new Error("Invalid subscription type. Expected COUNT.");return this.sendSubscribe(e)}unsubscribe(e){for(const t of this.relays){if(!t.isConnected())continue;const n=t.getSubscriptions();if(!n||n.length===0)continue;const r=n.filter(s=>e.includes(s.id));for(const s of r){const i={type:"CLOSE",subscriptionId:s.id};s.options&&s.options.timeout&&clearTimeout(s.options.timeout);try{t.ws.sendMessage(JSON.stringify([i.type,i.subscriptionId])),t.removeSubscription(s.id)}catch(o){console.error(o)}}}}unsubscribeAll(){for(const e of this.relays){const t=e.getSubscriptions();t&&t.length>0&&this.unsubscribe(t.map(n=>n.id))}}getSubscription(e){for(const t of this.relays){const n=t.getSubscription(e);if(n)return n}}getSubscriptions(){return this.relays.map(e=>e.getSubscriptions()).flat()}countSubscriptions(){return this.relays.map(e=>e.getSubscriptions().length).reduce((e,t)=>e+t,0)}updateSubscription(e){for(const t of this.relays)t.url===e.relayUrl&&t.updateSubscription(e)}countConnections(){let e=0;for(const t of this.relays)t.isConnected()&&e++;return e}getAuthChallenge(e){return this.relays.filter(n=>e.includes(n.url)).map(n=>({relayUrl:n.url,challenge:n.authChallenge}))}sendEvent(e){const t={type:"EVENT",data:e.event},n=JSON.stringify([t.type,t.data]),r=[],s=e.relayUrls?this.relays.filter(i=>e.relayUrls.includes(i.url)):this.relays;for(const i of s)if(i.isReady("write")){const{relayUrls:o,...c}=e,a={id:cn(),...c,relayUrl:i.url,send:!0,error:void 0};if(!i.supportsEvent(e.event)){console.log(`Event ${e.event.id} not published to ${i.url} because not all needed NIPS are supported`,t),a.send=!1,a.error=`Event ${e.event.id} not published to ${i.url} because not all needed NIPS are supported`,r.push(a);continue}i.ws.sendMessage(n),r.push(a)}else console.warn(`Relay ${i.url} is not ready for write operations. Skipping...`);return r.length>0?r:void 0}sendQueueItems(e){var r;const t={type:"EVENT",data:(r=e.find(s=>s.event))==null?void 0:r.event},n=JSON.stringify([t.type,t.data]);for(const s of e){const i=this.relays.find(o=>o.url===s.relayUrl);i&&(i.ws.sendMessage(n),s.send=!0)}return e}listen(e){for(const t of this.relays)t.isEnabled&&t.ws.listen(n=>{n[0]==="AUTH"&&(console.log(`Received auth challenge ${n[1]} from ${t.url}.`),t.authChallenge=n[1]),e({data:n,meta:t.getInfo("default")})})}disconnect(){this.unsubscribeAll(),setTimeout(()=>{var t;const e={subscriptions:this.countSubscriptions(),connections:this.countConnections()};console.log(` + Stats: + - Subscriptions: ${e.subscriptions} + - Connections: ${e.connections} + `);for(const n of this.relays)(t=n.ws)==null||t.disconnect();this.relays=[]},1e3)}},Be=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new he(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const s=qs(n.content);s&&(this.data=s)}const r=En(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return $s(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return _s(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return Cs(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new je;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}},Ns=class{constructor(){}connect(e){this.connection=new WebSocket(e)}isConnected(){return this.connection&&this.connection.readyState===this.connection.OPEN}sendMessage(e,t){const n=t||{retries:10,retryTimeout:100,retryCount:0};if(this.isConnected())this.connection.send(e);else{const r=n.retryCount+1;if(r===10)throw new Error(`Could not send message after ${r} retries`);setTimeout(()=>this.sendMessage(e,n),100)}}listen(e){this.connection.onmessage=t=>{e(JSON.parse(t.data))}}disconnect(){this.connection.close()}};async function Fe(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((s,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}async function Qs(e){let t=e.replace(/^wss:\/\//i,"https://");console.log("###############"),console.log("Fetching relay information from",t),console.log("###############");const n=new AbortController;return setTimeout(()=>{n.abort()},5e3),Fe(t,{Accept:"application/nostr+json"})}var Js=class extends Ds{constructor(e,t){super(e),(!t&&e||e&&t.connectManually!==!0)&&this.connectRelays()}connectRelays(){console.log(`=> Connecting to ${this.relays.length} relay(s) ...`);for(const e of this.relays)if(!e.isConnected()){console.log(`=> Connecting to ${e.url} ...`);try{e.ws=new Ns,e.ws.connect(e.url),e.ws.connection.onopen=()=>{console.log(`Websocket connected to ${e.url}`)},e.ws.connection.onclose=t=>{console.log(`WebSocket to ${e.url} closed.`,JSON.stringify(t))},e.ws.connection.onerror=t=>{console.log(`WebSocket disconnected from ${e.url}`,JSON.stringify(t))}}catch(t){console.error("Error connecting to relay",t)}}}loadFromDiscovered(e){this.addInitialRelays(e.map(t=>({url:t.url,read:!0,write:!0}))),this.connectRelays()}async getRelayInformation(){const e=[];for(const t of this.relays)if(!t.info)try{t.info=await Qs(t.url),console.log(`Relay ${t.url} information`,t.info),e.push(t.getInfo("withInfo"))}catch(n){console.error("Error getting relay information",n)}return e}},Vs=class extends Be{constructor(e){super(e)}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{if(!this.hasZapInfo()){const o=await Fe(n.url);if(!Us(o))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");this.lightningZapInfo=o}console.log("LnurlEndpointResponse",this.lightningZapInfo);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?Ls(this.getLud16()):this.getLud06()},s=Fs(r,this.lightningZapInfo.callback,t),i=await Fe(s.invoiceUrl);if(!Rs(r,i))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",i),{...i,event:s.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await Fe(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}};const Xs=(e,t)=>t.some(n=>e instanceof n);let vn,An;function Ys(){return vn||(vn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ks(){return An||(An=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Tn=new WeakMap,yt=new WeakMap,Sn=new WeakMap,wt=new WeakMap,bt=new WeakMap;function ei(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{n(ge(e.result)),s()},o=()=>{r(e.error),s()};e.addEventListener("success",i),e.addEventListener("error",o)});return t.then(n=>{n instanceof IDBCursor&&Tn.set(n,e)}).catch(()=>{}),bt.set(t,e),t}function ti(e){if(yt.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{n(),s()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});yt.set(e,t)}let mt={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return yt.get(e);if(t==="objectStoreNames")return e.objectStoreNames||Sn.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ge(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function ni(e){mt=e(mt)}function ri(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Et(this),t,...n);return Sn.set(r,t.sort?t.sort():[t]),ge(r)}:Ks().includes(e)?function(...t){return e.apply(Et(this),t),ge(Tn.get(this))}:function(...t){return ge(e.apply(Et(this),t))}}function si(e){return typeof e=="function"?ri(e):(e instanceof IDBTransaction&&ti(e),Xs(e,Ys())?new Proxy(e,mt):e)}function ge(e){if(e instanceof IDBRequest)return ei(e);if(wt.has(e))return wt.get(e);const t=si(e);return t!==e&&(wt.set(e,t),bt.set(t,e)),t}const Et=e=>bt.get(e);function ii(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),c=ge(o);return r&&o.addEventListener("upgradeneeded",a=>{r(ge(o.result),a.oldVersion,a.newVersion,ge(o.transaction),a)}),n&&o.addEventListener("blocked",a=>n(a.oldVersion,a.newVersion,a)),c.then(a=>{i&&a.addEventListener("close",()=>i()),s&&a.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),c}const oi=["get","getKey","getAll","getAllKeys","count"],ci=["put","add","delete","clear"],vt=new Map;function xn(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(vt.get(t))return vt.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=ci.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||oi.includes(n)))return;const i=async function(o,...c){const a=this.transaction(o,s?"readwrite":"readonly");let u=a.store;return r&&(u=u.index(c.shift())),(await Promise.all([u[n](...c),s&&a.done]))[0]};return vt.set(t,i),i}ni(e=>({...e,get:(t,n,r)=>xn(t,n)||e.get(t,n,r),has:(t,n)=>!!xn(t,n)||e.has(t,n)}));const ai=50;/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const In=Symbol("Comlink.proxy"),ui=Symbol("Comlink.endpoint"),li=Symbol("Comlink.releaseProxy"),At=Symbol("Comlink.finalizer"),Ze=Symbol("Comlink.thrown"),Un=e=>typeof e=="object"&&e!==null||typeof e=="function",fi={canHandle:e=>Un(e)&&e[In],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Tt(e,t),[n,[n]]},deserialize(e){return e.start(),pi(e)}},di={canHandle:e=>Un(e)&&Ze in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},Rn=new Map([["proxy",fi],["throw",di]]);function hi(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Tt(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(s){if(!s||!s.data)return;if(!hi(n,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:o,path:c}=Object.assign({path:[]},s.data),a=(s.data.argumentList||[]).map(me);let u;try{const l=c.slice(0,-1).reduce((g,E)=>g[E],e),f=c.reduce((g,E)=>g[E],e);switch(o){case"GET":u=f;break;case"SET":l[c.slice(-1)[0]]=me(s.data.value),u=!0;break;case"APPLY":u=f.apply(l,a);break;case"CONSTRUCT":{const g=new f(...a);u=Ei(g)}break;case"ENDPOINT":{const{port1:g,port2:E}=new MessageChannel;Tt(e,E),u=mi(g,[g])}break;case"RELEASE":u=void 0;break;default:return}}catch(l){u={value:l,[Ze]:0}}Promise.resolve(u).catch(l=>({value:l,[Ze]:0})).then(l=>{const[f,g]=Qe(l);t.postMessage(Object.assign(Object.assign({},f),{id:i}),g),o==="RELEASE"&&(t.removeEventListener("message",r),kn(t),At in e&&typeof e[At]=="function"&&e[At]())}).catch(l=>{const[f,g]=Qe({value:new TypeError("Unserializable return value"),[Ze]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),g)})}),t.start&&t.start()}function gi(e){return e.constructor.name==="MessagePort"}function kn(e){gi(e)&&e.close()}function pi(e,t){return St(e,[],t)}function Ge(e){if(e)throw new Error("Proxy has been released and is not useable")}function On(e){return Se(e,{type:"RELEASE"}).then(()=>{kn(e)})}const De=new WeakMap,Ne="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(De.get(e)||0)-1;De.set(e,t),t===0&&On(e)});function yi(e,t){const n=(De.get(t)||0)+1;De.set(t,n),Ne&&Ne.register(e,t,e)}function wi(e){Ne&&Ne.unregister(e)}function St(e,t=[],n=function(){}){let r=!1;const s=new Proxy(n,{get(i,o){if(Ge(r),o===li)return()=>{wi(s),On(e),r=!0};if(o==="then"){if(t.length===0)return{then:()=>s};const c=Se(e,{type:"GET",path:t.map(a=>a.toString())}).then(me);return c.then.bind(c)}return St(e,[...t,o])},set(i,o,c){Ge(r);const[a,u]=Qe(c);return Se(e,{type:"SET",path:[...t,o].map(l=>l.toString()),value:a},u).then(me)},apply(i,o,c){Ge(r);const a=t[t.length-1];if(a===ui)return Se(e,{type:"ENDPOINT"}).then(me);if(a==="bind")return St(e,t.slice(0,-1));const[u,l]=Bn(c);return Se(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},l).then(me)},construct(i,o){Ge(r);const[c,a]=Bn(o);return Se(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:c},a).then(me)}});return yi(s,e),s}function bi(e){return Array.prototype.concat.apply([],e)}function Bn(e){const t=e.map(Qe);return[t.map(n=>n[0]),bi(t.map(n=>n[1]))]}const Cn=new WeakMap;function mi(e,t){return Cn.set(e,t),e}function Ei(e){return Object.assign(e,{[In]:!0})}function Qe(e){for(const[t,n]of Rn)if(n.canHandle(e)){const[r,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:e},Cn.get(e)||[]]}function me(e){switch(e.type){case"HANDLER":return Rn.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Se(e,t,n){return new Promise(r=>{const s=vi();e.addEventListener("message",function i(o){!o.data||!o.data.id||o.data.id!==s||(e.removeEventListener("message",i),r(o.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),n)})}function vi(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class Ai{constructor(){N(this,"_priority");N(this,"_background");N(this,"_current");this._priority=[],this._background=[],this._current=Promise.resolve()}enqueuePriority(t){const n=this._current.then(()=>t());return this._priority.push(n),this._current=n.catch(()=>{}),n}enqueueBackground(t){const n=this._current.then(()=>t());return this._background.push(n),this._current=n.catch(()=>{}),n}clearPriority(){this._priority=[]}clearBackground(){this._background=[]}async process(){for(;this._priority.length>0||this._background.length>0;){const t=this._priority.shift()||this._background.shift();t&&await t}this._current=Promise.resolve()}clear(){this._priority=[],this._background=[],this._current=Promise.resolve()}}const Ee=new Ai;class Ti{constructor(t){N(this,"connected");N(this,"db");N(this,"client");N(this,"eventsMap",new Map);N(this,"maxEvents");N(this,"checkedUsers",[]);N(this,"checkedEvents",[]);N(this,"eventsPublishingQueue",[]);N(this,"followingUserIds",[]);this.connected=!1,this.db=null,this.client=null,this.maxEvents=(t==null?void 0:t.maxEvents)||ai}async init(){this.db=await ii("nostr-client",1,{upgrade(t){t.createObjectStore("users",{keyPath:"user.pubkey"}),t.createObjectStore("following",{keyPath:"user.pubkey"})}})}async connect(t,n){this.client=new Js(t),(n==null?void 0:n.autoLoadInfo)!==!1&&await this.client.getRelayInformation(),this.client.listen(async r=>{await this.processEvent(r)})}disconnect(){var t;(t=this.client)==null||t.disconnect(),this.eventsMap.clear(),this.connected=!1}getRelays(){var t;return(t=this.client)!=null&&t.relays?this.client.relays.map(n=>n.getInfo("withInfo")):[]}updateRelay(t,n){var r;for(const s of((r=this.client)==null?void 0:r.relays)||[])if(s.url===t){typeof n.isEnabled<"u"&&(s.isEnabled=n.isEnabled),typeof n.read<"u"&&(s.read=n.read),typeof n.write<"u"&&(s.write=n.write);break}}getSubscriptions(){var t;return((t=this.client)==null?void 0:t.getSubscriptions())||[]}updateSubscription(t){var n;(n=this.client)==null||n.updateSubscription(t),postMessage({type:"subscription:update",data:t})}async subscribe(t){var n;return(n=this.client)==null?void 0:n.subscribe(t)}unsubscribe(t){var n;return(n=this.client)==null?void 0:n.unsubscribe(t)}unsubscribeAll(){var t;return console.log("WORKER: UNSUBSCRIBE ALL"),(t=this.client)==null?void 0:t.unsubscribeAll()}addEvent(t){this.eventsMap.set(t.event.id,t),postMessage({type:"event:new",data:t})}updateEvent(t){this.eventsMap.set(t.event.id,t),postMessage({type:"event:update",data:t})}setMaxEvents(t){this.maxEvents=t}addQueueItems(t){this.eventsPublishingQueue.push(...t)}updateQueueItem(t){const n=this.eventsPublishingQueue.findIndex(r=>r.event.id===t.event.id);n!==-1&&(this.eventsPublishingQueue[n]=t,postMessage({type:"event:queue:update",data:t}))}async getUser(t){if(!this.db)throw new Error("DB not initialized");const n=await this.db.get("users",t);return n?{user:new Vs(n.user),relayUrls:n.relayUrls}:void 0}async addUser(t){if(!this.db)throw new Error("DB not initialized");const{user:n}=t;await this.db.put("users",{user:n,relayUrls:t.relayUrls})}async updateUser(t){if(!this.db)throw new Error("DB not initialized");const n=await this.db.get("users",t.user.pubkey);await this.db.put("users",{user:t.user?t.user:n.user,relayUrls:t.relayUrls?t.relayUrls:n.relayUrls})}async countUsers(){if(!this.db)throw new Error("DB not initialized");return await this.db.count("users")}count(t){var n;return(n=this.client)==null?void 0:n.count(t)}async processEvent(t,n=0){if(!t.data)return;const r=t.data[0];if((r===ee.AUTH||r===ee.OK||r===ee.NOTICE||r===ee.COUNT||r===ee.EOSE)&&Ee.enqueueBackground(async()=>{var s,i,o;if(r===ee.OK){const c=t.data[1],a=t.data[2],u=t.data[3],l=this.eventsPublishingQueue.find(f=>f.event.id===c);l&&(this.updateQueueItem({...l,accepted:a,error:a===!1?u:void 0}),postMessage({type:"relay:message",data:t}));return}else if(r===ee.EOSE){const c=(s=this.client)==null?void 0:s.getSubscriptions(),a=c==null?void 0:c.find(u=>u.id===t.data[1]);a&&this.updateSubscription({...a,eose:!0}),postMessage({type:"relay:message",data:t});return}else if(r===ee.COUNT){const c=(i=this.client)==null?void 0:i.getSubscriptions(),a=c==null?void 0:c.find(u=>u.id===t.data[1]);a&&this.updateSubscription({...a,result:JSON.stringify(t.data[2])});return}else if(r===ee.NOTICE){const c=(o=this.client)==null?void 0:o.getSubscriptions(),a=c==null?void 0:c.find(u=>u.id===t.data[1]);a&&this.updateSubscription({...a,result:t.data[1]}),postMessage({type:"relay:message",data:t});return}}),r===ee.EVENT){const s=t.data[2].kind;s===W.SHORT_TEXT_NOTE||s===W.LONG_FORM_CONTENT?Ee.enqueuePriority(async()=>{const i=t.data[2];if(this.eventsMap.size>=this.maxEvents)return;const o=i.id?this.eventsMap.has(i.id):!1;if(!i.pubkey)return;const c={event:new he(i),eventRelayUrls:[t.meta.url]},a=await this.getUser(i.pubkey);a&&(c.user=a.user);const u=c.event.hasMentions();u&&u.map(async f=>{const g=await this.getUser(f);g?c.mentions?c.mentions.push(g.user):c.mentions=[g.user]:c.mentions?c.mentions.push(new Be({pubkey:f})):c.mentions=[new Be({pubkey:f})]});const l=c.event.hasEventTags();if(l){const f=l.find(g=>g.marker==="root");if(f){const g=f.eventId,E=this.eventsMap.get(g);if(E){E.replies?E.replies.find(w=>w.event.id===c.event.id)||E.replies.push({...c}):E.replies=[{...c}],this.updateEvent(E),console.log(`Reply event added to event ${E.event.id}`);return}n<3&&setTimeout(()=>{this.processEvent(t,n+1)},1e3);return}}o||this.addEvent(c)}):s===W.ZAP_RECEIPT?Ee.enqueueBackground(async()=>{const i=t.data[2];if(!i.pubkey)return;const o=new he(i),c=await this.getUser(o.pubkey),a=o.hasEventTags(),u=a==null?void 0:a.find(l=>l.marker==="root");if(u){const l=this.eventsMap.get(u.eventId);l&&(l.zapReceipt?l.zapReceipt.push({event:o,user:c==null?void 0:c.user}):l.zapReceipt=[{event:o,user:c==null?void 0:c.user}],this.updateEvent(l))}}):s===W.METADATA?Ee.enqueueBackground(async()=>{const i=new Be,o=t.data[2];i.fromEvent(o),await this.getUser(i.pubkey)?(await this.updateUser({user:i,relayUrls:[t.meta.url]}),await this.updateUserFollowing({user:i,relayUrls:[t.meta.url]})):(await this.addUser({user:i,relayUrls:[t.meta.url]}),await this.updateUserFollowing({user:i,relayUrls:[t.meta.url]}));for(const a of this.eventsMap.values()){let u=!1;a.event.pubkey===i.pubkey&&(a.user=i,u=!0),a.reactions&&a.reactions.map(l=>{l.event.pubkey===i.pubkey&&(l.user=i,u=!0)}),a.replies&&a.replies.map(l=>{l.event.pubkey===i.pubkey&&(l.user=i,u=!0)}),a.mentions&&a.mentions.map(l=>{l.pubkey===i.pubkey&&(l=i,u=!0)}),u&&this.updateEvent(a)}}):s===W.REACTION?Ee.enqueuePriority(async()=>{const i=new he(t.data[2]),o=i.hasEventTags();if(!o)return;const c=await this.getUser(i.pubkey),a=o.filter(u=>u.eventId).map(u=>u.eventId);for(const u of a){const l=this.eventsMap.get(u);l&&(l.reactions&&l.reactions.length?l.reactions.push({event:i,user:c==null?void 0:c.user}):l.reactions=[{event:i,user:c==null?void 0:c.user}],console.log(`Reaction event added to event ${l.event.id}`),this.updateEvent(l))}}):s===W.REPOST&&Ee.enqueueBackground(async()=>{const i=new he(t.data[2]),o=i.hasEventTags();if(!o){console.log("No response found for repost event");return}const c=await this.getUser(i.pubkey);o.filter(u=>u.eventId).map(u=>u.eventId).map(u=>{const l=this.eventsMap.get(u);l&&(l.reposts?l.reposts.push({event:i,user:c==null?void 0:c.user}):l.reposts=[{event:i,user:c==null?void 0:c.user}],console.log(`Repost event added to event ${l.event.id}`),this.updateEvent(l))})})}}getEventById(t){return this.eventsMap.get(t)}async sendEvent(t){if(!this.client)throw new Error("Client not initialized");const n=this.client.sendEvent(t);if(n)return t.event.kind,W.SHORT_TEXT_NOTE,W.LONG_FORM_CONTENT,W.RECOMMEND_RELAY,this.addQueueItems(n),n.map(r=>{this.updateQueueItem({...r})}),n;throw new Error("Failed to send event")}sendQueueItems(t){if(!this.client)throw new Error("Client not initialized");this.addQueueItems(t);const n=this.client.sendQueueItems(t);if(n)return n.map(r=>{this.updateQueueItem({...r})}),n;throw new Error("Failed to send event")}clearEvents(){console.log("WORKER: CLEAR EVENTS"),Ee.clearPriority(),this.eventsMap.clear(),this.checkedEvents=[],this.checkedUsers=[]}async followUser({pubkey:t,relayUrls:n}){if(!this.db)throw new Error("DB not initialized");const r=await this.db.get("users",t),s=await this.db.get("following",t);if(r&&!s)this.db.add("following",r);else if(!r&&!s){const i=new Be({pubkey:t});await this.db.put("following",{user:i,relayUrls:n}),n.map(o=>{this.requestInformation({source:"users",idsOrKeys:[t],relayUrl:o},{timeoutIn:1e4})})}this.followingUserIds.push(t)}async unfollowUser(t){if(!this.db)throw new Error("DB not initialized");await this.db.delete("following",t),this.followingUserIds=this.followingUserIds.filter(n=>n!==t)}async followingUser(t){if(!this.db)throw new Error("DB not initialized");return!!await this.db.get("following",t)}async getAllUsersFollowing(){if(!this.db)throw new Error("DB not initialized");const t=await this.db.getAll("following");return this.followingUserIds=t.map(n=>n.pubkey),t}async updateUserFollowing(t){if(!this.db)throw new Error("DB not initialized");const n=await this.db.get("following",t.user.pubkey);n&&await this.db.put("following",{user:t.user,relayUrls:t.relayUrls?t.relayUrls:n.relayUrls})}async processActiveEvents(t){var u,l;const n=[],r=[];for(const f of this.eventsMap.entries()){const g=f[1];(u=g.event)!=null&&u.pubkey&&!((l=g.user)!=null&&l.pubkey)&&n.push({pubkey:g.event.pubkey,relayUrls:g.eventRelayUrls}),g.reactions?g.reactions.map(E=>{var T;(T=E.user)!=null&&T.data||n.push({pubkey:E.event.pubkey,relayUrls:g.eventRelayUrls})}):r.push({id:g.event.id,relayUrls:g.eventRelayUrls}),g.replies&&g.replies.map(E=>{var T;(T=E.user)!=null&&T.data||n.push({pubkey:E.event.pubkey,relayUrls:g.eventRelayUrls})}),g.mentions&&g.mentions.map(E=>{E.data||n.push({pubkey:E.pubkey,relayUrls:g.eventRelayUrls})})}const s={};n.map(f=>{for(const g of f.relayUrls)s[g]||(s[g]=new Set),s[g].add(f.pubkey)});const i=Object.entries(s).map(([f,g])=>({source:"users",relayUrl:f,idsOrKeys:[...g]})),o={};r.map(f=>{for(const g of f.relayUrls)o[g]||(o[g]=new Set),o[g].add(f.id)});const c=Object.entries(o).map(([f,g])=>({source:"events:related",relayUrl:f,idsOrKeys:[...g]})),a=[];[...i,...c].map(f=>{a.push(this.requestInformation(f,{timeoutIn:6e4,view:t}))})}async requestInformation(t,n){if(t.idsOrKeys.length===0)return;let r=[];if(t.source==="events"||t.source==="events:related"){if(r=t.idsOrKeys.filter(i=>!this.checkedEvents.includes(i)),r.length===0)return;this.checkedEvents=[...this.checkedEvents,...r]}else if(t.source==="users"){if(r=t.idsOrKeys.filter(i=>!this.checkedUsers.includes(i)),r.length===0)return;this.checkedUsers=[...this.checkedUsers,...r]}console.log(`=> Getting information for ${r.length} ${t.source}`);const s=[];for(let i=0;i{const c=r.find(a=>{var u,l;return a.filters&&((u=a.filters["#e"])==null?void 0:u.includes(o))&&((l=a.filters.kinds)==null?void 0:l.some(f=>n.includes(f)))});c&&s.push(c.id)}):t.map(o=>{const c=r.find(a=>{var u;return a.filters&&((u=a.filters["#e"])==null?void 0:u.includes(o))});c&&s.push(c.id)}),s.length>0?s:void 0}}const Si=new Ti;Tt(Si)})(); diff --git a/assets/worker-fa83cfed.js b/assets/worker-fa83cfed.js deleted file mode 100644 index ec937d3..0000000 --- a/assets/worker-fa83cfed.js +++ /dev/null @@ -1,9 +0,0 @@ -var Si=Object.defineProperty;var Ii=(X,Q,ae)=>Q in X?Si(X,Q,{enumerable:!0,configurable:!0,writable:!0,value:ae}):X[Q]=ae;var N=(X,Q,ae)=>(Ii(X,typeof Q!="symbol"?Q+"":Q,ae),ae);(function(){"use strict";var X={};Object.defineProperty(X,"__esModule",{value:!0}),X.bech32m=Y=X.bech32=void 0;const Q="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ae={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function St(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=Ae(t)^r>>5}t=Ae(t);for(let n=0;n=n;)i-=n,o.push(s>>i&c);if(r)i>0&&o.push(s<=t)return"Excess padding";if(s<a)throw new TypeError("Exceeds length limit");c=c.toLowerCase();let u=St(c);if(typeof u=="string")throw new Error(u);let l=c+"1";for(let f=0;f>5)throw new Error("Non 5-bit word");u=Ae(u)^b,l+=Q.charAt(b)}for(let f=0;f<6;++f)u=Ae(u);u^=t;for(let f=0;f<6;++f){const b=u>>(5-f)*5&31;l+=Q.charAt(b)}return l}function r(c,o){if(o=o||90,c.length<8)return c+" too short";if(c.length>o)return"Exceeds length limit";const a=c.toLowerCase(),u=c.toUpperCase();if(c!==a&&c!==u)return"Mixed-case string "+c;c=a;const l=c.lastIndexOf("1");if(l===-1)return"No separator character for "+c;if(l===0)return"Missing prefix for "+c;const f=c.slice(0,l),b=c.slice(l+1);if(b.length<6)return"Data too short";let A=St(f);if(typeof A=="string")return A;const T=[];for(let w=0;w=b.length)&&T.push(E)}return A!==t?"Invalid checksum for "+c:{prefix:f,words:T}}function s(c,o){const a=r(c,o);if(typeof a=="object")return a}function i(c,o){const a=r(c,o);if(typeof a=="object")return a;throw new Error(a)}return{decodeUnsafe:s,decode:i,encode:n,toWords:Pn,fromWordsUnsafe:Hn,fromWords:Mn}}var Y=X.bech32=It("bech32");X.bech32m=It("bech32m");var Rt={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(d){if(!Number.isSafeInteger(d))throw new Error(`Wrong integer: ${d}`)}e.assertNumber=t;function n(...d){const g=(h,p)=>v=>h(p(v)),y=Array.from(d).reverse().reduce((h,p)=>h?g(h,p.encode):p.encode,void 0),I=d.reduce((h,p)=>h?g(h,p.decode):p.decode,void 0);return{encode:y,decode:I}}function r(d){return{encode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return g.map(y=>{if(t(y),y<0||y>=d.length)throw new Error(`Digit index outside alphabet: ${y} (alphabet: ${d.length})`);return d[y]})},decode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="string")throw new Error("alphabet.decode input should be array of strings");return g.map(y=>{if(typeof y!="string")throw new Error(`alphabet.decode: not string element=${y}`);const I=d.indexOf(y);if(I===-1)throw new Error(`Unknown letter: "${y}". Allowed: ${d}`);return I})}}}function s(d=""){if(typeof d!="string")throw new Error("join separator should be string");return{encode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="string")throw new Error("join.encode input should be array of strings");for(let y of g)if(typeof y!="string")throw new Error(`join.encode: non-string input=${y}`);return g.join(d)},decode:g=>{if(typeof g!="string")throw new Error("join.decode input should be string");return g.split(d)}}}function i(d,g="="){if(t(d),typeof g!="string")throw new Error("padding chr should be string");return{encode(y){if(!Array.isArray(y)||y.length&&typeof y[0]!="string")throw new Error("padding.encode input should be array of strings");for(let I of y)if(typeof I!="string")throw new Error(`padding.encode: non-string input=${I}`);for(;y.length*d%8;)y.push(g);return y},decode(y){if(!Array.isArray(y)||y.length&&typeof y[0]!="string")throw new Error("padding.encode input should be array of strings");for(let h of y)if(typeof h!="string")throw new Error(`padding.decode: non-string input=${h}`);let I=y.length;if(I*d%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;I>0&&y[I-1]===g;I--)if(!((I-1)*d%8))throw new Error("Invalid padding: string has too much padding");return y.slice(0,I)}}}function c(d){if(typeof d!="function")throw new Error("normalize fn should be function");return{encode:g=>g,decode:g=>d(g)}}function o(d,g,y){if(g<2)throw new Error(`convertRadix: wrong from=${g}, base cannot be less than 2`);if(y<2)throw new Error(`convertRadix: wrong to=${y}, base cannot be less than 2`);if(!Array.isArray(d))throw new Error("convertRadix: data should be array");if(!d.length)return[];let I=0;const h=[],p=Array.from(d);for(p.forEach(v=>{if(t(v),v<0||v>=g)throw new Error(`Wrong integer: ${v}`)});;){let v=0,_=!0;for(let B=I;Bg?a(g,d%g):d,u=(d,g)=>d+(g-a(d,g));function l(d,g,y,I){if(!Array.isArray(d))throw new Error("convertRadix2: data should be array");if(g<=0||g>32)throw new Error(`convertRadix2: wrong from=${g}`);if(y<=0||y>32)throw new Error(`convertRadix2: wrong to=${y}`);if(u(g,y)>32)throw new Error(`convertRadix2: carry overflow from=${g} to=${y} carryBits=${u(g,y)}`);let h=0,p=0;const v=2**y-1,_=[];for(const B of d){if(t(B),B>=2**g)throw new Error(`convertRadix2: invalid data word=${B} from=${g}`);if(h=h<32)throw new Error(`convertRadix2: carry overflow pos=${p} from=${g}`);for(p+=g;p>=y;p-=y)_.push((h>>p-y&v)>>>0);h&=2**p-1}if(h=h<=g)throw new Error("Excess padding");if(!I&&h)throw new Error(`Non-zero padding: ${h}`);return I&&p>0&&_.push(h>>>0),_}function f(d){return t(d),{encode:g=>{if(!(g instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return o(Array.from(g),2**8,d)},decode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(o(g,d,2**8))}}}function b(d,g=!1){if(t(d),d<=0||d>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,d)>32||u(d,8)>32)throw new Error("radix2: carry overflow");return{encode:y=>{if(!(y instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(y),8,d,!g)},decode:y=>{if(!Array.isArray(y)||y.length&&typeof y[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(l(y,d,8,g))}}}function A(d){if(typeof d!="function")throw new Error("unsafeWrapper fn should be function");return function(...g){try{return d.apply(null,g)}catch{}}}function T(d,g){if(t(d),typeof g!="function")throw new Error("checksum fn should be function");return{encode(y){if(!(y instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const I=g(y).slice(0,d),h=new Uint8Array(y.length+d);return h.set(y),h.set(I,y.length),h},decode(y){if(!(y instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const I=y.slice(0,-d),h=g(I).slice(0,d),p=y.slice(-d);for(let v=0;vd.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(b(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),s("")),e.base64url=n(b(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),s(""));const w=d=>n(f(58),r(d),s(""));e.base58=w("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=w("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=w("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const m=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(d){let g="";for(let y=0;yn(T(4,g=>d(d(g))),e.base58);e.base58check=E;const R=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),U=[996825010,642813549,513874426,1027748829,705979059];function x(d){const g=d>>25;let y=(d&33554431)<<5;for(let I=0;I>I&1)===1&&(y^=U[I]);return y}function C(d,g,y=1){const I=d.length;let h=1;for(let p=0;p126)throw new Error(`Invalid prefix (${d})`);h=x(h)^v>>5}h=x(h);for(let p=0;pz)throw new TypeError(`Length ${Z} exceeds limit ${z}`);return k=k.toLowerCase(),`${k}1${R.encode($)}${C(k,$,g)}`}function _(k,$=90){if(typeof k!="string")throw new Error(`bech32.decode input should be string, not ${typeof k}`);if(k.length<8||$!==!1&&k.length>$)throw new TypeError(`Wrong string length: ${k.length} (${k}). Expected (8..${$})`);const z=k.toLowerCase();if(k!==z&&k!==k.toUpperCase())throw new Error("String must be lowercase or uppercase");k=z;const Z=k.lastIndexOf("1");if(Z===0||Z===-1)throw new Error('Letter "1" must be present between prefix and data only');const oe=k.slice(0,Z),ce=k.slice(Z+1);if(ce.length<6)throw new Error("Data must be at least 6 characters long");const te=R.decode(ce).slice(0,-6),Se=C(oe,te,g);if(!ce.endsWith(Se))throw new Error(`Invalid checksum in ${k}: expected "${Se}"`);return{prefix:oe,words:te}}const B=A(_);function H(k){const{prefix:$,words:z}=_(k,!1);return{prefix:$,words:z,bytes:I(z)}}return{encode:v,decode:_,decodeToBytes:H,decodeUnsafe:B,fromWords:I,fromWordsUnsafe:p,toWords:h}}e.bech32=S("bech32"),e.bech32m=S("bech32m"),e.utf8={encode:d=>new TextDecoder().decode(d),decode:d=>new TextEncoder().encode(d)},e.hex=n(b(4),r("0123456789abcdef"),s(""),c(d=>{if(typeof d!="string"||d.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof d} with length ${d.length}`);return d.toLowerCase()}));const O={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},L=`Invalid encoding type. Available types: ${Object.keys(O).join(", ")}`,D=(d,g)=>{if(typeof d!="string"||!O.hasOwnProperty(d))throw new TypeError(L);if(!(g instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return O[d].encode(g)};e.bytesToString=D,e.str=e.bytesToString;const P=(d,g)=>{if(!O.hasOwnProperty(d))throw new TypeError(L);if(typeof g!="string")throw new TypeError("stringToBytes() expects string");return O[d].decode(g)};e.stringToBytes=P,e.bytes=e.stringToBytes})(Rt);const{bech32:re,hex:K,utf8:Wn}=Rt,Ot={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},Ut={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},kt={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},Bt={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},Ce=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],qn={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},zn=BigInt("2100000000000000000"),Ct=BigInt(1e11),Ve={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},Lt={};for(let e=0,t=Object.keys(Ve);eK.encode(re.fromWordsUnsafe(e)),16:e=>K.encode(re.fromWordsUnsafe(e)),13:e=>Wn.encode(re.fromWordsUnsafe(e)),19:e=>K.encode(re.fromWordsUnsafe(e)),23:e=>K.encode(re.fromWordsUnsafe(e)),27:e=>K.encode(re.fromWordsUnsafe(e)),6:Le,24:Le,3:Zn,5:Gn};function Fn(e){return t=>({tagCode:parseInt(e),words:re.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function Le(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function Zn(e){const t=[];let n,r,s,i,c,o=re.fromWordsUnsafe(e);for(;o.length>0;)n=K.encode(o.slice(0,33)),r=K.encode(o.slice(33,41)),s=parseInt(K.encode(o.slice(41,45)),16),i=parseInt(K.encode(o.slice(45,49)),16),c=parseInt(K.encode(o.slice(49,51)),16),o=o.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:s,fee_proportional_millionths:i,cltv_expiry_delta:c});return t}function Gn(e){const t=e.slice().reverse().map(s=>[!!(s&1),!!(s&2),!!(s&4),!!(s&8),!!(s&16)]).reduce((s,i)=>s.concat(i),[]);for(;t.length{let c;t[i*2]?c="required":t[i*2+1]?c="supported":c="unsupported",n[s]=c});const r=t.slice(Ce.length*2);return n.extra_bits={start_bit:Ce.length*2,bits:r,has_required:r.reduce((s,i,c)=>c%2!==0?s||!1:s||i,!1)},n}function _t(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const s=BigInt(r),i=n?s*Ct/qn[n]:s*Ct;if(n==="p"&&s%BigInt(10)!==BigInt(0)||i>zn)throw new Error("Amount is outside of valid range");return t?i.toString():i}function Dn(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=re.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const s=r.prefix;let i=r.words,c=e.slice(s.length+1),o=i.slice(-104);i=i.slice(0,-104);let a=s.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(a&&!a[2]&&(a=s.match(/^ln(\S+)$/)),!a)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=a[1];let l;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");l=t}else switch(u){case Ot.bech32:l=Ot;break;case Ut.bech32:l=Ut;break;case kt.bech32:l=kt;break;case Bt.bech32:l=Bt;break}if(!l||l.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:l});const f=a[2];let b;if(f){const x=a[3];b=_t(f+x,!0),n.push({name:"amount",letters:a[2]+a[3],value:b})}else b=null;n.push({name:"separator",letters:"1"});const A=Le(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:c.slice(0,7),value:A}),c=c.slice(7);let T,w,m,E;for(;i.length>0;){const x=i[0].toString();T=Lt[x]||"unknown_tag",w=jn[x]||Fn(x),i=i.slice(1),m=Le(i.slice(0,2)),i=i.slice(2),E=i.slice(0,m),i=i.slice(m),n.push({name:T,tag:c[0],letters:c.slice(0,1+2+m),value:w(E)}),c=c.slice(1+2+m)}n.push({name:"signature",letters:c.slice(0,104),value:K.encode(re.fromWordsUnsafe(o))}),c=c.slice(104),n.push({name:"checksum",letters:c});let R={paymentRequest:e,sections:n,get expiry(){let x=n.find(C=>C.name==="expiry");if(x)return U("timestamp")+x.value},get route_hints(){return n.filter(x=>x.name==="route_hint").map(x=>x.value)}};for(let x in Ve)x!=="route_hint"&&Object.defineProperty(R,x,{get(){return U(x)}});return R;function U(x){let C=n.find(S=>S.name===x);return C?C.value:void 0}}var Nn={decode:Dn,hrpToMillisat:_t};function Xe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Qn(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function $t(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Jn(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Xe(e.outputLen),Xe(e.blockLen)}function Vn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Xn(e,t){$t(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,Ke=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),se=(e,t)=>e<<32-t|e>>>t;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Yn(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function et(e){if(typeof e=="string"&&(e=Yn(e)),!Pt(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Kn(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!Pt(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class Ht{clone(){return this._cloneInto()}}function Mt(e){const t=r=>e().update(et(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Wt(e=32){if(Ye&&typeof Ye.getRandomValues=="function")return Ye.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function er(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),c=Number(n>>s&i),o=Number(n&i),a=r?4:0,u=r?0:4;e.setUint32(t+a,c,r),e.setUint32(t+u,o,r)}class tr extends Ht{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ke(this.buffer)}update(t){pe.exists(this);const{view:n,buffer:r,blockLen:s}=this;t=et(t);const i=t.length;for(let c=0;cs-c&&(this.process(r,0),c=0);for(let f=c;fl.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,rr=(e,t,n)=>e&t^e&n^t&n,sr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ue=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),le=new Uint32Array(64);class qt extends tr{constructor(){super(64,32,8,!1),this.A=ue[0]|0,this.B=ue[1]|0,this.C=ue[2]|0,this.D=ue[3]|0,this.E=ue[4]|0,this.F=ue[5]|0,this.G=ue[6]|0,this.H=ue[7]|0}get(){const{A:t,B:n,C:r,D:s,E:i,F:c,G:o,H:a}=this;return[t,n,r,s,i,c,o,a]}set(t,n,r,s,i,c,o,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=c|0,this.G=o|0,this.H=a|0}process(t,n){for(let f=0;f<16;f++,n+=4)le[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const b=le[f-15],A=le[f-2],T=se(b,7)^se(b,18)^b>>>3,w=se(A,17)^se(A,19)^A>>>10;le[f]=w+le[f-7]+T+le[f-16]|0}let{A:r,B:s,C:i,D:c,E:o,F:a,G:u,H:l}=this;for(let f=0;f<64;f++){const b=se(o,6)^se(o,11)^se(o,25),A=l+b+nr(o,a,u)+sr[f]+le[f]|0,w=(se(r,2)^se(r,13)^se(r,22))+rr(r,s,i)|0;l=u,u=a,a=o,o=c+A|0,c=i,i=s,s=r,r=A+w|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,c=c+this.D|0,o=o+this.E|0,a=a+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,s,i,c,o,a,u,l)}roundClean(){le.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class ir extends qt{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const _e=Mt(()=>new qt);Mt(()=>new ir);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zt=BigInt(0),$e=BigInt(1),or=BigInt(2),Pe=e=>e instanceof Uint8Array,cr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fe(e){if(!Pe(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+s.length,0));let n=0;return e.forEach(r=>{if(!Pe(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function ur(e,t){if(e.length!==t.length)return!1;for(let n=0;nzt;e>>=$e,t+=1);return t}function dr(e,t){return e>>BigInt(t)&$e}const hr=(e,t,n)=>e|(n?$e:zt)<(or<new Uint8Array(e),Zt=e=>Uint8Array.from(e);function Gt(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=st(e),s=st(e),i=0;const c=()=>{r.fill(1),s.fill(0),i=0},o=(...f)=>n(s,r,...f),a=(f=st())=>{s=o(Zt([0]),f),r=o(),f.length!==0&&(s=o(Zt([1]),f),r=o())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const b=[];for(;f{c(),a(f);let A;for(;!(A=b(u()));)a();return c(),A}}const gr={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ue(e,t,n={}){const r=(s,i,c)=>{const o=gr[i];if(typeof o!="function")throw new Error(`Invalid validator "${i}", expected function`);const a=e[s];if(!(c&&a===void 0)&&!o(a,e))throw new Error(`Invalid param ${String(s)}=${a} (${typeof a}), expected ${i}`)};for(const[s,i]of Object.entries(t))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return e}var pr=Object.freeze({__proto__:null,bitGet:dr,bitLen:fr,bitMask:rt,bitSet:hr,bytesToHex:fe,bytesToNumberBE:G,bytesToNumberLE:nt,concatBytes:we,createHmacDrbg:Gt,ensureBytes:j,equalBytes:ur,hexToBytes:Te,hexToNumber:tt,numberToBytesBE:de,numberToBytesLE:Ft,numberToHexUnpadded:jt,numberToVarBytesBE:ar,utf8ToBytes:lr,validateObject:Ue});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const q=BigInt(0),M=BigInt(1),ye=BigInt(2),wr=BigInt(3),it=BigInt(4),Dt=BigInt(5),Nt=BigInt(8);BigInt(9),BigInt(16);function F(e,t){const n=e%t;return n>=q?n:t+n}function yr(e,t,n){if(n<=q||t 0");if(n===M)return q;let r=M;for(;t>q;)t&M&&(r=r*e%n),e=e*e%n,t>>=M;return r}function J(e,t,n){let r=e;for(;t-- >q;)r*=r,r%=n;return r}function ot(e,t){if(e===q||t<=q)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=F(e,t),r=t,s=q,i=M;for(;n!==q;){const o=r/n,a=r%n,u=s-i*o;r=n,n=a,s=i,i=u}if(r!==M)throw new Error("invert: does not exist");return F(s,t)}function br(e){const t=(e-M)/ye;let n,r,s;for(n=e-M,r=0;n%ye===q;n/=ye,r++);for(s=ye;s(r[s]="function",r),t);return Ue(e,n)}function Ar(e,t,n){if(n 0");if(n===q)return e.ONE;if(n===M)return t;let r=e.ONE,s=t;for(;n>q;)n&M&&(r=e.mul(r,s)),s=e.sqr(s),n>>=M;return r}function Tr(e,t){const n=new Array(t.length),r=t.reduce((i,c,o)=>e.is0(c)?i:(n[o]=i,e.mul(i,c)),e.ONE),s=e.inv(r);return t.reduceRight((i,c,o)=>e.is0(c)?i:(n[o]=e.mul(i,n[o]),e.mul(i,c)),s),n}function ct(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function xr(e,t,n=!1,r={}){if(e<=q)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=ct(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const c=mr(e),o=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:rt(s),ZERO:q,ONE:M,create:a=>F(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);return q<=a&&aa===q,isOdd:a=>(a&M)===M,neg:a=>F(-a,e),eql:(a,u)=>a===u,sqr:a=>F(a*a,e),add:(a,u)=>F(a+u,e),sub:(a,u)=>F(a-u,e),mul:(a,u)=>F(a*u,e),pow:(a,u)=>Ar(o,a,u),div:(a,u)=>F(a*ot(u,e),e),sqrN:a=>a*a,addN:(a,u)=>a+u,subN:(a,u)=>a-u,mulN:(a,u)=>a*u,inv:a=>ot(a,e),sqrt:r.sqrt||(a=>c(o,a)),invertBatch:a=>Tr(o,a),cmov:(a,u,l)=>l?u:a,toBytes:a=>n?Ft(a,i):de(a,i),fromBytes:a=>{if(a.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${a.length}`);return n?nt(a):G(a)}});return Object.freeze(o)}function Sr(e,t,n=!1){e=j("privateHash",e);const r=e.length,s=ct(t).nByteLength+8;if(s<24||r1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${r}`);const i=n?nt(e):G(e);return F(i,t-M)+M}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ir=BigInt(0),at=BigInt(1);function Rr(e,t){const n=(s,i)=>{const c=i.negate();return s?c:i},r=s=>{const i=Math.ceil(t/s)+1,c=2**(s-1);return{windows:i,windowSize:c}};return{constTimeNegate:n,unsafeLadder(s,i){let c=e.ZERO,o=s;for(;i>Ir;)i&at&&(c=c.add(o)),o=o.double(),i>>=at;return c},precomputeWindow(s,i){const{windows:c,windowSize:o}=r(i),a=[];let u=s,l=u;for(let f=0;f>=A,m>a&&(m-=b,c+=at);const E=w,R=w+Math.abs(m)-1,U=T%2!==0,x=m<0;m===0?l=l.add(n(U,i[E])):u=u.add(n(x,i[R]))}return{p:u,f:l}},wNAFCached(s,i,c,o){const a=s._WINDOW_SIZE||1;let u=i.get(s);return u||(u=this.precomputeWindow(s,a),a!==1&&i.set(s,o(u))),this.wNAF(a,u,c)}}}function Qt(e){return vr(e.Fp),Ue(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ct(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Or(e){const t=Qt(e);Ue(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:Ur,hexToBytes:kr}=pr,be={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=be;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Ur(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=be,n=typeof e=="string"?kr(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:i}=be._parseInt(n.subarray(2)),{d:c,l:o}=be._parseInt(i);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:c}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const l=u.toString(16);return l.length&1?`0${l}`:l},r=t(n(e.s)),s=t(n(e.r)),i=r.length/2,c=s.length/2,o=n(i),a=n(c);return`30${n(c+i+4)}02${a}${s}02${o}${r}`}},ie=BigInt(0),V=BigInt(1);BigInt(2);const Jt=BigInt(3);BigInt(4);function Br(e){const t=Or(e),{Fp:n}=t,r=t.toBytes||((T,w,m)=>{const E=w.toAffine();return we(Uint8Array.from([4]),n.toBytes(E.x),n.toBytes(E.y))}),s=t.fromBytes||(T=>{const w=T.subarray(1),m=n.fromBytes(w.subarray(0,n.BYTES)),E=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:m,y:E}});function i(T){const{a:w,b:m}=t,E=n.sqr(T),R=n.mul(E,T);return n.add(n.add(R,n.mul(T,w)),m)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function c(T){return typeof T=="bigint"&&ien.eql(U,n.ZERO);return R(m)&&R(E)?f.ZERO:new f(m,E,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const m=n.invertBatch(w.map(E=>E.pz));return w.map((E,R)=>E.toAffine(m[R])).map(f.fromAffine)}static fromHex(w){const m=f.fromAffine(s(j("pointHex",w)));return m.assertValidity(),m}static fromPrivateKey(w){return f.BASE.multiply(a(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:w,y:m}=this.toAffine();if(!n.isValid(w)||!n.isValid(m))throw new Error("bad point: x or y not FE");const E=n.sqr(m),R=i(w);if(!n.eql(E,R))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){l(w);const{px:m,py:E,pz:R}=this,{px:U,py:x,pz:C}=w,S=n.eql(n.mul(m,C),n.mul(U,R)),O=n.eql(n.mul(E,C),n.mul(x,R));return S&&O}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:m}=t,E=n.mul(m,Jt),{px:R,py:U,pz:x}=this;let C=n.ZERO,S=n.ZERO,O=n.ZERO,L=n.mul(R,R),D=n.mul(U,U),P=n.mul(x,x),d=n.mul(R,U);return d=n.add(d,d),O=n.mul(R,x),O=n.add(O,O),C=n.mul(w,O),S=n.mul(E,P),S=n.add(C,S),C=n.sub(D,S),S=n.add(D,S),S=n.mul(C,S),C=n.mul(d,C),O=n.mul(E,O),P=n.mul(w,P),d=n.sub(L,P),d=n.mul(w,d),d=n.add(d,O),O=n.add(L,L),L=n.add(O,L),L=n.add(L,P),L=n.mul(L,d),S=n.add(S,L),P=n.mul(U,x),P=n.add(P,P),L=n.mul(P,d),C=n.sub(C,L),O=n.mul(P,D),O=n.add(O,O),O=n.add(O,O),new f(C,S,O)}add(w){l(w);const{px:m,py:E,pz:R}=this,{px:U,py:x,pz:C}=w;let S=n.ZERO,O=n.ZERO,L=n.ZERO;const D=t.a,P=n.mul(t.b,Jt);let d=n.mul(m,U),g=n.mul(E,x),y=n.mul(R,C),I=n.add(m,E),h=n.add(U,x);I=n.mul(I,h),h=n.add(d,g),I=n.sub(I,h),h=n.add(m,R);let p=n.add(U,C);return h=n.mul(h,p),p=n.add(d,y),h=n.sub(h,p),p=n.add(E,R),S=n.add(x,C),p=n.mul(p,S),S=n.add(g,y),p=n.sub(p,S),L=n.mul(D,h),S=n.mul(P,y),L=n.add(S,L),S=n.sub(g,L),L=n.add(g,L),O=n.mul(S,L),g=n.add(d,d),g=n.add(g,d),y=n.mul(D,y),h=n.mul(P,h),g=n.add(g,y),y=n.sub(d,y),y=n.mul(D,y),h=n.add(h,y),d=n.mul(g,h),O=n.add(O,d),d=n.mul(p,h),S=n.mul(I,S),S=n.sub(S,d),d=n.mul(I,g),L=n.mul(p,L),L=n.add(L,d),new f(S,O,L)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return A.wNAFCached(this,u,w,m=>{const E=n.invertBatch(m.map(R=>R.pz));return m.map((R,U)=>R.toAffine(E[U])).map(f.fromAffine)})}multiplyUnsafe(w){const m=f.ZERO;if(w===ie)return m;if(o(w),w===V)return this;const{endo:E}=t;if(!E)return A.unsafeLadder(this,w);let{k1neg:R,k1:U,k2neg:x,k2:C}=E.splitScalar(w),S=m,O=m,L=this;for(;U>ie||C>ie;)U&V&&(S=S.add(L)),C&V&&(O=O.add(L)),L=L.double(),U>>=V,C>>=V;return R&&(S=S.negate()),x&&(O=O.negate()),O=new f(n.mul(O.px,E.beta),O.py,O.pz),S.add(O)}multiply(w){o(w);let m=w,E,R;const{endo:U}=t;if(U){const{k1neg:x,k1:C,k2neg:S,k2:O}=U.splitScalar(m);let{p:L,f:D}=this.wNAF(C),{p:P,f:d}=this.wNAF(O);L=A.constTimeNegate(x,L),P=A.constTimeNegate(S,P),P=new f(n.mul(P.px,U.beta),P.py,P.pz),E=L.add(P),R=D.add(d)}else{const{p:x,f:C}=this.wNAF(m);E=x,R=C}return f.normalizeZ([E,R])[0]}multiplyAndAddUnsafe(w,m,E){const R=f.BASE,U=(C,S)=>S===ie||S===V||!C.equals(R)?C.multiplyUnsafe(S):C.multiply(S),x=U(this,m).add(U(w,E));return x.is0()?void 0:x}toAffine(w){const{px:m,py:E,pz:R}=this,U=this.is0();w==null&&(w=U?n.ONE:n.inv(R));const x=n.mul(m,w),C=n.mul(E,w),S=n.mul(R,w);if(U)return{x:n.ZERO,y:n.ZERO};if(!n.eql(S,n.ONE))throw new Error("invZ was invalid");return{x,y:C}}isTorsionFree(){const{h:w,isTorsionFree:m}=t;if(w===V)return!0;if(m)return m(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:m}=t;return w===V?this:m?m(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return fe(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const b=t.nBitLength,A=Rr(f,t.endo?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:a,weierstrassEquation:i,isWithinCurveOrder:c}}function Cr(e){const t=Qt(e);return Ue(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Lr(e){const t=Cr(e),{Fp:n,n:r}=t,s=n.BYTES+1,i=2*n.BYTES+1;function c(h){return iefe(de(h,t.nByteLength));function T(h){const p=r>>V;return h>p}function w(h){return T(h)?o(-h):h}const m=(h,p,v)=>G(h.slice(p,v));class E{constructor(p,v,_){this.r=p,this.s=v,this.recovery=_,this.assertValidity()}static fromCompact(p){const v=t.nByteLength;return p=j("compactSignature",p,v*2),new E(m(p,0,v),m(p,v,2*v))}static fromDER(p){const{r:v,s:_}=be.toSig(j("DER",p));return new E(v,_)}assertValidity(){if(!b(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!b(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(p){return new E(this.r,this.s,p)}recoverPublicKey(p){const{r:v,s:_,recovery:B}=this,H=O(j("msgHash",p));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const k=B===2||B===3?v+t.n:v;if(k>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const $=B&1?"03":"02",z=u.fromHex($+A(k)),Z=a(k),oe=o(-H*Z),ce=o(_*Z),te=u.BASE.multiplyAndAddUnsafe(z,oe,ce);if(!te)throw new Error("point at infinify");return te.assertValidity(),te}hasHighS(){return T(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Te(this.toDERHex())}toDERHex(){return be.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Te(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}const R={isValidPrivateKey(h){try{return l(h),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const h=t.randomBytes(n.BYTES+8),p=Sr(h,r);return de(p,t.nByteLength)},precompute(h=8,p=u.BASE){return p._setWindowSize(h),p.multiply(BigInt(3)),p}};function U(h,p=!0){return u.fromPrivateKey(h).toRawBytes(p)}function x(h){const p=h instanceof Uint8Array,v=typeof h=="string",_=(p||v)&&h.length;return p?_===s||_===i:v?_===2*s||_===2*i:h instanceof u}function C(h,p,v=!0){if(x(h))throw new Error("first arg must be private key");if(!x(p))throw new Error("second arg must be public key");return u.fromHex(p).multiply(l(h)).toRawBytes(v)}const S=t.bits2int||function(h){const p=G(h),v=h.length*8-t.nBitLength;return v>0?p>>BigInt(v):p},O=t.bits2int_modN||function(h){return o(S(h))},L=rt(t.nBitLength);function D(h){if(typeof h!="bigint")throw new Error("bigint expected");if(!(ie<=h&&hve in v))throw new Error("sign() legacy options not supported");const{hash:_,randomBytes:B}=t;let{lowS:H,prehash:k,extraEntropy:$}=v;H==null&&(H=!0),h=j("msgHash",h),k&&(h=j("prehashed msgHash",_(h)));const z=O(h),Z=l(p),oe=[D(Z),D(z)];if($!=null){const ve=$===!0?B(n.BYTES):$;oe.push(j("extraEntropy",ve,n.BYTES))}const ce=we(...oe),te=z;function Se(ve){const Ie=S(ve);if(!b(Ie))return;const Ln=a(Ie),Re=u.BASE.multiply(Ie).toAffine(),ne=o(Re.x);if(ne===ie)return;const Oe=o(Ln*o(te+ne*Z));if(Oe===ie)return;let _n=(Re.x===ne?0:2)|Number(Re.y&V),$n=Oe;return H&&T(Oe)&&($n=w(Oe),_n^=1),new E(ne,$n,_n)}return{seed:ce,k2sig:Se}}const d={lowS:t.lowS,prehash:!1},g={lowS:t.lowS,prehash:!1};function y(h,p,v=d){const{seed:_,k2sig:B}=P(h,p,v),H=t;return Gt(H.hash.outputLen,H.nByteLength,H.hmac)(_,B)}u.BASE._setWindowSize(8);function I(h,p,v,_=g){var Re;const B=h;if(p=j("msgHash",p),v=j("publicKey",v),"strict"in _)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:k}=_;let $,z;try{if(typeof B=="string"||B instanceof Uint8Array)try{$=E.fromDER(B)}catch(ne){if(!(ne instanceof be.Err))throw ne;$=E.fromCompact(B)}else if(typeof B=="object"&&typeof B.r=="bigint"&&typeof B.s=="bigint"){const{r:ne,s:Oe}=B;$=new E(ne,Oe)}else throw new Error("PARSE");z=u.fromHex(v)}catch(ne){if(ne.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&$.hasHighS())return!1;k&&(p=t.hash(p));const{r:Z,s:oe}=$,ce=O(p),te=a(oe),Se=o(ce*te),ve=o(Z*te),Ie=(Re=u.BASE.multiplyAndAddUnsafe(z,Se,ve))==null?void 0:Re.toAffine();return Ie?o(Ie.x)===Z:!1}return{CURVE:t,getPublicKey:U,getSharedSecret:C,sign:y,verify:I,ProjectivePoint:u,Signature:E,utils:R}}class Vt extends Ht{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,pe.hash(t);const r=et(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?t.create().update(r).digest():r);for(let c=0;cnew Vt(e,t).update(n).digest();Xt.create=(e,t)=>new Vt(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function _r(e){return{hash:e,hmac:(t,...n)=>Xt(e,t,Kn(...n)),randomBytes:Wt}}function $r(e,t){const n=r=>Lr({...e,..._r(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const He=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Me=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Yt=BigInt(1),We=BigInt(2),Kt=(e,t)=>(e+t/We)/t;function en(e){const t=He,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),c=BigInt(23),o=BigInt(44),a=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=J(l,n,t)*l%t,b=J(f,n,t)*l%t,A=J(b,We,t)*u%t,T=J(A,s,t)*A%t,w=J(T,i,t)*T%t,m=J(w,o,t)*w%t,E=J(m,a,t)*m%t,R=J(E,o,t)*w%t,U=J(R,n,t)*l%t,x=J(U,c,t)*T%t,C=J(x,r,t)*u%t,S=J(C,We,t);if(!ut.eql(ut.sqr(S),e))throw new Error("Cannot find square root");return S}const ut=xr(He,void 0,void 0,{sqrt:en}),lt=$r({a:BigInt(0),b:BigInt(7),Fp:ut,n:Me,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Me,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Yt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,c=BigInt("0x100000000000000000000000000000000"),o=Kt(i*e,t),a=Kt(-r*e,t);let u=F(e-o*n-a*s,t),l=F(-o*r-a*i,t);const f=u>c,b=l>c;if(f&&(u=t-u),b&&(l=t-l),u>c||l>c)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:b,k2:l}}}},_e),qe=BigInt(0),tn=e=>typeof e=="bigint"&&qetypeof e=="bigint"&&qes.charCodeAt(0)));n=we(r,r),nn[e]=n}return _e(we(n,...t))}const ft=e=>e.toRawBytes(!0).slice(1),dt=e=>de(e,32),ht=e=>F(e,He),ke=e=>F(e,Me),gt=lt.ProjectivePoint,Hr=(e,t,n)=>gt.BASE.multiplyAndAddUnsafe(e,t,n);function pt(e){let t=lt.utils.normPrivateKeyToScalar(e),n=gt.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:ke(-t),bytes:ft(n)}}function rn(e){if(!tn(e))throw new Error("bad x: need 0 < x < p");const t=ht(e*e),n=ht(t*e+BigInt(7));let r=en(n);r%We!==qe&&(r=ht(-r));const s=new gt(e,r,Yt);return s.assertValidity(),s}function sn(...e){return ke(G(ze("BIP0340/challenge",...e)))}function Mr(e){return pt(e).bytes}function Wr(e,t,n=Wt(32)){const r=j("message",e),{bytes:s,scalar:i}=pt(t),c=j("auxRand",n,32),o=dt(i^G(ze("BIP0340/aux",c))),a=ze("BIP0340/nonce",o,s,r),u=ke(G(a));if(u===qe)throw new Error("sign failed: k is zero");const{bytes:l,scalar:f}=pt(u),b=sn(l,s,r),A=new Uint8Array(64);if(A.set(l,0),A.set(dt(ke(f+b*i)),32),!on(A,r,s))throw new Error("sign: Invalid signature produced");return A}function on(e,t,n){const r=j("signature",e,64),s=j("message",t),i=j("publicKey",n,32);try{const c=rn(G(i)),o=G(r.subarray(0,32));if(!tn(o))return!1;const a=G(r.subarray(32,64));if(!Pr(a))return!1;const u=sn(dt(o),ft(c),s),l=Hr(c,a,ke(-u));return!(!l||!l.hasEvenY()||l.toAffine().x!==o)}catch{return!1}}const qr=(()=>({getPublicKey:Mr,sign:Wr,verify:on,utils:{randomPrivateKey:lt.utils.randomPrivateKey,lift_x:rn,pointToBytes:ft,numberToBytesBE:de,bytesToNumberBE:G,taggedHash:ze,mod:F}}))();let cn=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var an=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(an||{}),W=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(W||{}),un=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(un||{}),ee=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(ee||{});function ln(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function zr(e){const t=[];for(const i of e){const c=new Uint8Array([i.type]);let o;i.type===1?o=new TextEncoder().encode(i.value):i.type===3?o=new Uint32Array([i.value]):o=ln(i.value);const a=new Uint8Array([o.length]);t.push(c),t.push(a),t.push(o)}let n=t.reduce((i,c)=>i+c.length,0);const r=new Uint8Array(n);let s=0;for(const i of t)r.set(i,s),s+=i.length;return r}function jr(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=fn(t.value),{type:t.type,value:n}})}function Zr(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=ln(t[0].value):n=zr(t);const r=Y.toWords(new Uint8Array(n.buffer));return Y.encode(e,r,1023)}function Gr(e){const{prefix:t,words:n}=Y.decode(e,1023),r=new Uint8Array(Y.fromWords(n));let s;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")s=[{type:0,value:fn(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=jr(r);s=Fr(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:s}}function Dr(e){return Nn.decode(e)}function Nr(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function Qr(e){return["amount",e]}function Jr(e){let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"&&(n=r[1]),r.length===3&&r[2]==="content-warning"&&r[0]==="l"&&(n=r[1]));return t?n:void 0}var Vr=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/,Xr=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g;function dn(e){if(typeof e!="string")return null;const t=e.match(Vr);return t&&t.length===3?{prefix:t[1],bech32:`${t[1]}${t[2]}`}:null}function Yr(e){return dn(e)!==null}function Kr(e){const t=dn(e);return t===null?null:Gr(t.bech32)}function es(e,t){return`nostr:${Zr(e,t)}`}function ts(e){return es("npub",[{type:0,value:e}])}function hn(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function ns(e,t){if(!gn(e,t).isValid)return;const r=/(.*)?(wss:\/\/[a-zA-Z0-9.-]+)/,s={message:void 0,relayUrl:void 0,nurls:[]},i=r.exec(e);if(i)return s.message=i[1]?i[1].trim():void 0,s.relayUrl=i[2],s;const c=[],o=[];let a,u;const l=[];for(;(u=Xr.exec(e))!==null;){const b=u[0];if(Yr(b)){const A=Kr(b);if(a=A.prefix,a==="npub"&&A.tlvItems.length>0){const T=A.tlvItems.filter(m=>m.type===0);if(T.length===0)continue;const w=T[0].value;c.push(w),l.push({index:u.index,length:b.length,replaceWith:w})}else if(a==="nprofile"){const T=A.tlvItems.filter(E=>E.type===0);if(T.length===0)continue;const w=T[0].value;c.push(w),l.push({index:u.index,length:b.length,replaceWith:w});const m=A.tlvItems.filter(E=>E.type===1);if(m.length===0)continue;for(const E of m)hn(E.value)?o.push(E.value):console.error(`Invalid relay url ${E.value}`)}}}let f=0;for(const{index:b,length:A,replaceWith:T}of l){const w=b+f;e=e.slice(0,w)+T+e.slice(w+A),f+=T.length-A}if(c.length>0&&a)return s.message=e.trim(),s.nurls=[{type:"npub",publicKeys:c,relayUrls:o}],s}function rs(e){if(!e)return"";let t=e.message?`${e.message} `:"";if(e.relayUrl)return`${t} ${e.relayUrl}`.trim();if(!e.nurls||e.nurls.length===0)return t.trim();for(const n of e.nurls)if(n.type==="npub")t+=`${ts(n.publicKeys[0])} `;else throw new Error(`Unsupported nurl type ${n.type}`);return t.trim()}function gn(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!hn(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return ss(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function ss(e){return/<[^>]*>/.test(e)}function is(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let s=r[0],i=r[1],c=r[2],o;n.length===3&&(o=n[2]),t.push({kind:s,pubkey:i,identifier:c,relay:o})}if(t.length!==0)return t}function os(e){const t=is(e.tags);if(t)return t}function cs(e){const{kind:t,pubkey:n,identifier:r,relay:s}=e;return s?[`a:${t}:${n}:${r}, ${s}`]:[`a:${t}:${n}:${r}`]}function as(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function us(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function ls(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function fs(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function ds(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let s=r[1]||"";t.includes(s)||t.push(s)}return t&&t.length>0?t:void 0}}function hs(e){return["d",e]}function gs(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function ps(e){return["lnurl",e]}function ws(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function ys(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function bs(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function ms(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function Es(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function vs(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(o=>o[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(o=>o[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let s;t[0].length===3?s=t[0][2]:r.length>0&&r[0].length===3&&(s=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!s||!i?void 0:{eventId:n,kind:s,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function As(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const s=[];return t?(s.push(["e",t,n]),r&&s.push(["p",r])):r&&s.push(["p",r,n]),s}function Ts(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function xs(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var Ss=new TextEncoder;new TextDecoder("utf-8");function pn(e){const t=_e(Ss.encode(e));return fe(t)}function Is({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function Rs(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function Os(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const s=Dr(t.pr);let i;const c=s.sections.find(o=>o.name==="amount");if(c)i=c.value;else return!1;return!(n&&n.toString()!==i)}function Us(e){const t=new he(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],s=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:s};return JSON.stringify(i)}var ks=new TextEncoder,wn=new TextDecoder;function Bs(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function Cs(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=Y.decode(e,2e4),n=new Uint8Array(Y.fromWords(t));return wn.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=Bs(e);if(t){const{words:n}=Y.decode(t,2e4),r=new Uint8Array(Y.fromWords(n));return wn.decode(r)}return e}throw new Error(`invalid url ${e}`)}function Ls(e){const t=ks.encode(e),n=Y.toWords(new Uint8Array(t));return Y.encode("lnurl",n,2e4)}function yn(e){return e.endsWith(".onion")}function _s(e){const[t,n]=e.split("@");return`${yn(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function $s(e){const[t,n]=e.split("@");return`${yn(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function Ps(e){let t=0;for(let n=0;na[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),s]);const c=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=pn(c),Ps(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(a=>a[0]!=="nonce"),e.tags.push(["nonce",r.toString(),s]),e;if(n&&r>=n)return;r++}}function bn(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function Ms(e){return e.toLowerCase()}function Ws(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=qr.sign(e,t);return fe(n)}function qs(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var zs=class{constructor(e){if(e){if(!bn(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=Ms(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(mn(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function mn(e){return!(e.length!==3||!Object.values(un).includes(e[1].split(":")[0])||!bn(e[1].split(":")[1]))}function En(e){const t=e.tags.filter(r=>r[0]==="i"&&mn(r));if(t.length===0)return;const n=[];for(const r of t){const s=new zs;s.fromTag(r),n.push(s)}return n}var he=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=xs(this.ToObj());this.id=pn(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,console.log(`Signing event ${this.id} with ${e.publicKey}`),this.sig=Ws(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=Hs(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}mentionUsers(e){if(!this.extractContent())this.content=rs({message:this.content,nurls:[{type:"npub",publicKeys:e}]});else throw new Error("Already has motified content")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t[0].publicKeys:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return ns(this.content,this.kind)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return ls(this)?us(this):as(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return ms(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return Es(this)}addEventCoordinatesTag(e){this.addTag(cs(e))}hasEventCoordinatesTags(){return os(this)}addIdentifierTag(e){this.addTag(hs(e))}hasIdentifierTags(){return ds(this)}addLnurlTag(e){this.addTag(ps(e))}hasLnurlTags(){return gs(this)}addAmountTag(e){this.addTag(Qr(e))}hasAmountTags(){return Nr(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return fs(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return Ts(this)}addNonceTag(e){const t=ys(this,e);this.tags=t.tags}hasNonceTag(){return ws(this)}replaceNonceTag(e){const t=bs(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return Jr(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return En(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");As(e).forEach(n=>this.addTag(n))}hasReportTags(){return vs(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return Zs({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=gn(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function js(e){const t=new he({content:"",kind:9734});return t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function Fs(e,t,n){const r=js(e);r.signAndGenerateId(n);const s=r.toURI();return{event:r,eventUri:s,invoiceUrl:Is({callback:t,amount:e.amount,event:s,lnurl:e.lnurl})}}function Zs(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=Us(e.zapRequest),s=new he({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&s.addEventTag({eventId:n[1]}),e.preimage&&s.addTag(["preimage",e.preimage]),s}var je=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},Gs=class{constructor(e){this.subscriptions=[],this.url=e.url,this.read=e.read,this.write=e.write,this.requiresPOW=0,this.info=e.info,this.isEnabled=!0}isConnected(){return this.ws!==void 0&&this.ws.isConnected()}isReady(e){if(!this.isConnected()||!this.isEnabled)return!1;switch(e){case"read":return this.read;case"write":return this.write;case"any":return this.read||this.write;default:return!1}}supportsEvent(e){var s;const t=e.determineRequiredNIP(),n=((s=this.info)==null?void 0:s.supported_nips)||[];return console.log(`Required NIP: ${t.join(", ")}`,`Supported NIP: ${n.join(", ")}`),t.every(i=>n.includes(i))}supportsEventOrThrow(e){if(!this.supportsEvent(e))throw new Error(`Event ${e.id} is not supported by relay ${this.url}`)}addSubscription(e){this.subscriptions.push(e)}updateSubscription(e){const t=this.subscriptions.findIndex(n=>n.id===e.id);t!==-1&&(this.subscriptions[t]=e)}removeSubscription(e){this.subscriptions=this.subscriptions.filter(t=>t.id!==e)}getSubscription(e){const t=this.subscriptions.find(n=>n.id===e);return t?{...t,relayUrl:this.url}:null}getSubscriptions(){return this.subscriptions.map(e=>({...e,relayUrl:this.url}))}getInfo(e){return e==="default"?{url:this.url,read:this.read,write:this.write,powRequired:this.requiresPOW,isReady:this.isReady("any")}:{url:this.url,read:this.read,write:this.write,powRequired:this.requiresPOW,info:this.info,isReady:this.isReady("any")}}},Ds=class{constructor(e){this.relays=[],this.addInitialRelays(e)}addInitialRelays(e){if(e&&(!this.relays||this.relays.length===0))for(const t of e)this.relays.push(new Gs(t))}sendSubscribe(e){var s;const t=[],n=e!=null&&e.relayUrls?this.relays.filter(i=>e.relayUrls.includes(i.url)):this.relays,r="read";for(const i of n)if(i.isReady(r)){const{relayUrls:c,...o}=e,a={...o,id:cn(),relayUrl:i.url,created:Date.now(),isActive:!0};let u,l;if(e.type==="REQ")l={type:"REQ",subscriptionId:a.id,filters:JSON.parse(JSON.stringify(a.filters))},u=JSON.stringify([l.type,l.subscriptionId,l.filters]);else if(e.type==="COUNT"){const f=(s=i.info)==null?void 0:s.supported_nips;if(f&&!f.includes(45)){console.warn(`Relay ${i.url} does not support count command.`),a.error=`Relay ${i.url} does not support count command.`;continue}l={type:"COUNT",subscriptionId:a.id,filters:JSON.parse(JSON.stringify(a.filters))},u=JSON.stringify([l.type,l.subscriptionId,l.filters])}else if(e.type==="AUTH")l={type:"AUTH",signedEvent:e.signedEvent},u=JSON.stringify([l.type,l.signedEvent]);else throw new Error("Invalid subscription type.");try{if(i.ws.sendMessage(u),i.addSubscription(a),e.type==="REQ"&&e.options){const f=e.options.timeoutIn;f&&(a.options={timeoutIn:f,timeoutAt:Date.now()+f,timeout:setTimeout(()=>{this.unsubscribe([a.id])},f)})}}catch(f){console.error(f)}}else console.warn(`Relay ${i.url} is not ready for ${r} operations. Skipping...`);return t}subscribe(e){return this.sendSubscribe(e)}count(e){if(e.type!=="COUNT")throw new Error("Invalid subscription type. Expected COUNT.");return this.sendSubscribe(e)}unsubscribe(e){for(const t of this.relays){if(!t.isConnected())continue;const n=t.getSubscriptions();if(!n||n.length===0)continue;const r=n.filter(s=>e.includes(s.id));for(const s of r){const i={type:"CLOSE",subscriptionId:s.id};s.options&&s.options.timeout&&clearTimeout(s.options.timeout);try{t.ws.sendMessage(JSON.stringify([i.type,i.subscriptionId])),t.removeSubscription(s.id)}catch(c){console.error(c)}}}}unsubscribeAll(){for(const e of this.relays){const t=e.getSubscriptions();t&&t.length>0&&this.unsubscribe(t.map(n=>n.id))}}getSubscription(e){for(const t of this.relays){const n=t.getSubscription(e);if(n)return n}}getSubscriptions(){return this.relays.map(e=>e.getSubscriptions()).flat()}countSubscriptions(){return this.relays.map(e=>e.getSubscriptions().length).reduce((e,t)=>e+t,0)}updateSubscription(e){for(const t of this.relays)t.url===e.relayUrl&&t.updateSubscription(e)}countConnections(){let e=0;for(const t of this.relays)t.isConnected()&&e++;return e}getAuthChallenge(e){return this.relays.filter(n=>e.includes(n.url)).map(n=>({relayUrl:n.url,challenge:n.authChallenge}))}sendEvent(e){const t={type:"EVENT",data:e.event},n=JSON.stringify([t.type,t.data]),r=[],s=e.relayUrls?this.relays.filter(i=>e.relayUrls.includes(i.url)):this.relays;for(const i of s)if(i.isReady("write")){const{relayUrls:c,...o}=e,a={id:cn(),...o,relayUrl:i.url,send:!0,error:void 0};if(!i.supportsEvent(e.event)){console.log(`Event ${e.event.id} not published to ${i.url} because not all needed NIPS are supported`,t),a.send=!1,a.error=`Event ${e.event.id} not published to ${i.url} because not all needed NIPS are supported`,r.push(a);continue}i.ws.sendMessage(n),r.push(a)}else console.warn(`Relay ${i.url} is not ready for write operations. Skipping...`);return r.length>0?r:void 0}sendQueueItems(e){var r;const t={type:"EVENT",data:(r=e.find(s=>s.event))==null?void 0:r.event},n=JSON.stringify([t.type,t.data]);for(const s of e){const i=this.relays.find(c=>c.url===s.relayUrl);i&&(i.ws.sendMessage(n),s.send=!0)}return e}listen(e){for(const t of this.relays)t.isEnabled&&t.ws.listen(n=>{n[0]==="AUTH"&&(console.log(`Received auth challenge ${n[1]} from ${t.url}.`),t.authChallenge=n[1]),e({data:n,meta:t.getInfo("default")})})}disconnect(){this.unsubscribeAll(),setTimeout(()=>{var t;const e={subscriptions:this.countSubscriptions(),connections:this.countConnections()};console.log(` - Stats: - - Subscriptions: ${e.subscriptions} - - Connections: ${e.connections} - `);for(const n of this.relays)(t=n.ws)==null||t.disconnect();this.relays=[]},1e3)}},Be=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new he(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const s=qs(n.content);s&&(this.data=s)}const r=En(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return $s(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return _s(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return Cs(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new je;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}},Ns=class{constructor(){}connect(e){this.connection=new WebSocket(e)}isConnected(){return this.connection&&this.connection.readyState===this.connection.OPEN}sendMessage(e,t){const n=t||{retries:10,retryTimeout:100,retryCount:0};if(this.isConnected())this.connection.send(e);else{const r=n.retryCount+1;if(r===10)throw new Error(`Could not send message after ${r} retries`);setTimeout(()=>this.sendMessage(e,n),100)}}listen(e){this.connection.onmessage=t=>{e(JSON.parse(t.data))}}disconnect(){this.connection.close()}};async function Fe(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((s,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}async function Qs(e){let t=e.replace(/^wss:\/\//i,"https://");console.log("###############"),console.log("Fetching relay information from",t),console.log("###############");const n=new AbortController;return setTimeout(()=>{n.abort()},5e3),Fe(t,{Accept:"application/nostr+json"})}var Js=class extends Ds{constructor(e,t){super(e),(!t&&e||e&&t.connectManually!==!0)&&this.connectRelays()}connectRelays(){console.log(`=> Connecting to ${this.relays.length} relay(s) ...`);for(const e of this.relays)if(!e.isConnected()){console.log(`=> Connecting to ${e.url} ...`);try{e.ws=new Ns,e.ws.connect(e.url),e.ws.connection.onopen=()=>{console.log(`Websocket connected to ${e.url}`)},e.ws.connection.onclose=t=>{console.log(`WebSocket to ${e.url} closed.`,JSON.stringify(t))},e.ws.connection.onerror=t=>{console.log(`WebSocket disconnected from ${e.url}`,JSON.stringify(t))}}catch(t){console.error("Error connecting to relay",t)}}}loadFromDiscovered(e){this.addInitialRelays(e.map(t=>({url:t.url,read:!0,write:!0}))),this.connectRelays()}async getRelayInformation(){const e=[];for(const t of this.relays)if(!t.info)try{t.info=await Qs(t.url),console.log(`Relay ${t.url} information`,t.info),e.push(t.getInfo("withInfo"))}catch(n){console.error("Error getting relay information",n)}return e}},Vs=class extends Be{constructor(e){super(e)}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{if(!this.hasZapInfo()){const c=await Fe(n.url);if(!Rs(c))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");this.lightningZapInfo=c}console.log("LnurlEndpointResponse",this.lightningZapInfo);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?Ls(this.getLud16()):this.getLud06()},s=Fs(r,this.lightningZapInfo.callback,t),i=await Fe(s.invoiceUrl);if(!Os(r,i))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",i),{...i,event:s.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await Fe(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}};const Xs=(e,t)=>t.some(n=>e instanceof n);let vn,An;function Ys(){return vn||(vn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ks(){return An||(An=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Tn=new WeakMap,wt=new WeakMap,xn=new WeakMap,yt=new WeakMap,bt=new WeakMap;function ei(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",i),e.removeEventListener("error",c)},i=()=>{n(ge(e.result)),s()},c=()=>{r(e.error),s()};e.addEventListener("success",i),e.addEventListener("error",c)});return t.then(n=>{n instanceof IDBCursor&&Tn.set(n,e)}).catch(()=>{}),bt.set(t,e),t}function ti(e){if(wt.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",c),e.removeEventListener("abort",c)},i=()=>{n(),s()},c=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",i),e.addEventListener("error",c),e.addEventListener("abort",c)});wt.set(e,t)}let mt={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return wt.get(e);if(t==="objectStoreNames")return e.objectStoreNames||xn.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ge(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function ni(e){mt=e(mt)}function ri(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Et(this),t,...n);return xn.set(r,t.sort?t.sort():[t]),ge(r)}:Ks().includes(e)?function(...t){return e.apply(Et(this),t),ge(Tn.get(this))}:function(...t){return ge(e.apply(Et(this),t))}}function si(e){return typeof e=="function"?ri(e):(e instanceof IDBTransaction&&ti(e),Xs(e,Ys())?new Proxy(e,mt):e)}function ge(e){if(e instanceof IDBRequest)return ei(e);if(yt.has(e))return yt.get(e);const t=si(e);return t!==e&&(yt.set(e,t),bt.set(t,e)),t}const Et=e=>bt.get(e);function ii(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const c=indexedDB.open(e,t),o=ge(c);return r&&c.addEventListener("upgradeneeded",a=>{r(ge(c.result),a.oldVersion,a.newVersion,ge(c.transaction),a)}),n&&c.addEventListener("blocked",a=>n(a.oldVersion,a.newVersion,a)),o.then(a=>{i&&a.addEventListener("close",()=>i()),s&&a.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),o}const oi=["get","getKey","getAll","getAllKeys","count"],ci=["put","add","delete","clear"],vt=new Map;function Sn(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(vt.get(t))return vt.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=ci.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||oi.includes(n)))return;const i=async function(c,...o){const a=this.transaction(c,s?"readwrite":"readonly");let u=a.store;return r&&(u=u.index(o.shift())),(await Promise.all([u[n](...o),s&&a.done]))[0]};return vt.set(t,i),i}ni(e=>({...e,get:(t,n,r)=>Sn(t,n)||e.get(t,n,r),has:(t,n)=>!!Sn(t,n)||e.has(t,n)}));const ai=25;/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const In=Symbol("Comlink.proxy"),ui=Symbol("Comlink.endpoint"),li=Symbol("Comlink.releaseProxy"),At=Symbol("Comlink.finalizer"),Ze=Symbol("Comlink.thrown"),Rn=e=>typeof e=="object"&&e!==null||typeof e=="function",fi={canHandle:e=>Rn(e)&&e[In],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Tt(e,t),[n,[n]]},deserialize(e){return e.start(),pi(e)}},di={canHandle:e=>Rn(e)&&Ze in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},On=new Map([["proxy",fi],["throw",di]]);function hi(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Tt(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(s){if(!s||!s.data)return;if(!hi(n,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:c,path:o}=Object.assign({path:[]},s.data),a=(s.data.argumentList||[]).map(me);let u;try{const l=o.slice(0,-1).reduce((b,A)=>b[A],e),f=o.reduce((b,A)=>b[A],e);switch(c){case"GET":u=f;break;case"SET":l[o.slice(-1)[0]]=me(s.data.value),u=!0;break;case"APPLY":u=f.apply(l,a);break;case"CONSTRUCT":{const b=new f(...a);u=Ei(b)}break;case"ENDPOINT":{const{port1:b,port2:A}=new MessageChannel;Tt(e,A),u=mi(b,[b])}break;case"RELEASE":u=void 0;break;default:return}}catch(l){u={value:l,[Ze]:0}}Promise.resolve(u).catch(l=>({value:l,[Ze]:0})).then(l=>{const[f,b]=Qe(l);t.postMessage(Object.assign(Object.assign({},f),{id:i}),b),c==="RELEASE"&&(t.removeEventListener("message",r),Un(t),At in e&&typeof e[At]=="function"&&e[At]())}).catch(l=>{const[f,b]=Qe({value:new TypeError("Unserializable return value"),[Ze]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),b)})}),t.start&&t.start()}function gi(e){return e.constructor.name==="MessagePort"}function Un(e){gi(e)&&e.close()}function pi(e,t){return xt(e,[],t)}function Ge(e){if(e)throw new Error("Proxy has been released and is not useable")}function kn(e){return xe(e,{type:"RELEASE"}).then(()=>{Un(e)})}const De=new WeakMap,Ne="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(De.get(e)||0)-1;De.set(e,t),t===0&&kn(e)});function wi(e,t){const n=(De.get(t)||0)+1;De.set(t,n),Ne&&Ne.register(e,t,e)}function yi(e){Ne&&Ne.unregister(e)}function xt(e,t=[],n=function(){}){let r=!1;const s=new Proxy(n,{get(i,c){if(Ge(r),c===li)return()=>{yi(s),kn(e),r=!0};if(c==="then"){if(t.length===0)return{then:()=>s};const o=xe(e,{type:"GET",path:t.map(a=>a.toString())}).then(me);return o.then.bind(o)}return xt(e,[...t,c])},set(i,c,o){Ge(r);const[a,u]=Qe(o);return xe(e,{type:"SET",path:[...t,c].map(l=>l.toString()),value:a},u).then(me)},apply(i,c,o){Ge(r);const a=t[t.length-1];if(a===ui)return xe(e,{type:"ENDPOINT"}).then(me);if(a==="bind")return xt(e,t.slice(0,-1));const[u,l]=Bn(o);return xe(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},l).then(me)},construct(i,c){Ge(r);const[o,a]=Bn(c);return xe(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:o},a).then(me)}});return wi(s,e),s}function bi(e){return Array.prototype.concat.apply([],e)}function Bn(e){const t=e.map(Qe);return[t.map(n=>n[0]),bi(t.map(n=>n[1]))]}const Cn=new WeakMap;function mi(e,t){return Cn.set(e,t),e}function Ei(e){return Object.assign(e,{[In]:!0})}function Qe(e){for(const[t,n]of On)if(n.canHandle(e)){const[r,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:e},Cn.get(e)||[]]}function me(e){switch(e.type){case"HANDLER":return On.get(e.name).deserialize(e.value);case"RAW":return e.value}}function xe(e,t,n){return new Promise(r=>{const s=vi();e.addEventListener("message",function i(c){!c.data||!c.data.id||c.data.id!==s||(e.removeEventListener("message",i),r(c.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),n)})}function vi(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class Ai{constructor(){N(this,"_priority");N(this,"_background");N(this,"_current");this._priority=[],this._background=[],this._current=Promise.resolve()}enqueuePriority(t){const n=this._current.then(()=>t());return this._priority.push(n),this._current=n.catch(()=>{}),n}enqueueBackground(t){const n=this._current.then(()=>t());return this._background.push(n),this._current=n.catch(()=>{}),n}clearPriority(){this._priority=[]}clearBackground(){this._background=[]}async process(){for(;this._priority.length>0||this._background.length>0;){const t=this._priority.shift()||this._background.shift();t&&await t}this._current=Promise.resolve()}clear(){this._priority=[],this._background=[],this._current=Promise.resolve()}}const Ee=new Ai;class Ti{constructor(t){N(this,"connected");N(this,"db");N(this,"client");N(this,"eventsMap",new Map);N(this,"maxEvents");N(this,"checkedUsers",[]);N(this,"checkedEvents",[]);N(this,"eventsPublishingQueue",[]);N(this,"followingUserIds",[]);this.connected=!1,this.db=null,this.client=null,this.maxEvents=(t==null?void 0:t.maxEvents)||ai}async init(){this.db=await ii("nostr-client",1,{upgrade(t){t.createObjectStore("users",{keyPath:"user.pubkey"}),t.createObjectStore("following",{keyPath:"user.pubkey"})}})}async connect(t,n){this.client=new Js(t),(n==null?void 0:n.autoLoadInfo)!==!1&&await this.client.getRelayInformation(),this.client.listen(async r=>{await this.processEvent(r)})}disconnect(){var t;(t=this.client)==null||t.disconnect(),this.eventsMap.clear(),this.connected=!1}getRelays(){var t;return(t=this.client)!=null&&t.relays?this.client.relays.map(n=>n.getInfo("withInfo")):[]}updateRelay(t,n){var r;for(const s of((r=this.client)==null?void 0:r.relays)||[])if(s.url===t){typeof n.isEnabled<"u"&&(s.isEnabled=n.isEnabled),typeof n.read<"u"&&(s.read=n.read),typeof n.write<"u"&&(s.write=n.write);break}}getSubscriptions(){var t;return((t=this.client)==null?void 0:t.getSubscriptions())||[]}updateSubscription(t){var n;(n=this.client)==null||n.updateSubscription(t),postMessage({type:"subscription:update",data:t})}async subscribe(t){var n;return(n=this.client)==null?void 0:n.subscribe(t)}unsubscribe(t){var n;return(n=this.client)==null?void 0:n.unsubscribe(t)}unsubscribeAll(){var t;return console.log("WORKER: UNSUBSCRIBE ALL"),(t=this.client)==null?void 0:t.unsubscribeAll()}addEvent(t){this.eventsMap.set(t.event.id,t),postMessage({type:"event:new",data:t})}updateEvent(t){this.eventsMap.set(t.event.id,t),postMessage({type:"event:update",data:t})}setMaxEvents(t){this.maxEvents=t}addQueueItems(t){this.eventsPublishingQueue.push(...t)}updateQueueItem(t){const n=this.eventsPublishingQueue.findIndex(r=>r.event.id===t.event.id);n!==-1&&(this.eventsPublishingQueue[n]=t,postMessage({type:"event:queue:update",data:t}))}async getUser(t){if(!this.db)throw new Error("DB not initialized");const n=await this.db.get("users",t);return n?{user:new Vs(n.user),relayUrls:n.relayUrls}:void 0}async addUser(t){if(!this.db)throw new Error("DB not initialized");const{user:n}=t;await this.db.put("users",{user:n,relayUrls:t.relayUrls})}async updateUser(t){if(!this.db)throw new Error("DB not initialized");const n=await this.db.get("users",t.user.pubkey);await this.db.put("users",{user:t.user?t.user:n.user,relayUrls:t.relayUrls?t.relayUrls:n.relayUrls})}async countUsers(){if(!this.db)throw new Error("DB not initialized");return await this.db.count("users")}count(t){var n;return(n=this.client)==null?void 0:n.count(t)}async processEvent(t,n=0){if(!t.data)return;const r=t.data[0];if((r===ee.AUTH||r===ee.OK||r===ee.NOTICE||r===ee.COUNT||r===ee.EOSE)&&Ee.enqueueBackground(async()=>{var s,i,c;if(r===ee.OK){const o=t.data[1],a=t.data[2],u=t.data[3],l=this.eventsPublishingQueue.find(f=>f.event.id===o);l&&(this.updateQueueItem({...l,accepted:a,error:a===!1?u:void 0}),postMessage({type:"relay:message",data:t}));return}else if(r===ee.EOSE){const o=(s=this.client)==null?void 0:s.getSubscriptions(),a=o==null?void 0:o.find(u=>u.id===t.data[1]);a&&this.updateSubscription({...a,eose:!0}),postMessage({type:"relay:message",data:t});return}else if(r===ee.COUNT){const o=(i=this.client)==null?void 0:i.getSubscriptions(),a=o==null?void 0:o.find(u=>u.id===t.data[1]);a&&this.updateSubscription({...a,result:JSON.stringify(t.data[2])});return}else if(r===ee.NOTICE){const o=(c=this.client)==null?void 0:c.getSubscriptions(),a=o==null?void 0:o.find(u=>u.id===t.data[1]);a&&this.updateSubscription({...a,result:t.data[1]}),postMessage({type:"relay:message",data:t});return}}),r===ee.EVENT){const s=t.data[2].kind;s===W.SHORT_TEXT_NOTE||s===W.LONG_FORM_CONTENT?Ee.enqueuePriority(async()=>{const i=t.data[2];if(this.eventsMap.size>=this.maxEvents)return;const c=i.id?this.eventsMap.has(i.id):!1;if(!i.pubkey)return;const o={event:new he(i),eventRelayUrls:[t.meta.url]},a=await this.getUser(i.pubkey);a&&(o.user=a.user);const u=o.event.hasMentions();if(u)for(const f of u){const b=await this.getUser(f);b?o.mentions?o.mentions.push(b.user):o.mentions=[b.user]:o.mentions?o.mentions.push(new Be({pubkey:f})):o.mentions=[new Be({pubkey:f})]}const l=o.event.hasEventTags();if(l){const f=l.find(b=>b.marker==="root");if(f){const b=f.eventId,A=this.eventsMap.get(b);if(A){A.replies?A.replies.find(w=>w.event.id===o.event.id)||A.replies.push({...o}):A.replies=[{...o}],this.updateEvent(A),console.log(`Reply event added to event ${A.event.id}`);return}n<3&&setTimeout(()=>{this.processEvent(t,n+1)},1e3);return}}c||this.addEvent(o)}):s===W.ZAP_RECEIPT?Ee.enqueueBackground(async()=>{const i=t.data[2];if(!i.pubkey)return;const c=new he(i),o=await this.getUser(c.pubkey),a=c.hasEventTags(),u=a==null?void 0:a.find(l=>l.marker==="root");if(u){const l=this.eventsMap.get(u.eventId);l&&(l.zapReceipt?l.zapReceipt.push({event:c,user:o==null?void 0:o.user}):l.zapReceipt=[{event:c,user:o==null?void 0:o.user}],this.updateEvent(l))}}):s===W.METADATA?Ee.enqueueBackground(async()=>{const i=new Be,c=t.data[2];i.fromEvent(c),await this.getUser(i.pubkey)?(await this.updateUser({user:i,relayUrls:[t.meta.url]}),await this.updateUserFollowing({user:i,relayUrls:[t.meta.url]})):(await this.addUser({user:i,relayUrls:[t.meta.url]}),await this.updateUserFollowing({user:i,relayUrls:[t.meta.url]}));for(const a of this.eventsMap.values())a.event.pubkey===i.pubkey&&(a.user=i,this.updateEvent(a))}):s===W.REACTION?Ee.enqueuePriority(async()=>{const i=new he(t.data[2]),c=i.hasEventTags();if(!c)return;const o=await this.getUser(i.pubkey),a=c.filter(u=>u.eventId).map(u=>u.eventId);for(const u of a){const l=this.eventsMap.get(u);l&&(l.reactions&&l.reactions.length?l.reactions.push({event:i,user:o==null?void 0:o.user}):l.reactions=[{event:i,user:o==null?void 0:o.user}],console.log(`Reaction event added to event ${l.event.id}`),this.updateEvent(l))}}):s===W.REPOST&&Ee.enqueueBackground(async()=>{const i=new he(t.data[2]),c=i.hasEventTags();if(!c){console.log("No response found for repost event");return}const o=await this.getUser(i.pubkey),a=c.filter(u=>u.eventId).map(u=>u.eventId);for(const u of a){const l=this.eventsMap.get(u);l&&(l.reposts?l.reposts.push({event:i,user:o==null?void 0:o.user}):l.reposts=[{event:i,user:o==null?void 0:o.user}],console.log(`Repost event added to event ${l.event.id}`),this.updateEvent(l))}})}}getEventById(t){return this.eventsMap.get(t)}async sendEvent(t){if(!this.client)throw new Error("Client not initialized");const n=this.client.sendEvent(t);if(n){t.event.kind,W.SHORT_TEXT_NOTE,W.LONG_FORM_CONTENT,W.RECOMMEND_RELAY,this.addQueueItems(n);for(const r of n)this.updateQueueItem({...r});return n}else throw new Error("Failed to send event")}sendQueueItems(t){if(!this.client)throw new Error("Client not initialized");this.addQueueItems(t);const n=this.client.sendQueueItems(t);if(n){for(const r of n)this.updateQueueItem({...r});return n}else throw new Error("Failed to send event")}clearEvents(){console.log("WORKER: CLEAR EVENTS"),Ee.clearPriority(),this.eventsMap.clear(),this.checkedEvents=[],this.checkedUsers=[]}async followUser({pubkey:t,relayUrls:n}){if(!this.db)throw new Error("DB not initialized");const r=await this.db.get("users",t),s=await this.db.get("following",t);if(r&&!s)this.db.add("following",r);else if(!r&&!s){const i=new Be({pubkey:t});await this.db.put("following",{user:i,relayUrls:n});for(const c of n)await this.requestInformation({source:"users",idsOrKeys:[t],relayUrl:c},{timeoutIn:1e4})}this.followingUserIds.push(t)}async unfollowUser(t){if(!this.db)throw new Error("DB not initialized");await this.db.delete("following",t),this.followingUserIds=this.followingUserIds.filter(n=>n!==t)}async followingUser(t){if(!this.db)throw new Error("DB not initialized");return!!await this.db.get("following",t)}async getAllUsersFollowing(){if(!this.db)throw new Error("DB not initialized");const t=await this.db.getAll("following");return this.followingUserIds=t.map(n=>n.pubkey),t}async updateUserFollowing(t){if(!this.db)throw new Error("DB not initialized");const n=await this.db.get("following",t.user.pubkey);n&&await this.db.put("following",{user:t.user,relayUrls:t.relayUrls?t.relayUrls:n.relayUrls})}async requestInformation(t,n){if(t.idsOrKeys.length===0)return;let r=[];if(t.source==="events"||t.source==="events:related"){if(r=t.idsOrKeys.filter(i=>!this.checkedEvents.includes(i)),r.length===0)return;this.checkedEvents=[...this.checkedEvents,...r]}else if(t.source==="users"){if(r=t.idsOrKeys.filter(i=>!this.checkedUsers.includes(i)),r.length===0)return;this.checkedUsers=[...this.checkedUsers,...r]}console.log(`=> Getting information for ${r.length} ${t.source}`);const s=[];for(let i=0;i{var u,l;return a.filters&&((u=a.filters["#e"])==null?void 0:u.includes(c))&&((l=a.filters.kinds)==null?void 0:l.some(f=>n.includes(f)))});o&&s.push(o.id)}else for(const c of t){const o=r.find(a=>{var u;return a.filters&&((u=a.filters["#e"])==null?void 0:u.includes(c))});o&&s.push(o.id)}return s.length>0?s:void 0}}const xi=new Ti;Tt(xi)})(); diff --git a/index.html b/index.html index a5616d3..73c9d2b 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Nostr React Client Playground - +