1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[167],{182:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="0.0.0-automated"},760:(e,t,i)=>{"use strict";i.d(t,{N:()=>y});var r=i(5155),s=i(2115),n=i(869),o=i(2885),a=i(845),l=i(1508);class h extends s.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function u(e){let{children:t,isPresent:i}=e,n=(0,s.useId)(),o=(0,s.useRef)(null),a=(0,s.useRef)({width:0,height:0,top:0,left:0}),{nonce:u}=(0,s.useContext)(l.Q);return(0,s.useInsertionEffect)(()=>{let{width:e,height:t,top:r,left:s}=a.current;if(i||!o.current||!e||!t)return;o.current.dataset.motionPopId=n;let l=document.createElement("style");return u&&(l.nonce=u),document.head.appendChild(l),l.sheet&&l.sheet.insertRule('\n [data-motion-pop-id="'.concat(n,'"] {\n position: absolute !important;\n width: ').concat(e,"px !important;\n height: ").concat(t,"px !important;\n top: ").concat(r,"px !important;\n left: ").concat(s,"px !important;\n }\n ")),()=>{document.head.removeChild(l)}},[i]),(0,r.jsx)(h,{isPresent:i,childRef:o,sizeRef:a,children:s.cloneElement(t,{ref:o})})}let c=e=>{let{children:t,initial:i,isPresent:n,onExitComplete:l,custom:h,presenceAffectsLayout:c,mode:f}=e,p=(0,o.M)(d),m=(0,s.useId)(),g=(0,s.useCallback)(e=>{for(let t of(p.set(e,!0),p.values()))if(!t)return;l&&l()},[p,l]),y=(0,s.useMemo)(()=>({id:m,initial:i,isPresent:n,custom:h,onExitComplete:g,register:e=>(p.set(e,!1),()=>p.delete(e))}),c?[Math.random(),g]:[n,g]);return(0,s.useMemo)(()=>{p.forEach((e,t)=>p.set(t,!1))},[n]),s.useEffect(()=>{n||p.size||!l||l()},[n]),"popLayout"===f&&(t=(0,r.jsx)(u,{isPresent:n,children:t})),(0,r.jsx)(a.t.Provider,{value:y,children:t})};function d(){return new Map}var f=i(2082);let p=e=>e.key||"";function m(e){let t=[];return s.Children.forEach(e,e=>{(0,s.isValidElement)(e)&&t.push(e)}),t}var g=i(7494);let y=e=>{let{children:t,custom:i,initial:a=!0,onExitComplete:l,presenceAffectsLayout:h=!0,mode:u="sync",propagate:d=!1}=e,[y,v]=(0,f.xQ)(d),w=(0,s.useMemo)(()=>m(t),[t]),b=d&&!y?[]:w.map(p),_=(0,s.useRef)(!0),T=(0,s.useRef)(w),k=(0,o.M)(()=>new Map),[x,S]=(0,s.useState)(w),[P,E]=(0,s.useState)(w);(0,g.E)(()=>{_.current=!1,T.current=w;for(let e=0;e<P.length;e++){let t=p(P[e]);b.includes(t)?k.delete(t):!0!==k.get(t)&&k.set(t,!1)}},[P,b.length,b.join("-")]);let A=[];if(w!==x){let e=[...w];for(let t=0;t<P.length;t++){let i=P[t],r=p(i);b.includes(r)||(e.splice(t,0,i),A.push(i))}"wait"===u&&A.length&&(e=A),E(m(e)),S(w);return}let{forceRender:j}=(0,s.useContext)(n.L);return(0,r.jsx)(r.Fragment,{children:P.map(e=>{let t=p(e),s=(!d||!!y)&&(w===P||b.includes(t));return(0,r.jsx)(c,{isPresent:s,initial:(!_.current||!!a)&&void 0,custom:s?void 0:i,presenceAffectsLayout:h,mode:u,onExitComplete:s?void 0:()=>{if(!k.has(t))return;k.set(t,!0);let e=!0;k.forEach(t=>{t||(e=!1)}),e&&(null==j||j(),E(T.current),d&&(null==v||v()),l&&l())},children:e},t)})})}},845:(e,t,i)=>{"use strict";i.d(t,{t:()=>r});let r=(0,i(2115).createContext)(null)},851:(e,t,i)=>{"use strict";i.d(t,{UU:()=>tj});let r=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(i.bind(i,2410)).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)};class s extends Error{constructor(e,t="FunctionsError",i){super(e),this.name=t,this.context=i}}class n extends s{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class o extends s{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class a extends s{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}!function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"}(q||(q={}));class l{constructor(e,{headers:t={},customFetch:i,region:s=q.Any}={}){this.url=e,this.headers=t,this.region=s,this.fetch=r(i)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var i,r,s,l,h;return r=this,s=void 0,l=void 0,h=function*(){try{let r,s,{headers:l,method:h,body:u}=t,c={},{region:d}=t;d||(d=this.region),d&&"any"!==d&&(c["x-region"]=d),u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)&&("undefined"!=typeof Blob&&u instanceof Blob||u instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",r=u):"str
1ing"==typeof u?(c["Content-Type"]="text/plain",r=u):"undefined"!=typeof FormData&&u instanceof FormData?r=u:(c["Content-Type"]="application/json",r=JSON.stringify(u)));let f=yield this.fetch(`${this.url}/${e}`,{method:h||"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),l),body:r}).catch(e=>{throw new n(e)}),p=f.headers.get("x-relay-error");if(p&&"true"===p)throw new o(f);if(!f.ok)throw new a(f);let m=(null!==(i=f.headers.get("Content-Type"))&&void 0!==i?i:"text/plain").split(";")[0].trim();return{data:"application/json"===m?yield f.json():"application/octet-stream"===m?yield f.blob():"text/event-stream"===m?f:"multipart/form-data"===m?yield f.formData():yield f.text(),error:null}}catch(e){return{data:null,error:e}}},new(l||(l=Promise))(function(e,t){function i(e){try{o(h.next(e))}catch(e){t(e)}}function n(e){try{o(h.throw(e))}catch(e){t(e)}}function o(t){var r;t.done?e(t.value):((r=t.value)instanceof l?r:new l(function(e){e(r)})).then(i,n)}o((h=h.apply(r,s||[])).next())})}}let{PostgrestClient:h,PostgrestQueryBuilder:u,PostgrestFilterBuilder:c,PostgrestTransformBuilder:d,PostgrestBuilder:f,PostgrestError:p}=i(5646),m={"X-Client-Info":"realtime-js/2.11.2"};!function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"}(z||(z={})),function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"}(W||(W={})),function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"}(K||(K={})),(H||(H={})).websocket="websocket",function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"}(J||(J={}));class g{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):"string"==typeof e?t(JSON.parse(e)):t({})}_binaryDecode(e){let t=new DataView(e),i=new TextDecoder;return this._decodeBroadcast(e,t,i)}_decodeBroadcast(e,t,i){let r=t.getUint8(1),s=t.getUint8(2),n=this.HEADER_LENGTH+2,o=i.decode(e.slice(n,n+r));n+=r;let a=i.decode(e.slice(n,n+s));return n+=s,{ref:null,topic:o,event:a,payload:JSON.parse(i.decode(e.slice(n,e.byteLength)))}}}class y{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}!function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"}(G||(G={}));let v=(e,t,i={})=>{var r;let s=null!==(r=i.skipTypes)&&void 0!==r?r:[];return Object.keys(t).reduce((i,r)=>(i[r]=w(r,e,t,s),i),{})},w=(e,t,i,r)=>{let s=t.find(t=>t.name===e),n=null==s?void 0:s.type,o=i[e];return n&&!r.includes(n)?b(n,o):_(o)},b=(e,t)=>{if("_"===e.charAt(0))return S(t,e.slice(1,e.length));switch(e){case G.bool:return T(t);case G.float4:case G.float8:case G.int2:case G.int4:case G.int8:case G.numeric:case G.oid:return k(t);case G.json:case G.jsonb:return x(t);case G.timestamp:return P(t);case G.abstime:case G.date:case G.daterange:case G.int4range:case G.int8range:case G.money:case G.reltime:case G.text:case G.time:case G.timestamptz:case G.timetz:case G.tsrange:case G.tstzrange:default:return _(t)}},_=e=>e,T=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},k=e=>{if("string"==typeof e){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},x=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.log(`JSON parse error: ${e}`)}return e},S=(e,t)=>{if("string"!=typeof e)return e;let i=e.length-1,r=e[i];if("{"===e[0]&&"}"===r){let r,s=e.slice(1,i);try{r=JSON.parse("["+s+"]")}catch(e){r=s?s.split(","):[]}return r.map(e=>b(t,e))}return e},P=e=>"string"==typeof e?e.replace(" ","T"):e,E=e=>{let t=e;return(t=(t=t.replace(/^ws/i,"http")).replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,"")).replace(/\/+$/,"")};class A{constructor(e,t,i={},r=1e4){this.channel=e,this.event=t,this.payload=i,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHo
1oks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var i;return this._hasReceived(e)&&t(null===(i=this.receivedResp)||void 0===i?void 0:i.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){!this.timeoutTimer&&(this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref),this.channel._on(this.refEvent,{},e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout))}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}!function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"}(Y||(Y={}));class j{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let i=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(i.state,{},e=>{let{onJoin:t,onLeave:i,onSync:r}=this.caller;this.joinRef=this.channel._joinRef(),this.state=j.syncState(this.state,e,t,i),this.pendingDiffs.forEach(e=>{this.state=j.syncDiff(this.state,e,t,i)}),this.pendingDiffs=[],r()}),this.channel._on(i.diff,{},e=>{let{onJoin:t,onLeave:i,onSync:r}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=j.syncDiff(this.state,e,t,i),r())}),this.onJoin((e,t,i)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:i})}),this.onLeave((e,t,i)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:i})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,i,r){let s=this.cloneDeep(e),n=this.transformState(t),o={},a={};return this.map(s,(e,t)=>{n[e]||(a[e]=t)}),this.map(n,(e,t)=>{let i=s[e];if(i){let r=t.map(e=>e.presence_ref),s=i.map(e=>e.presence_ref),n=t.filter(e=>0>s.indexOf(e.presence_ref)),l=i.filter(e=>0>r.indexOf(e.presence_ref));n.length>0&&(o[e]=n),l.length>0&&(a[e]=l)}else o[e]=t}),this.syncDiff(s,{joins:o,leaves:a},i,r)}static syncDiff(e,t,i,r){let{joins:s,leaves:n}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return i||(i=()=>{}),r||(r=()=>{}),this.map(s,(t,r)=>{var s;let n=null!==(s=e[t])&&void 0!==s?s:[];if(e[t]=this.cloneDeep(r),n.length>0){let i=e[t].map(e=>e.presence_ref),r=n.filter(e=>0>i.indexOf(e.presence_ref));e[t].unshift(...r)}i(t,n,r)}),this.map(n,(t,i)=>{let s=e[t];if(!s)return;let n=i.map(e=>e.presence_ref);s=s.filter(e=>0>n.indexOf(e.presence_ref)),e[t]=s,r(t,s,i),0===s.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(i=>t(i,e[i]))}static transformState(e){return Object.getOwnPropertyNames(e=this.cloneDeep(e)).reduce((t,i)=>{let r=e[i];return"metas"in r?t[i]=r.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):t[i]=r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}!function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"}(X||(X={})),function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"}(Z||(Z={})),function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"}(Q||(Q={}));class C{constructor(e,t={config:{}},i){this.topic=e,this.params=t,this.socket=i,this.bindings={},this.state=W.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new A(this,K.join,this.params,this.timeout),this.rejoinTimer=new y(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=W.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e
1=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=W.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=W.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=W.errored,this.rejoinTimer.scheduleTimeout())}),this._on(K.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new j(this),this.broadcastEndpointURL=E(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(e,t=this.timeout){var i,r;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{let{config:{broadcast:s,presence:n,private:o}}=this.params;this._onError(t=>null==e?void 0:e(Q.CHANNEL_ERROR,t)),this._onClose(()=>null==e?void 0:e(Q.CLOSED));let a={},l={broadcast:s,presence:n,postgres_changes:null!==(r=null===(i=this.bindings.postgres_changes)||void 0===i?void 0:i.map(e=>e.filter))&&void 0!==r?r:[],private:o};this.socket.accessTokenValue&&(a.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:l},a)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:t})=>{var i;if(this.socket.setAuth(),void 0===t){null==e||e(Q.SUBSCRIBED);return}{let r=this.bindings.postgres_changes,s=null!==(i=null==r?void 0:r.length)&&void 0!==i?i:0,n=[];for(let i=0;i<s;i++){let s=r[i],{filter:{event:o,schema:a,table:l,filter:h}}=s,u=t&&t[i];if(u&&u.event===o&&u.schema===a&&u.table===l&&u.filter===h)n.push(Object.assign(Object.assign({},s),{id:u.id}));else{this.unsubscribe(),null==e||e(Q.CHANNEL_ERROR,Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=n,e&&e(Q.SUBSCRIBED);return}}).receive("error",t=>{null==e||e(Q.CHANNEL_ERROR,Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{null==e||e(Q.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,i){return this._on(e,t,i)}async send(e,t={}){var i,r;if(this._canPush()||"broadcast"!==e.type)return new Promise(i=>{var r,s,n;let o=this._push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(n=null===(s=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===s?void 0:s.broadcast)||void 0===n?void 0:n.ack)||i("ok"),o.receive("ok",()=>i("ok")),o.receive("error",()=>i("error")),o.receive("timeout",()=>i("timed out"))});{let{event:s,payload:n}=e,o={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:n,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!==(i=t.timeout)&&void 0!==i?i:this.timeout);return await (null===(r=e.body)||void 0===r?void 0:r.cancel()),e.ok?"ok":"error"}catch(e){if("AbortError"===e.name)return"timed out";return"error"}}}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=W.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(K.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(i=>{let r=new A(this,K.leave,{},e);r.receive("ok",()=>{t(),i("ok")}).receive("timeout",()=>{t(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})})}async _fetchWithTimeout(e,t,i){let r=new AbortController,s=setTimeout(()=>r.abort(),i),n=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(s),n}_push(e,t,i=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new A(this,e,t,i);return this._canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}_onMessage(e,t,i){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,i){var r,s;let n=e.toLocaleLowerCase(),{close:o,error:a,leave:l,join:h}=K;if(i&&[o,a,l,h].indexOf(n)>=0&&i!==this._joinRef())return;let u=this._onMessage(n,t,i);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(n)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter(e=>{var t,i,r;return(null===(t=e.filter)||void 0===t?void 0:t.event)==="*"||(null===(r=null===(i=e.filter)||void 0===i?void 0:i.event)||void 0===r?void 0:r.toLocaleLowerCase())===n}).map(e=>e.callback(u,i)):null===(s=this.bindings[n])||void 0===s||s.filter(e=>{var i,r,s,o,a,l;if(!["broadcast","presence","postgres_changes"].includes(n))return e.type.toLocaleLowerCase()===n;if("id"in e){let n=e.id,o=null===(i=e.filter)||void 0===i?void 0:i.event;return n&&(null===(r=t.ids)||void 0===r?void 0:r.includes(n))&&("*"===o||(null==o?void 0:o.toLocaleLowerCase())===(null===(s=t.data)||void 0===s?void 0:s.type.toLocaleLowerCase()))}{let i=null===(a=null===(o=null==e?void 0:e.filter)||void 0===o?void 0:o.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===i||i===(null===(l=null==t?void 0:t.event)||void 0===l?void 0:l.toLocaleLowerCase())}}).map(e=>{if("object"==typeof u&&"ids"in u){let e=u.data,{schema:t,table:i,commit_timestamp:r,type:s,errors:n}=e;u=Object.assign(Object.assign({},{schema:t,table:i,commit_timestamp:r,eventType:s,new:{},old:{},errors:n}),this._getPayloadRecords(e))}e.callback(u,i)})}_isClosed(){return this.state===W.closed}_isJoined(){return this.state===W.joined}_isJoining(){return this.state===W.joining}_isLeaving(){return this.state===W.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,i){let r=e.toLocaleLowerCase(),s={type:r,filter:t,callback:i};return this.bindings[r]?this.bindings[r].push(s):this.bindings[r]=[s],this}_off(e,t){let i=e.toLocaleLowerCase();return this.bindings[i]=this.bindings[i].filter(e=>{var r;return!((null===(r=e.type)||void 0===r?void 0:r.toLocaleLowerCase())===i&&C.isEqual(e.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(e[i]!==t[i])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(K.close,{},e)}_onError(e){this._on(K.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=W.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=v(e.columns,e.record)),("UPDATE"===e.type||"DELET
1E"===e.type)&&(t.old=v(e.columns,e.old_record)),t}}let R=()=>{},O="undefined"!=typeof WebSocket,L=` 2 addEventListener("message", (e) => { 3 if (e.data.event === "start") { 4 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 5 } 6 });`;class M{constructor(e,t){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=m,this.params={},this.timeout=1e4,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=R,this.conn=null,this.sendBuffer=[],this.serializer=new g,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(i.bind(i,2410)).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)},this.endPoint=`${e}/${H.websocket}`,this.httpEndpoint=E(e),(null==t?void 0:t.transport)?this.transport=t.transport:this.transport=null,(null==t?void 0:t.params)&&(this.params=t.params),(null==t?void 0:t.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),(null==t?void 0:t.timeout)&&(this.timeout=t.timeout),(null==t?void 0:t.logger)&&(this.logger=t.logger),(null==t?void 0:t.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);let s=null===(r=null==t?void 0:t.params)||void 0===r?void 0:r.apikey;if(s&&(this.accessTokenValue=s,this.apiKey=s),this.reconnectAfterMs=(null==t?void 0:t.reconnectAfterMs)?t.reconnectAfterMs:e=>[1e3,2e3,5e3,1e4][e-1]||1e4,this.encode=(null==t?void 0:t.encode)?t.encode:(e,t)=>t(JSON.stringify(e)),this.decode=(null==t?void 0:t.decode)?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new y(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(null==t?void 0:t.fetch),null==t?void 0:t.worker){if("undefined"!=typeof window&&!window.Worker)throw Error("Web Worker is not supported");this.worker=(null==t?void 0:t.worker)||!1,this.workerUrl=null==t?void 0:t.workerUrl}this.accessToken=(null==t?void 0:t.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(O){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new $(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),i.e(294).then(i.t.bind(i,294,23)).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:"1.0.0"}))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t}async removeAllChannels(){let e=await Promise.all(this.channels.map(e=>e.unsubscribe()));return this.disconnect(),e}log(e,t,i){this.logger(e,t,i)}connectionState(){switch(this.conn&&this.conn.readyState){case z.connecting:return J.Connecting;case z.open:return J.Open;case z.closing:return J.Closing;default:return J.Closed}}isConnected(){return this.connectionState()===J.Open}channel(e,t={config:{}}){let i=new C(`realtime:${e}`,t,this);return this.channels.push(i),i}push(e){let{topic:t,event:i,payload:r,ref:s}=e,n=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};this.log("push",`${t} ${i} (${s})`,r),this.isConnected()?n():this.sendBuffer.push(n)}async setAuth(e=null){let t=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(t){let e=null;try{e=JSON.parse(atob(t.split(".")[1]))}catch(e){}if(e&&e.exp&&!(Math.floor(Date.now()/1e3)-e.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${e.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${e.exp}`);
6this.accessTokenValue=t,this.channels.forEach(e=>{t&&e.updateJoinPayload({access_token:t}),e.joinedOnce&&e._isJoined()&&e._push(K.access_token,{access_token:t})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),null===(e=this.conn)||void 0===e||e.close(1e3,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:i,payload:r,ref:s}=e;s&&s===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${r.status||""} ${t} ${i} ${s&&"("+s+")"||""}`,r),this.channels.filter(e=>e._isMember(t)).forEach(e=>e._trigger(i,r,s)),this.stateChangeCallbacks.message.forEach(t=>t(e))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),this.worker){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this.workerRef.terminate()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}else this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(K.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;let i=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${i}${r}`}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([L],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}}class ${constructor(e,t,i){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=z.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=i.close}}class I extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function D(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class U extends I{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class B extends I{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}let V=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(i.bind(i,2410)).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)},F=()=>(function(e,t,i,r){return new(i||(i=Promise))(function(s,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})})(void 0,void 0,void 0,function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(i.bind(i,2410))).Response:Response}),N=e=>{if(Array.isArray(e))return e.map(e=>N(e));if("function"==typeof e||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,i])=>{t[e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""))]=N(i)}),t};var q,z,W,K,H,J,G,Y,X,Z,Q,ee=function(e,t,i,r){return new(i||(i=Prom
6ise))(function(s,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};let et=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ei=(e,t,i)=>ee(void 0,void 0,void 0,function*(){e instanceof(yield F())&&!(null==i?void 0:i.noResolveJson)?e.json().then(i=>{t(new U(et(i),e.status||500))}).catch(e=>{t(new B(et(e),e))}):t(new B(et(e),e))}),er=(e,t,i,r)=>{let s={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?s:(s.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),r&&(s.body=JSON.stringify(r)),Object.assign(Object.assign({},s),i))};function es(e,t,i,r,s,n){return ee(this,void 0,void 0,function*(){return new Promise((o,a)=>{e(i,er(t,r,s,n)).then(e=>{if(!e.ok)throw e;return(null==r?void 0:r.noResolveJson)?e:e.json()}).then(e=>o(e)).catch(e=>ei(e,a,r))})})}function en(e,t,i,r){return ee(this,void 0,void 0,function*(){return es(e,"GET",t,i,r)})}function eo(e,t,i,r,s){return ee(this,void 0,void 0,function*(){return es(e,"POST",t,r,s,i)})}function ea(e,t,i,r,s){return ee(this,void 0,void 0,function*(){return es(e,"DELETE",t,r,s,i)})}var el=i(4134).hp,eh=function(e,t,i,r){return new(i||(i=Promise))(function(s,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};let eu={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ec={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class ed{constructor(e,t={},i,r){this.url=e,this.headers=t,this.bucketId=i,this.fetch=V(r)}uploadOrUpdate(e,t,i,r){return eh(this,void 0,void 0,function*(){try{let s,n=Object.assign(Object.assign({},ec),r),o=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(n.upsert)}),a=n.metadata;"undefined"!=typeof Blob&&i instanceof Blob?((s=new FormData).append("cacheControl",n.cacheControl),a&&s.append("metadata",this.encodeMetadata(a)),s.append("",i)):"undefined"!=typeof FormData&&i instanceof FormData?((s=i).append("cacheControl",n.cacheControl),a&&s.append("metadata",this.encodeMetadata(a))):(s=i,o["cache-control"]=`max-age=${n.cacheControl}`,o["content-type"]=n.contentType,a&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(a)))),(null==r?void 0:r.headers)&&(o=Object.assign(Object.assign({},o),r.headers));let l=this._removeEmptyFolders(t),h=this._getFinalPath(l),u=yield this.fetch(`${this.url}/object/${h}`,Object.assign({method:e,body:s,headers:o},(null==n?void 0:n.duplex)?{duplex:n.duplex}:{})),c=yield u.json();if(u.ok)return{data:{path:l,id:c.Id,fullPath:c.Key},error:null};return{data:null,error:c}}catch(e){if(D(e))return{data:null,error:e};throw e}})}upload(e,t,i){return eh(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,i)})}uploadToSignedUrl(e,t,i,r){return eh(this,void 0,void 0,function*(){let s=this._removeEmptyFolders(e),n=this._getFinalPath(s),o=new URL(this.url+`/object/upload/sign/${n}`);o.searchParams.set("token",t);try{let e,t=Object.assign({upsert:ec.upsert},r),n=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&i instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),e.append("",i)):"undefined"!=typeof FormData&&i instanceof FormData?(e=i).append("cacheControl",t.cacheControl):(e=i,n["cache-control"]=`max-age=${t.cacheControl}`,n["content-type"]=t.contentType);let a=yield this.fetch(o.toString(),{method:"PUT",body:e,headers:n}),l=yield a.json();if(a.ok)return{data:{path:s,fullPath:l.Key},error:null};return{data:null,error:l}}catch(e){if(D(e))return{data:null,error:e};throw e}})}createSignedUploadUrl(e,t){return eh(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),r=Object.assign({},this.headers);(null==t?void 0:t.upsert)&&(r["x-upsert"]="true");let s=yield eo(this.fetch,`${this.url}/object/upload/sign/${i}`,{},{headers:r}),n=new URL(this.url+s.url),o=n.searchParams.get("token");if(!o)throw new I("No token returned by API");return{data:{signedUrl:n.toString(),path:e,token:o},error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}update(e,t,i){return eh(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,i)})}move(e,t,i){return eh(this,void 0,void 0,function*(){try{return{data:yield eo(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,de
6stinationBucket:null==i?void 0:i.destinationBucket},{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}copy(e,t,i){return eh(this,void 0,void 0,function*(){try{return{data:{path:(yield eo(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==i?void 0:i.destinationBucket},{headers:this.headers})).Key},error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}createSignedUrl(e,t,i){return eh(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),s=yield eo(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},(null==i?void 0:i.transform)?{transform:i.transform}:{}),{headers:this.headers}),n=(null==i?void 0:i.download)?`&download=${!0===i.download?"":i.download}`:"";return{data:s={signedUrl:encodeURI(`${this.url}${s.signedURL}${n}`)},error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}createSignedUrls(e,t,i){return eh(this,void 0,void 0,function*(){try{let r=yield eo(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),s=(null==i?void 0:i.download)?`&download=${!0===i.download?"":i.download}`:"";return{data:r.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${s}`):null})),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}download(e,t){return eh(this,void 0,void 0,function*(){let i=void 0!==(null==t?void 0:t.transform),r=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),s=r?`?${r}`:"";try{let t=this._getFinalPath(e),r=yield en(this.fetch,`${this.url}/${i?"render/image/authenticated":"object"}/${t}${s}`,{headers:this.headers,noResolveJson:!0});return{data:yield r.blob(),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}info(e){return eh(this,void 0,void 0,function*(){let t=this._getFinalPath(e);try{let e=yield en(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:N(e),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}exists(e){return eh(this,void 0,void 0,function*(){let t=this._getFinalPath(e);try{return yield function(e,t,i,r){return ee(this,void 0,void 0,function*(){return es(e,"HEAD",t,Object.assign(Object.assign({},i),{noResolveJson:!0}),void 0)})}(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(D(e)&&e instanceof B){let t=e.originalError;if([400,404].includes(null==t?void 0:t.status))return{data:!1,error:e}}throw e}})}getPublicUrl(e,t){let i=this._getFinalPath(e),r=[],s=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==s&&r.push(s);let n=void 0!==(null==t?void 0:t.transform),o=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==o&&r.push(o);let a=r.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${n?"render/image":"object"}/public/${i}${a}`)}}}remove(e){return eh(this,void 0,void 0,function*(){try{return{data:yield ea(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}list(e,t,i){return eh(this,void 0,void 0,function*(){try{let r=Object.assign(Object.assign(Object.assign({},eu),t),{prefix:e||""});return{data:yield eo(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},i),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return void 0!==el?el.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}let ef={"X-Client-Info":"storage-js/2.7.1"};var ep=function(e,t,i,r){return new(i||(i=Promise))(function(s,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};class em{constructor(e,t={},i){this.url=e,this.headers=Object.assign(Object.assign({},ef),t),this.fetch=V(i)}listBuckets(){return ep(this,void 0,void 0,function*(){try{return{data:yield en(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}getBucket(e){return ep(this,void 0,void 0,function*(){try{return{data:yield en(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}createBucket(e,t={public:!1}){return ep(this,void 0,void 0,function*(){try{return{data:yield eo(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}updateBucket(e,t){return ep(this,void 0,void 0,function*(){try{return{data:yield function(e,t,i,r,s){return ee(this,void 0,void 0,function*(){return es(e,"PUT",t,r,void 0,i)})}(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}emptyBucket(e){return ep(this,void 0,void 0,function*(){try{return{data:yield eo(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}deleteBucket(e){return ep(this,void 0,void 0,function*(){try{return{data:yield ea(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(e){if(D(e))return{data:null,error:e};throw e}})}}class eg extends em{constructor(e,t={},i){super(e,t,i)}from(e){return new ed(this.url,this.headers,e,this.fetch)}}let ey="";ey="undefined"!=typeof Deno?"deno":"undefined"!=typeof document?"web":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";let ev={headers:{"X-Client-Info":`supabase-js-${ey}/2.49.4`}},ew={schema:"public"},eb={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},e_={};var eT=i(2410);let ek=e=>{let t;return t=e||("undefined"==typeof fetch?eT.default:fetch),(...e)=>t(...e)},ex=()=>"undefined"==typeof Headers?eT.Headers:Headers,eS=(e,t,i)=>{let r=ek(i),s=ex();return(i,n)=>
6(function(e,t,i,r){return new(i||(i=Promise))(function(s,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})})(void 0,void 0,void 0,function*(){var o;let a=null!==(o=yield t())&&void 0!==o?o:e,l=new s(null==n?void 0:n.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${a}`),r(i,Object.assign(Object.assign({},n),{headers:l}))})},eP="2.69.1",eE={"X-Client-Info":`gotrue-js/${eP}`},eA="X-Supabase-Api-Version",ej={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},eC=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class eR extends Error{constructor(e,t,i){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=i}}function eO(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class eL extends eR{constructor(e,t,i){super(e,t,i),this.name="AuthApiError",this.status=t,this.code=i}}class eM extends eR{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class e$ extends eR{constructor(e,t,i,r){super(e,i,r),this.name=t,this.status=i}}class eI extends e${constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}class eD extends e${constructor(){super("Auth session or user missing","AuthInvalidToken
6ResponseError",500,void 0)}}class eU extends e${constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class eB extends e${constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class eV extends e${constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class eF extends e${constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function eN(e){return eO(e)&&"AuthRetryableFetchError"===e.name}class eq extends e${constructor(e,t,i){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=i}}class ez extends e${constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}let eW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),eK=" \n\r=".split(""),eH=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<eK.length;t+=1)e[eK[t].charCodeAt(0)]=-2;for(let t=0;t<eW.length;t+=1)e[eW[t].charCodeAt(0)]=t;return e})();function eJ(e,t,i){let r=eH[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)i(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(-2===r)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function eG(e){let t=[],i=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},n=e=>{!function(e,t,i){if(0===t.utf8seq){if(e<=127){i(e);return}for(let i=1;i<6;i+=1)if((e>>7-i&1)==0){t.utf8seq=i;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&i(t.codepoint)}}(e,r,i)};for(let t=0;t<e.length;t+=1)eJ(e.charCodeAt(t),s,n);return t.join("")}let eY=()=>"undefined"!=typeof window&&"undefined"!=typeof document,eX={tested:!1,writable:!1},eZ=()=>{if(!eY())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(eX.tested)return eX.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),eX.tested=!0,eX.writable=!0}catch(e){eX.tested=!0,eX.writable=!1}return eX.writable},eQ=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(i.bind(i,2410)).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)},e0=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,e1=async(e,t,i)=>{await e.setItem(t,JSON.stringify(i))},e2=async(e,t)=>{let i=await e.getItem(t);if(!i)return null;try{return JSON.parse(i)}catch(e){return i}},e5=async(e,t)=>{await e.removeItem(t)};class e8{constructor(){this.promise=new e8.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function e6(e){let t=e.split(".");if(3!==t.length)throw new ez("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!eC.test(t[e]))throw new ez("JWT not in base64url format");return{header:JSON.parse(eG(t[0])),payload:JSON.parse(eG(t[1])),signature:function(e){let t=[],i={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)eJ(e.charCodeAt(t),i,r);return new Uint8Array(t)}(t[2]),raw:{header:t[0],payload:t[1]}}}async function e3(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function e4(e){return("0"+e.toString(16)).substr(-2)}async function e9(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>String.fromCharCode(e)).join("")}async function e7(e){return"undefined"==typeof crypto||void 0===crypto.subtle||"undefined"==typeof TextEncoder?(console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e):btoa(await e9(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function te(e,t,i=!1){let r=function(){let e=new Uint32Array(56);if("undefined"==typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,i="";for(let r=0;r<56;r++)i+=e.charAt(Math.floor(Math.random()*t));return i}return crypto.getRandomValues(e),Array.from(e,e4).join("")}(),s=r;i&&(s+="/PASSWORD_RECOVERY"),await e1(e,`${t}-code-verifier`,s);let n=await e7(r),o=r===n?"plain":"s256";return[n,o]}e8.promiseConstructor=Promise;let tt=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;var ti=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)0>t.indexOf(r[s])&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(i[r[s]]=e[r[s]]);return i};let tr=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ts=[502,503,504];async function tn(e){var t;let i,r;if(!e0(e))throw new eF(tr(e),0);if(ts.includes(e.status))throw new eF(tr(e),e.status);try{i=await e.json()}catch(e){throw new eM(tr(e),e)}let s=function(e){let t=e.headers.get(eA);if(!t||!t.match(tt))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}(e);if(s&&s.getTime()>=ej["2024-01-01"].timestamp&&"object"==typeof i&&i&&"string"==typeof i.code?r=i.code:"object"==typeof i&&i&&"string"==typeof i.error_code&&(r=i.error_code),r){if("weak_password"===r)throw new eq(tr(i),e.status,(null===(t=i.weak_password)||void 0===t?void 0:t.reasons)||[]);else if("session_not_found"===r)throw new eI}else if("object"==typeof i&&i&&"object"==typeof i.weak_password&&i.weak_password&&Array.isArray(i.weak_password.reasons)&&i.weak_password.reasons.length&&i.weak_password.reasons.reduce((e,t)=>
6e&&"string"==typeof t,!0))throw new eq(tr(i),e.status,i.weak_password.reasons);throw new eL(tr(i),e.status||500,r)}let to=(e,t,i,r)=>{let s={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),i))};async function ta(e,t,i,r){var s;let n=Object.assign({},null==r?void 0:r.headers);n[eA]||(n[eA]=ej["2024-01-01"].name),(null==r?void 0:r.jwt)&&(n.Authorization=`Bearer ${r.jwt}`);let o=null!==(s=null==r?void 0:r.query)&&void 0!==s?s:{};(null==r?void 0:r.redirectTo)&&(o.redirect_to=r.redirectTo);let a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await tl(e,t,i+a,{headers:n,noResolveJson:null==r?void 0:r.noResolveJson},{},null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function tl(e,t,i,r,s,n){let o,a=to(t,r,s,n);try{o=await e(i,Object.assign({},a))}catch(e){throw console.error(e),new eF(tr(e),0)}if(o.ok||await tn(o),null==r?void 0:r.noResolveJson)return o;try{return await o.json()}catch(e){await tn(e)}}function th(e){var t,i,r;let s=null;if((r=e).access_token&&r.refresh_token&&r.expires_in&&(s=Object.assign({},e),!e.expires_at))s.expires_at=(i=e.expires_in,Math.round(Date.now()/1e3)+i);return{data:{session:s,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function tu(e){let t=th(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function tc(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function td(e){return{data:e,error:null}}function tf(e){let{action_link:t,email_otp:i,hashed_token:r,redirect_to:s,verification_type:n}=e;return{data:{properties:{action_link:t,email_otp:i,hashed_token:r,redirect_to:s,verification_type:n},user:Object.assign({},ti(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function tp(e){return e}var tm=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)0>t.indexOf(r[s])&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(i[r[s]]=e[r[s]]);return i};class tg{constructor({url:e="",headers:t={},fetch:i}){this.url=e,this.headers=t,this.fetch=eQ(i),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t="global"){try{return await ta(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(eO(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await ta(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:tc})}catch(e){if(eO(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,i=tm(e,["options"]),r=Object.assign(Object.assign({},i),t);return"newEmail"in i&&(r.new_email=null==i?void 0:i.newEmail,delete r.newEmail),await ta(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:tf,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(eO(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await ta(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:tc})}catch(e){if(eO(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,i,r,s,n,o,a;try{let l={nextPage:null,lastPage:0,total:0},h=await ta(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(i=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==i?i:"",per_page:null!==(s=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==s?s:""},xform:tp});if(h.error)throw h.error;let u=await h.json(),c=null!==(n=h.headers.get("x-total-count"))&&void 0!==n?n:0,d=null!==(a=null===(o=h.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return d.length>
60&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),i=JSON.parse(e.split(";")[1].split("=")[1]);l[`${i}Page`]=t}),l.total=parseInt(c)),{data:Object.assign(Object.assign({},u),l),error:null}}catch(e){if(eO(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){try{return await ta(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:tc})}catch(e){if(eO(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){try{return await ta(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:tc})}catch(e){if(eO(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){try{return await ta(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:tc})}catch(e){if(eO(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){try{let{data:t,error:i}=await ta(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:i}}catch(e){if(eO(e))return{data:null,error:e};throw e}}async _deleteFactor(e){try{return{data:await ta(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(eO(e))return{data:null,error:e};throw e}}}let ty={getItem:e=>eZ()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{eZ()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{eZ()&&globalThis.localStorage.removeItem(e)}};function tv(e={}){return{getItem:t=>e[t]||null,setItem:(t,i)=>{e[t]=i},removeItem:t=>{delete e[t]}}}let tw={debug:!!(globalThis&&eZ()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"))};class tb extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class t_ extends tb{}async function tT(e,t,i){tw.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),tw.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async r=>{if(r){tw.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,r.name);try{return await i()}finally{tw.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,r.name)}}else if(0===t)throw tw.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new t_(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);else{if(tw.debug)try{let e=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(e){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",e)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await i()}}))}if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}let tk={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:eE,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function tx(e,t,i){return await i()}class tS{constructor(e){var t,i;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=tS.nextInstanceID,tS.nextInstanceID+=1,this.instanceID>0&&eY()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let r=Object.assign(Object.assign({},tk),e);if(this.logDebugMessages=!!r.debug,"function"==typeof r.debug&&(this.logger=r.debug),this.persistSession=r.persistSession,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.admin=new tg({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=eQ(r.fetch),this.lock=r.lock||tx,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,r.lock?this.lock=r.lock:eY()&&(null===(t=null==globalThis?void 0:globalThis.navigator)||void 0===t?void 0:t.locks)?this.lock=tT:this.lock=tx,this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?r.storage?this.storage=r.storage:eZ()?this.storage=ty:(this.memoryStorage={},this.storage=tv(this.memoryStorage)):(this.memoryStorage={},this.storage=tv(this.memoryStorage)),eY()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null===(i=this.broadcastChannel)||void 0===i||i.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e),await this._notifyAllSubscribers(e.data.event,e.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${eP}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){var e;try{let t=function(e){let t={},i=new URL(e);if(i.hash&&"#"===i.hash[0])try{new URLSearchParams(i.hash.substring(1)).forEac
6h((e,i)=>{t[i]=e})}catch(e){}return i.searchParams.forEach((e,i)=>{t[i]=e}),t}(window.location.href),i="none";if(this._isImplicitGrantCallback(t)?i="implicit":await this._isPKCECallback(t)&&(i="pkce"),eY()&&this.detectSessionInUrl&&"none"!==i){let{data:r,error:s}=await this._getSessionFromURL(t,i);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),eO(s)&&"AuthImplicitGrantRedirectError"===s.name){let t=null===(e=s.details)||void 0===e?void 0:e.code;if("identity_already_exists"===t||"identity_not_found"===t||"single_identity_not_deletable"===t)return{error:s}}return await this._removeSession(),{error:s}}let{session:n,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",n,"redirect type",o),await this._saveSession(n),setTimeout(async()=>{"recovery"===o?await this._notifyAllSubscribers("PASSWORD_RECOVERY",n):await this._notifyAllSubscribers("SIGNED_IN",n)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if(eO(e))return{error:e};return{error:new eM("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,i,r;try{let{data:s,error:n}=await ta(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!==(i=null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.data)&&void 0!==i?i:{},gotrue_meta_security:{captcha_token:null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken}},xform:th});if(n||!s)return{data:{user:null,session:null},error:n};let o=s.session,a=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",o)),{data:{user:a,session:o},error:null}}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async signUp(e){var t,i,r;try{let s;if("email"in e){let{email:i,password:r,options:n}=e,o=null,a=null;"pkce"===this.flowType&&([o,a]=await te(this.storage,this.storageKey)),s=await ta(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==n?void 0:n.emailRedirectTo,body:{email:i,password:r,data:null!==(t=null==n?void 0:n.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},code_challenge:o,code_challenge_method:a},xform:th})}else if("phone"in e){let{phone:t,password:n,options:o}=e;s=await ta(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:n,data:null!==(i=null==o?void 0:o.data)&&void 0!==i?i:{},channel:null!==(r=null==o?void 0:o.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:th})}else throw new eU("You must provide either an email or phone number and a password");let{data:n,error:o}=s;if(o||!n)return{data:{user:null,session:null},error:o};let a=n.session,l=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:l,session:a},error:null}}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:i,password:r,options:s}=e;t=await ta(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:tu})}else if("phone"in e){let{phone:i,password:r,options:s}=e;t=await ta(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:tu})}else throw new eU("You must provide either an email or phone number and a password");let{data:i,error:r}=t;if(r)return{data:{user:null,session:null},error:r};if(!i||!i.session||!i.user)return{data:{user:null,session:null},error:new eD};return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign({user:i.user,session:i.session},i.weak_password?{weakPassword:i.weak_password}:null),error:r}}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOAuth(e){var t,i,r,s;return await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(i=e.options)||void 0===i?void 0:i.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(s=e.options)||void 0===s?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let t=await e2(this.storage,`${this.storageKey}-code-verifier`),[i,r]=(null!=t?t:"").split("/");try{let{data:t,error:s}=await ta(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:i},xform:th});if(await e5(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!t||!t.session||!t.user)return{data:{user:null,session:null,redirectType:null},error:new eD};return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),{data:Object.assign(Object.assign({},t),{redirectType:null!=r?r:null}),error:s}}catch(e){if(eO(e))return{data:{user:null,session:null,redirectType:null},error:e};throw e}}async signInWithIdToken(e){try{let{options:t,provider:i,token:r,access_token:s,nonce:n}=e,{data:o,error:a}=await ta(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:i,id_token:r,access_token:s,nonce:n,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:th});if(a)return{data:{user:null,session:null},error:a};if(!o||!o.session||!o.user)return{data:{user:null,session:null},error:new eD};return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:o,error:a}}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOtp(e){var t,i,r,s,n;try{if("email"in e){let{email:r,options:s}=e,n=null,o=null;"pkce"===this.flowType&&([n,o]=await te(this.storage,this.storageKey));let{error:a}=await ta(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:{}
6,create_user:null===(i=null==s?void 0:s.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:n,code_challenge_method:o},redirectTo:null==s?void 0:s.emailRedirectTo});return{data:{user:null,session:null},error:a}}if("phone"in e){let{phone:t,options:i}=e,{data:o,error:a}=await ta(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(r=null==i?void 0:i.data)&&void 0!==r?r:{},create_user:null===(s=null==i?void 0:i.shouldCreateUser)||void 0===s||s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},channel:null!==(n=null==i?void 0:i.channel)&&void 0!==n?n:"sms"}});return{data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a}}throw new eU("You must provide either an email or phone number.")}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async verifyOtp(e){var t,i;try{let r,s;"options"in e&&(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo,s=null===(i=e.options)||void 0===i?void 0:i.captchaToken);let{data:n,error:o}=await ta(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:r,xform:th});if(o)throw o;if(!n)throw Error("An error occurred on token verification.");let a=n.session,l=n.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",a)),{data:{user:l,session:a},error:null}}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithSSO(e){var t,i,r;try{let s=null,n=null;return"pkce"===this.flowType&&([s,n]=await te(this.storage,this.storageKey)),await ta(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(i=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==i?i:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:n}),headers:this.headers,xform:td})}catch(e){if(eO(e))return{data:null,error:e};throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:i}=e;if(i)throw i;if(!t)throw new eI;let{error:r}=await ta(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}})}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:i,type:r,options:s}=e,{error:n}=await ta(this.fetch,"POST",t,{headers:this.headers,body:{email:i,type:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},redirectTo:null==s?void 0:s.emailRedirectTo});return{data:{user:null,session:null},error:n}}if("phone"in e){let{phone:i,type:r,options:s}=e,{data:n,error:o}=await ta(this.fetch,"POST",t,{headers:this.headers,body:{phone:i,type:r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}}});return{data:{user:null,session:null,messageId:null==n?void 0:n.message_id},error:o}}throw new eU("You must provide either an email or phone number and a type")}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await i}catch(e){}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let e=null,t=await e2(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not val
6id"),await this._removeSession())),!e)return{data:{session:null},error:null};let i=!!e.expires_at&&1e3*e.expires_at-Date.now()<9e4;if(this._debug("#__loadSession()",`session has${i?"":" not"} expired`,"expires_at",e.expires_at),!i){if(this.storage.isServer){let t=this.suppressGetSessionWarning;e=new Proxy(e,{get:(e,i,r)=>(t||"user"!==i||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t=!0,this.suppressGetSessionWarning=!0),Reflect.get(e,i,r))})}return{data:{session:e},error:null}}let{session:r,error:s}=await this._callRefreshToken(e.refresh_token);if(s)return{data:{session:null},error:s};return{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{if(e)return await ta(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:tc});return await this._useSession(async e=>{var t,i,r;let{data:s,error:n}=e;if(n)throw n;return(null===(t=s.session)||void 0===t?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await ta(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(r=null===(i=s.session)||void 0===i?void 0:i.access_token)&&void 0!==r?r:void 0,xform:tc}):{data:{user:null},error:new eI}})}catch(e){if(eO(e))return eO(e)&&"AuthSessionMissingError"===e.name&&(await this._removeSession(),await e5(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:e};throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async i=>{let{data:r,error:s}=i;if(s)throw s;if(!r.session)throw new eI;let n=r.session,o=null,a=null;"pkce"===this.flowType&&null!=e.email&&([o,a]=await te(this.storage,this.storageKey));let{data:l,error:h}=await ta(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:n.access_token,xform:tc});if(h)throw h;return n.user=l.user,await this._saveSession(n),await this._notifyAllSubscribers("USER_UPDATED",n),{data:{user:n.user},error:null}})}catch(e){if(eO(e))return{data:{user:null},error:e};throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new eI;let t=Date.now()/1e3,i=t,r=!0,s=null,{payload:n}=e6(e.access_token);if(n.exp&&(r=(i=n.exp)<=t),r){let{session:t,error:i}=await this._callRefreshToken(e.refresh_token);if(i)return{data:{user:null,session:null},error:i};if(!t)return{data:{user:null,session:null},error:null};s=t}else{let{data:r,error:n}=await this._getUser(e.access_token);if(n)throw n;s={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:i-t,expires_at:i},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return{data:{user:s.user,session:s},error:null}}catch(e){if(eO(e))return{data:{session:null,user:null},error:e};throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var i;if(!e){let{data:r,error:s}=t;if(s)throw s;e=null!==(i=r.session)&&void 0!==i?i:void 0}if(!(null==e?void 0:e.refresh_token))throw new eI;let{session:r,error:s}=await this._callRefreshToken(e.refresh_token);return s?{data:{user:null,session:null},error:s}:r?{data:{user:r.user,session:r},error:null}:{data:{user:null,session:null},error:null}})}catch(e){if(eO(e))return{data:{user:null,session:null},error:e};throw e}}
6async _getSessionFromURL(e,t){try{if(!eY())throw new eB("No browser detected.");if(e.error||e.error_description||e.error_code)throw new eB(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new eV("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new eB("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new eV("No code detected.");let{data:t,error:i}=await this._exchangeCodeForSession(e.code);if(i)throw i;let r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:t.session,redirectType:null},error:null}}let{provider_token:i,provider_refresh_token:r,access_token:s,refresh_token:n,expires_in:o,expires_at:a,token_type:l}=e;if(!s||!o||!n||!l)throw new eB("No session defined in URL");let h=Math.round(Date.now()/1e3),u=parseInt(o),c=h+u;a&&(c=parseInt(a));let d=c-h;1e3*d<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${u}s`);let f=c-u;h-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,c,h):h-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",f,c,h);let{data:p,error:m}=await this._getUser(s);if(m)throw m;let g={provider_token:i,provider_refresh_token:r,access_token:s,expires_in:u,expires_at:c,refresh_token:n,token_type:l,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:g,redirectType:e.type},error:null}}catch(e){if(eO(e))return{data:{session:null,redirectType:null},error:e};throw e}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await e2(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var i;let{data:r,error:s}=t;if(s)return{error:s};let n=null===(i=r.session)||void 0===i?void 0:i.access_token;if(n){let{error:t}=await this.admin.signOut(n,e);if(t&&!(eO(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status||403===t.status)))return{error:t}}return"others"!==e&&(await this._removeSession(),await e5(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),i={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,i),(async()=>{await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:i}}}async _emitInitialSession(e){return await this._useSession(async t=>{var i,r;try{let{data:{session:r},error:s}=t;if(s)throw s;await (null===(i=this.stateChangeEmitters.get(e))||void 0===i?void 0:i.callback("INITIAL_SESSION",r)),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(t){await (null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}})}async resetPasswordForEmail(e,t={}){let i=null,r=null;"pkce"===this.flowType&&([i,r]=await te(this.storage,this.storageKey,!0));try{return await ta(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:i,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(eO(e))return{data:null,error:e};throw e}}async getUserIdentities(){var e;try{let{data:t,error:i}=await this.getUser();if(i)throw i;return{data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null}}catch(e){if(eO(e))return{data:null,error:e};throw e}}async linkIdentity(e){var t;try{let{data:i,error:r}=await this._useSession(async t=>{var i,r,s,n,o;let{data:a,error:l}=t;if(l)throw l;let h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null===(i=e.options)||void 0===i?void 0:i.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(s=e.options)||void 0===s?void 0:s.queryParams,skipBrowserRedirect:!0});return await ta(this.fetch,"GET",h,{headers:this.headers,jwt:null!==(o=null===(n=a.session)||void 0===n?void 0:n.access_token)&&void 0!==o?o:void 0})});if(r)throw r;return!eY()||(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)||window.location.assign(null==i?void 0:i.url),{data:{provider:e.provider,url:null==i?void 0:i.url},error:null}}catch(t){if(eO(t))return{data:{provider:e.provider,url:null},error:t};throw t}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var i,r;let{data:s,error:n}=t;if(n)throw n;
6return await ta(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!==(r=null===(i=s.session)||void 0===i?void 0:i.access_token)&&void 0!==r?r:void 0})})}catch(e){if(eO(e))return{data:null,error:e};throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{var i,r;let s=Date.now();return await (i=async i=>(i>0&&await e3(200*Math.pow(2,i-1)),this._debug(t,"refreshing attempt",i),await ta(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:th})),r=(e,t)=>{let i=200*Math.pow(2,e);return t&&eN(t)&&Date.now()+i-s<3e4},new Promise((e,t)=>{(async()=>{for(let s=0;s<1/0;s++)try{let t=await i(s);if(!r(s,null,t)){e(t);return}}catch(e){if(!r(s,e)){t(e);return}}})()}))}catch(e){if(this._debug(t,"error",e),eO(e))return{data:{session:null,user:null},error:e};throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let i=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",i),eY()&&!t.skipBrowserRedirect&&window.location.assign(i),{data:{provider:e,url:i},error:null}}async _recoverAndRefresh(){var e;let t="#_recoverAndRefresh()";this._debug(t,"begin");try{let i=await e2(this.storage,this.storageKey);if(this._debug(t,"session from storage",i),!this._isValidSession(i)){this._debug(t,"session is not valid"),null!==i&&await this._removeSession();return}let r=(null!==(e=i.expires_at)&&void 0!==e?e:1/0)*1e3-Date.now()<9e4;if(this._debug(t,`session has${r?"":" not"} expired with margin of 90000s`),r){if(this.autoRefreshToken&&i.refresh_token){let{error:e}=await this._callRefreshToken(i.refresh_token);e&&(console.error(e),eN(e)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(e){this._debug(t,"error",e),console.error(e);return}finally{this._debug(t,"end")}}async _callRefreshToken(e){var t,i;if(!e)throw new eI;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{this.refreshingDeferred=new e8;let{data:t,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!t.session)throw new eI;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let r={session:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(e){if(this._debug(r,"error",e),eO(e)){let i={session:null,error:e};return eN(e)||await this._removeSession(),null===(t=this.refreshingDeferred)||void 0===t||t.resolve(i),i}throw null===(i=this.refreshingDeferred)||void 0===i||i.reject(e),e}finally{this.refreshingDeferred=null,this._debug(r,"end")}}async _notifyAllSubscribers(e,t,i=!0){let r=`#_notifyAllSubscribers(${e})`;this._debug(r,"begin",t,`broadcast = ${i}`);try{this.broadcastChannel&&i&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(s),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await e1(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await e5(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&eY()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:i}}=t;if(!i||!i.refresh_token||!i.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let r=Math.floor((1e3*i.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(i.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof tb)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!eY()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(
6await this.initializePromise,await this._acquireLock(-1,async()=>{if("visible"!==document.visibilityState){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,i){let r=[`provider=${encodeURIComponent(t)}`];if((null==i?void 0:i.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(i.redirectTo)}`),(null==i?void 0:i.scopes)&&r.push(`scopes=${encodeURIComponent(i.scopes)}`),"pkce"===this.flowType){let[e,t]=await te(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(i.toString())}if(null==i?void 0:i.queryParams){let e=new URLSearchParams(i.queryParams);r.push(e.toString())}return(null==i?void 0:i.skipBrowserRedirect)&&r.push(`skip_http_redirect=${i.skipBrowserRedirect}`),`${e}?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var i;let{data:r,error:s}=t;return s?{data:null,error:s}:await ta(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(i=null==r?void 0:r.session)||void 0===i?void 0:i.access_token})})}catch(e){if(eO(e))return{data:null,error:e};throw e}}async _enroll(e){try{return await this._useSession(async t=>{var i,r;let{data:s,error:n}=t;if(n)return{data:null,error:n};let o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:{issuer:e.issuer}),{data:a,error:l}=await ta(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:null===(i=null==s?void 0:s.session)||void 0===i?void 0:i.access_token});return l?{data:null,error:l}:("totp"===e.factorType&&(null===(r=null==a?void 0:a.totp)||void 0===r?void 0:r.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),{data:a,error:null})})}catch(e){if(eO(e))return{data:null,error:e};throw e}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var i;let{data:r,error:s}=t;if(s)return{data:null,error:s};let{data:n,error:o}=await ta(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(i=null==r?void 0:r.session)||void 0===i?void 0:i.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+n.expires_in},n)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",n),{data:n,error:o})})}catch(e){if(eO(e))return{data:null,error:e};throw e}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var i;let{data:r,error:s}=t;return s?{data:null,error:s}:await ta(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:null===(i=null==r?void 0:r.session)||void 0===i?void 0:i.access_token})})}catch(e){if(eO(e))return{data:null,error:e};throw e}})}async _challengeAndVerify(e){let{data:t,error:i}=await this._challenge({factorId:e.factorId});return i?{data:null,error:i}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let i=(null==e?void 0:e.factors)||[],r=i.filter(e=>"totp"===e.factor_type&&"verified"===e.status),s=i.filter(e=>"phone"===e.factor_type&&"verified"===e.status);return{data:{all:i,totp:r,phone:s},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,i;let{data:{session:r},error:s}=e;if(s)return{data:null,error:s};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:n}=e6(r.access_token),o=null;n.aal&&(o=n.aal);let a=o;return(null!==(i=null===(t=r.user.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==i?i:[]).length>0&&(a="aal2"),{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:n.amr||[]},error:null}}))}async fetchJwk(e,t={keys:[]}){let i=t.keys.find(t=>t.kid===e);if(i||(i=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+6e5>Date.now())return i;let{data:r,error:s}=await ta(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;if(!r.keys||0===r.keys.length)throw new ez("JWKS is empty");if(this.jwks=r,this.jwks_cached_at=Date.now(),!(i=r.keys.find(t=>t.kid===e)))throw new ez("No matching signing key found in JWKS");return i}async getClaims(e,t={keys:[]}){try{let r=e;if(!r){let{data:e,error:t}
6=await this.getSession();if(t||!e.session)return{data:null,error:t};r=e.session.access_token}let{header:s,payload:n,signature:o,raw:{header:a,payload:l}}=e6(r);var i=n.exp;if(!i)throw Error("Missing exp claim");if(i<=Math.floor(Date.now()/1e3))throw Error("JWT has expired");if(!s.kid||"HS256"===s.alg||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){let{error:e}=await this.getUser(r);if(e)throw e;return{data:{claims:n,header:s,signature:o},error:null}}let h=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw Error("Invalid alg claim")}}(s.alg),u=await this.fetchJwk(s.kid,t),c=await crypto.subtle.importKey("jwk",u,h,!0,["verify"]);if(!await crypto.subtle.verify(h,c,o,function(e){let t=[];return function(e,t){for(let i=0;i<e.length;i+=1){let r=e.charCodeAt(i);if(r>55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(i+1)-56320&65535|t)+65536,i+=1}!function(e,t){if(e<=127){t(e);return}if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(r,t)}}(e,e=>t.push(e)),new Uint8Array(t)}(`${a}.${l}`)))throw new ez("Invalid JWT signature");return{data:{claims:n,header:s,signature:o},error:null}}catch(e){if(eO(e))return{data:null,error:e};throw e}}}tS.nextInstanceID=0;let tP=tS;class tE extends tP{constructor(e){super(e)}}class tA{constructor(e,t,i){var r,s,n;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw Error("supabaseUrl is required.");if(!t)throw Error("supabaseKey is required.");let o=e.replace(/\/$/,"");this.realtimeUrl=`${o}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${o}/auth/v1`,this.storageUrl=`${o}/storage/v1`,this.functionsUrl=`${o}/functions/v1`;let a=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,l=function(e,t){let{db:i,auth:r,realtime:s,global:n}=e,{db:o,auth:a,realtime:l,global:h}=t,u={db:Object.assign(Object.assign({},o),i),auth:Object.assign(Object.assign({},a),r),realtime:Object.assign(Object.assign({},l),s),global:Object.assign(Object.assign({},h),n),accessToken:()=>{var e,t,i,r;return e=this,t=void 0,r=function*(){return""},new(i=void 0,i=Promise)(function(s,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}};return e.accessToken?u.accessToken=e.accessToken:delete u.accessToken,u}(null!=i?i:{},{db:ew,realtime:e_,auth:Object.assign(Object.assign({},eb),{storageKey:a}),global:ev});this.storageKey=null!==(r=l.auth.storageKey)&&void 0!==r?r:"",this.headers=null!==(s=l.global.headers)&&void 0!==s?s:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!==(n=l.auth)&&void 0!==n?n:{},this.headers,l.global.fetch),this.fetch=eS(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.rest=new h(`${o}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new l(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new eg(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},i={}){return this.rest.rpc(e,t,i)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t,i,r,s,n;return i=this,r=void 0,s=void 0,n=function*(){if(this.accessToken)return yield this.accessToken();let{data:i}=yield this.auth.getSession();return null!==(t=null===(e=i.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null}
6,new(s||(s=Promise))(function(e,t){function o(e){try{l(n.next(e))}catch(e){t(e)}}function a(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):((i=t.value)instanceof s?i:new s(function(e){e(i)})).then(o,a)}l((n=n.apply(i,r||[])).next())})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:i,storage:r,storageKey:s,flowType:n,lock:o,debug:a},l,h){let u={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new tE({url:this.authUrl,headers:Object.assign(Object.assign({},u),l),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:i,storage:r,flowType:n,lock:o,debug:a,fetch:h,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new M(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,i){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==i?this.changedAccessToken=i:"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}}let tj=(e,t,i)=>new tA(e,t,i)},869:(e,t,i)=>{"use strict";i.d(t,{L:()=>r});let r=(0,i(2115).createContext)({})},1508:(e,t,i)=>{"use strict";i.d(t,{Q:()=>r});let r=(0,i(2115).createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"})},1971:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class i extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
6de=e.code}}t.default=i},1978:(e,t,i)=>{"use strict";let r;function s(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}i.d(t,{P:()=>nm});let n=e=>Array.isArray(e);function o(e,t){if(!Array.isArray(t))return!1;let i=t.length;if(i!==e.length)return!1;for(let r=0;r<i;r++)if(t[r]!==e[r])return!1;return!0}function a(e){return"string"==typeof e||Array.isArray(e)}function l(e){let t=[{},{}];return null==e||e.values.forEach((e,i)=>{t[0][i]=e.get(),t[1][i]=e.getVelocity()}),t}function h(e,t,i,r){if("function"==typeof t){let[s,n]=l(r);t=t(void 0!==i?i:e.custom,s,n)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[s,n]=l(r);t=t(void 0!==i?i:e.custom,s,n)}return t}function u(e,t,i){let r=e.getProps();return h(r,t,void 0!==i?i:r.custom,e)}let c=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],d=["initial",...c];function f(e){let t;return()=>(void 0===t&&(t=e()),t)}let p=f(()=>void 0!==window.ScrollTimeline);class m{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t}attachTimeline(e,t){let i=this.animations.map(i=>p()&&i.attachTimeline?i.attachTimeline(e):"function"==typeof t?t(i):void 0);return()=>{i.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class g extends m{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function y(e,t){return e?e[t]||e.default||e:void 0}function v(e){let t=0,i=e.next(t);for(;!i.done&&t<2e4;)t+=50,i=e.next(t);return t>=2e4?1/0:t}function w(e){return"function"==typeof e}function b(e,t){e.timeline=t,e.onfinish=null}let _=e=>Array.isArray(e)&&"number"==typeof e[0],T={linearEasing:void 0},k=function(e,t){let i=f(e);return()=>{var e;return null!==(e=T[t])&&void 0!==e?e:i()}}(()=>{try{document.createElement("div").animate({opacity:0}
6,{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),x=(e,t,i)=>{let r=t-e;return 0===r?1:(i-e)/r},S=(e,t,i=10)=>{let r="",s=Math.max(Math.round(t/i),2);for(let t=0;t<s;t++)r+=e(x(0,s-1,t))+", ";return`linear(${r.substring(0,r.length-2)})`},P=([e,t,i,r])=>`cubic-bezier(${e}, ${t}, ${i}, ${r})`,E={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:P([0,.65,.55,1]),circOut:P([.55,0,1,.45]),backIn:P([.31,.01,.66,-.59]),backOut:P([.33,1.53,.69,.99])},A={x:!1,y:!1};function j(e,t){let i=function(e,t,i){var r;if(e instanceof Element)return[e];if("string"==typeof e){let t=document,i=(r=void 0,t.querySelectorAll(e));return i?Array.from(i):[]}return Array.from(e)}(e),r=new AbortController;return[i,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function C(e){return t=>{"touch"===t.pointerType||A.x||A.y||e(t)}}let R=(e,t)=>!!t&&(e===t||R(e,t.parentElement)),O=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,L=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),M=new WeakSet;function $(e){return t=>{"Enter"===t.key&&e(t)}}function I(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}let D=(e,t)=>{let i=e.currentTarget;if(!i)return;let r=$(()=>{if(M.has(i))return;I(i,"down");let e=$(()=>{I(i,"up")});i.addEventListener("keyup",e,t),i.addEventListener("blur",()=>I(i,"cancel"),t)});i.addEventListener("keydown",r,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",r),t)};function U(e){return O(e)&&!(A.x||A.y)}let B=e=>1e3*e,V=e=>e/1e3,F=e=>e,N=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],q=new Set(N),z=new Set(["width","height","top","left","right","bottom",...N]),W=e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue),K=e=>n(e)?e[e.length-1]||0:e,H={skipAnimations:!1,useManualTiming:!1},J=["read","resolveKeyframes","update","preRender","render","postRender"];function G(e,t){let i=!1,r=!0,s={delta:0,timestamp:0,isProcessing:!1},n=()=>i=!0,o=J.reduce((e,t)=>(e[t]=function(e){let t=new Set,i=new Set,r=!1,s=!1,n=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function a(t){n.has(t)&&(l.schedule(t),e()),t(o)}let l={schedule:(e,s=!1,o=!1)=>{let a=o&&r?t:i;return s&&n.add(e),a.has(e)||a.add(e),e},cancel:e=>{i.delete(e),n.delete(e)},process:e=>{if(o=e,r){s=!0;return}r=!0,[t,i]=[i,t],t.forEach(a),t.clear(),r=!1,s&&(s=!1,l.process(e))}};return l}(n),e),{}),{read:a,resolveKeyframes:l,update:h,preRender:u,render:c,postRender:d}=o,f=()=>{let n=H.useManualTiming?s.timestamp:performance.now();i=!1,s.delta=r?1e3/60:Math.max(Math.min(n-s.timestamp,40),1),s.timestamp=n,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),s.isProcessing=!1,i&&t&&(r=!1,e(f))},p=()=>{i=!0,r=!0,s.isProcessing||e(f)};return{schedule:J.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,s=!1)=>(i||p(),r.schedule(e,t,s)),e},{}),cancel:e=>{for(let t=0;t<J.length;t++)o[J[t]].cancel(e)},state:s,steps:o}}let{schedule:Y,cancel:X,state:Z,steps:Q}=G("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:F,!0);function ee(){r=void 0}let et={now:()=>(void 0===r&&et.set(Z.isProcessing||H.useManualTiming?Z.timestamp:performance.now()),r),set:e=>{r=e,queueMicrotask(ee)}};function ei(e,t){-1===e.indexOf(t)&&e.push(t)}function er(e,t){let i=e.indexOf(t);i>-1&&e.splice(i,1)}class es{constructor(){this.subscriptions=[]}add(e){return ei(this.subscriptions,e),()=>er(this.subscriptions,e)}notify(e,t,i){let r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,i);else for(let s=0;s<r;s++){let r=this.subscriptions[s];r&&r(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let en=e=>!isNaN(parseFloat(e)),eo={current:void 0};class ea{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{let i=et.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=et.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=en(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new es);let i=this.events[e].add(t);return"change"===e?()=>{i(),Y.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return eo.current&&eo.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;
6let t=et.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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 el(e,t){return new ea(e,t)}let eh=e=>!!(e&&e.getVelocity);function eu(e,t){let i=e.getValue("willChange");if(eh(i)&&i.add)return i.add(t)}let ec=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ed="data-"+ec("framerAppearId"),ef={current:!1},ep=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e;function em(e,t,i,r){if(e===t&&i===r)return F;let s=t=>(function(e,t,i,r,s){let n,o,a=0;do(n=ep(o=t+(i-t)/2,r,s)-e)>0?i=o:t=o;while(Math.abs(n)>1e-7&&++a<12);return o})(t,0,1,e,i);return e=>0===e||1===e?e:ep(s(e),t,r)}let eg=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ey=e=>t=>1-e(1-t),ev=em(.33,1.53,.69,.99),ew=ey(ev),eb=eg(ew),e_=e=>(e*=2)<1?.5*ew(e):.5*(2-Math.pow(2,-10*(e-1))),eT=e=>1-Math.sin(Math.acos(e)),ek=ey(eT),ex=eg(eT),eS=e=>/^0[^.\s]+$/u.test(e),eP=(e,t,i)=>i>t?t:i<e?e:i,eE={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},eA={...eE,transform:e=>eP(0,1,e)},ej={...eE,default:1},eC=e=>Math.round(1e5*e)/1e5,eR=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,eO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,eL=(e,t)=>i=>!!("string"==typeof i&&eO.test(i)&&i.startsWith(e)||t&&null!=i&&Object.prototype.hasOwnProperty.call(i,t)),eM=(e,t,i)=>r=>{if("string"!=typeof r)return r;let[s,n,o,a]=r.match(eR);return{[e]:parseFloat(s),[t]:parseFloat(n),[i]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},e$=e=>eP(0,255,e),eI={...eE,transform:e=>Math.round(e$(e))},eD={test:eL("rgb","red"),parse:eM("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:r=1})=>"rgba("+eI.transform(e)+", "+eI.transform(t)+", "+eI.transform(i)+", "+eC(eA.transform(r))+")"},eU={test:eL("#"),parse:function(e){let t="",i="",r="",s="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,i+=i,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:eD.transform},eB=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),eV=eB("deg"),eF=eB("%"),eN=eB("px"),eq=eB("vh"),ez=eB("vw"),eW={...eF,parse:e=>eF.parse(e)/100,transform:e=>eF.transform(100*e)},eK={test:eL("hsl","hue"),parse:eM("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:r=1})=>"hsla("+Math.round(e)+", "+eF.transform(eC(t))+", "+eF.transform(eC(i))+", "+eC(eA.transform(r))+")"},eH={test:e=>eD.test(e)||eU.test(e)||eK.test(e),parse:e=>eD.test(e)?eD.parse(e):eK.test(e)?eK.parse(e):eU.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?eD.transform(e):eK.transform(e)},eJ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,eG="number",eY="color",eX=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function eZ(e){let t=e.toString(),i=[],r={color:[],number:[],var:[]},s=[],n=0,o=t.replace(eX,e=>(eH.test(e)?(r.color.push(n),s.push(eY),i.push(eH.parse(e))):e.startsWith("var(")?(r.var.push(n),s.push("var"),i.push(e)):(r.number.push(n),s.push(eG),i.push(parseFloat(e))),++n,"${}")).split("${}");return{values:i,split:o,indexes:r,types:s}}function eQ(e){return eZ(e).values}function e0(e){let{split:t,types:i}=eZ(e),r=t.length;return e=>{let s="";for(let n=0;n<r;n++)if(s+=t[n],void 0!==e[n]){let t=i[n];t===eG?s+=eC(e[n]):t===eY?s+=eH.transform(e[n]):s+=e[n]}return s}}let e1=e=>"number"==typeof e?0:e,e2={test:function(e){var t,i;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(eR))||void 0===t?void 0:t.length)||0)+((null===(i=e.match(eJ))||void 0===i?void 0:i.length)||0)>0},parse:eQ,createTransformer:e0,getAnimatableNone:function(e){let t=eQ(e);return e0(e)(t.map(e1))}},e5=new Set(["brightness","contrast","saturate","opacity"]);function e8(e){let[t,i]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[r]=i.match(eR)||[];if(!r)return e;let s=i.replace(r,""),n=+!!e5.has(t);return r!==i&&(n*=100),t+"("+n+s+")"}let e6=/\b([a-z-]*)\(.*?\)/gu,e3={...e2,getAnimatableNone:e=>{let t=e.match(e6);return t?t.map(e8).join(" "):e}},e4={...eE,transform:Math.round},e9={borderWidth:eN,borderTopWidth:eN,borderRightWidth:eN,borderBottomWidth:eN,borderLeftWidth:eN,borderRadius:eN,radius:eN,borderTopLeftRadius:eN,borderTopRightRadius:eN,borderBottomRightRadius:eN,borderBottomLeftRadius:eN,width:eN,maxWidth:eN,height:eN,maxHeight:eN,top:eN,right:eN,bottom:eN,left
6:eN,padding:eN,paddingTop:eN,paddingRight:eN,paddingBottom:eN,paddingLeft:eN,margin:eN,marginTop:eN,marginRight:eN,marginBottom:eN,marginLeft:eN,backgroundPositionX:eN,backgroundPositionY:eN,rotate:eV,rotateX:eV,rotateY:eV,rotateZ:eV,scale:ej,scaleX:ej,scaleY:ej,scaleZ:ej,skew:eV,skewX:eV,skewY:eV,distance:eN,translateX:eN,translateY:eN,translateZ:eN,x:eN,y:eN,z:eN,perspective:eN,transformPerspective:eN,opacity:eA,originX:eW,originY:eW,originZ:eN,zIndex:e4,size:eN,fillOpacity:eA,strokeOpacity:eA,numOctaves:e4},e7={...e9,color:eH,backgroundColor:eH,outlineColor:eH,fill:eH,stroke:eH,borderColor:eH,borderTopColor:eH,borderRightColor:eH,borderBottomColor:eH,borderLeftColor:eH,filter:e3,WebkitFilter:e3},te=e=>e7[e];function tt(e,t){let i=te(e);return i!==e3&&(i=e2),i.getAnimatableNone?i.getAnimatableNone(t):void 0}let ti=new Set(["auto","none","0"]),tr=e=>e===eE||e===eN,ts=(e,t)=>parseFloat(e.split(", ")[t]),tn=(e,t)=>(i,{transform:r})=>{if("none"===r||!r)return 0;let s=r.match(/^matrix3d\((.+)\)$/u);if(s)return ts(s[1],t);{let t=r.match(/^matrix\((.+)\)$/u);return t?ts(t[1],e):0}},to=new Set(["x","y","z"]),ta=N.filter(e=>!to.has(e)),tl={width:({x:e},{paddingLeft:t="0",paddingRight:i="0"})=>e.max-e.min-parseFloat(t)-parseFloat(i),height:({y:e},{paddingTop:t="0",paddingBottom:i="0"})=>e.max-e.min-parseFloat(t)-parseFloat(i),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:tn(4,13),y:tn(5,14)};tl.translateX=tl.x,tl.translateY=tl.y;let th=new Set,tu=!1,tc=!1;function td(){if(tc){let e=Array.from(th).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),i=new Map;t.forEach(e=>{let t=function(e){let t=[];return ta.forEach(i=>{let r=e.getValue(i);void 0!==r&&(t.push([i,r.get()]),r.set(+!!i.startsWith("scale")))}),t}(e);t.length&&(i.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=i.get(e);t&&t.forEach(([t,i])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(i)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}tc=!1,tu=!1,th.forEach(e=>e.complete()),th.clear()}function tf(){th.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(tc=!0)})}class tp{constructor(e,t,i,r,s,n=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=s,this.isAsync=n}scheduleResolve(){this.isScheduled=!0,this.isAsync?(th.add(this),tu||(tu=!0,Y.read(tf),Y.resolveKeyframes(td))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let s=0;s<e.length;s++)if(null===e[s])if(0===s){let s=null==r?void 0:r.get(),n=e[e.length-1];if(void 0!==s)e[0]=s;else if(i&&t){let r=i.readValue(t,n);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=n),r&&void 0===s&&r.set(e[0])}else e[s]=e[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),th.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,th.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let tm=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),tg=e=>t=>"string"==typeof t&&t.startsWith(e),ty=tg("--"),tv=tg("var(--"),tw=e=>!!tv(e)&&tb.test(e.split("/*")[0].trim()),tb=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,t_=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,tT=e=>t=>t.test(e),tk=[eE,eN,eF,eV,ez,eq,{test:e=>"auto"===e,parse:e=>e}],tx=e=>tk.find(tT(e));class tS extends tp{constructor(e,t,i,r,s){super(e,t,i,r,s,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let i=0;i<e.length;i++){let r=e[i];if("string"==typeof r&&tw(r=r.trim())){let s=function e(t,i,r=1){F(r<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[s,n]=function(e){let t=t_.exec(e);if(!t)return[,];let[,i,r,s]=t;return[`--${null!=i?i:r}`,s]}(t);if(!s)return;let o=window.getComputedStyle(i).getPropertyValue(s);if(o){let e=o.trim();return tm(e)?parseFloat(e):e}return tw(n)?e(n,i,r+1):n}(r,t.current);void 0!==s&&(e[i]=s),i===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!z.has(i)||2!==e.length)return;let[r,s]=e,n=tx(r),o=tx(s);if(n!==o)if(tr(n)&&tr(o))for(let t=0;t<e.length;t++){let i=e[t];"string"==typeof i&&(e[t]=parseFloat(i))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let t=0;t<e.length;t++){var r;("number"==typeof(r=e[t])?0===r:null===r||"none"===r||"0"===r||eS(r))&&i.push(t)}if(i.length){let r,s=0;for(;s<e.length&&!r;){let t=e[s];"string"==typeof t&&!ti.has(t)&&eZ(t).values.length&&(r=e[s]),s++}if(r&&t)for(let s of i)e[s]=tt(t,r)}}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tl[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];void 0!==r&&e.getValue(i,r).jump(r,!1)}measureEndState(){var e;let{element:t,name:i,unresolvedKeyframes:r}=this;if(!t||!t.current)return;let s=t.getValue(i);s&&s.jump(this.measuredOrigin,!1);let n=r.length-1,o=r[n];r[n]=tl[i](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEac
6h(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}let tP=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(e2.test(e)||"0"===e)&&!e.startsWith("url(")),tE=e=>null!==e;function tA(e,{repeat:t,repeatType:i="loop"},r){let s=e.filter(tE),n=t&&"loop"!==i&&t%2==1?0:s.length-1;return n&&void 0!==r?r:s[n]}class tj{constructor({autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:n="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=et.now(),this.options={autoplay:e,delay:t,type:i,repeat:r,repeatDelay:s,repeatType:n,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(tf(),td()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=et.now(),this.hasAttemptedResolve=!0;let{name:i,type:r,velocity:s,delay:n,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,i,r){let s=e[0];if(null===s)return!1;if("display"===t||"visibility"===t)return!0;let n=e[e.length-1],o=tP(s,t),a=tP(n,t);return F(o===a,`You are trying to animate ${t} from "${s}" to "${n}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${n} via the \`style\` property.`),!!o&&!!a&&(function(e){let t=e[0];if(1===e.length)return!0;for(let i=0;i<e.length;i++)if(e[i]!==t)return!0}(e)||("spring"===i||w(i))&&r)}(e,i,r,s))if(ef.current||!n){a&&a(tA(e,this.options,t)),o&&o(),this.resolveFinishedPromise();return}else this.options.duration=0;let h=this.initPlayback(e,t);!1!==h&&(this._resolved={keyframes:e,finalKeyframe:t,...h},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}let tC=(e,t,i)=>e+(t-e)*i;function tR(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function tO(e,t){return i=>i>0?t:e}let tL=(e,t,i)=>{let r=e*e,s=i*(t*t-r)+r;return s<0?0:Math.sqrt(s)},tM=[eU,eD,eK],t$=e=>tM.find(t=>t.test(e));function tI(e){let t=t$(e);if(F(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let i=t.parse(e);return t===eK&&(i=function({hue:e,saturation:t,lightness:i,alpha:r}){e/=360,i/=100;let s=0,n=0,o=0;if(t/=100){let r=i<.5?i*(1+t):i+t-i*t,a=2*i-r;s=tR(a,r,e+1/3),n=tR(a,r,e),o=tR(a,r,e-1/3)}else s=n=o=i;return{red:Math.round(255*s),green:Math.round(255*n),blue:Math.round(255*o),alpha:r}}(i)),i}let tD=(e,t)=>{let i=tI(e),r=tI(t);if(!i||!r)return tO(e,t);let s={...i};return e=>(s.red=tL(i.red,r.red,e),s.green=tL(i.green,r.green,e),s.blue=tL(i.blue,r.blue,e),s.alpha=tC(i.alpha,r.alpha,e),eD.transform(s))},tU=(e,t)=>i=>t(e(i)),tB=(...e)=>e.reduce(tU),tV=new Set(["none","hidden"]);function tF(e,t){return i=>tC(e,t,i)}function tN(e){return"number"==typeof e?tF:"string"==typeof e?tw(e)?tO:eH.test(e)?tD:tW:Array.isArray(e)?tq:"object"==typeof e?eH.test(e)?tD:tz:tO}function tq(e,t){let i=[...e],r=i.length,s=e.map((e,i)=>tN(e)(e,t[i]));return e=>{for(let t=0;t<r;t++)i[t]=s[t](e);return i}}function tz(e,t){let i={...e,...t},r={};for(let s in i)void 0!==e[s]&&void 0!==t[s]&&(r[s]=tN(e[s])(e[s],t[s]));return e=>{for(let t in r)i[t]=r[t](e);return i}}let tW=(e,t)=>{let i=e2.createTransformer(t),r=eZ(e),s=eZ(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?tV.has(e)&&!s.values.length||tV.has(t)&&!r.values.length?function(e,t){return tV.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}(e,t):tB(tq(function(e,t){var i;let r=[],s={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let o=t.types[n],a=e.indexes[o][s[o]],l=null!==(i=e.values[a])&&void 0!==i?i:0;r[n]=l,s[o]++}return r}(r,s),s.values),i):(F(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),tO(e,t))};function tK(e,t,i){return"number"==typeof e&&"number"==typeof t&&"number"==typeof i?tC(e,t,i):tN(e)(e,t)}function tH(e,t,i){var r,s;let n=Math.max(t-5,0);return r=i-e(n),(s=t-n)?1e3/s*r:0}let tJ={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function tG(e,t){return e*Math.sqrt(1-t*t)}let tY=["duration","bounce"],tX=["stiffness","damping","mass"];function tZ(e,t){return t.some(t=>void 0!==e[t])}function tQ(e=tJ.visualDuration,t=tJ.bounce){let i,r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:s,restDelta:n}=r,o=r.keyframes[0],a=r.keyframes[r.keyframes.length-1],l={done:!1,value:o},{stiffness:h,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=function(e){let t={velocity:tJ.velocity,stiffness:tJ.stiffness,damping:tJ.damping,mass:tJ.mass,isResolvedFromDuration:!1,...e};if(!tZ(e,tX)&&tZ(e,tY))if(e.visualDuration){let i=2*Math.PI/(1.2*e.visualDuration),r=i*i,s=2*eP(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:tJ.mass,stiffness:r,damping:s}}else{let i=function({duration:e=tJ.duration,bounce:t=tJ.bounce,velocity:i=tJ.velocity,mass:r=tJ.mass}){let s,n;F(e<=B(tJ.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=eP(tJ.minDamping,tJ.maxDamping,o),e=eP(tJ.minDuration,tJ.maxDuration,V(e)),o<1?(s=t=>{let r=t*o,s=r*e;return .001-(r-i)/tG(t,o)*Math.exp(-s)},n=t=>{let r=t*o*e,n=Math.pow(o,2)*Math.pow(t,2)*e,a=Math.exp(-r),l=tG(Math.pow(t,2),o);return(r*i+i-n)*a*(-s(t)+.001>0?-1:1)/l}):(s=t=>-.001+Math.exp(-t*e)*((t-i)*e+1),n=t=>e*e*(i-t)*Math.exp(-t*e));let a=function(e,t,i){let r=i;for(let i=1;i<12;i++)r-=e(r)/t(r);return r}(s,n,5/e);if(e=B(e),isNaN(a))return{stiffness:tJ.stiffness,damping:tJ.damping,duration:e};{let t=Math.pow(a,2)*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}(e);(t={...t,...i,mass:tJ.mass}).isResolvedFromDuration=!0}return t}({...r,velocity:-V(r.velocity||0)}),m=f||0,g=u/(2*Math.sqrt(h*c)),y=a-o,w=V(Math.sqrt(h/c)),b=5>Math.abs(y);if(s||(s=b?tJ.restSpeed.granular:tJ.restSpeed.default),n||(n=b?tJ.restDelta.granular:tJ.restDelta.default),g<1){let e=tG(w,g);i=t=>a-Math.exp(-g*w*t)*((m+g*w*y)/e*Math.sin(e*t)+y*Math.cos(e*t))}else if(1===g)i=e=>a-Math.exp(-w*e)*(y+(m+w*y)*e);else{let e=w*Math.sqrt(g*g-1);i=t=>{let i=Math.exp(-g*w*t),r=Math.min(e*t,300);return a-i*((m+g*w*y)*Math.sinh(r)+e*y*Math.cosh(r))/e}}
6let _={calculatedDuration:p&&d||null,next:e=>{let t=i(e);if(p)l.done=e>=d;else{let r=0;g<1&&(r=0===e?B(m):tH(i,e,t));let o=Math.abs(a-t)<=n;l.done=Math.abs(r)<=s&&o}return l.value=l.done?a:t,l},toString:()=>{let e=Math.min(v(_),2e4),t=S(t=>_.next(e*t).value,e,30);return e+"ms "+t}};return _}function t0({keyframes:e,velocity:t=0,power:i=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:l,restDelta:h=.5,restSpeed:u}){let c,d,f=e[0],p={done:!1,value:f},m=e=>void 0!==a&&e<a||void 0!==l&&e>l,g=e=>void 0===a?l:void 0===l?a:Math.abs(a-e)<Math.abs(l-e)?a:l,y=i*t,v=f+y,w=void 0===o?v:o(v);w!==v&&(y=w-f);let b=e=>-y*Math.exp(-e/r),_=e=>w+b(e),T=e=>{let t=b(e),i=_(e);p.done=Math.abs(t)<=h,p.value=p.done?w:i},k=e=>{m(p.value)&&(c=e,d=tQ({keyframes:[p.value,g(p.value)],velocity:tH(_,e,p.value),damping:s,stiffness:n,restDelta:h,restSpeed:u}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return(d||void 0!==c||(t=!0,T(e),k(e)),void 0!==c&&e>=c)?d.next(e-c):(t||T(e),p)}}}let t1=em(.42,0,1,1),t2=em(0,0,.58,1),t5=em(.42,0,.58,1),t8=e=>Array.isArray(e)&&"number"!=typeof e[0],t6={linear:F,easeIn:t1,easeInOut:t5,easeOut:t2,circIn:eT,circInOut:ex,circOut:ek,backIn:ew,backInOut:eb,backOut:ev,anticipate:e_},t3=e=>{if(_(e)){F(4===e.length,"Cubic bezier arrays must contain four numerical values.");let[t,i,r,s]=e;return em(t,i,r,s)}return"string"==typeof e?(F(void 0!==t6[e],`Invalid easing type '${e}'`),t6[e]):e};function t4({duration:e=300,keyframes:t,times:i,ease:r="easeInOut"}){let s=t8(r)?r.map(t3):t3(r),n={done:!1,value:t[0]},o=function(e,t,{clamp:i=!0,ease:r,mixer:s}={}){let n=e.length;if(F(n===t.length,"Both input and output ranges must be the same length"),1===n)return()=>t[0];if(2===n&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=function(e,t,i){let r=[],s=i||tK,n=e.length-1;for(let i=0;i<n;i++){let n=s(e[i],e[i+1]);t&&(n=tB(Array.isArray(t)?t[i]||F:t,n)),r.push(n)}return r}(t,r,s),l=a.length,h=i=>{if(o&&i<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(i<e[r+1]);r++);let s=x(e[r],e[r+1],i);return a[r](s)};return i?t=>h(eP(e[0],e[n-1],t)):h}((i&&i.length===t.length?i:function(e){let t=[0];return function(e,t){let i=e[e.length-1];for(let r=1;r<=t;r++){let s=x(0,t,r);e.push(tC(i,1,s))}}(t,e.length-1),t}(t)).map(t=>t*e),t,{ease:Array.isArray(s)?s:t.map(()=>s||t5).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(n.value=o(t),n.done=t>=e,n)}}let t9=e=>{let t=({timestamp:t})=>e(t);return{start:()=>Y.update(t,!0),stop:()=>X(t),now:()=>Z.isProcessing?Z.timestamp:et.now()}},t7={decay:t0,inertia:t0,tween:t4,keyframes:t4,spring:tQ},ie=e=>e/100;class it extends tj{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:e}=this.options;e&&e()};let{name:t,motionValue:i,element:r,keyframes:s}=this.options,n=(null==r?void 0:r.KeyframeResolver)||tp;this.resolver=new n(s,(e,t)=>this.onKeyframesResolved(e,t),t,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){let t,i,{type:r="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o,velocity:a=0}=this.options,l=w(r)?r:t7[r]||t4;l!==t4&&"number"!=typeof e[0]&&(t=tB(ie,tK(e[0],e[1])),e=[0,100]);let h=l({...this.options,keyframes:e});"mirror"===o&&(i=l({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===h.calculatedDuration&&(h.calculatedDuration=v(h));let{calculatedDuration:u}=h,c=u+n;return{generator:h,mirroredGenerator:i,mapPercentToKeyframes:t,calculatedDuration:u,resolvedDuration:c,totalDuration:c*(s+1)-n}}onPostResolved(){let{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){let{resolved:i}=this;if(!i){let{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}let{finalKeyframe:r,generator:s,mirroredGenerator:n,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:h,resolvedDuration:u}=i;if(null===this.startTime)return s.next(0);let{delay:c,repeat:d,repeatType:f,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-h/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;let g=this.currentTime-c*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>h;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=h);let v=this.currentTime,w=s;if(d){let e=Math.min(this.currentTime,h)/u,t=Math.floor(e),i=e%1;!i&&e>=1&&(i=1),1===i&&t--,(t=Math.min(t,d+1))%2&&("reverse"===f?(i=1-i,p&&(i-=p/u)):"mirror"===f&&(w=n)),v=eP(0,1,i)*u}let b=y?{done:!1,value:a[0]}:w.next(v);o&&(b.value=o(b.value));let{done:_}=b;y||null===l||(_=this.speed>=0?this.currentTime>=h:this.currentTime<=0);let T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&_);return T&&void 0!==r&&(b.value=tA(a,this.options,r)),m&&m(b.value),T&&this.finish(),b}get duration(){let{resolved:e}=this;return e?V(e.calculatedDuration):0}
6get time(){return V(this.currentTime)}set time(e){e=B(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=V(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:e=t9,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();let r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}let ii=new Set(["opacity","clipPath","filter","transform"]),ir=f(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),is={anticipate:e_,backInOut:eb,circInOut:ex};class io extends tj{constructor(e){super(e);let{name:t,motionValue:i,element:r,keyframes:s}=this.options;this.resolver=new tS(s,(e,t)=>this.onKeyframesResolved(e,t),t,i,r),this.resolver.scheduleResolve()}initPlayback(e,t){var i;let{duration:r=300,times:s,ease:n,type:o,motionValue:a,name:l,startTime:h}=this.options;if(!a.owner||!a.owner.current)return!1;if("string"==typeof n&&k()&&n in is&&(n=is[n]),w((i=this.options).type)||"spring"===i.type||!function e(t){return!!("function"==typeof t&&k()||!t||"string"==typeof t&&(t in E||k())||_(t)||Array.isArray(t)&&t.every(e))}(i.ease)){let{onComplete:t,onUpdate:i,motionValue:a,element:l,...h}=this.options,u=function(e,t){let i=new it({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},s=[],n=0;for(;!r.done&&n<2e4;)s.push((r=i.sample(n)).value),n+=10;return{times:void 0,keyframes:s,duration:n-10,ease:"linear"}}(e,h);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,s=u.times,n=u.ease,o="keyframes"}let u=function(e,t,i,{delay:r=0,duration:s=300,repeat:n=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){let h={[t]:i};l&&(h.offset=l);let u=function e(t,i){if(t)return"function"==typeof t&&k()?S(t,i):_(t)?P(t):Array.isArray(t)?t.map(t=>e(t,i)||E.easeOut):E[t]}(a,s);return Array.isArray(u)&&(h.easing=u),e.animate(h,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:n+1,direction:"reverse"===o?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:s,ease:n});return u.startTime=null!=h?h:this.calcStartTime(),this.pendingTimeline?(b(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{let{onComplete:i}=this.options;a.set(tA(e,this.options,t)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:n,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:t}=e;return V(t)}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:t}=e;return V(t.currentTime||0)}set time(e){let{resolved:t}=this;if(!t)return;let{animation:i}=t;i.currentTime=B(e)}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:t}=e;return t.playbackRate}set speed(e){let{resolved:t}=this;if(!t)return;let{animation:i}=t;i.playbackRate=e}get state(){let{resolved:e}=this;if(!e)return"idle";let{animation:t}=e;return t.playState}get startTime(){let{resolved:e}=this;if(!e)return null;let{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){let{resolved:t}=this;if(!t)return F;let{animation:i}=t;b(i,e)}else this.pendingTimeline=e;return F}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:t}=e;
6"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:t,keyframes:i,duration:r,type:s,ease:n,times:o}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){let{motionValue:e,onUpdate:t,onComplete:a,element:l,...h}=this.options,u=new it({...h,keyframes:i,duration:r,type:s,ease:n,times:o,isGenerator:!0}),c=B(this.time);e.setWithVelocity(u.sample(c-10).value,u.sample(c).value,10)}let{onStop:a}=this.options;a&&a(),this.cancel()}complete(){let{resolved:e}=this;e&&e.animation.finish()}cancel(){let{resolved:e}=this;e&&e.animation.cancel()}static supports(e){let{motionValue:t,name:i,repeatDelay:r,repeatType:s,damping:n,type:o}=e;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;let{onUpdate:a,transformTemplate:l}=t.owner.getProps();return ir()&&i&&ii.has(i)&&!a&&!l&&!r&&"mirror"!==s&&0!==n&&"inertia"!==o}}let ia={type:"spring",stiffness:500,damping:25,restSpeed:10},il=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),ih={type:"keyframes",duration:.8},iu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ic=(e,{keyframes:t})=>t.length>2?ih:q.has(e)?e.startsWith("scale")?il(t[1]):ia:iu,id=(e,t,i,r={},s,n)=>o=>{let a=y(r,e)||{},l=a.delay||r.delay||0,{elapsed:h=0}=r;h-=B(l);let u={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-h,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:n?void 0:s};!function({when:e,delay:t,delayChildren:i,staggerChildren:r,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length}(a)&&(u={...u,...ic(e,u)}),u.duration&&(u.duration=B(u.duration)),u.repeatDelay&&(u.repeatDelay=B(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if(!1!==u.type&&(0!==u.duration||u.repeatDelay)||(u.duration=0,0!==u.delay||(c=!0)),(ef.current||H.skipAnimations)&&(c=!0,u.duration=0,u.delay=0),c&&!n&&void 0!==t.get()){let e=tA(u.keyframes,a);if(void 0!==e)return Y.update(()=>{u.onUpdate(e),u.onComplete()}),new g([])}return!n&&io.supports(u)?new io(u):new it(u)};function ip(e,t,{delay:i=0,transitionOverride:r,type:s}={}){var n;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);let h=[],c=s&&e.animationState&&e.animationState.getState()[s];for(let t in l){let r=e.getValue(t,null!==(n=e.latestValues[t])&&void 0!==n?n:null),s=l[t];if(void 0===s||c&&function({protectedKeys:e,needsAnimating:t},i){let r=e.hasOwnProperty(i)&&!0!==t[i];return t[i]=!1,r}(c,t))continue;let a={delay:i,...y(o||{},t)},u=!1;if(window.MotionHandoffAnimation){let i=e.props[ed];if(i){let e=window.MotionHandoffAnimation(i,t,Y);null!==e&&(a.startTime=e,u=!0)}}eu(e,t),r.start(id(t,r,s,e.shouldReduceMotion&&z.has(t)?{type:!1}:a,e,u));let d=r.animation;d&&h.push(d)}return a&&Promise.all(h).then(()=>{Y.update(()=>{a&&function(e,t){let{transitionEnd:i={},transition:r={},...s}=u(e,t)||{};for(let t in s={...s,...i}){let i=K(s[t]);e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,el(i))}}(e,a)})}),h}function im(e,t,i={}){var r;let s=u(e,t,"exit"===i.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(n=i.transitionOverride);let o=s?()=>Promise.all(ip(e,s,i)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:s=0,staggerChildren:o,staggerDirection:a}=n;return function(e,t,i=0,r=0,s=1,n){let o=[],a=(e.variantChildren.size-1)*r,l=1===s?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(ig).forEach((e,r)=>{e.notify("AnimationStart",t),o.push(im(e,t,{...n,delay:i+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(o)}(e,t,s+r,o,a,i)}:()=>Promise.resolve(),{when:l}=n;if(!l)return Promise.all([o(),a(i.delay)]);{let[e,t]="beforeChildren"===l?[o,a]:[a,o];return e().then(()=>t())}}function ig(e,t){return e.sortNodePosition(t)}let iy=d.length,iv=[...c].reverse(),iw=c.length;function ib(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function i_(){return{animate:ib(!0),whileInView:ib(),whileHover:ib(),whileTap:ib(),whileDrag:ib(),whileFocus:ib(),exit:ib()}}class iT{constructor(e){this.isMounted=!1,this.node=e}update(){}}class ik extends iT{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:i})=>(function(e,t,i={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t))r=Promise.all(t.map(t=>im(e,t,i)));else if("string"==typeof t)r=im(e,t,i);else{let s="function"==typeof t?u(e,t,i.custom):t;r=Promise.all(ip(e,s,i))}return r.then(()=>
6{e.notify("AnimationComplete",t)})})(e,t,i))),i=i_(),r=!0,l=t=>(i,r)=>{var s;let n=u(e,r,"exit"===t?null===(s=e.presenceContext)||void 0===s?void 0:s.custom:void 0);if(n){let{transition:e,transitionEnd:t,...r}=n;i={...i,...r,...t}}return i};function h(h){let{props:u}=e,c=function e(t){if(!t)return;if(!t.isControllingVariants){let i=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(i.initial=t.props.initial),i}let i={};for(let e=0;e<iy;e++){let r=d[e],s=t.props[r];(a(s)||!1===s)&&(i[r]=s)}return i}(e.parent)||{},f=[],p=new Set,m={},g=1/0;for(let t=0;t<iw;t++){var y,v;let d=iv[t],w=i[d],b=void 0!==u[d]?u[d]:c[d],_=a(b),T=d===h?w.isActive:null;!1===T&&(g=t);let k=b===c[d]&&b!==u[d]&&_;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),w.protectedKeys={...m},!w.isActive&&null===T||!b&&!w.prevProp||s(b)||"boolean"==typeof b)continue;let x=(y=w.prevProp,"string"==typeof(v=b)?v!==y:!!Array.isArray(v)&&!o(v,y)),S=x||d===h&&w.isActive&&!k&&_||t>g&&_,P=!1,E=Array.isArray(b)?b:[b],A=E.reduce(l(d),{});!1===T&&(A={});let{prevResolvedValues:j={}}=w,C={...j,...A},R=t=>{S=!0,p.has(t)&&(P=!0,p.delete(t)),w.needsAnimating[t]=!0;let i=e.getValue(t);i&&(i.liveStyle=!1)};for(let e in C){let t=A[e],i=j[e];if(m.hasOwnProperty(e))continue;let r=!1;(n(t)&&n(i)?o(t,i):t===i)?void 0!==t&&p.has(e)?R(e):w.protectedKeys[e]=!0:null!=t?R(e):p.add(e)}w.prevProp=b,w.prevResolvedValues=A,w.isActive&&(m={...m,...A}),r&&e.blockInitialAnimation&&(S=!1);let O=!(k&&x)||P;S&&O&&f.push(...E.map(e=>({animation:e,options:{type:d}})))}if(p.size){let t={};p.forEach(i=>{let r=e.getBaseTarget(i),s=e.getValue(i);s&&(s.liveStyle=!0),t[i]=null!=r?r:null}),f.push({animation:t})}let w=!!f.length;return r&&(!1===u.initial||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}return{animateChanges:h,setActive:function(t,r){var s;if(i[t].isActive===r)return Promise.resolve();null===(s=e.variantChildren)||void 0===s||s.forEach(e=>{var i;return null===(i=e.animationState)||void 0===i?void 0:i.setActive(t,r)}),i[t].isActive=r;let n=h(t);for(let e in i)i[e].protectedKeys={};return n},setAnimateFunction:function(i){t=i(e)},getState:()=>i,reset:()=>{i=i_(),r=!0}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();s(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}let ix=0;class iS extends iT{constructor(){super(...arguments),this.id=ix++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;let r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}function iP(e,t,i,r={passive:!0}){return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i)}function iE(e){return{point:{x:e.pageX,y:e.pageY}}}let iA=e=>t=>O(t)&&e(t,iE(t));function ij(e,t,i,r){return iP(e,t,iA(i),r)}let iC=(e,t)=>Math.abs(e-t);class iR{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=iM(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,i=function(e,t){return Math.sqrt(iC(e.x,t.x)**2+iC(e.y,t.y)**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!i)return;let{point:r}=e,{timestamp:s}=Z;this.history.push({...r,timestamp:s});let{onStart:n,onMove:o}=this.handlers;t||(n&&n(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=iO(t,this.transformPagePoint),Y.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:i,onSessionEnd:r,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let n=iM("pointercancel"===e.type?this.lastMoveEventInfo:iO(t,this.transformPagePoint),this.history);this.startEvent&&i&&i(e,n),r&&r(e,n)},!O(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;let n=iO(iE(e),this.transformPagePoint),{point:o}=n,{timestamp:a}=Z;this.history=[{...o,timestamp:a}];let{onSessionStart:l}=t;l&&l(e,iM(n,this.history)),this.removeListeners=tB(ij(this.contextWindow,"pointermove",this.handlePointerMove),ij(this.contextWindow,"pointerup",this.handlePointerUp),ij(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),X(this.updatePoint)}}function iO(e,t){return t?{point:t(e.point)}:e}function iL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function iM({point:e},t){return{point:e,delta:iL(e,i$(t)),offset:iL(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,r=null,s=i$(e);for(;i>=0&&(r=e[i],!(s.timestamp-r.timestamp>B(.1)));)i--;if(!r)return{x:0,y:0};let n=V(s.timestamp-r.timestamp);if(0===n)return{x:0,y:0};let o={x:(s.x-r.x)/n,y:(s.y-r.y)/n};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(t,.1)}}function i$(e){return e[e.length-1]}function iI(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function iD(e){return e.max-e.min}function iU(e,t,i,r=.5){e.origin=r,e.originPoint=tC(t.min,t.max,e.origin),e.scale=iD(i)/iD(t),e.translate=tC(i.min,i.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function iB(e,t,i,r){iU(e.x,t.x,i.x,r?r.originX:void 0),iU(e.y,t.y,i.y,r?r.originY:void 0)}function iV(e,t,i){e.min=i.min+t.min,e.max=e.min+iD(t)}function iF(e,t,i){e.min=t.min-i.min,e.max=e.min+iD(t)}
6function iN(e,t,i){iF(e.x,t.x,i.x),iF(e.y,t.y,i.y)}function iq(e,t,i){return{min:void 0!==t?e.min+t:void 0,max:void 0!==i?e.max+i-(e.max-e.min):void 0}}function iz(e,t){let i=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([i,r]=[r,i]),{min:i,max:r}}function iW(e,t,i){return{min:iK(e,t),max:iK(e,i)}}function iK(e,t){return"number"==typeof e?e:e[t]||0}let iH=()=>({translate:0,scale:1,origin:0,originPoint:0}),iJ=()=>({x:iH(),y:iH()}),iG=()=>({min:0,max:0}),iY=()=>({x:iG(),y:iG()});function iX(e){return[e("x"),e("y")]}function iZ({top:e,left:t,right:i,bottom:r}){return{x:{min:t,max:i},y:{min:e,max:r}}}function iQ(e){return void 0===e||1===e}function i0({scale:e,scaleX:t,scaleY:i}){return!iQ(e)||!iQ(t)||!iQ(i)}function i1(e){return i0(e)||i2(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function i2(e){var t,i;return(t=e.x)&&"0%"!==t||(i=e.y)&&"0%"!==i}function i5(e,t,i,r,s){return void 0!==s&&(e=r+s*(e-r)),r+i*(e-r)+t}function i8(e,t=0,i=1,r,s){e.min=i5(e.min,t,i,r,s),e.max=i5(e.max,t,i,r,s)}function i6(e,{x:t,y:i}){i8(e.x,t.translate,t.scale,t.originPoint),i8(e.y,i.translate,i.scale,i.originPoint)}function i3(e,t){e.min=e.min+t,e.max=e.max+t}function i4(e,t,i,r,s=.5){let n=tC(e.min,e.max,s);i8(e,t,i,n,r)}function i9(e,t){i4(e.x,t.x,t.scaleX,t.scale,t.originX),i4(e.y,t.y,t.scaleY,t.scale,t.originY)}function i7(e,t){return iZ(function(e,t){if(!t)return e;let i=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}let re=({current:e})=>e?e.ownerDocument.defaultView:null,rt=new WeakMap;class ri{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=iY(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let{dragSnapToOrigin:r}=this.getProps();this.panSession=new iR(e,{onSessionStart:e=>{let{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(iE(e).point)},onStart:(e,t)=>{let{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();if(i&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(A[e])return null;else return A[e]=!0,()=>{A[e]=!1};return A.x||A.y?null:(A.x=A.y=!0,()=>{A.x=A.y=!1})}(i),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iX(e=>{let t=this.getAxisMotionValue(e).get()||0;if(eF.test(t)){let{projection:i}=this.visualElement;if(i&&i.layout){let r=i.layout.layoutBox[e];r&&(t=iD(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),s&&Y.postRender(()=>s(e,t)),eu(this.visualElement,"transform");let{animationState:n}=this.visualElement;n&&n.setActive("whileDrag",!0)},onMove:(e,t)=>{let{dragPropagation:i,dragDirectionLock:r,onDirectionLock:s,onDrag:n}=this.getProps();if(!i&&!this.openDragLock)return;let{offset:o}=t;if(r&&null===this.currentDirection){this.currentDirection=function(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}(o),null!==this.currentDirection&&s&&s(this.currentDirection);return}this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),n&&n(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>iX(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:re(this.visualElement)})}stop(e,t){let i=this.isDragging;if(this.cancel(),!i)return;let{velocity:r}=t;this.startAnimation(r);let{onDragEnd:s}=this.getProps();s&&Y.postRender(()=>s(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){let{drag:r}=this.getProps();if(!i||!rr(e,r,this.currentDirection))return;let s=this.getAxisMotionValue(e),n=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(n=function(e,{min:t,max:i},r){return void 0!==t&&e<t?e=r?tC(t,e,r.min):Math.max(e,t):void 0!==i&&e>i&&(e=r?tC(i,e,r.max):Math.min(e,i)),e}(n,this.constraints[e],this.elastic[e])),s.set(n)}resolveConstraints(){var e;let{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,s=this.constraints;t&&iI(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=function(e,{top:t,left:i,bottom:r,right:s}){return{x:iq(e.x,i,s),y:iq(e.y,t,r)}}(r.layoutBox,t):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:iW(e,"left","right"),y:iW(e,"top","bottom")}}(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&iX(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let i={};return void 0!==t.min&&(i.min=t.min-e.min),void 0!==t.max&&(i.max=t.max-e.min),i}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!iI(t))return!1;let r=t.current;F(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:s}=this.visualElement;if(!s||!s.layout)return!1;let n=function(e,t,i){let r=i7(e,i),{scroll:s}=t;return s&&(i3(r.x,s.offset.x),i3(r.y,s.offset.y)),r}(r,s.root,this.visualElement.getTransformPagePoint()),o={x:iz((e=s.layout.layoutBox).x,n.x),y:iz(e.y,n.y)};if(i){let e=i(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=iZ(e))}return o}startAnimation(e){let{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(iX(o=>
6{if(!rr(o,t,this.currentDirection))return;let l=a&&a[o]||{};n&&(l={min:0,max:0});let h={type:"inertia",velocity:i?e[o]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(o,h)})).then(o)}startAxisValueAnimation(e,t){let i=this.getAxisMotionValue(e);return eu(this.visualElement,e),i.start(id(e,i,0,t,this.visualElement,!1))}stopAnimation(){iX(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){iX(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps();return i[t]||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){iX(t=>{let{drag:i}=this.getProps();if(!rr(t,i,this.currentDirection))return;let{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){let{min:i,max:n}=r.layout.layoutBox[t];s.set(e[t]-tC(i,n,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!iI(t)||!i||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};iX(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){let i=t.get();r[e]=function(e,t){let i=.5,r=iD(e),s=iD(t);return s>r?i=x(t.min,t.max-r,e.min):r>s&&(i=x(e.min,e.max-s,t.min)),eP(0,1,i)}({min:i,max:i},this.constraints[e])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),iX(t=>{if(!rr(t,e,null))return;let i=this.getAxisMotionValue(t),{min:s,max:n}=this.constraints[t];i.set(tC(s,n,r[t]))})}addListeners(){if(!this.visualElement.current)return;rt.set(this.visualElement,this);let e=ij(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:i=!0}=this.getProps();t&&i&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();iI(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",t);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Y.read(t);let s=iP(window,"resize",()=>this.scalePositionWithinConstraints()),n=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(iX(t=>{let i=this.getAxisMotionValue(t);i&&(this.originPoint[t]+=e[t].translate,i.set(i.get()+e[t].translate))}),this.visualElement.render())});return()=>{s(),e(),r(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:n=.35,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:n,dragMomentum:o}}}function rr(e,t,i){return(!0===t||t===e)&&(null===i||i===e)}class rs extends iT{constructor(e){super(e),this.removeGroupControls=F,this.removeListeners=F,this.controls=new ri(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||F}unmount(){this.removeGroupControls(),this.removeListeners()}}let rn=e=>(t,i)=>{e&&Y.postRender(()=>e(t,i))};class ro extends iT{constructor(){super(...arguments),this.removePointerDownListener=F}onPointerDown(e){this.session=new iR(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:re(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:rn(e),onStart:rn(t),onMove:i,onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ij(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}var ra,rl,rh=i(5155),ru=i(2115),rc=i(2082),rd=i(869);let rf=(0,ru.createContext)({}),rp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function rm(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let rg={correct:(e,t)=>
6{if(!t.target)return e;if("string"==typeof e)if(!eN.test(e))return e;else e=parseFloat(e);let i=rm(e,t.target.x),r=rm(e,t.target.y);return`${i}% ${r}%`}},ry={},{schedule:rv,cancel:rw}=G(queueMicrotask,!1);class rb extends ru.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;Object.assign(ry,rT),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),rp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,n=i.projection;return n&&(n.isPresent=s,r||e.layoutDependency!==t||void 0===t?n.willUpdate():this.safeToRemove(),e.isPresent===s||(s?n.promote():n.relegate()||Y.postRender(()=>{let e=n.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),rv.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function r_(e){let[t,i]=(0,rc.xQ)(),r=(0,ru.useContext)(rd.L);return(0,rh.jsx)(rb,{...e,layoutGroup:r,switchLayoutGroup:(0,ru.useContext)(rf),isPresent:t,safeToRemove:i})}let rT={borderRadius:{...rg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rg,borderTopRightRadius:rg,borderBottomLeftRadius:rg,borderBottomRightRadius:rg,boxShadow:{correct:(e,{treeScale:t,projectionDelta:i})=>{let r=e2.parse(e);if(r.length>5)return e;let s=e2.createTransformer(e),n=+("number"!=typeof r[0]),o=i.x.scale*t.x,a=i.y.scale*t.y;r[0+n]/=o,r[1+n]/=a;let l=tC(o,a,.5);return"number"==typeof r[2+n]&&(r[2+n]/=l),"number"==typeof r[3+n]&&(r[3+n]/=l),s(r)}}},rk=(e,t)=>e.depth-t.depth;class rx{constructor(){this.children=[],this.isDirty=!1}add(e){ei(this.children,e),this.isDirty=!0}remove(e){er(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rk),this.isDirty=!1,this.children.forEach(e)}}function rS(e){let t=eh(e)?e.get():e;return W(t)?t.toValue():t}let rP=["TopLeft","TopRight","BottomLeft","BottomRight"],rE=rP.length,rA=e=>"string"==typeof e?parseFloat(e):e,rj=e=>"number"==typeof e||eN.test(e);function rC(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let rR=rL(0,.5,ek),rO=rL(.5,.95,F);function rL(e,t,i){return r=>r<e?0:r>t?1:i(x(e,t,r))}function rM(e,t){e.min=t.min,e.max=t.max}function r$(e,t){rM(e.x,t.x),rM(e.y,t.y)}function rI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function rD(e,t,i,r,s){return e-=t,e=r+1/i*(e-r),void 0!==s&&(e=r+1/s*(e-r)),e}function rU(e,t,[i,r,s],n,o){!function(e,t=0,i=1,r=.5,s,n=e,o=e){if(eF.test(t)&&(t=parseFloat(t),t=tC(o.min,o.max,t/100)-o.min),"number"!=typeof t)return;let a=tC(n.min,n.max,r);e===n&&(a-=t),e.min=rD(e.min,t,i,a,s),e.max=rD(e.max,t,i,a,s)}(e,t[i],t[r],t[s],t.scale,n,o)}let rB=["x","scaleX","originX"],rV=["y","scaleY","originY"];function rF(e,t,i,r){rU(e.x,t,rB,i?i.x:void 0,r?r.x:void 0),rU(e.y,t,rV,i?i.y:void 0,r?r.y:void 0)}function rN(e){return 0===e.translate&&1===e.scale}function rq(e){return rN(e.x)&&rN(e.y)}function rz(e,t){return e.min===t.min&&e.max===t.max}function rW(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function rK(e,t){return rW(e.x,t.x)&&rW(e.y,t.y)}function rH(e){return iD(e.x)/iD(e.y)}function rJ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class rG{constructor(){this.members=[]}add(e){ei(this.members,e),e.scheduleRender()}remove(e){if(er(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,i=this.members.findIndex(t=>e===t);if(0===i)return!1;for(let e=i;e>=0;e--){let i=this.members[e];if(!1!==i.isPresent){t=i;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;!1===r&&i.hide()}}
6exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let rY={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},rX="undefined"!=typeof window&&void 0!==window.MotionDebug,rZ=["","X","Y","Z"],rQ={visibility:"hidden"},r0=0;function r1(e,t,i,r){let{latestValues:s}=t;s[e]&&(i[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function r2({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(e={},i=null==t?void 0:t()){this.id=r0++,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.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,rX&&(rY.totalNodes=rY.resolvedTargetDeltas=rY.recalculatedProjection=0),this.nodes.forEach(r6),this.nodes.forEach(si),this.nodes.forEach(sr),this.nodes.forEach(r3),rX&&window.MotionDebug.record(rY)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new rx)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new es),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let i=this.eventHandlers.get(e);i&&i.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=t instanceof SVGElement&&"svg"!==t.tagName,this.instance=t;let{layoutId:r,layout:s,visualElement:n}=this.options;if(n&&!n.current&&n.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(s||r)&&(this.isLayoutDirty=!0),e){let i,r=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(e,t){let i=et.now(),r=({timestamp:s})=>{let n=s-i;n>=250&&(X(r),e(n-t))};return Y.read(r,!0),()=>X(r)}(r,250),rp.hasAnimatedSinceResize&&(rp.hasAnimatedSinceResize=!1,this.nodes.forEach(st))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&n&&(r||s)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:i,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let s=this.options.transition||n.getDefaultTransition()||sh,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!rK(this.targetLayout,r)||i,h=!t&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,h);let t={...y(s,"layout"),onPlay:o,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||st(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,X(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.forEac
6h(ss),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:i}=t.options;if(!i)return;let r=i.props[ed];if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",Y,!(e||i))}let{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&e(s)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:i}=this.options;if(void 0===t&&!i)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(r9);return}this.isUpdating||this.nodes.forEach(r7),this.isUpdating=!1,this.nodes.forEach(se),this.nodes.forEach(r5),this.nodes.forEach(r8),this.clearAllSnapshots();let e=et.now();Z.delta=eP(0,1e3/60,e-Z.timestamp),Z.timestamp=e,Z.isProcessing=!0,Q.update.process(Z),Q.preRender.process(Z),Q.render.process(Z),Z.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(r4),this.sharedNodes.forEach(sn)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Y.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Y.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 e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=iY(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!s)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!rq(this.projectionDelta),i=this.getTransformTemplate(),r=i?i(this.latestValues,""):void 0,n=r!==this.prevTransformTemplateValue;e&&(t||i1(this.latestValues)||n)&&(s(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let i=this.measurePageBox(),r=this.removeElementScroll(i);return e&&(r=this.removeTransform(r)),sd((t=r).x),sd(t.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var e;let{visualElement:t}=this.options;if(!t)return iY();let i=t.measureViewportBox();if(!((null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)||this.path.some(sp))){let{scroll:e}=this.root;e&&(i3(i.x,e.offset.x),i3(i.y,e.offset.y))}return i}removeElementScroll(e){var t;let i=iY();if(r$(i,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return i;for(let t=0;t<this.path.length;t++){let r=this.path[t],{scroll:s,options:n}=r;r!==this.root&&s&&n.layoutScroll&&(s.wasRoot&&r$(i,e),i3(i.x,s.offset.x),i3(i.y,s.offset.y))}return i}applyTransform(e,t=!1){let i=iY();r$(i,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&i9(i,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),i1(r.latestValues)&&i9(i,r.latestValues)}return i1(this.latestValues)&&i9(i,this.latestValues),i}removeTransform(e){let t=iY();r$(t,e);for(let e=0;e<this.path.length;e++){let i=this.path[e];if(!i.instance||!i1(i.latestValues))continue;i0(i.latestValues)&&i.updateSnapshot();let r=iY();r$(r,i.measurePageBox()),rF(t,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,r)}return i1(this.latestValues)&&rF(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Z.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t,i,r,s;let n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isS
6haredProjectionDirty);let o=!!this.resumingFrom||this!==n;if(!(e||o&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:a,layoutId:l}=this.options;if(this.layout&&(a||l)){if(this.resolvedRelativeTargetAt=Z.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=iY(),this.relativeTargetOrigin=iY(),iN(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),r$(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if((this.target||(this.target=iY(),this.targetWithTransforms=iY()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target)?(this.forceRelativeParentToResolveTarget(),i=this.target,r=this.relativeTarget,s=this.relativeParent.target,iV(i.x,r.x,s.x),iV(i.y,r.y,s.y)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):r$(this.target,this.layout.layoutBox),i6(this.target,this.targetDelta)):r$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=iY(),this.relativeTargetOrigin=iY(),iN(this.relativeTargetOrigin,this.target,e.target),r$(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}rX&&rY.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||i0(this.parent.latestValues)||i2(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;let t=this.getLead(),i=!!this.resumingFrom||this!==t,r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===Z.timestamp&&(r=!1),r)return;let{layout:s,layoutId:n}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(s||n))return;r$(this.layoutCorrected,this.layout.layoutBox);let o=this.treeScale.x,a=this.treeScale.y;!function(e,t,i,r=!1){let s,n,o=i.length;if(o){t.x=t.y=1;for(let a=0;a<o;a++){n=(s=i[a]).projectionDelta;let{visualElement:o}=s.options;(!o||!o.props.style||"contents"!==o.props.style.display)&&(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&i9(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),n&&(t.x*=n.x.scale,t.y*=n.y.scale,i6(e,n)),r&&i1(s.latestValues)&&i9(e,s.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,i),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=iY());let{target:l}=t;if(!l){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(rI(this.prevProjectionDelta.x,this.projectionDelta.x),rI(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),iB(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===o&&this.treeScale.y===a&&rJ(this.projectionDelta.x,this.prevProjectionDelta.x)&&rJ(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),rX&&rY.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=iJ(),this.projectionDelta=iJ(),this.projectionDeltaWithTransform=iJ()}setAnimationOrigin(e,t=!1){let i,r=this.snapshot,s=r?r.latestValues:{},n={...this.latestValues},o=iJ();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let a=iY(),l=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(sl));this.animationProgress=0,this.mixTargetDelta=t=>{let r=t/1e3;if(so(o.x,e.x,r),so(o.y,e.y,r),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var h,d,f,p,m,g;if(iN(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,p=this.relativeTargetOrigin,m=a,g=r,sa(f.x,p.x,m.x,g),sa(f.y,p.y,m.y,g),i&&(h=this.relativeTarget,d=i,rz(h.x,d.x)&&rz(h.y,d.y)))this.isProjectionDirty=!1;i||(i=iY()),r$(i,this.relativeTarget)}l&&(this.animationValues=n,function(e,t,i,r,s,n){s?(e.opacity=tC(0,void 0!==i.opacity?i.opacity:1,rR(r)),e.opacityExit=tC(void 0!==t.opacity?t.opacity:1,0,rO(r))):n&&(e.opacity=tC(void 0!==t.opacity?t.opacity:1,void 0!==i.opacity?i.opacity:1,r));for(let s=0;s<rE;s++){let n=`border${rP[s]}
6Radius`,o=rC(t,n),a=rC(i,n);(void 0!==o||void 0!==a)&&(o||(o=0),a||(a=0),0===o||0===a||rj(o)===rj(a)?(e[n]=Math.max(tC(rA(o),rA(a),r),0),(eF.test(a)||eF.test(o))&&(e[n]+="%")):e[n]=a)}(t.rotate||i.rotate)&&(e.rotate=tC(t.rotate||0,i.rotate||0,r))}(n,s,this.latestValues,r,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(X(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Y.update(()=>{rp.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,i){let r=eh(0)?0:el(e);return r.start(id("",r,1e3,i)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.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);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:i,layout:r,latestValues:s}=e;if(t&&i&&r){if(this!==e&&this.layout&&r&&sf(this.options.animationType,this.layout.layoutBox,r.layoutBox)){i=this.target||iY();let t=iD(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let r=iD(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+r}r$(t,i),i9(t,s),iB(this.projectionDeltaWithTransform,this.layoutCorrected,t,s)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new rG),this.sharedNodes.get(e).add(t);let i=t.options.initialPromotionConfig;t.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){var e;let{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;let{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:i}={}){let r=this.getStack();r&&r.promote(this,i),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:i}=e;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(t=!0),!t)return;let r={};i.z&&r1("z",e,r,this.animationValues);for(let t=0;t<rZ.length;t++)r1(`rotate${rZ[t]}`,e,r,this.animationValues),r1(`skew${rZ[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){var t,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return rQ;let r={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=rS(null==e?void 0:e.pointerEvents)||"",r.transform=s?s(this.latestValues,""):"none",r;let n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){let t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=rS(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!i1(this.latestValues)&&(t.transform=s?s({},""):"none",this.hasProjected=!1),t}let o=n.animationValues||n.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,i){let r="",s=e.x.translate/t.x,n=e.y.translate/t.y,o=(null==i?void 0:i.z)||0;if((s||n||o)&&(r=`translate3d(${s}px, ${n}px, ${o}px) `),(1!==t.x||1!==t.y)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),i){let{transformPerspective:e,rotate:t,rotateX:s,rotateY:n,skewX:o,skewY:a}=i;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),s&&(r+=`rotateX(${s}deg) `),n&&(r+=`rotateY(${n}deg) `),o&&(r+=`skewX(${o}deg) `),a&&(r+=`skewY(${a}deg) `)}let a=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==a||1!==l)&&(r+=`scale(${a}, ${l}
6)`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,o),s&&(r.transform=s(o,r.transform));let{x:a,y:l}=this.projectionDelta;for(let e in r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,n.animationValues?r.opacity=n===this?null!==(i=null!==(t=o.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:r.opacity=n===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0,ry){if(void 0===o[e])continue;let{correct:t,applyTo:i}=ry[e],s="none"===r.transform?o[e]:t(o[e],n);if(i){let e=i.length;for(let t=0;t<e;t++)r[i[t]]=s}else r[e]=s}return this.options.layoutId&&(r.pointerEvents=n===this?rS(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(r9),this.root.sharedNodes.clear()}}}function r5(e){e.updateLayout()}function r8(e){var t;let i=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){let{layoutBox:t,measuredBox:r}=e.layout,{animationType:s}=e.options,n=i.source!==e.layout.source;"size"===s?iX(e=>{let r=n?i.measuredBox[e]:i.layoutBox[e],s=iD(r);r.min=t[e].min,r.max=r.min+s}):sf(s,i.layoutBox,t)&&iX(r=>{let s=n?i.measuredBox[r]:i.layoutBox[r],o=iD(t[r]);s.max=s.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=iJ();iB(o,t,i.layoutBox);let a=iJ();n?iB(a,e.applyTransform(r,!0),i.measuredBox):iB(a,t,i.layoutBox);let l=!rq(o),h=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:s,layout:n}=r;if(s&&n){let o=iY();iN(o,i.layoutBox,s.layoutBox);let a=iY();iN(a,t,n.layoutBox),rK(o,a)||(h=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:i,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function r6(e){rX&&rY.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 r3(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function r4(e){e.clearSnapshot()}function r9(e){e.clearMeasurements()}function r7(e){e.isLayoutDirty=!1}function se(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function st(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function si(e){e.resolveTargetDelta()}function sr(e){e.calcProjection()}function ss(e){e.resetSkewAndRotation()}function sn(e){e.removeLeadSnapshot()}function so(e,t,i){e.translate=tC(t.translate,0,i),e.scale=tC(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function sa(e,t,i,r){e.min=tC(t.min,i.min,r),e.max=tC(t.max,i.max,r)}function sl(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let sh={duration:.45,ease:[.4,0,.1,1]},su=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sc=su("applewebkit/")&&!su("chrome/")?Math.round:F;function sd(e){e.min=sc(e.min),e.max=sc(e.max)}function sf(e,t,i){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(rH(t)-rH(i)))}function sp(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}let sm=r2({attachResizeListener:(e,t)=>iP(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),sg={current:void 0},sy=r2({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sg.current){let e=new sm({});e.mount(window),e.setOptions({layoutScroll:!0}),sg.current=e}return sg.current},resetTransform:(e,t)=>
6{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function sv(e,t,i){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===i);let s=r["onHover"+i];s&&Y.postRender(()=>s(t,iE(t)))}class sw extends iT{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,i={}){let[r,s,n]=j(e,i),o=C(e=>{let{target:i}=e,r=t(e);if("function"!=typeof r||!i)return;let n=C(e=>{r(e),i.removeEventListener("pointerleave",n)});i.addEventListener("pointerleave",n,s)});return r.forEach(e=>{e.addEventListener("pointerenter",o,s)}),n}(e,e=>(sv(this.node,e,"Start"),e=>sv(this.node,e,"End"))))}unmount(){}}class sb extends iT{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tB(iP(this.node.current,"focus",()=>this.onFocus()),iP(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function s_(e,t,i){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===i);let s=r["onTap"+("End"===i?"":i)];s&&Y.postRender(()=>s(t,iE(t)))}class sT extends iT{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,i={}){let[r,s,n]=j(e,i),o=e=>{let r=e.currentTarget;if(!U(e)||M.has(r))return;M.add(r);let n=t(e),o=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),U(e)&&M.has(r)&&(M.delete(r),"function"==typeof n&&n(e,{success:t}))},a=e=>{o(e,i.useGlobalTarget||R(r,e.target))},l=e=>{o(e,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return r.forEach(e=>{!L.has(e.tagName)&&-1===e.tabIndex&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(i.useGlobalTarget?window:e).addEventListener("pointerdown",o,s),e.addEventListener("focus",e=>D(e,s),s)}),n}(e,e=>(s_(this.node,e,"Start"),(e,{success:t})=>s_(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}let sk=new WeakMap,sx=new WeakMap,sS=e=>{let t=sk.get(e.target);t&&t(e)},sP=e=>{e.forEach(sS)},sE={some:0,all:1};class sA extends iT{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,n={root:t?t.current:void 0,rootMargin:i,threshold:"number"==typeof r?r:sE[r]};return function(e,t,i){let r=function({root:e,...t}){let i=e||document;sx.has(i)||sx.set(i,{});let r=sx.get(i),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(sP,{root:e,...t})),r[s]}(t);return sk.set(e,i),r.observe(e),()=>{sk.delete(e),r.unobserve(e)}}(this.node.current,n,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,s&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:i,onViewportLeave:r}=this.node.getProps(),n=t?i:r;n&&n(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}(e,t))&&this.startObserver()}unmount(){}}let sj=(0,ru.createContext)({strict:!1});var sC=i(1508);let sR=(0,ru.createContext)({});function sO(e){return s(e.animate)||d.some(t=>a(e[t]))}function sL(e){return!!(sO(e)||e.variants)}function sM(e){return Array.isArray(e)?e.join(" "):e}var s$=i(8972);let sI={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"]},sD={};for(let e in sI)sD[e]={isEnabled:t=>sI[e].some(e=>!!t[e])};let sU=Symbol.for("motionComponentSymbol");var sB=i(845),sV=i(7494);let sF=["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 sN(e){if("string"!=typeof e||e.includes("-"));else if(sF.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}var sq=i(2885);let sz=e=>(t,i)=>{let r=(0,ru.useContext)(sR),n=(0,ru.useContext)(sB.t),o=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:i},r,n,o){let a={latestValues:function(e,t,i,r){let n={},o=r(e,{});for(let e in o)n[e]=rS(o[e]);let{initial:a,animate:l}=e,u=sO(e),c=sL(e);t&&c&&!u&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===l&&(l=t.animate));let d=!!i&&!1===i.initial,f=(d=d||!1===a)?l:a;if(f&&"boolean"!=typeof f&&!s(f)){let t=Array.isArray(f)?f:[f];for(let i=0;i<t.length;i++){let r=h(e,t[i]);if(r){let{transitionEnd:e,transition:t,...i}=r;for(let e in i){let t=i[e];if(Array.isArray(t)){let e=d?t.length-1:0;t=t[e]}null!==t&&(n[e]=t)}for(let t in e)n[t]=e[t]}}}return n}(r,n,o,e),renderState:t()};return i&&(a.onMount=e=>i({props:r,current:e,...a}),a.onUpdate=e=>i(e)),a})(e,t,r,n);return i?o():(0,sq.M)(o)},sW=(e,t)=>
6t&&"number"==typeof e?t.transform(e):e,sK={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sH=N.length;function sJ(e,t,i){let{style:r,vars:s,transformOrigin:n}=e,o=!1,a=!1;for(let e in t){let i=t[e];if(q.has(e)){o=!0;continue}if(ty(e)){s[e]=i;continue}{let t=sW(i,e9[e]);e.startsWith("origin")?(a=!0,n[e]=t):r[e]=t}}if(!t.transform&&(o||i?r.transform=function(e,t,i){let r="",s=!0;for(let n=0;n<sH;n++){let o=N[n],a=e[o];if(void 0===a)continue;let l=!0;if(!(l="number"==typeof a?a===+!!o.startsWith("scale"):0===parseFloat(a))||i){let e=sW(a,e9[o]);if(!l){s=!1;let t=sK[o]||o;r+=`${t}(${e}) `}i&&(t[o]=e)}}return r=r.trim(),i?r=i(t,s?"":r):s&&(r="none"),r}(t,e.transform,i):r.transform&&(r.transform="none")),a){let{originX:e="50%",originY:t="50%",originZ:i=0}=n;r.transformOrigin=`${e} ${t} ${i}`}}let sG={offset:"stroke-dashoffset",array:"stroke-dasharray"},sY={offset:"strokeDashoffset",array:"strokeDasharray"};function sX(e,t,i){return"string"==typeof e?e:eN.transform(t+i*e)}function sZ(e,{attrX:t,attrY:i,attrScale:r,originX:s,originY:n,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...h},u,c){if(sJ(e,h,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f,dimensions:p}=e;d.transform&&(p&&(f.transform=d.transform),delete d.transform),p&&(void 0!==s||void 0!==n||f.transform)&&(f.transformOrigin=function(e,t,i){let r=sX(t,e.x,e.width),s=sX(i,e.y,e.height);return`${r} ${s}`}(p,void 0!==s?s:.5,void 0!==n?n:.5)),void 0!==t&&(d.x=t),void 0!==i&&(d.y=i),void 0!==r&&(d.scale=r),void 0!==o&&function(e,t,i=1,r=0,s=!0){e.pathLength=1;let n=s?sG:sY;e[n.offset]=eN.transform(-r);let o=eN.transform(t),a=eN.transform(i);e[n.array]=`${o} ${a}`}(d,o,a,l,!1)}let sQ=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),s0=()=>({...sQ(),attrs:{}}),s1=e=>"string"==typeof e&&"svg"===e.toLowerCase();function s2(e,{style:t,vars:i},r,s){for(let n in Object.assign(e.style,t,s&&s.getProjectionStyles(r)),i)e.style.setProperty(n,i[n])}let s5=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 s8(e,t,i,r){for(let i in s2(e,t,void 0,r),t.attrs)e.setAttribute(s5.has(i)?i:ec(i),t.attrs[i])}function s6(e,{layout:t,layoutId:i}){return q.has(e)||e.startsWith("origin")||(t||void 0!==i)&&(!!ry[e]||"opacity"===e)}function s3(e,t,i){var r;let{style:s}=e,n={};for(let o in s)(eh(s[o])||t.style&&eh(t.style[o])||s6(o,e)||(null===(r=null==i?void 0:i.getValue(o))||void 0===r?void 0:r.liveStyle)!==void 0)&&(n[o]=s[o]);return n}function s4(e,t,i){let r=s3(e,t,i);for(let i in e)(eh(e[i])||eh(t[i]))&&(r[-1!==N.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]);return r}let s9=["x","y","width","height","cx","cy","r"],s7={useVisualState:sz({scrapeMotionValuesFromProps:s4,createRenderState:s0,onUpdate:({props:e,prevProps:t,current:i,renderState:r,latestValues:s})=>{if(!i)return;let n=!!e.drag;if(!n){for(let e in s)if(q.has(e)){n=!0;break}}if(!n)return;let o=!t;if(t)for(let i=0;i<s9.length;i++){let r=s9[i];e[r]!==t[r]&&(o=!0)}o&&Y.read(()=>{!function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}(i,r),Y.render(()=>{sZ(r,s,s1(i.tagName),e.transformTemplate),s8(i,r)})})}})},ne={useVisualState:sz({scrapeMotionValuesFromProps:s3,createRenderState:sQ})};function nt(e,t,i){for(let r in t)eh(t[r])||s6(r,i)||(e[r]=t[r])}let ni=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function nr(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ni.has(e)}let ns=e=>!nr(e);try{!function(e){e&&(ns=t=>t.startsWith("on")?!nr(t):e(t))}(require("@emotion/is-prop-valid").default)}catch(e){}let nn={current:null},no={current:!1},na=[...tk,eH,e2],nl=e=>na.find(tT(e)),nh=new WeakMap,nu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class nc{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:n},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tp,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.renderScheduledAt=0,this.scheduleRender=()=>{let e=et.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Y.render(this.render,!1,!0))};let{latestValues:a,renderState:l,onUpdate:h}=n;this.onUpdate=h,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!s,this.isControllingVariants=sO(t),this.isVariantNode=sL(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...c}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in c){let t=c[e];void 0!==a[e]&&eh(t)&&t.set(a[e],!1)}}mount(e){if(this.current=e,nh.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
6h((e,t)=>this.bindToMotionValue(t,e)),!no.current&&(no.current=!0,s$.B))if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>nn.current=e.matches;e.addListener(t),t()}else nn.current=!1;this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||nn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in nh.delete(this.current),this.projection&&this.projection.unmount(),X(this.notifyUpdate),X(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){let i;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let r=q.has(e),s=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Y.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),n=t.on("renderRequest",this.scheduleRender);window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),n(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in sD){let t=sD[e];if(!t)continue;let{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):iY()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<nu.length;t++){let i=nu[t];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let r=e["on"+i];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=function(e,t,i){for(let r in t){let s=t[r],n=i[r];if(eh(s))e.addValue(r,s);else if(eh(n))e.addValue(r,el(s,{owner:e}));else if(n!==s)if(e.hasValue(r)){let t=e.getValue(r);!0===t.liveStyle?t.jump(s):t.hasAnimated||t.set(s)}else{let t=e.getStaticValue(r);e.addValue(r,el(void 0!==t?t:s,{owner:e}))}}for(let r in i)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return void 0===i&&void 0!==t&&(i=el(null===t?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){var i;let r=void 0===this.latestValues[e]&&this.current?null!==(i=this.getBaseTargetFromProps(this.props,e))&&void 0!==i?i:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(tm(r)||eS(r))?r=parseFloat(r):!nl(r)&&e2.test(t)&&(r=tt(e,t)),this.setBaseTarget(e,eh(r)?r.get():r)),eh(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;let i,{initial:r}=this.props;if("string"==typeof r||"object"==typeof r){let s=h(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);s&&(i=s[e])}if(r&&void 0!==i)return i;let s=this.getBaseTargetFromProps(this.props,e);return void 0===s||eh(s)?void 0!==this.initialValues[e]&&void 0===i?void 0:this.baseTarget[e]:s}on(e,t){return this.events[e]||(this.events[e]=new es),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class nd extends nc{constructor(){super(...arguments),this.KeyframeResolver=tS}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;eh(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class nf extends nd{constructor(){super(...arguments),this.type="html",this.renderInstance=s2}readValueFromInstance(e,t){if(q.has(t)){let e=te(t);return e&&e.default||0}{let i=window.getComputedStyle(e),r=(ty(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return i7(e,t)}build(e,t,i){sJ(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return s3(e,t,i)}}class np extends nd{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=iY}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(q.has(t)){let e=te(t);return e&&e.default||0}return t=s5.has(t)?t:ec(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return s4(e,t,i)}build(e,t,i){sZ(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){s8(e,t,i,r)}mount(e){this.isSVGTag=s1(e.tagName),super.mount(e)}}let nm=function(e){if("undefined"==typeof Proxy)return e;let t=new Map;return new Proxy((...t)=>e(...t),{get:(i,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}((ra={animation:{Feature:ik},exit:{Feature:iS},inView:{Feature:sA},tap:{Feature:sT},focus:{Feature:sb},hover:{Feature:sw},pan:{Feature:ro},drag:{Feature:rs,ProjectionNode:sy,MeasureLayout:r_},layout:{ProjectionNode:sy,MeasureLayout:r_}},rl=(e,t)=>
6sN(e)?new np(t):new nf(t,{allowProjection:e!==ru.Fragment}),function(e,{forwardMotionProps:t}={forwardMotionProps:!1}){return function(e){var t,i;let{preloadedFeatures:r,createVisualElement:s,useRender:n,useVisualState:o,Component:l}=e;function h(e,t){var i,r,h;let u,c={...(0,ru.useContext)(sC.Q),...e,layoutId:function(e){let{layoutId:t}=e,i=(0,ru.useContext)(rd.L).id;return i&&void 0!==t?i+"-"+t:t}(e)},{isStatic:d}=c,f=function(e){let{initial:t,animate:i}=function(e,t){if(sO(e)){let{initial:t,animate:i}=e;return{initial:!1===t||a(t)?t:void 0,animate:a(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,(0,ru.useContext)(sR));return(0,ru.useMemo)(()=>({initial:t,animate:i}),[sM(t),sM(i)])}(e),p=o(e,d);if(!d&&s$.B){r=0,h=0,(0,ru.useContext)(sj).strict;let e=function(e){let{drag:t,layout:i}=sD;if(!t&&!i)return{};let r={...t,...i};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==i?void 0:i.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(c);u=e.MeasureLayout,f.visualElement=function(e,t,i,r,s){var n,o;let{visualElement:a}=(0,ru.useContext)(sR),l=(0,ru.useContext)(sj),h=(0,ru.useContext)(sB.t),u=(0,ru.useContext)(sC.Q).reducedMotion,c=(0,ru.useRef)(null);r=r||l.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:a,props:i,presenceContext:h,blockInitialAnimation:!!h&&!1===h.initial,reducedMotionConfig:u}));let d=c.current,f=(0,ru.useContext)(rf);d&&!d.projection&&s&&("html"===d.type||"svg"===d.type)&&function(e,t,i,r){let{layoutId:s,layout:n,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:h}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:s,layout:n,alwaysMeasureLayout:!!o||a&&iI(a),visualElement:e,animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:h})}(c.current,i,s,f);let p=(0,ru.useRef)(!1);(0,ru.useInsertionEffect)(()=>{d&&p.current&&d.update(i,h)});let m=i[ed],g=(0,ru.useRef)(!!m&&!(null===(n=window.MotionHandoffIsComplete)||void 0===n?void 0:n.call(window,m))&&(null===(o=window.MotionHasOptimisedAnimation)||void 0===o?void 0:o.call(window,m)));return(0,sV.E)(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),rv.render(d.render),g.current&&d.animationState&&d.animationState.animateChanges())}),(0,ru.useEffect)(()=>{d&&(!g.current&&d.animationState&&d.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,m)}),g.current=!1))}),d}(l,p,c,s,e.ProjectionNode)}return(0,rh.jsxs)(sR.Provider,{value:f,children:[u&&f.visualElement?(0,rh.jsx)(u,{visualElement:f.visualElement,...c}):null,n(l,e,(i=f.visualElement,(0,ru.useCallback)(e=>{e&&p.onMount&&p.onMount(e),i&&(e?i.mount(e):i.unmount()),t&&("function"==typeof t?t(e):iI(t)&&(t.current=e))},[i])),p,d,f.visualElement)]})}r&&function(e){for(let t in e)sD[t]={...sD[t],...e[t]}}(r),h.displayName="motion.".concat("string"==typeof l?l:"create(".concat(null!==(i=null!==(t=l.displayName)&&void 0!==t?t:l.name)&&void 0!==i?i:"",")"));let u=(0,ru.forwardRef)(h);return u[sU]=l,u}({...sN(e)?s7:ne,preloadedFeatures:ra,useRender:function(e=!1){return(t,i,r,{latestValues:s},n)=>{let o=(sN(t)?function(e,t,i,r){let s=(0,ru.useMemo)(()=>{let i=s0();return sZ(i,t,s1(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){let t={};nt(t,e.style,e),s.style={...t,...s.style}}return s}:function(e,t){let i={},r=function(e,t){let i=e.style||{},r={};return nt(r,i,e),Object.assign(r,function({transformTemplate:e},t){return(0,ru.useMemo)(()=>{let i=sQ();return sJ(i,t,e),Object.assign({},i.vars,i.style)},[t])}(e,t)),r}(e,t);return e.drag&&!1!==e.dragListener&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=r,i})(i,s,n,t),a=function(e,t,i){let r={};for(let s in e)("values"!==s||"object"!=typeof e.values)&&(ns(s)||
6!0===i&&nr(s)||!t&&!nr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}(i,"string"==typeof t,e),l=t!==ru.Fragment?{...a,...o,ref:r}:{},{children:h}=i,u=(0,ru.useMemo)(()=>eh(h)?h.get():h,[h]);return(0,ru.createElement)(t,{...l,children:u})}}(t),createVisualElement:rl,Component:e})}))},2082:(e,t,i)=>{"use strict";i.d(t,{xQ:()=>n});var r=i(2115),s=i(845);function n(e=!0){let t=(0,r.useContext)(s.t);if(null===t)return[!0,null];let{isPresent:i,onExitComplete:o,register:a}=t,l=(0,r.useId)();(0,r.useEffect)(()=>{e&&a(l)},[e]);let h=(0,r.useCallback)(()=>e&&o&&o(l),[l,o,e]);return!i&&o?[!1,h]:[!0]}},2410:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Headers:()=>o,Request:()=>a,Response:()=>l,default:()=>n,fetch:()=>s});var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i.g)return i.g;throw Error("unable to locate global object")}();let s=r.fetch,n=r.fetch.bind(r),o=r.Headers,a=r.Request,l=r.Response},2757:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{formatUrl:function(){return n},formatWithValidation:function(){return a},urlObjectKeys:function(){return o}});let r=i(6966)._(i(8859)),s=/https?|ftp|gopher|file/;function n(e){let{auth:t,hostname:i}=e,n=e.protocol||"",o=e.pathname||"",a=e.hash||"",l=e.query||"",h=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?h=t+e.host:i&&(h=t+(~i.indexOf(":")?"["+i+"]":i),e.port&&(h+=":"+e.port)),l&&"object"==typeof l&&(l=String(r.urlQueryToSearchParams(l)));let u=e.search||l&&"?"+l||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==h?(h="//"+(h||""),o&&"/"!==o[0]&&(o="/"+o)):h||(h=""),a&&"#"!==a[0]&&(a="#"+a),u&&"?"!==u[0]&&(u="?"+u),""+n+h+(o=o.replace(/[?#]/g,encodeURIComponent))+(u=u.replace("#","%23"))+a}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function a(e){return n(e)}},2885:(e,t,i)=>{"use strict";i.d(t,{M:()=>s});var r=i(2115);function s(e){let t=(0,r.useRef)(null);return null===t.current&&(t.current=e()),t.current}},3280:function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=r(i(7156));class n extends s.default{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){let i=Array.from(new Set(t)).map(e=>"string"==typeof e&&RegExp("[,()]").test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${i})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:i,type:r}={}){let s="";"plain"===r?s="pl":"phrase"===r?s="ph":"websearch"===r&&(s="w");let n=void 0===i?"":`(${i})`;return this.url.searchParams.append(e,`${s}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,i){return this.url.searchParams.append(e,`not.${t}.${i}`),this}or(e,{foreignTable:t,referencedTable:i=t}={}){let r=i?`${i}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,i){return this.url.searchParams.append(e,`${t}.${i}`),this}}t.default=n},4134:(e,t,i)=>{"use strict";var r=i(7719),s=i(7610),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>
vendor: 18,930 bytes, line 6
60x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,i){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e){var r=e,s=t;if(("string"!=typeof s||""===s)&&(s="utf8"),!a.isEncoding(s))throw TypeError("Unknown encoding: "+s);var n=0|p(r,s),l=o(n),h=l.write(r,s);return h!==n&&(l=l.slice(0,h)),l}if(ArrayBuffer.isView(e)){var u=e;if(j(u,Uint8Array)){var m=new Uint8Array(u);return d(m.buffer,m.byteOffset,m.byteLength)}return c(u)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return d(e,t,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var g=e.valueOf&&e.valueOf();if(null!=g&&g!==e)return a.from(g,t,i);var y=function(e){if(a.isBuffer(e)){var t=0|f(e.length),i=o(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?o(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(y)return y;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return h(e),o(e<0?0:0|f(e))}function c(e){for(var t=e.length<0?0:0|f(e.length),i=o(t),r=0;r<t;r+=1)i[r]=255&e[r];return i}function d(e,t,i){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),a.prototype),r}function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return E(e).length;default:if(s)return r?-1:P(e).length;t=(""+t).toLowerCase(),s=!0}}function m(e,t,i){var s,n,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var s="",n=t;n<i;++n)s+=C[e[n]];return s}(this,t,i);case"utf8":case"utf-8":return w(this,t,i);case"ascii":return function(e,t,i){var r="";i=Math.min(e.length,i);for(var s=t;s<i;++s)r+=String.fromCharCode(127&e[s]);return r}(this,t,i);case"latin1":case"binary":return function(e,t,i){var r="";i=Math.min(e.length,i);for(var s=t;s<i;++s)r+=String.fromCharCode(e[s]);return r}(this,t,i);case"base64":return s=this,n=t,o=i,0===n&&o===s.length?r.fromByteArray(s):r.fromByteArray(s.slice(n,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var r=e.slice(t,i),s="",n=0;n<r.length-1;n+=2)s+=String.fromCharCode(r[n]+256*r[n+1]);return s}(this,t,i);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function g(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function y(e,t,i,r,s){var n;if(0===e.length)return -1;if("string"==typeof i?(r=i,i=0):i>0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),(n=i*=1)!=n&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length)if(s)return -1;else i=e.length-1;else if(i<0)if(!s)return -1;else i=0;if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:v(e,t,i,r,s);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(s)return Uint8Array.prototype.indexOf.call(e,t,i);else return Uint8Array.prototype.lastIndexOf.call(e,t,i);return v(e,[t],i,r,s)}throw TypeError("val must be string, number or Buffer")}function v(e,t,i,r,s){var n,o=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,i/=2}function h(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var u=-1;for(n=i;n<a;n++)if(h(e,n)===h(t,-1===u?0:n-u)){if(-1===u&&(u=n),n-u+1===l)return u*o}else -1!==u&&(n-=n-u),u=-1}else for(i+l>a&&(i=a-l),n=i;n>=0;n--){for(var c=!0,d=0;d<l;d++)if(h(e,n+d)!==h(t,d)){c=!1;break}if(c)return n}return -1}function w(e,t,i){i=Math.min(e.length,i);for(var r=[],s=t;s<i;){var n,o,a,l,h=e[s],u=null,c=h>239?4:h>223?3:h>191?2:1;if(s+c<=i)switch(c){case 1:h<128&&(u=h);break;case 2:(192&(n=e[s+1]))==128&&(l=(31&h)<<6|63&n)>127&&(u=l);break;case 3:n=e[s+1],o=e[s+2],(192&n)==128&&(192&o)==128&&(l=(15&h)<<12|(63&n)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:n=e[s+1],o=e[s+2],a=e[s+3],(192&n)==128&&(192&o)==128&&(192&a)==128&&(l=(15&h)<<18|(63&n)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),s+=c}var d=r,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var p="",m=0;m<f;)p+=String.fromCharCode.apply(String,d.slice(m,m+=4096));return p}function b(e,t,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>i)throw RangeError("Trying to access beyond buffer length")}function _(e,t,i,r,s,n){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<n)throw RangeError('"value" argument is out of bounds');if(i+r>e.length)throw RangeError("Index out of range")}function T(e,t,i,r,s,n){if(i+r>e.length||i<0)throw RangeError("Index out of range")}function k(e,t,i,r,n){return t*=1,i>>>=0,n||T(e,t,i,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,i,r,23,4),i+4}function x(e,t,i,r,n){return t*=1,i>>>=0,n||T(e,t,i,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,i,r,52,8),i+8}t.hp=a,t.IS=50,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,i){return(h(e),e<=0)?o(e):void 0!==t?"string"==typeof i?o(e).fill(t,i):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return u(e)},a.allocUnsafeSlow=function(e){return u(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),j(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,r=t.length,s=0,n=Math.min(i,r);s<n;++s)if(e[s]!==t[s]){i=e[s],r=t[s];break}return i<r?-1:+(r<i)},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(i=0,t=0;i<e.length;++i)t+=e[i].length;var i,r=a.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var n=e[i];if(j(n,Uint8Array))s+n.length>r.length?a.from(n).copy(r,s):Uint8Array.prototype.set.call(r,n,s);else if(a.isBuffer(n))n.copy(r,s);else throw TypeError('"list" argument must be an Array of Buffers');s+=n.length}return r},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?w(this,0,e):m.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",i=t.IS;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,i,r,s){if(j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||i>e.length||r<0||s>this.length)throw RangeError("out of range index");if(r>=s&&t>=i)return 0;if(r>=s)return -1;if(t>=i)return 1;if(t>>>=0,i>>>=0,r>>>=0,s>>>=0,this===e)return 0;for(var n=s-r,o=i-t,l=Math.min(n,o),h=this.slice(r,s),u=e.slice(t,i),c=0;c<l;++c)if(h[c]!==u[c]){n=h[c],o=u[c];break}return n<o?-1:+(o<n)},a.prototype.includes=function(e,t,i){return -1!==this.indexOf(e,t,i)},a.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},a.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},a.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,n,o,a,l,h,u,c,d=this.length-t;if((void 0===i||i>d)&&(i=d),e.length>0&&(i<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var f=!1;;)switch(r){case"hex":return function(e,t,i,r){i=Number(i)||0;var s=e.length-i;r?(r=Number(r))>s&&(r=s):r=s;var n=t.length;r>n/2&&(r=n/2);for(var o=0;o<r;++o){var a,l=parseInt(t.substr(2*o,2),16);if((a=l)!=a)break;e[i+o]=l}return o}(this,e,t,i);case"utf8":case"utf-8":return s=t,n=i,A(P(e,this.length-s),this,s,n);case"ascii":case"latin1":case"binary":return o=t,a=i,A(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(e),this,o,a);case"base64":return l=t,h=i,A(E(e),this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,c=i,A(function(e,t){for(var i,r,s=[],n=0;n<e.length&&!((t-=2)<0);++n)r=(i=e.charCodeAt(n))>>8,s.push(i%256),s.push(r);return s}(e,this.length-u),this,u,c);default:if(f)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),f=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,a.prototype),r},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var r=this[e],s=1,n=0;++n<t&&(s*=256);)r+=this[e+n]*s;return r},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var r=this[e+--t],s=1;t>0&&(s*=256);)r+=this[e+--t]*s;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var r=this[e],s=1,n=0;++n<t&&(s*=256);)r+=this[e+n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var r=t,s=1,n=this[e+--r];r>0&&(s*=256);)n+=this[e+--r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?0xffff0000|i:i},a.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?0xffff0000|i:i},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),s.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),s.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),s.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),s.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,i,r){if(e*=1,t>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;_(this,e,t,i,s,0)}var n=1,o=0;for(this[t]=255&e;++o<i&&(n*=256);)this[t+o]=e/n&255;return t+i},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,i,r){if(e*=1,t>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;_(this,e,t,i,s,0)}var n=i-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+i},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,i,r){if(e*=1,t>>>=0,!r){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var n=0,o=1,a=0;for(this[t]=255&e;++n<i&&(o*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/o>>0)-a&255;return t+i},a.prototype.writeIntBE=function(e,t,i,r){if(e*=1,t>>>=0,!r){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var n=i-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o>>0)-a&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,i){return e*=1,t>>>=0,i||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,i){return k(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return k(this,e,t,!1,i)},a.prototype.writeDoubleLE=function(e,t,i){return x(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return x(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,r){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var s=r-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,r):Uint8Array.prototype.set.call(e,this.subarray(i,r),t),s},a.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var s,n=e.charCodeAt(0);("utf8"===r&&n<128||"latin1"===r)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s<i;++s)this[s]=e;else{var o=a.isBuffer(e)?e:a.from(e,r),l=o.length;
6if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-t;++s)this[s+t]=o[s%l]}return this};var S=/[^+/0-9A-Za-z-_]/g;function P(e,t){t=t||1/0;for(var i,r=e.length,s=null,n=[],o=0;o<r;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!s){if(i>56319||o+1===r){(t-=3)>-1&&n.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&n.push(239,191,189),s=i;continue}i=(s-55296<<10|i-56320)+65536}else s&&(t-=3)>-1&&n.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;n.push(i)}else if(i<2048){if((t-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((t-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return n}function E(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,i,r){for(var s=0;s<r&&!(s+i>=t.length)&&!(s>=e.length);++s)t[s+i]=e[s];return s}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),i=0;i<16;++i)for(var r=16*i,s=0;s<16;++s)t[r+s]=e[i]+e[s];return t}()},4416:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});let r=(0,i(9946).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},5068:function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=r(i(3280));class n{constructor(e,{headers:t={},schema:i,fetch:r}){this.url=e,this.headers=t,this.schema=i,this.fetch=r}select(e,{head:t=!1,count:i}={}){let r=!1,n=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!r?"":('"'===e&&(r=!r),e)).join("");return this.url.searchParams.set("select",n),i&&(this.headers.Prefer=`count=${i}`),new s.default({method:t?"HEAD":"GET",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:i=!0}={}){let r=[];if(this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),i||r.push("missing=default"),this.headers.Prefer=r.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new s.default({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:i=!1,count:r,defaultToNull:n=!0}={}){let o=[`resolution=${i?"ignore":"merge"}-duplicates`];if(void 0!==t&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),n||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new s.default({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){let i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),t&&i.push(`count=${t}`),this.headers.Prefer=i.join(","),new s.default({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let t=[];return e&&t.push(`count=${e}`),this.headers.Prefer&&t.unshift(this.headers.Prefer),this.headers.Prefer=t.join(","),new s.default({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}t.default=n},5171:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_HEADERS=void 0;let r=i(182);t.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${r.version}`}},5646:function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PostgrestError=t.PostgrestBuilder=t.PostgrestTransformBuilder=t.PostgrestFilterBuilder=t.PostgrestQueryBuilder=t.PostgrestClient=void 0;let s=r(i(9936));t.PostgrestClient=s.default;let n=r(i(5068));t.PostgrestQueryBuilder=n.default;let o=r(i(3280));t.PostgrestFilterBuilder=o.default;let a=r(i(7156));t.PostgrestTransformBuilder=a.default;let l=r(i(9286));t.PostgrestBuilder=l.default;let h=r(i(1971));t.PostgrestError=h.default,t.default={PostgrestClient:s.default,PostgrestQueryBuilder:n.default,PostgrestFilterBuilder:o.default,PostgrestTransformBuilder:
6a.default,PostgrestBuilder:l.default,PostgrestError:h.default}},6654:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return s}});let r=i(2115);function s(e,t){let i=(0,r.useRef)(null),s=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=i.current;e&&(i.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(i.current=n(e,r)),t&&(s.current=n(t,r))},[e,t])}function n(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let i=e(t);return"function"==typeof i?i:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6874:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return p}});let r=i(8229),s=i(5155),n=r._(i(2115)),o=i(2757),a=i(5227),l=i(9818),h=i(6654),u=i(9991),c=i(5929);i(3230);let d=i(4930);function f(e){return"string"==typeof e?e:(0,o.formatUrl)(e)}let p=n.default.forwardRef(function(e,t){let i,r,{href:o,as:p,children:m,prefetch:g=null,passHref:y,replace:v,shallow:w,scroll:b,onClick:_,onMouseEnter:T,onTouchStart:k,legacyBehavior:x=!1,...S}=e;i=m,x&&("string"==typeof i||"number"==typeof i)&&(i=(0,s.jsx)("a",{children:i}));let P=n.default.useContext(a.AppRouterContext),E=!1!==g,A=null===g?l.PrefetchKind.AUTO:l.PrefetchKind.FULL,{href:j,as:C}=n.default.useMemo(()=>{let e=f(o);return{href:e,as:p?f(p):e}},[o,p]);x&&(r=n.default.Children.only(i));let R=x?r&&"object"==typeof r&&r.ref:t,O=n.default.useCallback(e=>(E&&null!==P&&(0,d.mountLinkInstance)(e,j,P,A),()=>{(0,d.unmountLinkInstance)(e)}),[E,j,P,A]),L={ref:(0,h.useMergedRef)(O,R),onClick(e){x||"function"!=typeof _||_(e),x&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),P&&(e.defaultPrevented||function(e,t,i,r,s,o,a){let{nodeName:l}=e.currentTarget;!("A"===l.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e))&&(e.preventDefault(),n.default.startTransition(()=>{let e=null==a||a;"beforePopState"in t?t[s?"replace":"push"](i,r,{shallow:o,scroll:e}):t[s?"replace":"push"](r||i,{scroll:e})}))}(e,P,j,C,v,w,b))},onMouseEnter(e){x||"function"!=typeof T||T(e),x&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),P&&E&&(0,d.onNavigationIntent)(e.currentTarget)},onTouchStart:function(e){x||"function"!=typeof k||k(e),x&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),P&&E&&(0,d.onNavigationIntent)(e.currentTarget)}};return(0,u.isAbsoluteUrl)(C)?L.href=C:x&&!y&&("a"!==r.type||"href"in r.props)||(L.href=(0,c.addBasePath)(C)),x?n.default.cloneElement(r,L):(0,s.jsx)("a",{...S,...L,children:i})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7156:function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=r(i(9286));class n extends s.default{select(e){let t=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",i),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:i,foreignTable:r,referencedTable:s=r}={}){let n=s?`${s}.order`:"order",o=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===i?"":i?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:i=t}={}){let r=void 0===i?"limit":`${i}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:i,referencedTable:r=i}={}){let s=void 0===r?"offset":`${r}.offset`,n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(n,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return"GET"===this.method?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
6explain({analyze:e=!1,verbose:t=!1,settings:i=!1,buffers:r=!1,wal:s=!1,format:n="text"}={}){var o;let a=[e?"analyze":null,t?"verbose":null,i?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=null!==(o=this.headers.Accept)&&void 0!==o?o:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${n}; for="${l}"; options=${a};`,this}rollback(){var e;return(null!==(e=this.headers.Prefer)&&void 0!==e?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}t.default=n},7494:(e,t,i)=>{"use strict";i.d(t,{E:()=>s});var r=i(2115);let s=i(8972).B?r.useLayoutEffect:r.useEffect},7610:(e,t)=>{t.read=function(e,t,i,r,s){var n,o,a=8*s-r-1,l=(1<<a)-1,h=l>>1,u=-7,c=i?s-1:0,d=i?-1:1,f=e[t+c];for(c+=d,n=f&(1<<-u)-1,f>>=-u,u+=a;u>0;n=256*n+e[t+c],c+=d,u-=8);for(o=n&(1<<-u)-1,n>>=-u,u+=r;u>0;o=256*o+e[t+c],c+=d,u-=8);if(0===n)n=1-h;else{if(n===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),n-=h}return(f?-1:1)*o*Math.pow(2,n-r)},t.write=function(e,t,i,r,s,n){var o,a,l,h=8*n-s-1,u=(1<<h)-1,c=u>>1,d=5960464477539062e-23*(23===s),f=r?0:n-1,p=r?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?t+=d/l:t+=d*Math.pow(2,1-c),t*l>=2&&(o++,l/=2),o+c>=u?(a=0,o=u):o+c>=1?(a=(t*l-1)*Math.pow(2,s),o+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,s),o=0));s>=8;e[i+f]=255&a,f+=p,a/=256,s-=8);for(o=o<<s|a,h+=s;h>0;e[i+f]=255&o,f+=p,o/=256,h-=8);e[i+f-p]|=128*m}},7719:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),i=t[0],r=t[1];return(i+r)*3/4-r},t.toByteArray=function(e){var t,i,n=l(e),o=n[0],a=n[1],h=new s((o+a)*3/4-a),u=0,c=a>0?o-4:o;for(i=0;i<c;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],h[u++]=t>>16&255,h[u++]=t>>8&255,h[u++]=255&t;return 2===a&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,h[u++]=255&t),1===a&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,h[u++]=t>>8&255,h[u++]=255&t),h},t.fromByteArray=function(e){for(var t,r=e.length,s=r%3,n=[],o=0,a=r-s;o<a;o+=16383)n.push(function(e,t,r){for(var s,n=[],o=t;o<r;o+=3)s=(e[o]<<16&0xff0000)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(i[s>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return n.join("")}(e,o,o+16383>a?a:o+16383));return 1===s?n.push(i[(t=e[r-1])>>2]+i[t<<4&63]+"=="):2===s&&n.push(i[(t=(e[r-2]<<8)+e[r-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),n.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)i[o]=n[o],r[n.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var r=i===t?0:4-i%4;return[i,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8859:(e,t)=>{"use strict";function i(e){let t={};for(let[i,r]of e.entries()){let e=t[i];void 0===e?t[i]=r:Array.isArray(e)?e.push(r):t[i]=[e,r]}return t}function r(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[i,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(i,r(e));else t.set(i,r(s));return t}function n(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(let t of i){for(let i of t.keys())e.delete(i);for(let[i,r]of t.entries())e.append(i,r)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{assign:function(){return n},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return s}})},8972:(e,t,i)=>{"use strict";i.d(t,{B:()=>r});let r="undefined"!=typeof window},9286:function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=r(i(2410)),n=r(i(1971));class o{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:"undefined"==typeof fetch?this.fetch=s.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Object.assign({},this.headers),this.headers[e]=t,this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");let i=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,i,r;let s=null,o=null,a=null,l=e.status,h=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(o="text/csv"===this.headers.Accept?t:this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?t:JSON.parse(t))}let r=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),n=null===(i=e.headers.get("content-range"))||void 0===i?void 0:i.split("/");r&&n&&n.length>1&&(a=parseInt(n[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(o)&&(o.length>1?(s={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,a=null,l=406,h="Not Acceptable"):o=1===o.length?o[0]:null)}else{let t=await e.text();try{s=JSON.parse(t),Array.isArray(s)&&404===e.status&&(o=[],s=null,l=200,h="OK")}catch(i){404===e.status&&""===t?(l=204,h="No Content"):s={message:t}}if(s&&this.isMaybeSingle&&(null===(r=null==s?void 0:s.details)||void 0===r?void 0:r.includes("0 rows"))&&(s=null,l=200,h="OK"),s&&this.shouldThrowOnError)throw new n.default(s)}return{error:s,data:o,count:a,status:l,statusText:h}});return this.shouldThrowOnError||(i=i.catch(e=>{var t,i,r;return{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:`${null!==(i=null==e?void 0:e.stack)&&void 0!==i?i:""}`,hint:"",code:`${null!==(r=null==e?void 0:e.code)&&void 0!==r?r:""}`},data:null,count:null,status:0,statusText:""}}
6)),i.then(e,t)}returns(){return this}overrideTypes(){return this}}t.default=o},9936:function(e,t,i){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=r(i(5068)),n=r(i(3280)),o=i(5171);class a{constructor(e,{headers:t={},schema:i,fetch:r}={}){this.url=e,this.headers=Object.assign(Object.assign({},o.DEFAULT_HEADERS),t),this.schemaName=i,this.fetch=r}from(e){let t=new URL(`${this.url}/${e}`);return new s.default(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new a(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:i=!1,get:r=!1,count:s}={}){let o,a,l=new URL(`${this.url}/rpc/${e}`);i||r?(o=i?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{l.searchParams.append(e,t)})):(o="POST",a=t);let h=Object.assign({},this.headers);return s&&(h.Prefer=`count=${s}`),new n.default({method:o,url:l,headers:h,schema:this.schemaName,body:a,fetch:this.fetch,allowEmpty:!1})}}t.default=a},9946:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var r=i(2115);let s=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.filter((e,t,i)=>!!e&&i.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((e,t)=>{let{color:i="currentColor",size:s=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:h="",children:u,iconNode:c,...d}=e;return(0,r.createElement)("svg",{ref:t,...o,width:s,height:s,stroke:i,strokeWidth:l?24*Number(a)/Number(s):a,className:n("lucide",h),...d},[...c.map(e=>{let[t,i]=e;return(0,r.createElement)(t,i)}),...Array.isArray(u)?u:[u]])}),l=(e,t)=>{let i=(0,r.forwardRef)((i,o)=>{let{className:l,...h}=i;return(0,r.createElement)(a,{ref:o,iconNode:t,className:n("lucide-".concat(s(e)),l),...h})});return i.displayName="".concat(e),i}},9991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{DecodeError:function(){return p},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return y},NormalizeError:function(){return m},PageNotFoundError:function(){return g},SP:function(){return d},ST:function(){return f},WEB_VITALS:function(){return i},execOnce:function(){return r},getDisplayName:function(){return l},getLocationOrigin:function(){return o},getURL:function(){return a},isAbsoluteUrl:function(){return n},isResSent:function(){return h},loadGetInitialProps:function(){return c},normalizeRepeatedSlashes:function(){return u},stringifyError:function(){return w}});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function r(e){let t,i=!1;return function(){for(var r=arguments.length,s=Array(r),n=0;n<r;n++)s[n]=arguments[n];return i||(i=!0,t=e(...s)),t}}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,n=e=>s.test(e);function o(){let{protocol:e,hostname:t,port:i}=window.location;
6return e+"//"+t+(i?":"+i:"")}function a(){let{href:e}=window.location,t=o();return e.substring(t.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function u(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function c(e,t){let i=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await c(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(i&&h(i))return r;if(!r)throw Object.defineProperty(Error('"'+l(e)+'.getInitialProps()" should resolve to an object. But found "'+r+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}let d="undefined"!=typeof performance,f=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class p extends Error{}class m extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class y extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(e){return JSON.stringify({message:e.message,stack:e.stack})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.