1import{r as u,j as c,C as Ao,a as Do,D as Pa,u as Ia,x as Oa}from"./chunk-LFPYN7LY-BdYBcLxf.js";import{a as Kn}from"./index-CRu4RAg2.js";var Xr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Na={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ma=class{#t=Na;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},zt=new Ma;function ja(e){setTimeout(e,0)}var $t=typeof window>"u"||"Deno"in globalThis;function pn(){}function hh(e,t){return typeof e=="function"?e(t):e}function Rr(e){return typeof e=="number"&&e>=0&&e!==1/0}function Lo(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jt(e,t){return typeof e=="function"?e(t):e}function ot(e,t){return typeof e=="function"?e(t):e}function mh(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Aa(i,t.options))return!1}else if(!Kr(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function gh(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(kr(t.options.mutationKey)!==kr(o))return!1}else if(!Kr(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Aa(e,t){return(t?.queryKeyHashFn||kr)(e)}function kr(e){return JSON.stringify(e,(t,n)=>Pr(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Kr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Kr(e[n],t[n])):!1}var Da=Object.prototype.hasOwnProperty;function Fo(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=gs(e)&&gs(t);if(!r&&!(Pr(e)&&Pr(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,l=r?new Array(a):{};let d=0;for(let f=0;f<a;f++){const p=r?f:i[f],y=e[p],g=t[p];if(y===g){l[p]=y,(r?f<o:Da.call(e,p))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){l[p]=g;continue}const m=Fo(y,g,n+1);l[p]=m,m===y&&d++}return o===a&&d===o?e:l}function Tr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function gs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pr(e){if(!bs(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!bs(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function bs(e){return Object.prototype.toString.call(e)==="[object Object]"}function La(e){return new Promise(t=>{zt.setTimeout(t,e)})}function Ir(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Fo(e,t):t}function bh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function yh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var _o=Symbol();function Fa(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===_o?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Uo(e,t){return typeof e=="function"?e(...t):!!e}function vh(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var _a=class extends Xr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!$t&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();
1this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Bo=new _a;function Or(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Ua=ja;function Ba(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=Ua;const o=a=>{t?e.push(a):s(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Qr=Ba(),Ha=class extends Xr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!$t&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},Ho=new Ha;function Va(e){return Math.min(1e3*2**e,3e4)}function Vo(e){return(e??"online")==="online"?Ho.isOnline():!0}var Nr=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function za(e){let t=!1,n=0,r;const s=Or(),o=()=>s.status!=="pending",i=h=>{if(!o()){const w=new Nr(h);y(w),e.onCancel?.(w)}},a=()=>{t=!0},l=()=>{t=!1},d=()=>Bo.isFocused()&&(e.networkMode==="always"||Ho.isOnline())&&e.canRun(),f=()=>Vo(e.networkMode)&&e.canRun(),p=h=>{o()||(r?.(),s.resolve(h))},y=h=>{o()||(r?.(),s.reject(h))},g=()=>new Promise(h=>{r=w=>{(o()||d())&&h(w)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let h;const w=n===0?e.initialPromise:void 0;try{h=w??e.fn()}catch(x){h=Promise.reject(x)}Promise.resolve(h).then(p).catch(x=>
1{if(o())return;const R=e.retry??($t?0:3),N=e.retryDelay??Va,M=typeof N=="function"?N(n,x):N,S=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,x);if(t||!S){y(x);return}n++,e.onFail?.(n,x),La(M).then(()=>d()?void 0:g()).then(()=>{t?y(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?m():g().then(m),s)}}var Wa=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rr(this.gcTime)&&(this.#t=zt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($t?1/0:300*1e3))}clearGcTimeout(){this.#t&&(zt.clearTimeout(this.#t),this.#t=void 0)}},wh=class extends Wa{#t;#e;#n;#s;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=vs(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=vs(this.options);t.data!==void 0&&(this.setState(ys(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Ir(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(pn).catch(pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>ot(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_o||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Jt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Lo(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const a=Fa(this.options,t),d=(()=>{const f={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#i=!1,this.options.persister?this.options.persister(a,d,this):a(d)},i=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(a),a})();this.options.behavior?.onFetch(i,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=za({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Nr&&a.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(a,l)=>{this.#o({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Nr){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#o({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...zo(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...ys(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?r:void 0,r;case"error":const s=e.error;
1return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Qr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function zo(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Vo(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ys(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vs(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var $a=class extends Xr{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#i=Or(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#s=void 0;#r;#a;#i;#o;#m;#f;#p;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),ws(this.#e,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mr(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ot(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),t._defaulted&&!Tr(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&xs(this.#e,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#e!==n||ot(this.options.enabled,this.#e)!==ot(t.enabled,this.#e)||Jt(this.options.staleTime,this.#e)!==Jt(t.staleTime,this.#e))&&this.#g();const s=this.#b();r&&(this.#e!==n||ot(this.options.enabled,this.#e)!==ot(t.enabled,this.#e)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return qa(this,n)&&(this.#s=n,this.#a=this.options,this.#r=this.#e.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#S();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(pn)),t}#g(){this.#w();const e=Jt(this.options.staleTime,this.#e);if($t||this.#s.isStale||!Rr(e))return;const n=Lo(this.#s.dataUpdatedAt,e)+1;this.#c=zt.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!($t||ot(this.options.enabled,this.#e)===!1||!Rr(this.#l)||this.#l===0)&&(this.#u=zt.setInterval(()=>
1{(this.options.refetchIntervalInBackground||Bo.isFocused())&&this.#d()},this.#l))}#v(){this.#g(),this.#y(this.#b())}#w(){this.#c&&(zt.clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(zt.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,s=this.#s,o=this.#r,i=this.#a,l=e!==n?e.state:this.#n,{state:d}=e;let f={...d},p=!1,y;if(t._optimisticResults){const v=this.hasListeners(),T=!v&&ws(e,t),F=v&&xs(e,n,t,r);(T||F)&&(f={...f,...zo(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:h}=f;y=f.data;let w=!1;if(t.placeholderData!==void 0&&y===void 0&&h==="pending"){let v;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(v=s.data,w=!0):v=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,v!==void 0&&(h="success",y=Ir(s?.data,v,t),p=!0)}if(t.select&&y!==void 0&&!w)if(s&&y===o?.data&&t.select===this.#m)y=this.#f;else try{this.#m=t.select,y=t.select(y),y=Ir(s?.data,y,t),this.#f=y,this.#o=null}catch(v){this.#o=v}this.#o&&(g=this.#o,y=this.#f,m=Date.now(),h="error");const x=f.fetchStatus==="fetching",R=h==="pending",N=h==="error",M=R&&x,S=y!==void 0,I={status:h,fetchStatus:f.fetchStatus,isPending:R,isSuccess:h==="success",isError:N,isInitialLoading:M,isLoading:M,data:y,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:x,isRefetching:x&&!R,isLoadingError:N&&!S,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:N&&S,isStale:Zr(e,t),refetch:this.refetch,promise:this.#i,isEnabled:ot(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const v=I.data!==void 0,T=I.status==="error"&&!v,F=W=>{T?W.reject(I.error):v&&W.resolve(I.data)},$=()=>{const W=this.#i=I.promise=Or();F(W)},K=this.#i;switch(K.status){case"pending":e.queryHash===n.queryHash&&F(K);break;case"fulfilled":(T||I.data!==K.value)&&$();break;case"rejected":(!T||I.error!==K.reason)&&$();break}}return I}updateResult(){const e=this.#s,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#p=this.#e),Tr(t,e))return;this.#s=t;const n=()=>
1{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#h.size)return!0;const o=new Set(s??this.#h);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(i=>{const a=i;return this.#s[a]!==e[a]&&o.has(a)})};this.#C({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#C(e){Qr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ga(e,t){return ot(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ws(e,t){return Ga(e,t)||e.state.data!==void 0&&Mr(e,t,t.refetchOnMount)}function Mr(e,t,n){if(ot(t.enabled,e)!==!1&&Jt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Zr(e,t)}return!1}function xs(e,t,n,r){return(e!==t||ot(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Zr(e,n)}function Zr(e,t){return ot(t.enabled,e)!==!1&&e.isStaleByTime(Jt(t.staleTime,e))}function qa(e,t){return!Tr(e.getCurrentResult(),t)}var Wo=u.createContext(void 0),Jr=e=>{const t=u.useContext(Wo);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},xh=({client:e,children:t})=>(u.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Wo.Provider,{value:e,children:t})),$o=u.createContext(!1),Ya=()=>u.useContext($o);$o.Provider;function Xa(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ka=u.createContext(Xa()),Qa=()=>u.useContext(Ka),Za=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Uo(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ja=e=>{u.useEffect(()=>{e.clearReset()},[e])},el=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Uo(n,[e.error,r])),Sh=(e,t)=>t.state.data===void 0,tl=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},nl=(e,t)=>e.isLoading&&e.isFetching&&!t,rl=(e,t)=>e?.suspense&&t.isPending,Ss=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function sl(e,t,n){const r=Ya(),s=Qa(),o=Jr(),i=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=o.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",tl(i),Za(i,s,a),Ja(s);const l=!o.getQueryCache().get(i.queryHash),[d]=u.useState(()=>new t(o,i)),f=d.getOptimisticResult(i),p=!r&&e.subscribed!==!1;if(u.useSyncExternalStore(u.useCallback(y=>{const g=p?d.subscribe(Qr.batchCalls(y)):pn;return d.updateResult(),g},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),u.useEffect(()=>{d.setOptions(i)},[i,d]),rl(i,f))throw Ss(i,d,s);if(el({result:f,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(i,f),i.experimental_prefetchInRender&&!$t&&nl(f,r)&&(l?Ss(i,d,s):a?.promise)?.catch(pn).finally(()=>{d.updateResult()}),i.notifyOnChangeProps?f:d.trackResult(f)}function Go(e,t){return sl(e,$a)}function Ch(e){return e}const qo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const ol=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const il=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Cs=e=>{const t=il(e);return t.charAt(0).toUpperCase()+t.slice(1)};var al={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"};const ll=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const cl=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>u.createElement("svg",{ref:l,...al,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:qo("lucide",s),...!o&&!ll(a)&&{"aria-hidden":"true"},...a},[...i.map(([d,f])=>u.createElement(d,f)),...Array.isArray(o)?o:[o]]));const ul=(e,t)=>
1{const n=u.forwardRef(({className:r,...s},o)=>u.createElement(cl,{ref:o,iconNode:t,className:qo(`lucide-${ol(Cs(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Cs(e),n};const dl=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],fl=ul("arrow-up-right",dl);function Eh(){try{if(!window.blueConicClient)return;window.blueConicClient._handledInteractions=[],window.blueConicClient.handlePageView({hidePositions:!0})}catch{}}function Un(e,t){try{if(!window.blueConicClient?.profile)return;const n=window.blueConicClient.profile.getProfile();n.setValue("email",e),n.setValue("ory_id",t),window.blueConicClient.profile.updateProfile()}catch{}}const Ct={youtube:"https://www.youtube.com/c/TowardsDataScience",twitter:"https://x.com/TDataScience",linkedin:"https://www.linkedin.com/company/towards-data-science/",threads:"https://www.threads.net/@towardsdatascience",bluesky:"https://bsky.app/profile/towardsdatascience.com"};function pl(){return"production"}const Cn=pl(),hl={isDev:!1,environment:Cn==="staging"?"staging":"production",writerApiUrl:"https://write.insightmediagroup.io/api",writeAppUrl:"https://write.insightmediagroup.io",tdsWebUrl:"https://towardsdatascience.com",accountsApiUrl:"https://img-api-v2.towardsdatascience.com",accountsOAuthBaseUrl:"https://img-api-v2.insightmediagroup.io",googleClientId:"919523763095-6d6g0ekl2ctclfu88hfei7b4cgdve4bt.apps.googleusercontent.com",gtmId:"GTM-NDXD39TW",gtmAuth:Cn==="staging"?"U9ZGXQykxSdp0zjAMjWB_A":"",gtmPreview:Cn==="staging"?"env-16":"",gtmCookiesWin:Cn==="staging"?"x":"",hubspotId:"46095657"},Es=hl,Je={...Es,platformSlug:"tds",writeAppRegisterUrl:`${Es.writeAppUrl}`,internalEmbedHosts:["towardsdatascience.com","contributor.insightmediagroup.io"],assetsUrl:"https://assets.insightmediagroup.io"},Yo={emailStep:{heading:{subscribe:"Sign up to Towards Data Science",login:"Login to Towards Data Science"},cta:{subscribe:"Register for free to access our entire library of content. By joining our community of data science professionals, you'll be among the learners and leaders who are exploring and contributing to the advancement of AI and machine learning.",login:"Enter your email below to receive a login code."}},verifyStep:{heading:{subscribe:"Sign up to Towards Data Science",login:"Login to Towards Data Science"}},profileStep:{heading:{subscribe:"Sign up to Towards Data Science",login:"Update Your Profile"},cta:{subscribe:"Refine your profile to unlock insights and opportunities aligned with your skills and experience.",login:"Refine your profile to unlock insights and opportunities aligned with your skills and experience."}},welcomeStep:{welcome:{subscribe:"Thanks for joining! We're thrilled to welcome you as a member of our data science community. You now have full access to all our articles, tutorials, deep dives, newsletters and more.",login:"You're now logged in to Towards Data Science."},whatsNext:{subscribe:"Follow TDS on your favorite social media networks.",login:"Follow TDS on your favorite social media networks."}}};function Xo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Xo(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ml(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Xo(e))&&(r&&(r+=" "),r+=t);return r}const gl=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},bl=(e,t)=>({classGroupId:e,validator:t}),Ko=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Bn="-",Rs=[],yl="arbitrary..",vl=e=>{const t=xl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return wl(i);const a=i.split(Bn),l=a[0]===""&&a.length>1?1:0;return Qo(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],d=n[i];return l?d?gl(d,l):l:d||Rs}return n[i]||Rs}}},Qo=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const d=Qo(e,t+1,o);if(d)return d}const i=n.validators;if(i===null)return;const a=t===0?e.join(Bn):e.slice(t).join(Bn),l=i.length;for(let d=0;d<l;d++){const f=i[d];if(f.validator(a))return f.classGroupId}},wl=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?yl+r:void 0})(),xl=e=>{const{theme:t,classGroups:n}=e;return Sl(n,t)},Sl=(e,t)=>{const n=Ko();for(const r in e){const s=e[r];es(s,n,r,t)}return n},es=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];Cl(i,t,n,r)}},Cl=(e,t,n,r)=>{if(typeof e=="string"){El(e,t,n);return}if(typeof e=="function"){Rl(e,t,n,r);return}kl(e,t,n,r)},El=(e,t,n)=>{const r=e===""?t:Zo(t,e);r.classGroupId=n},Rl=(e,t,n,r)=>{if(Tl(e)){es(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(bl(n,e))},kl=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[a,l]=s[i];es(l,Zo(t,a),n,r)}},Zo=(e,t)=>{let n=e;const r=t.split(Bn),s=r.length;for(let o=0;o<s;o++){const i=r[o];let a=n.nextPart.get(i);a||(a=Ko(),n.nextPart.set(i,a)),n=a}return n},Tl=e=>
vendor: 4,720 bytes, line 1
1"isThemeGetter"in e&&e.isThemeGetter===!0,Pl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},jr="!",ks=":",Il=[],Ts=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Ol=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,a=0,l=0,d;const f=s.length;for(let h=0;h<f;h++){const w=s[h];if(i===0&&a===0){if(w===ks){o.push(s.slice(l,h)),l=h+1;continue}if(w==="/"){d=h;continue}}w==="["?i++:w==="]"?i--:w==="("?a++:w===")"&&a--}const p=o.length===0?s:s.slice(l);let y=p,g=!1;p.endsWith(jr)?(y=p.slice(0,-1),g=!0):p.startsWith(jr)&&(y=p.slice(1),g=!0);const m=d&&d>l?d-l:void 0;return Ts(o,g,y,m)};if(t){const s=t+ks,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):Ts(Il,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},Nl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const i=n[o],a=i[0]==="[",l=t.has(i);a||l?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},Ml=e=>({cache:Pl(e.cacheSize),parseClassName:Ol(e),sortModifiers:Nl(e),...vl(e)}),jl=/\s+/,Al=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(jl);let l="";for(let d=a.length-1;d>=0;d-=1){const f=a[d],{isExternal:p,modifiers:y,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:h}=n(f);if(p){l=f+(l.length>0?" "+l:l);continue}let w=!!h,x=r(w?m.substring(0,h):m);if(!x){if(!w){l=f+(l.length>0?" "+l:l);continue}if(x=r(m),!x){l=f+(l.length>0?" "+l:l);continue}w=!1}const R=y.length===0?"":y.length===1?y[0]:o(y).join(":"),N=g?R+jr:R,M=N+x;if(i.indexOf(M)>-1)continue;i.push(M);const S=s(x,w);for(let O=0;O<S.length;++O){const I=S[O];i.push(N+I)}l=f+(l.length>0?" "+l:l)}return l},Dl=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Jo(n))&&(s&&(s+=" "),s+=r);return s},Jo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Jo(e[r]))&&(n&&(n+=" "),n+=t);return n},Ll=(e,...t)=>{let n,r,s,o;const i=l=>{const d=t.reduce((f,p)=>p(f),e());return n=Ml(d),r=n.cache.get,s=n.cache.set,o=a,a(l)},a=l=>{const d=r(l);if(d)return d;const f=Al(l,n);return s(l,f),f};return o=i,(...l)=>o(Dl(...l))},Fl=[],Ue=e=>{const t=n=>n[e]||Fl;return t.isThemeGetter=!0,t},ei=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ti=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_l=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ul=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pt=e=>_l.test(e),ge=e=>!!e&&!Number.isNaN(Number(e)),It=e=>!!e&&Number.isInteger(Number(e)),sr=e=>e.endsWith("%")&&ge(e.slice(0,-1)),xt=e=>Ul.test(e),ni=()=>!0,Wl=e=>Bl.test(e)&&!Hl.test(e),ts=()=>!1,$l=e=>Vl.test(e),Gl=e=>zl.test(e),ql=e=>!H(e)&&!z(e),Yl=e=>Mt(e,oi,ts),H=e=>ei.test(e),Ut=e=>Mt(e,ii,Wl),Ps=e=>Mt(e,nc,ge),Xl=e=>Mt(e,li,ni),Kl=e=>Mt(e,ai,ts),Is=e=>Mt(e,ri,ts),Ql=e=>Mt(e,si,Gl),En=e=>Mt(e,ci,$l),z=e=>ti.test(e),on=e=>Yt(e,ii),Zl=e=>Yt(e,ai),Os=e=>Yt(e,ri),Jl=e=>Yt(e,oi),ec=e=>Yt(e,si),Rn=e=>Yt(e,ci,!0),tc=e=>Yt(e,li,!0),Mt=(e,t,n)=>{const r=ei.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Yt=(e,t,n=!1)=>{const r=ti.exec(e);return r?r[1]?t(r[1]):n:!1},ri=e=>e==="position"||e==="percentage",si=e=>e==="image"||e==="url",oi=e=>e==="length"||e==="size"||e==="bg-size",ii=e=>e==="length",nc=e=>e==="number",ai=e=>e==="family-name",li=e=>e==="number"||e==="weight",ci=e=>e==="shadow",rc=()=>{const e=Ue("color"),t=Ue("font"),n=Ue("text"),r=Ue("font-weight"),s=Ue("tracking"),o=Ue("leading"),i=Ue("breakpoint"),a=Ue("container"),l=Ue("spacing"),d=Ue("radius"),f=Ue("shadow"),p=Ue("inset-shadow"),y=Ue("text-shadow"),g=Ue("drop-shadow"),m=Ue("blur"),h=Ue("perspective"),w=Ue("aspect"),x=Ue("ease"),R=Ue("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...M(),z,H],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],v=()=>[z,H,l],T=()=>[Pt,"full","auto",...v()],F=()=>
vendor: 8,822 bytes, line 1
1[It,"none","subgrid",z,H],$=()=>["auto",{span:["full",It,z,H]},It,z,H],K=()=>[It,"auto",z,H],W=()=>["auto","min","max","fr",z,H],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...v()],ue=()=>[Pt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],be=()=>[Pt,"screen","full","dvw","lvw","svw","min","max","fit",...v()],L=()=>[Pt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...v()],j=()=>[e,z,H],G=()=>[...M(),Os,Is,{position:[z,H]}],pe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",Jl,Yl,{size:[z,H]}],he=()=>[sr,on,Ut],Y=()=>["","none","full",d,z,H],Q=()=>["",ge,on,Ut],ae=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[ge,sr,Os,Is],ie=()=>["","none",m,z,H],Ce=()=>["none",ge,z,H],se=()=>["none",ge,z,H],A=()=>[ge,z,H],V=()=>[Pt,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xt],breakpoint:[xt],color:[ni],container:[xt],"drop-shadow":[xt],ease:["in","out","in-out"],font:[ql],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xt],shadow:[xt],spacing:["px",ge],text:[xt],"text-shadow":[xt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pt,H,z,w]}],container:["container"],columns:[{columns:[ge,H,z,a]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[It,"auto",z,H]}],basis:[{basis:[Pt,"full","auto",a,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ge,Pt,"auto","initial","none",H]}],grow:[{grow:["",ge,z,H]}],shrink:[{shrink:["",ge,z,H]}],order:[{order:[It,"first","last","none",z,H]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pbs:[{pbs:v()}],pbe:[{pbe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mbs:[{mbs:oe()}],mbe:[{mbe:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:ue()}],"inline-size":[{inline:["auto",...be()]}],"min-inline-size":[{"min-inline":["auto",...be()]}],"max-inline-size":[{"max-inline":["none",...be()]}],"block-size":[{block:["auto",...L()]}],"min-block-size":[{"min-block":["auto",...L()]}],"max-block-size":[{"max-block":["none",...L()]}],w:[{w:[a,"screen",...ue()]}],"min-w":[{"min-w":[a,"screen","none",...ue()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...ue()]}],h:[{h:["screen","lh",...ue()]}],"min-h":[{"min-h":["screen","lh","none",...ue()]}],"max-h":[{"max-h":["screen","lh",...ue()]}],"font-size":[{text:["base",n,on,Ut]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tc,Xl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sr,H]}],"font-family":[{font:[Zl,Kl,t]}],"font-features":[{"font-features":[H]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,z,H]}],"line-clamp":[{"line-clamp":[ge,"none",z,Ps]}],leading:[{leading:[o,...v()]}],"list-image":[{"list-image":["none",z,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",z,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[ge,"from-font","auto",z,Ut]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ge,"auto",z,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z,H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",z,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:pe()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},It,z,H],radial:["",z,H],conic:[It,z,H]},ec,Ql]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-bs":[{"border-bs":Q()}],"border-w-be":[{"border-be":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}
vendor: 6,342 bytes, line 1
1],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ge,z,H]}],"outline-w":[{outline:["",ge,on,Ut]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",f,Rn,En]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",p,Rn,En]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ge,Ut]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",y,Rn,En]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[ge,z,H]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[z,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:pe()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",z,H]}],filter:[{filter:["","none",z,H]}],blur:[{blur:ie()}],brightness:[{brightness:[ge,z,H]}],contrast:[{contrast:[ge,z,H]}],"drop-shadow":[{"drop-shadow":["","none",g,Rn,En]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",ge,z,H]}],"hue-rotate":[{"hue-rotate":[ge,z,H]}],invert:[{invert:["",ge,z,H]}],saturate:[{saturate:[ge,z,H]}],sepia:[{sepia:["",ge,z,H]}],"backdrop-filter":[{"backdrop-filter":["","none",z,H]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ge,z,H]}],"backdrop-contrast":[{"backdrop-contrast":[ge,z,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ge,z,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ge,z,H]}],"backdrop-invert":[{"backdrop-invert":["",ge,z,H]}],"backdrop-opacity":[{"backdrop-opacity":[ge,z,H]}],"backdrop-saturate":[{"backdrop-saturate":[ge,z,H]}],"backdrop-sepia":[{"backdrop-sepia":["",ge,z,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",z,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ge,"initial",z,H]}],ease:[{ease:["linear","initial",x,z,H]}],delay:[{delay:[ge,z,H]}],animate:[{animate:["none",R,z,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,z,H]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:A()}],"skew-x":[{"skew-x":A()}],"skew-y":[{"skew-y":A()}],transform:[{transform:[z,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}
vendor: 4,729 bytes, line 1
1],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z,H]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mbs":[{"scroll-mbs":v()}],"scroll-mbe":[{"scroll-mbe":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pbs":[{"scroll-pbs":v()}],"scroll-pbe":[{"scroll-pbe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",z,H]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ge,on,Ut,Ps]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},sc=Ll(rc);
1function je(...e){return sc(ml(e))}function oc({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=u.useRef(e!==void 0),[o,i]=u.useState(t),a=s?e:o,l=u.useCallback(d=>{s||i(d)},[]);return[a,l]}const Ns={};function jt(e,t){const n=u.useRef(Ns);return n.current===Ns&&(n.current=e(t)),n}const or=Ao[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ic=or&&or!==u.useLayoutEffect?or:e=>e();function fe(e){const t=jt(ac).current;return t.next=e,ic(t.effect),t.trampoline}function ac(){const e={next:void 0,callback:lc,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function lc(){}const cc=()=>{},Ne=typeof document<"u"?u.useLayoutEffect:cc;function uc(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(i=>o.searchParams.append("args[]",i)),`${t} error #${r}; visit ${o} for the full message.`}}const Xt=uc("https://base-ui.com/production-error","Base UI");function Hn(e,t,n,r){const s=jt(ui).current;return fc(s,e,t,n,r)&&di(s,[e,t,n,r]),s.callback}function dc(e){const t=jt(ui).current;return pc(t,e)&&di(t,e),t.callback}function ui(){return{callback:null,cleanup:null,refs:[]}}function fc(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function pc(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function di(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const hc=parseInt(u.version,10);function ns(e){return hc>=e}function Ms(e){if(!u.isValidElement(e))return null;const t=e,n=t.props;return(ns(19)?n?.ref:t.ref)??null}function Ar(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function mc(e,t){const n={};for(const r in e){const s=e[r];if(t?.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function gc(e,t){return typeof e=="function"?e(t):e}function bc(e,t){return typeof e=="function"?e(t):e}const dn={};function rs(e,t,n,r,s){let o={...Dr(e,dn)};return t&&(o=Dn(o,t)),n&&(o=Dn(o,n)),r&&(o=Dn(o,r)),o}function yc(e){if(e.length===0)return dn;if(e.length===1)return Dr(e[0],dn);let t={...Dr(e[0],dn)};for(let n=1;n<e.length;n+=1)t=Dn(t,e[n]);return t}function Dn(e,t){return fi(t)?t(e):vc(e,t)}function vc(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Ar(e.style,r);break}case"className":{e[n]=pi(e.className,r);break}default:wc(n,r)?e[n]=xc(e[n],r):e[n]=r}}return e}function wc(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function fi(e){return typeof e=="function"}function Dr(e,t){return fi(e)?e(t):e??dn}function xc(e,t){return t?e?n=>{if(Sc(n)){const s=n;Lr(s);const o=t(s);return s.baseUIHandlerPrevented||e?.(s),o}const r=t(n);return e?.(n),r}:t:e}function Lr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function pi(e,t){return t?e?t+" "+e:t:e}function Sc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function hi(){}const et=Object.freeze({}),mi="data-base-ui-click-trigger",Cc="data-base-ui-swipe-ignore",Ec=`[${Cc}]`,Rc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function vt(e,t,n={}){const r=t.render,s=kc(t,n);if(n.enabled===!1)return null;const o=n.state??et;return Pc(e,r,s,o)}function kc(e,t={}){const{className:n,style:r,render:s}=e,{state:o=et,ref:i,props:a,stateAttributesMapping:l,enabled:d=!0}=t,f=d?gc(n,o):void 0,p=d?bc(r,o):void 0,y=d?mc(o,l):et,g=d?Ar(y,Array.isArray(a)?yc(a):a)??et:et;return typeof document<"u"&&(d?Array.isArray(i)?g.ref=dc([g.ref,Ms(s),...i]):g.ref=Hn(g.ref,Ms(s),i):Hn(null,null)),d?(f!==void 0&&(g.className=pi(g.className,f)),p!==void 0&&(g.style=Ar(g.style,p)),g):et}const Tc=Symbol.for("react.lazy");function Pc(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=rs(n,t.props);s.ref=n.ref;let o=t;return o?.$$typeof===Tc&&(o=u.Children.toArray(t)[0]),u.cloneElement(o,s)}if(e&&typeof e=="string")return Ic(e,n);throw new Error(Xt(8))}function Ic(e,t){return e==="button"?u.createElement("button",{type:"button",...t,key:t.key}):e==="img"?u.createElement("img",{alt:"",...t,key:t.key}):u.createElement(e,t)}const Oc="none",Fr="trigger-press",Nc="trigger-hover",gi="outside-press",Mc="close-press",bi="focus-out",jc="escape-key",Ac="close-watcher",Dc="imperative-action",kn="swipe";function ze(e,t,n,r){let s=!1,o=!1;const i=et;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}const Lc={...Ao};let js=0;function Fc(e,t="mui"){const[n,r]=u.useState(e),s=e||n;return u.useEffect(()=>{n==null&&(js+=1,r(`${t}-${js}`))},[n,t]),s}const As=Lc.useId;function yn(e,t){if(As!==void 0){const n=As();return e??(t?`${t}-${n}`:n)}return Fc(e,t)}function ss(e){return yn(e,"base-ui")}const _c=[];function yi(e){u.useEffect(e,_c)}const Tn=null;class Uc{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Pn=new Uc;class bt{static create(){return new bt}static request(t){return Pn.request(t)}static cancel(t){return Pn.cancel(t)}currentId=Tn;request(t){this.cancel(),this.currentId=Pn.request(()=>{this.currentId=Tn,t()})}cancel=()=>{this.currentId!==Tn&&(Pn.cancel(this.currentId),this.currentId=Tn)};disposeEffect=()=>this.cancel}function Qn(){const e=jt(bt.create).current;return yi(e.disposeEffect),e}function St(e){return e==null?e:"current"in e?e.current:e}
1let Gt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Bc={[Gt.startingStyle]:""},Hc={[Gt.endingStyle]:""},vn={transitionStatus(e){return e==="starting"?Bc:e==="ending"?Hc:null}};function Vc(e,t=!1,n=!0){const r=Qn();return fe((s,o=null)=>{r.cancel();function i(){Kn.flushSync(s)}const a=St(e);if(a==null)return;const l=a;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let d=function(){const p=Gt.startingStyle;if(!l.hasAttribute(p)){r.request(f);return}const y=new MutationObserver(()=>{l.hasAttribute(p)||(y.disconnect(),f())});y.observe(l,{attributes:!0,attributeFilter:[p]}),o?.addEventListener("abort",()=>y.disconnect(),{once:!0})},f=function(){Promise.all(l.getAnimations().map(p=>p.finished)).then(()=>{o?.aborted||i()}).catch(()=>{const p=l.getAnimations();if(n){if(o?.aborted)return;i()}else p.length>0&&p.some(y=>y.pending||y.playState!=="finished")&&f()})};if(t){d();return}r.request(f)}})}function zc(e,t=!1,n=!1){const[r,s]=u.useState(e&&t?"idle":void 0),[o,i]=u.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),Ne(()=>{if(!e&&o&&r!=="ending"&&n){const a=bt.request(()=>{s("ending")});return()=>{bt.cancel(a)}}},[e,o,r,n]),Ne(()=>{if(!e||t)return;const a=bt.request(()=>{s(void 0)});return()=>{bt.cancel(a)}},[t,e]),Ne(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const a=bt.request(()=>{s("idle")});return()=>{bt.cancel(a)}},[t,e,o,s,r]),u.useMemo(()=>({mounted:o,setMounted:i,transitionStatus:r}),[o,r])}function Zn(){return typeof window<"u"}function Jn(e){return os(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wc(e){var t;return(t=(os(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function os(e){return Zn()?e instanceof Node||e instanceof at(e).Node:!1}function pt(e){return Zn()?e instanceof Element||e instanceof at(e).Element:!1}function yt(e){return Zn()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function hn(e){return!Zn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}function is(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=er(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}let ir;function $c(){return ir==null&&(ir=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ir}function ar(e){return/^(html|body|#document)$/.test(Jn(e))}function er(e){return at(e).getComputedStyle(e)}function Gc(e){if(Jn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hn(e)&&e.host||Wc(e);return hn(t)?t.host:t}const qc=u.createContext(void 0);function Yc(e=!1){const t=u.useContext(qc);if(t===void 0&&!e)throw new Error(Xt(16));return t}function Xc(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,a=r&&t===!1;return{props:u.useMemo(()=>{const d={onKeyDown(f){n&&t&&f.key!=="Tab"&&f.preventDefault()}};return r||(d.tabIndex=s,!o&&n&&(d.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||a)&&(d.disabled=n),d},[r,n,t,i,a,o,s])}}function vi(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=u.useRef(null),a=Yc(!0),l=o??a!==void 0,{props:d}=Xc({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:s}),f=u.useCallback(()=>{const g=i.current;lr(g)&&l&&t&&d.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,d.disabled,l]);Ne(f,[f]);const p=u.useCallback((g={})=>{const{onClick:m,onMouseDown:h,onKeyUp:w,onKeyDown:x,onPointerDown:R,...N}=g;return rs({type:s?"button":void 0,onClick(S){if(t){S.preventDefault();return}m?.(S)},onMouseDown(S){t||h?.(S)},onKeyDown(S){if(t||(Lr(S),x?.(S),S.baseUIHandlerPrevented))return;const O=S.target===S.currentTarget,I=S.currentTarget,v=lr(I),T=!s&&Kc(I),F=O&&(s?v:!T),$=S.key==="Enter",K=S.key===" ",W=I.getAttribute("role"),ee=W?.startsWith("menuitem")||W==="option"||W==="gridcell";if(O&&l&&K){if(S.defaultPrevented&&ee)return;S.preventDefault(),T||s&&v?(I.click(),S.preventBaseUIHandler()):F&&(m?.(S),S.preventBaseUIHandler());return}F&&(!s&&(K||$)&&S.preventDefault(),!s&&$&&m?.(S))},onKeyUp(S){if(!t){if(Lr(S),w?.(S),S.target===S.currentTarget&&s&&l&&lr(S.currentTarget)&&S.key===" "){S.preventDefault();return}S.baseUIHandlerPrevented||S.target===S.currentTarget&&!s&&!l&&S.key===" "&&m?.(S)}},onPointerDown(S){if(t){S.preventDefault();return}R?.(S)}},s?void 0:{role:"button"},d,N)},[t,d,l,s]),y=fe(g=>{i.current=g,f()});return{getButtonProps:p,buttonRef:y}}function lr(e){return yt(e)&&e.tagName==="BUTTON"}function Kc(e){return!!(e?.tagName==="A"&&e?.href)}const sn=typeof navigator<"u",cr=Jc(),wi=tu(),xi=eu(),Si=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Ci=cr.platform==="MacIntel"&&cr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(cr.platform),Qc=sn&&/apple/i.test(navigator.vendor),Vn=sn&&/android/i.test(wi)||/android/i.test(xi);sn&&wi.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Zc=xi.includes("jsdom/");
1function Jc(){if(!sn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function eu(){if(!sn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function tu(){if(!sn)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const _r="data-base-ui-focusable",Ei="active",Ri="selected",nu="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Vt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Se(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&hn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function it(e){return"composedPath"in e?e.composedPath()[0]:e.target}function dt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function ru(e){return e.matches("html,body")}function as(e){return yt(e)&&e.matches(nu)}function Ds(e){return e?e.getAttribute("role")==="combobox"&&as(e):!1}function Ur(e){return e?e.hasAttribute(_r)?e:e.querySelector(`[${_r}]`)||e:null}function en(e,t,n=!0){return e.filter(s=>s.parentId===t&&(!n||s.context?.open)).flatMap(s=>[s,...en(e,s.id,n)])}function Ls(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function su(e){e.preventDefault(),e.stopPropagation()}function ou(e){return"nativeEvent"in e}function iu(e){return e.pointerType===""&&e.isTrusted?!0:Vn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function au(e){return Zc?!1:!Vn&&e.width===0&&e.height===0||Vn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Fs(e,t){return["mouse","pen"].includes(e)}function ki(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function lu(e){return er(e).display!=="none"}var cu=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],zn=cu.join(","),Ti=typeof Element>"u",rn=Ti?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Wn=!Ti&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},$n=function(t,n){var r;n===void 0&&(n=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",i=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):$n(t.parentNode));return i},uu=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Pi=function(t,n,r){if($n(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(zn));return n&&rn.call(t,zn)&&s.unshift(t),s=s.filter(r),s},Gn=function(t,n,r){for(var s=[],o=Array.from(t);o.length;){var i=o.shift();if(!$n(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,d=Gn(l,!0,r);r.flatten?s.push.apply(s,d):s.push({scopeParent:i,candidates:d})}else{var f=rn.call(i,zn);f&&r.filter(i)&&(n||!t.includes(i))&&s.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),y=!$n(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&y){var g=Gn(p===!0?i.children:p.children,!0,r);r.flatten?s.push.apply(s,g):s.push({scopeParent:i,candidates:g})}else o.unshift.apply(o,i.children)}}return s},Ii=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Oi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||uu(t))&&
1!Ii(t)?0:t.tabIndex},du=function(t,n){var r=Oi(t);return r<0&&n&&!Ii(t)?0:r},fu=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ni=function(t){return t.tagName==="INPUT"},pu=function(t){return Ni(t)&&t.type==="hidden"},hu=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},mu=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},gu=function(t){if(!t.name)return!0;var n=t.form||Wn(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(t.name));else try{s=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=mu(s,t.form);return!o||o===t},bu=function(t){return Ni(t)&&t.type==="radio"},yu=function(t){return bu(t)&&!gu(t)},vu=function(t){var n,r=t&&Wn(t),s=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var i,a,l;for(o=!!((i=s)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(s)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&s;){var d,f,p;r=Wn(s),s=(d=r)===null||d===void 0?void 0:d.host,o=!!((f=s)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(s))}}return o},_s=function(t){var n=t.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},wu=function(t,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var i=rn.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(rn.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var l=t;t;){var d=t.parentElement,f=Wn(t);if(d&&!d.shadowRoot&&s(d)===!0)return _s(t);t.assignedSlot?t=t.assignedSlot:!d&&f!==t.ownerDocument?t=f.host:t=d}t=l}if(vu(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _s(t);return!1},xu=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return rn.call(n,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}n=n.parentElement}return!1},Br=function(t,n){return!(n.disabled||pu(n)||wu(n,t)||hu(n)||xu(n))},Hr=function(t,n){return!(yu(n)||Oi(n)<0||!Br(t,n))},Su=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Mi=function(t){var n=[],r=[];return t.forEach(function(s,o){var i=!!s.scopeParent,a=i?s.scopeParent:s,l=du(a,i),d=i?Mi(s.candidates):a;l===0?i?n.push.apply(n,d):n.push(a):r.push({documentOrder:o,tabIndex:l,item:s,isScope:i,content:d})}),r.sort(fu).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(n)},tr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Gn([t],n.includeContainer,{filter:Hr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Su}):r=Pi(t,n.includeContainer,Hr.bind(null,n)),Mi(r)},Cu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Gn([t],n.includeContainer,{filter:Br.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Pi(t,n.includeContainer,Br.bind(null,n)),r},ji=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return rn.call(t,zn)===!1?!1:Hr(n,t)};function Oe(e){return e?.ownerDocument||document}const wn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ai(e,t){const n=tr(e,wn()),r=n.length;if(r===0)return;const s=Vt(Oe(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function Di(e){return Ai(Oe(e).body,1)||e}function Li(e){return Ai(Oe(e).body,-1)||e}function fn(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Se(n,r)}
1function Eu(e){tr(e,wn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Us(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Fi="ArrowUp",_i="ArrowDown",Ui="ArrowLeft",Bi="ArrowRight",Hi="Home",Vi="End",Ru=new Set([Ui,Bi]),ku=new Set([Fi,_i]),Tu=new Set([...Ru,...ku]);[...Tu];const zi=new Set([Fi,_i,Ui,Bi,Hi,Vi]);function ls(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,o=fe(s),i=Vc(r,n,!1);u.useEffect(()=>{if(!t)return;const a=new AbortController;return i(o,a.signal),()=>{a.abort()}},[t,n,o,i])}const an=0;class qt{static create(){return new qt}currentId=an;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=an,n()},t)}isStarted(){return this.currentId!==an}clear=()=>{this.currentId!==an&&(clearTimeout(this.currentId),this.currentId=an)};disposeEffect=()=>this.clear}function mn(){const e=jt(qt.create).current;return yi(e.disposeEffect),e}let Bs={},Hs={},Vs="";function Pu(e){if(typeof document>"u")return!1;const t=Oe(e);return at(t).innerWidth-t.documentElement.clientWidth>0}function Iu(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Oe(e),r=n.documentElement,s=n.body,o=is(r)?r:s,i=o.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const l=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=a,l===d}function Ou(e){const t=Oe(e),n=t.documentElement,r=t.body,s=is(n)?n:r,o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Nu(e){const t=Oe(e),n=t.documentElement,r=t.body,s=at(n);let o=0,i=0,a=!1;const l=bt.create();if(Si&&(s.visualViewport?.scale??1)!==1)return()=>{};function d(){const y=s.getComputedStyle(n),g=s.getComputedStyle(r),w=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Bs={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Vs=n.style.scrollBehavior,Hs={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,R=n.scrollWidth>n.clientWidth,N=y.overflowY==="scroll"||g.overflowY==="scroll",M=y.overflowX==="scroll"||g.overflowX==="scroll",S=Math.max(0,s.innerWidth-r.clientWidth),O=Math.max(0,s.innerHeight-r.clientHeight),I=parseFloat(g.marginTop)+parseFloat(g.marginBottom),v=parseFloat(g.marginLeft)+parseFloat(g.marginRight),T=is(n)?n:r;if(a=Iu(e),a){n.style.scrollbarGutter=w,T.style.overflowY="hidden",T.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||N)&&(n.style.overflowY="scroll"),(R||M)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||O?`calc(100dvh - ${I+O}px)`:"100dvh",width:v||S?`calc(100vw - ${v+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,Bs),Object.assign(r.style,Hs),a||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Vs)}function p(){f(),l.request(d)}return d(),s.addEventListener("resize",p),()=>{l.cancel(),f(),typeof s.removeEventListener=="function"&&s.removeEventListener("resize",p)}}class Mu{lockCount=0;restore=null;timeoutLock=qt.create();timeoutUnlock=qt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Oe(t).documentElement,s=at(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=hi;return}const o=Ci||!Pu(t);this.restore=o?Ou(t):Nu(t)}}const ju=new Mu;function Au(e=!0,t=null){Ne(()=>{if(e)return ju.acquire(t)},[e,t])}function ur(e){const t=jt(Du,e).current;return t.next=e,Ne(t.effect),t}function Du(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}
1const Lu={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Fu={...Lu,position:"fixed",top:0,left:0},qn=u.forwardRef(function(t,n){const[r,s]=u.useState();Ne(()=>{Qc&&s("button")},[]);const o={tabIndex:0,role:r};return c.jsx("span",{...t,ref:n,style:Fu,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});function Yn(e){return`data-base-ui-${e}`}let zs=0;function dr(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:s=!1}=t;r&&cancelAnimationFrame(zs);const o=()=>e?.focus({preventScroll:n});s?o():zs=requestAnimationFrame(o)}const fr={inert:new WeakMap,"aria-hidden":new WeakMap},Ws="data-base-ui-inert",Vr={inert:new WeakSet,"aria-hidden":new WeakSet};let ln=new WeakMap,pr=0;function _u(e){return Vr[e]}function Wi(e){return e?hn(e)?e.host:Wi(e.parentNode):null}const hr=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Wi(n);return e.contains(r)?r:null}).filter(n=>n!=null),$s=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Gs=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{Jn(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function Uu(e,t,n,r,{mark:s=!0,markerIgnoreElements:o=[]}){const i=r?"inert":n?"aria-hidden":null;let a=null,l=null;const d=hr(t,e),f=s?hr(t,o):[],p=new Set(f),y=s?Gs(t,$s(d),new Set(d)).filter(h=>!p.has(h)):[],g=[],m=[];if(i){const h=fr[i],w=_u(i);l=w,a=h;const x=hr(t,Array.from(t.querySelectorAll("[aria-live]"))),R=d.concat(x);Gs(t,$s(R),new Set(R)).forEach(M=>{const S=M.getAttribute(i),O=S!==null&&S!=="false",I=(h.get(M)||0)+1;h.set(M,I),g.push(M),I===1&&O&&w.add(M),O||M.setAttribute(i,i==="inert"?"":"true")})}return s&&y.forEach(h=>{const w=(ln.get(h)||0)+1;ln.set(h,w),m.push(h),w===1&&h.setAttribute(Ws,"")}),pr+=1,()=>{a&&g.forEach(h=>{const x=(a.get(h)||0)-1;a.set(h,x),x||(!l?.has(h)&&i&&h.removeAttribute(i),l?.delete(h))}),s&&m.forEach(h=>{const w=(ln.get(h)||0)-1;ln.set(h,w),w||h.removeAttribute(Ws)}),pr-=1,pr||(fr.inert=new WeakMap,fr["aria-hidden"]=new WeakMap,Vr.inert=new WeakSet,Vr["aria-hidden"]=new WeakSet,ln=new WeakMap)}}function qs(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0,markerIgnoreElements:o=[]}=t,i=Oe(e[0]).body;return Uu(e,i,n,r,{mark:s,markerIgnoreElements:o})}const $i=u.createContext(null),Gi=()=>u.useContext($i),Bu=Yn("portal");function Hu(e={}){const{ref:t,container:n,componentProps:r=et,elementProps:s}=e,o=yn(),a=Gi()?.portalNode,[l,d]=u.useState(null),[f,p]=u.useState(null),y=fe(w=>{w!==null&&p(w)}),g=u.useRef(null);Ne(()=>{if(n===null){g.current&&(g.current=null,p(null),d(null));return}if(o==null)return;const w=(n&&(os(n)?n:n.current))??a??document.body;if(w==null){g.current&&(g.current=null,p(null),d(null));return}g.current!==w&&(g.current=w,p(null),d(w))},[n,a,o]);const m=vt("div",r,{ref:[t,y],props:[{id:o,[Bu]:""},s]});return{portalNode:f,portalSubtree:l&&m?Kn.createPortal(m,l):null}}const Vu=u.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,renderGuards:a,...l}=t,{portalNode:d,portalSubtree:f}=Hu({container:s,ref:n,componentProps:t,elementProps:l}),p=u.useRef(null),y=u.useRef(null),g=u.useRef(null),m=u.useRef(null),[h,w]=u.useState(null),x=h?.modal,R=h?.open,N=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!d;u.useEffect(()=>{if(!d||x)return;function S(O){d&&O.relatedTarget&&fn(O)&&(O.type==="focusin"?Us:Eu)(d)}return d.addEventListener("focusin",S,!0),d.addEventListener("focusout",S,!0),()=>{d.removeEventListener("focusin",S,!0),d.removeEventListener("focusout",S,!0)}},[d,x]),u.useEffect(()=>{!d||R||Us(d)},[R,d]);const M=u.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:y,beforeInsideRef:g,afterInsideRef:m,portalNode:d,setFocusManagerState:w}),[d]);return c.jsxs(u.Fragment,{children:[f,c.jsxs($i.Provider,{value:M,children:[N&&d&&c.jsx(qn,{"data-type":"outside",ref:p,onFocus:S=>
1{if(fn(S,d))g.current?.focus();else{const O=h?h.domReference:null;Li(O)?.focus()}}}),N&&d&&c.jsx("span",{"aria-owns":d.id,style:Rc}),d&&Kn.createPortal(r,d),N&&d&&c.jsx(qn,{"data-type":"outside",ref:y,onFocus:S=>{if(fn(S,d))m.current?.focus();else{const O=h?h.domReference:null;Di(O)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ze(bi,S.nativeEvent))}}})]})]})});function zu(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const Wu=u.createContext(null),$u=u.createContext(null),qi=()=>u.useContext(Wu)?.id||null,Yi=e=>{const t=u.useContext($u);return e??t};function Gu(e,t){const n=at(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Ys=20;let Nt=[];function cs(){Nt=Nt.filter(e=>e.deref()?.isConnected)}function qu(e){cs(),e&&Jn(e)!=="body"&&(Nt.push(new WeakRef(e)),Nt.length>Ys&&(Nt=Nt.slice(-Ys)))}function mr(){return cs(),Nt[Nt.length-1]?.deref()}function Yu(e){if(!e)return null;const t=wn();return ji(e,t)?e:tr(e,t)[0]||e}function Xu(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():lu(e)}function Xs(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=wn(),s=Cu(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return ji(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Xi(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:d="",nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:y,externalTree:g,getInsideElements:m}=e,h="rootStore"in t?t.rootStore:t,w=h.useState("open"),x=h.useState("domReferenceElement"),R=h.useState("floatingElement"),{events:N,dataRef:M}=h.context,S=fe(()=>M.current.floatingContext?.nodeId),O=s===!1,I=Ds(x)&&O,v=u.useRef(["content"]),T=ur(s),F=ur(o),$=ur(d),K=Yi(g),W=Gi(),ee=u.useRef(!1),re=u.useRef(!1),oe=u.useRef(!1),ue=u.useRef(-1),be=u.useRef(""),L=u.useRef(""),j=u.useRef(null),G=u.useRef(null),pe=Hn(j,y,W?.beforeInsideRef),de=Hn(G,W?.afterInsideRef),he=mn(),Y=mn(),Q=Qn(),ae=W!=null,Z=Ur(R),U=fe((A=Z)=>A?tr(A,wn()):[]),ie=fe(()=>m?.().filter(A=>A!=null)??[]),Ce=fe(A=>{const V=U(A);return v.current.map(()=>V).filter(Boolean).flat()});u.useEffect(()=>{if(r||!a)return;function A(le){le.key==="Tab"&&Se(Z,Vt(Oe(Z)))&&U().length===0&&!I&&su(le)}const V=Oe(Z);return V.addEventListener("keydown",A),()=>{V.removeEventListener("keydown",A)}},[r,x,Z,a,v,I,U,Ce]),u.useEffect(()=>{if(r||!w)return;const A=Oe(Z);function V(){oe.current=!1}function le(J){const X=it(J),C=ie(),P=Se(R,X)||Se(x,X)||Se(W?.portalNode,X)||C.some(b=>
1b===X||Se(b,X));oe.current=!P,L.current=J.pointerType||"keyboard",X?.closest(`[${mi}]`)&&(re.current=!0)}function me(){L.current="keyboard"}return A.addEventListener("pointerdown",le,!0),A.addEventListener("pointerup",V,!0),A.addEventListener("pointercancel",V,!0),A.addEventListener("keydown",me,!0),()=>{A.removeEventListener("pointerdown",le,!0),A.removeEventListener("pointerup",V,!0),A.removeEventListener("pointercancel",V,!0),A.removeEventListener("keydown",me,!0)}},[r,R,x,Z,w,W,ie]),u.useEffect(()=>{if(r||!l)return;const A=Oe(Z);function V(){re.current=!0,Y.start(0,()=>{re.current=!1})}function le(P){const b=it(P),B=U().indexOf(b);B!==-1&&(ue.current=B)}function me(P){const b=P.relatedTarget,k=P.currentTarget,B=it(P);queueMicrotask(()=>{const _=S(),ne=h.context.triggerElements,te=ie(),Pe=b?.hasAttribute(Yn("focus-guard"))&&[j.current,G.current,W?.beforeInsideRef.current,W?.afterInsideRef.current,W?.beforeOutsideRef.current,W?.afterOutsideRef.current,St(p),St(f)].includes(b),Fe=!(Se(x,b)||Se(R,b)||Se(b,R)||Se(W?.portalNode,b)||te.some(ye=>ye===b||Se(ye,b))||b!=null&&ne.hasElement(b)||ne.hasMatchingElement(ye=>Se(ye,b))||Pe||K&&(en(K.nodesRef.current,_).find(ye=>Se(ye.context?.elements.floating,b)||Se(ye.context?.elements.domReference,b))||Ls(K.nodesRef.current,_).find(ye=>[ye.context?.elements.floating,Ur(ye.context?.elements.floating)].includes(b)||ye.context?.elements.domReference===b)));if(k===x&&Z&&Xs(Z,v),i&&k!==x&&!Xu(B)&&Vt(A)===A.body){if(yt(Z)&&(Z.focus(),i==="popup")){Q.request(()=>{Z.focus()});return}const ye=ue.current,ve=U(),Ae=ve[ye]||ve[ve.length-1]||Z;yt(Ae)&&Ae.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(I||!a)&&b&&Fe&&!re.current&&(I||b!==mr())&&(ee.current=!0,h.setOpen(!1,ze(bi,P)))})}function J(){oe.current||(M.current.insideReactTree=!0,he.start(0,()=>{M.current.insideReactTree=!1}))}const X=yt(x)?x:null,C=[];if(!(!R&&!X))return X&&(X.addEventListener("focusout",me),X.addEventListener("pointerdown",V),C.push(()=>{X.removeEventListener("focusout",me),X.removeEventListener("pointerdown",V)})),R&&(R.addEventListener("focusin",le),R.addEventListener("focusout",me),W&&(R.addEventListener("focusout",J,!0),C.push(()=>{R.removeEventListener("focusout",J,!0)})),C.push(()=>{R.removeEventListener("focusin",le),R.removeEventListener("focusout",me)})),()=>{C.forEach(P=>{P()})}},[r,x,R,Z,a,K,W,h,l,i,U,I,S,v,M,he,Y,Q,f,p,ie]),u.useEffect(()=>{if(r||!R||!w)return;const A=Array.from(W?.portalNode?.querySelectorAll(`[${Yn("portal")}]`)||[]),le=(K?Ls(K.nodesRef.current,S()):[]).find(b=>Ds(b.context?.elements.domReference||null))?.context?.elements.domReference,J=[...[R,...A,j.current,G.current,W?.beforeOutsideRef.current,W?.afterOutsideRef.current,...ie()],le,St(p),St(f),I?x:null].filter(b=>b!=null),X=qs(J,{ariaHidden:a||I,mark:!1}),C=[R,...A].filter(b=>b!=null),P=qs(C);return()=>{P(),X()}},[w,r,x,R,a,v,W,I,K,S,f,p,ie]),Ne(()=>{if(!w||r||!yt(Z))return;const A=Oe(Z),V=Vt(A);queueMicrotask(()=>{const le=Ce(Z),me=T.current,J=typeof me=="function"?me($.current||""):me;if(J===void 0||J===!1)return;let X;J===!0||J===null?X=le[0]||Z:X=St(J),X=X||le[0]||Z,!Se(Z,V)&&dr(X,{preventScroll:X===Z})})},[r,w,Z,O,Ce,T,$]),Ne(()=>{if(r||!Z)return;const A=Oe(Z),V=Vt(A);qu(V);function le(J){if(J.open||(be.current=Gu(J.nativeEvent,L.current)),J.reason===Nc&&J.nativeEvent.type==="mouseleave"&&(ee.current=!0),J.reason===gi)if(J.nested)ee.current=!1;else if(iu(J.nativeEvent)||au(J.nativeEvent))ee.current=!1;else{let X=!1;document.createElement("div").focus({get preventScroll(){return X=!0,!1}}),X?ee.current=!1:ee.current=!0}}N.on("openchange",le);function me(){const J=F.current;let X=typeof J=="function"?J(be.current):J;if(X===void 0||X===!1)return null;if(X===null&&(X=!0),typeof X=="boolean"){const P=x||mr();return P&&P.isConnected?P:null}const C=x||mr();return St(X)||C||null}return()=>{N.off("openchange",le);const J=Vt(A),X=ie(),C=Se(R,J)||X.some(b=>b===J||Se(b,J))||K&&en(K.nodesRef.current,S(),!1).some(b=>Se(b.context?.elements.floating,J)),P=me();queueMicrotask(()=>{const b=Yu(P),k=typeof F.current!="boolean";F.current&&!ee.current&&yt(b)&&(!(!k&&b!==J&&J!==A.body)||C)&&b.focus({preventScroll:!0}),ee.current=!1})}},[r,R,Z,F,M,N,K,x,S,ie]),Ne(()=>{if(!Si||w||!R)return;const A=Vt(Oe(R));!yt(A)||!as(A)||Se(R,A)&&A.blur()}
1,[w,R]),Ne(()=>{if(!(r||!W))return W.setFocusManagerState({modal:a,closeOnFocusOut:l,open:w,onOpenChange:h.setOpen,domReference:x}),()=>{W.setFocusManagerState(null)}},[r,W,a,w,h,l,x]),Ne(()=>{if(!(r||!Z))return Xs(Z,v),()=>{queueMicrotask(cs)}},[r,Z,v]);const se=!r&&(a?!I:!0)&&(ae||a);return c.jsxs(u.Fragment,{children:[se&&c.jsx(qn,{"data-type":"inside",ref:pe,onFocus:A=>{if(a){const V=Ce();dr(V[V.length-1])}else W?.portalNode&&(ee.current=!1,fn(A,W.portalNode)?Di(x)?.focus():St(p??W.beforeOutsideRef)?.focus())}}),n,se&&c.jsx(qn,{"data-type":"inside",ref:de,onFocus:A=>{a?dr(Ce()[0]):W?.portalNode&&(l&&(ee.current=!0),fn(A,W.portalNode)?Li(x)?.focus():St(f??W.afterOutsideRef)?.focus())}})]})}function Ku(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:s=!0,event:o="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:d=0,reason:f=Fr}=t,p=u.useRef(void 0),y=Qn(),g=mn(),m=u.useMemo(()=>({onPointerDown(h){p.current=h.pointerType},onMouseDown(h){const w=p.current,x=h.nativeEvent,R=n.select("open");if(h.button!==0||o==="click"||Fs(w)&&a)return;const N=r.current.openEvent,M=N?.type,S=n.select("domReferenceElement")!==h.currentTarget,O=R&&S||!(R&&i&&(!(N&&l)||M==="click"||M==="mousedown"));if(as(x.target)){const v=ze(f,x,x.target);O&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,v)}):n.setOpen(O,v);return}const I=h.currentTarget;y.request(()=>{const v=ze(f,x,I);O&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,v)}):n.setOpen(O,v)})},onClick(h){if(o==="mousedown-only")return;const w=p.current;if(o==="mousedown"&&w){p.current=void 0;return}if(Fs(w)&&a)return;const x=n.select("open"),R=r.current.openEvent,N=n.select("domReferenceElement")!==h.currentTarget,M=x&&N||!(x&&i&&(!(R&&l)||ki(R))),S=ze(f,h.nativeEvent,h.currentTarget);M&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,S)}):n.setOpen(M,S)},onKeyDown(){p.current=void 0}}),[r,o,a,n,l,i,y,g,d,f]);return u.useMemo(()=>s?{reference:m}:et,[s,m])}const Qu={intentional:"onClick",sloppy:"onPointerDown"};function Zu(){return!1}function Ju(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ed(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingElement"),{dataRef:o}=n.context,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:d="sloppy",referencePress:f=Zu,referencePressEvent:p="sloppy",bubbles:y,externalTree:g}=t,m=Yi(g),h=fe(typeof l=="function"?l:()=>!1),w=typeof l=="function"?h:l,x=w!==!1,R=fe(()=>d),N=u.useRef(!1),M=u.useRef(!1),S=u.useRef(!1),{escapeKey:O,outsidePress:I}=Ju(y),v=u.useRef(null),T=mn(),F=mn(),$=fe(()=>{F.clear(),o.current.insideReactTree=!1}),K=u.useRef(!1),W=u.useRef(""),ee=fe(f),re=fe(G=>
1{if(!r||!i||!a||G.key!=="Escape"||K.current)return;const pe=o.current.floatingContext?.nodeId,de=m?en(m.nodesRef.current,pe):[];if(!O&&de.length>0){let Q=!0;if(de.forEach(ae=>{ae.context?.open&&!ae.context.dataRef.current.__escapeKeyBubbles&&(Q=!1)}),!Q)return}const he=ou(G)?G.nativeEvent:G,Y=ze(jc,he);n.setOpen(!1,Y),!O&&!Y.isPropagationAllowed&&G.stopPropagation()}),oe=fe(()=>{o.current.insideReactTree=!0,F.start(0,$)});u.useEffect(()=>{if(!r||!i)return;o.current.__escapeKeyBubbles=O,o.current.__outsidePressBubbles=I;const G=new qt,pe=new qt;function de(){G.clear(),K.current=!0}function he(){G.start($c()?5:0,()=>{K.current=!1})}function Y(){S.current=!0,pe.start(0,()=>{S.current=!1})}function Q(){N.current=!1,M.current=!1}function ae(){const b=W.current,k=b==="pen"||!b?"mouse":b,B=R(),_=typeof B=="function"?B():B;return typeof _=="string"?_:_[k]}function Z(b){const k=ae();return k==="intentional"&&b.type!=="click"||k==="sloppy"&&b.type==="click"}function U(b){const k=o.current.floatingContext?.nodeId,B=m&&en(m.nodesRef.current,k).some(_=>dt(b,_.context?.elements.floating));return dt(b,n.select("floatingElement"))||dt(b,n.select("domReferenceElement"))||B}function ie(b){if(Z(b)){$();return}if(o.current.insideReactTree){$();return}const k=it(b),B=`[${Yn("inert")}]`;let _=Array.from(Oe(n.select("floatingElement")).querySelectorAll(B));const ne=pt(k)?k.getRootNode():null;hn(ne)&&(_=_.concat(Array.from(ne.querySelectorAll(B))));const te=n.context.triggerElements;if(k&&(te.hasElement(k)||te.hasMatchingElement(ve=>Se(ve,k))))return;let Pe=pt(k)?k:null;for(;Pe&&!ar(Pe);){const ve=Gc(Pe);if(ar(ve)||!pt(ve))break;Pe=ve}if(_.length&&pt(k)&&!ru(k)&&!Se(k,n.select("floatingElement"))&&_.every(ve=>!Se(Pe,ve)))return;if(yt(k)&&!("touches"in b)){const ve=ar(k),Ae=er(k),nt=/auto|scroll/,Be=ve||nt.test(Ae.overflowX),Ye=ve||nt.test(Ae.overflowY),lt=Be&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,kt=Ye&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,We=Ae.direction==="rtl",wt=kt&&(We?b.offsetX<=k.offsetWidth-k.clientWidth:b.offsetX>k.clientWidth),Xe=lt&&b.offsetY>k.clientHeight;if(wt||Xe)return}if(U(b))return;if(ae()==="intentional"&&S.current){pe.clear(),S.current=!1;return}if(typeof w=="function"&&!w(b))return;const Fe=o.current.floatingContext?.nodeId,ye=m?en(m.nodesRef.current,Fe):[];if(ye.length>0){let ve=!0;if(ye.forEach(Ae=>{Ae.context?.open&&!Ae.context.dataRef.current.__outsidePressBubbles&&(ve=!1)}),!ve)return}n.setOpen(!1,ze(gi,b)),$()}function Ce(b){ae()!=="sloppy"||b.pointerType==="touch"||!n.select("open")||!i||dt(b,n.select("floatingElement"))||dt(b,n.select("domReferenceElement"))||ie(b)}function se(b){if(ae()!=="sloppy"||!n.select("open")||!i||dt(b,n.select("floatingElement"))||dt(b,n.select("domReferenceElement")))return;const k=b.touches[0];k&&(v.current={startTime:Date.now(),startX:k.clientX,startY:k.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{v.current&&(v.current.dismissOnTouchEnd=!1,v.current.dismissOnMouseDown=!1)}))}function A(b){W.current="touch";
1const k=it(b);function B(){se(b),k?.removeEventListener(b.type,B)}k?.addEventListener(b.type,B)}function V(b){if(T.clear(),b.type==="pointerdown"&&(W.current=b.pointerType),b.type==="mousedown"&&v.current&&!v.current.dismissOnMouseDown)return;const k=it(b);function B(){b.type==="pointerdown"?Ce(b):ie(b),k?.removeEventListener(b.type,B)}k?.addEventListener(b.type,B)}function le(b){if(!N.current)return;const k=M.current;if(Q(),ae()==="intentional"){if(b.type==="pointercancel"){k&&Y();return}if(!U(b)){if(k){Y();return}typeof w=="function"&&!w(b)||(pe.clear(),S.current=!0,$())}}}function me(b){if(ae()!=="sloppy"||!v.current||dt(b,n.select("floatingElement"))||dt(b,n.select("domReferenceElement")))return;const k=b.touches[0];if(!k)return;const B=Math.abs(k.clientX-v.current.startX),_=Math.abs(k.clientY-v.current.startY),ne=Math.sqrt(B*B+_*_);ne>5&&(v.current.dismissOnTouchEnd=!0),ne>10&&(ie(b),T.clear(),v.current=null)}function J(b){const k=it(b);function B(){me(b),k?.removeEventListener(b.type,B)}k?.addEventListener(b.type,B)}function X(b){ae()!=="sloppy"||!v.current||dt(b,n.select("floatingElement"))||dt(b,n.select("domReferenceElement"))||(v.current.dismissOnTouchEnd&&ie(b),T.clear(),v.current=null)}function C(b){const k=it(b);function B(){X(b),k?.removeEventListener(b.type,B)}k?.addEventListener(b.type,B)}const P=Oe(s);return a&&(P.addEventListener("keydown",re),P.addEventListener("compositionstart",de),P.addEventListener("compositionend",he)),x&&(P.addEventListener("click",V,!0),P.addEventListener("pointerdown",V,!0),P.addEventListener("pointerup",le,!0),P.addEventListener("pointercancel",le,!0),P.addEventListener("mousedown",V,!0),P.addEventListener("mouseup",le,!0),P.addEventListener("touchstart",A,!0),P.addEventListener("touchmove",J,!0),P.addEventListener("touchend",C,!0)),()=>{a&&(P.removeEventListener("keydown",re),P.removeEventListener("compositionstart",de),P.removeEventListener("compositionend",he)),x&&(P.removeEventListener("click",V,!0),P.removeEventListener("pointerdown",V,!0),P.removeEventListener("pointerup",le,!0),P.removeEventListener("pointercancel",le,!0),P.removeEventListener("mousedown",V,!0),P.removeEventListener("mouseup",le,!0),P.removeEventListener("touchstart",A,!0),P.removeEventListener("touchmove",J,!0),P.removeEventListener("touchend",C,!0)),G.clear(),pe.clear(),Q(),S.current=!1}},[o,s,a,x,w,r,i,O,I,re,$,R,m,n,T]),u.useEffect($,[w,$]);const ue=u.useMemo(()=>({onKeyDown:re,[Qu[p]]:G=>{ee()&&n.setOpen(!1,ze(Fr,G.nativeEvent))},...p!=="intentional"&&{onClick(G){ee()&&n.setOpen(!1,ze(Fr,G.nativeEvent))}}}),[re,n,p,ee]),be=fe(G=>{if(!r||!i||G.button!==0)return;const pe=it(G.nativeEvent);Se(n.select("floatingElement"),pe)&&(N.current||(N.current=!0,M.current=!1))}),L=fe(G=>{!r||!i||(G.defaultPrevented||G.nativeEvent.defaultPrevented)&&N.current&&(M.current=!0)}),j=u.useMemo(()=>({onKeyDown:re,onPointerDown:L,onMouseDown:L,onClickCapture:oe,onMouseDownCapture(G){oe(),be(G)},onPointerDownCapture(G){oe(),be(G)},onMouseUpCapture:oe,onTouchEndCapture:oe,onTouchMoveCapture:oe}),[re,oe,be,L]);return u.useMemo(()=>i?{reference:ue,floating:j,trigger:ue}:{},[i,ue,j])}var Xn=Symbol("NOT_FOUND");function td(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function nd(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function rd(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Ks=e=>Array.isArray(e)?e:[e];function sd(e){const t=Array.isArray(e[0])?e[0]:e;return rd(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function od(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}function id(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Xn},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function ad(e,t){let n=[];function r(a){const l=n.findIndex(d=>t(a,d.key));if(l>-1){const d=n[l];return l>0&&(n.splice(l,1),n.unshift(d)),d.value}return Xn}function s(a,l){r(a)===Xn&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function i(){n=[]}return{get:r,put:s,getEntries:o,clear:i}}var ld=(e,t)=>e===t;function cd(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:s}=n;for(let o=0;o<s;o++)if(!e(n[o],r[o]))return!1;return!0}}function ud(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=ld,maxSize:s=1,resultEqualityCheck:o}=n,i=cd(r);let a=0;const l=s<=1?id(i):ad(s,i);function d(){let f=l.get(arguments);if(f===Xn){if(f=e.apply(null,arguments),a++,o){const y=l.getEntries().find(g=>o(g.value,f));y&&(f=y.value,a!==0&&a--)}l.put(arguments,f)}return f}return d.clearCache=()=>{l.clear(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}var dd=class{constructor(e){this.value=e}deref(){return this.value}},fd=typeof WeakRef<"u"?WeakRef:dd,pd=0,Qs=1;function In(){return{s:pd,v:void 0,o:null,p:null}}function Ki(e,t={}){let n=In();const{resultEqualityCheck:r}=t;let s,o=0;function i(){let a=n;const{length:l}=arguments;for(let p=0,y=l;p<y;p++){const g=arguments[p];if(typeof g=="function"||typeof g=="object"&&g!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const h=m.get(g);h===void 0?(a=In(),m.set(g,a)):a=h}else{let m=a.p;m===null&&(a.p=m=new Map);const h=m.get(g);h===void 0?(a=In(),m.set(g,a)):a=h}}const d=a;let f;if(a.s===Qs)f=a.v;else if(f=e.apply(null,arguments),o++,r){const p=s?.deref?.()??s;p!=null&&r(p,f)&&(f=p,o!==0&&o--),s=typeof f=="object"&&f!==null||typeof f=="function"?new fd(f):f}return d.s=Qs,d.v=f,f}return i.clearCache=()=>{n=In(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function Qi(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...s)=>{let o=0,i=0,a,l={},d=s.pop();typeof d=="object"&&(l=d,d=s.pop()),td(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const f={...n,...l},{memoize:p,memoizeOptions:y=[],argsMemoize:g=Ki,argsMemoizeOptions:m=[]}=f,h=Ks(y),w=Ks(m),x=sd(s),R=p(function(){return o++,d.apply(null,arguments)},...h),N=g(function(){i++;const S=od(x,arguments);return a=R.apply(null,S),a},...w);return Object.assign(N,{resultFunc:d,memoizedResultFunc:R,dependencies:x,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var hd=Qi(Ki),md=Object.assign((e,t=hd)=>{nd(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((i,a,l)=>(i[n[l]]=a,i),{}))},{withTypes:()=>md});Qi({memoize:ud,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Re=(e,t,n,r,s,o,...i)=>{if(i.length>0)throw new Error(Xt(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var gr={exports:{}},br={};var Zs;function gd(){if(Zs)return br;Zs=1;var e=Do();function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(p,y){var g=y(),m=r({inst:{value:g,getSnapshot:y}}),h=m[0].inst,w=m[1];return o(function(){h.value=g,h.getSnapshot=y,l(h)&&w({inst:h})},[p,g,y]),s(function(){return l(h)&&w({inst:h}),p(function(){l(h)&&w({inst:h})})},[p]),i(g),g}function l(p){var y=p.getSnapshot;p=p.value;try{var g=y();return!n(p,g)}catch{return!0}}function d(p,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return br.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,br}var Js;
1function Zi(){return Js||(Js=1,gr.exports=gd()),gr.exports}var bd=Zi(),yr={exports:{}},vr={};var eo;function yd(){if(eo)return vr;eo=1;var e=Do(),t=Zi();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return vr.useSyncExternalStoreWithSelector=function(d,f,p,y,g){var m=o(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function x(O){if(!R){if(R=!0,N=O,O=y(O),g!==void 0&&h.hasValue){var I=h.value;if(g(I,O))return M=I}return M=O}if(I=M,r(N,O))return I;var v=y(O);return g!==void 0&&g(I,v)?(N=O,I):(N=O,M=v)}var R=!1,N,M,S=p===void 0?null:p;return[function(){return x(f())},S===null?void 0:function(){return x(S())}]},[f,p,y,g]);var w=s(d,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=w},[w]),l(w),w},vr}var to;function vd(){return to||(to=1,yr.exports=yd()),yr.exports}var wd=vd();const xd=ns(19),Sd=xd?Ed:Rd;function Ji(e,t,n,r,s){return Sd(e,t,n,r,s)}function Cd(e,t,n,r,s){const o=u.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return bd.useSyncExternalStore(e.subscribe,o,o)}function Ed(e,t,n,r,s){return Cd(e,t,n,r,s)}function Rd(e,t,n,r,s){return wd.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class kd{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return Ji(this,t,n,r,s)}}class ea extends kd{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){u.useDebugValue(t),Ne(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;Ne(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);Ne(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){u.useDebugValue(t);const r=n!==void 0;Ne(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return u.useDebugValue(t),Ji(this,this.selectors[t],n,r,s)}useContextCallback(t,n){u.useDebugValue(t);const r=fe(n??hi);this.context[t]=r}useStateSetter(t){const n=u.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const a=s;s=i,n(i,a,this)}})}}const Td={open:Re(e=>e.open),domReferenceElement:Re(e=>e.domReferenceElement),referenceElement:Re(e=>e.positionReference??e.referenceElement),floatingElement:Re(e=>e.floatingElement),floatingId:Re(e=>e.floatingId)};class ta extends ea{constructor(t){const{nested:n,noEmit:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:zu(),nested:n,noEmit:r,triggerElements:o},Td)}setOpen=(t,n)=>{if((!t||!this.state.open||ki(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function Pd(e,t){const n=u.useRef(null),r=u.useRef(null);return u.useCallback(s=>{if(e!==void 0){if(n.current!==null){const o=n.current,i=r.current,a=t.context.triggerElements.getById(o);i&&a===i&&t.context.triggerElements.delete(o),n.current=null,r.current=null}s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s))}},[t,e])}function Id(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Pd(e,n),i=fe(a=>{if(o(a),!a||!n.select("open"))return;const l=n.select("activeTriggerId");if(l===e){n.update({activeTriggerElement:a,...r});return}l==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...r})});return Ne(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:s}}function Od(e){const t=e.useState("open");Ne(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,s]=n.value;e.update({activeTriggerId:r,activeTriggerElement:s})}}},[t,e])}function Nd(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=zc(e);t.useSyncedValues({mounted:r,transitionStatus:o});const i=fe(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return ls({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:o}}class na{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Md(){return new ta({open:!1,floatingElement:null,referenceElement:null,triggerElements:new na,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}
1function jd(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:Md(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:et,inactiveTriggerProps:et,popupProps:et}}const On=Re(e=>e.triggerIdProp??e.activeTriggerId),Ad={open:Re(e=>e.openProp??e.open),mounted:Re(e=>e.mounted),transitionStatus:Re(e=>e.transitionStatus),floatingRootContext:Re(e=>e.floatingRootContext),preventUnmountingOnClose:Re(e=>e.preventUnmountingOnClose),payload:Re(e=>e.payload),activeTriggerId:On,activeTriggerElement:Re(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Re((e,t)=>t!==void 0&&On(e)===t),isOpenedByTrigger:Re((e,t)=>t!==void 0&&On(e)===t&&e.open),isMountedByTrigger:Re((e,t)=>t!==void 0&&On(e)===t&&e.mounted),triggerProps:Re((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Re(e=>e.popupProps),popupElement:Re(e=>e.popupElement),positionerElement:Re(e=>e.positionerElement)};function Dd(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:s}=e,o=yn(),i=qi()!=null,a=t.useState("open"),l=t.useState("activeTriggerElement"),d=t.useState(r?"popupElement":"positionerElement"),f=t.context.triggerElements,p=jt(()=>new ta({open:a,referenceElement:l,floatingElement:d,triggerElements:f,onOpenChange:s,floatingId:o,nested:i,noEmit:n})).current;return Ne(()=>{const y={open:a,floatingId:o,referenceElement:l,floatingElement:d};pt(l)&&(y.domReferenceElement=l),p.state.positionReference===p.state.referenceElement&&(y.positionReference=l),p.update(y)},[a,o,l,d,p]),p.context.onOpenChange=s,p.context.nested=i,p.context.noEmit=n,p}function ra(e=[]){const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),s=e.map(d=>d?.trigger),o=u.useCallback(d=>Nn(d,e,"reference"),t),i=u.useCallback(d=>Nn(d,e,"floating"),n),a=u.useCallback(d=>Nn(d,e,"item"),r),l=u.useCallback(d=>Nn(d,e,"trigger"),s);return u.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a,getTriggerProps:l}),[o,i,a,l])}function Nn(e,t,n){const r=new Map,s=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[_r]="");for(const i in e)s&&e&&(i===Ei||i===Ri)||(o[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const l=t[i]?.[n];typeof l=="function"?a=e?l(e):null:a=l,a&&no(o,a,s,r)}return no(o,e,s,r),o}function no(e,t,n,r){for(const s in t){const o=t[s];n&&(s===Ei||s===Ri)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof o=="function"&&(r.get(s)?.push(o),e[s]=(...i)=>r.get(s)?.map(a=>a(...i)).find(a=>a!==void 0))):e[s]=o)}}const Ld=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Fd(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),s=n.useState("floatingId"),o=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:a="dialog"}=t,l=yn(),d=o?.id||l,f=u.useMemo(()=>Ur(i)?.id||s,[i,s]),p=Ld.get(a)??a,g=qi()!=null,m=u.useMemo(()=>p==="tooltip"||a==="label"?et:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&g&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,g,a]),h=u.useMemo(()=>p==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?f:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?f:void 0,...p==="menu"&&{id:d}},[p,f,r,d,a,m]),w=u.useMemo(()=>{const R={id:f,...p&&{role:p}};return p==="tooltip"||a==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":d}}},[p,f,d,a]),x=u.useCallback(({active:R,selected:N})=>{const M={role:"option",...R&&{id:`${f}-fui-option`}};switch(a){case"select":case"combobox":return{...M,"aria-selected":N}}return{}},[f,a]);return u.useMemo(()=>({reference:h,floating:w,item:x,trigger:m}),[h,w,m,x])}function _d(e){const t=u.useRef(""),n=u.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:u.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function Ud(e,t){const n=u.useRef(e),r=fe(t);Ne(()=>{n.current!==e&&r(n.current)},[e,r]),Ne(()=>{n.current=e},[e])}function Bd(e){const[t,n]=u.useState(null),r=fe((i,a)=>{e||n(a||(Ci?"touch":""))});Ud(e,i=>{i&&!e&&n(null)});const{onClick:s,onPointerDown:o}=_d(r);return u.useMemo(()=>({openMethod:t,triggerProps:{onClick:s,onPointerDown:o}}),[t,s,o])}function Hd(e){const{store:t,parentContext:n,actionsRef:r}=e,s=t.useState("open"),o=t.useState("disablePointerDismissal"),i=t.useState("modal"),a=t.useState("popupElement"),{openMethod:l,triggerProps:d}=Bd(s);Od(t);const{forceUnmount:f}=Nd(s,t),p=fe(T=>{const F=ze(T);return F.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},F}),y=u.useCallback(()=>{t.setOpen(!1,p(Dc))},[t,p]);u.useImperativeHandle(r,()=>({unmount:f,close:y}),[f,y]);const g=Dd({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,h]=u.useState(0),w=m===0,x=Fd(g),R=ed(g,{outsidePressEvent(){return t.context.
1internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(T){if(!t.context.outsidePressEnabledRef.current||"button"in T&&T.button!==0||"touches"in T&&T.touches.length!==1)return!1;const F=it(T);if(w&&!o){const $=F;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===$||t.context.backdropRef.current===$||Se($,a)&&!$?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:w});Au(s&&i===!0,a);const{getReferenceProps:N,getFloatingProps:M,getTriggerProps:S}=ra([x,R]);t.useContextCallback("onNestedDialogOpen",T=>{h(T+1)}),t.useContextCallback("onNestedDialogClose",()=>{h(0)}),u.useEffect(()=>(n?.onNestedDialogOpen&&s&&n.onNestedDialogOpen(m),n?.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[s,n,m]);const O=u.useMemo(()=>N(d),[N,d]),I=u.useMemo(()=>S(d),[S,d]),v=u.useMemo(()=>M(),[M]);t.useSyncedValues({openMethod:l,activeTriggerProps:O,inactiveTriggerProps:I,popupProps:v,floatingRootContext:g,nestedOpenDialogCount:m})}const sa=u.createContext(void 0);function tt(e){const t=u.useContext(sa);if(e===!1&&t===void 0)throw new Error(Xt(27));return t}const Vd={...Ad,modal:Re(e=>e.modal),nested:Re(e=>e.nested),nestedOpenDialogCount:Re(e=>e.nestedOpenDialogCount),disablePointerDismissal:Re(e=>e.disablePointerDismissal),openMethod:Re(e=>e.openMethod),descriptionElementId:Re(e=>e.descriptionElementId),titleElementId:Re(e=>e.titleElementId),viewportElement:Re(e=>e.viewportElement),role:Re(e=>e.role)};class zd extends ea{constructor(t){super(Wd(t),{popupRef:u.createRef(),backdropRef:u.createRef(),internalBackdropRef:u.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new na,onOpenChange:void 0,onOpenChangeComplete:void 0},Vd)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const s={open:t},o=n.trigger?.id??null;(o||t)&&(s.activeTriggerId=o,s.activeTriggerElement=n.trigger??null),this.update(s)}}function Wd(e={}){return{...jd(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}let qe=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Gt.startingStyle]="startingStyle",e[e.endingStyle=Gt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),$d=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Gd={[$d.popupOpen]:""},qd={[qe.open]:""},Yd={[qe.closed]:""},Xd={[qe.anchorHidden]:""},Kd={open(e){return e?Gd:null}},xn={open(e){return e?qd:Yd},anchorHidden(e){return e?Xd:null}},Qd={...xn,...vn},Zd=u.forwardRef(function(t,n){const{render:r,className:s,forceRender:o=!1,...i}=t,{store:a}=tt(),l=a.useState("open"),d=a.useState("nested"),f=a.useState("mounted"),p=a.useState("transitionStatus");return vt("div",t,{state:{open:l,transitionStatus:p},ref:[a.context.backdropRef,n],stateAttributesMapping:Qd,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:o||!d})}),Jd=u.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...a}=t,{store:l}=tt(),d=l.useState("open");function f(m){d&&l.setOpen(!1,ze(Mc,m.nativeEvent))}const{getButtonProps:p,buttonRef:y}=vi({disabled:o,native:i});return vt("button",t,{state:{disabled:o},ref:[n,y],props:[{onClick:f},a,p]})}),ef=u.forwardRef(function(t,n){const{render:r,className:s,id:o,...i}=t,{store:a}=tt(),l=ss(o);return a.useSyncedValueWithCleanup("descriptionElementId",l),vt("p",t,{ref:n,props:[{id:l},i]})});let tf=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),nf=(function(e){return e[e.open=qe.open]="open",e[e.closed=qe.closed]="closed",e[e.startingStyle=qe.startingStyle]="startingStyle",e[e.endingStyle=qe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const oa=u.createContext(void 0);function us(){const e=u.useContext(oa);if(e===void 0)throw new Error(Xt(26));return e}const rf={...xn,...vn,nestedDialogOpen(e){return e?{[nf.nestedDialogOpen]:""}:null}},sf=u.forwardRef(function(t,n){const{className:r,finalFocus:s,initialFocus:o,render:i,...a}=t,{store:l}=tt(),d=l.useState("descriptionElementId"),f=l.useState("disablePointerDismissal"),p=l.useState("floatingRootContext"),y=l.useState("popupProps"),g=l.useState("modal"),m=l.useState("mounted"),h=l.useState("nested"),w=l.useState("nestedOpenDialogCount"),x=l.useState("open"),R=l.useState("openMethod"),N=l.useState("titleElementId"),M=l.useState("transitionStatus"),S=l.useState("role");us(),ls({open:x,ref:l.context.popupRef,onComplete(){x&&l.context.onOpenChangeComplete?.(!0)}});function O($){return $==="touch"?l.context.popupRef.current:!0}const I=o===void 0?O:o,v=w>0,F=vt("div",t,{state:{open:x,nested:h,transitionStatus:M,nestedDialogOpen:v},props:[y,{"aria-labelledby":N??void 0,"aria-describedby":d??void 0,role:S,tabIndex:-1,hidden:!m,onKeyDown($){zi.has($.key)&&$.stopPropagation()},style:{[tf.nestedDialogs]:w}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:rf});return c.jsx(Xi,{context:p,openInteractionType:R,disabled:!m,closeOnFocusOut:!f,initialFocus:I,returnFocus:s,modal:g!==!1,restoreFocus:"popup",children:F})});function of(e){return ns(19)?e:e?"true":void 0}const af=u.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r?.getBoundingClientRect();o=`polygon( 2 0% 0%, 3 100% 0%, 4 100% 100%, 5 0% 100%, 6 0% 0%, 7 ${i.left}px ${i.top}px, 8 ${i.left}px ${i.bottom}px, 9 ${i.right}px ${i.bottom}px, 10 ${i.right}px ${i.top}px, 11 ${i.left}px ${i.top}px 12 )`}return c.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),ia=u.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:o}=tt(),i=o.useState("mounted"),a=o.useState("modal"),l=o.useState("open");return i||r?c.jsx(oa.Provider,{value:r,children:c.jsxs(Vu,{ref:n,...s,children:[i&&a===!0&&c.jsx(af,{ref:o.context.
12internalBackdropRef,inert:of(!l)}),t.children]})}):null}),aa=u.forwardRef(function(t,n){const{render:r,className:s,id:o,...i}=t,{store:a}=tt(),l=ss(o);return a.useSyncedValueWithCleanup("titleElementId",l),vt("h2",t,{ref:n,props:[{id:l},i]})}),lf=u.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,id:a,payload:l,handle:d,...f}=t,p=tt(!0),y=d?.store??p?.store;if(!y)throw new Error(Xt(79));const g=ss(a),m=y.useState("floatingRootContext"),h=y.useState("isOpenedByTrigger",g),w=u.useRef(null),{registerTrigger:x,isMountedByThisTrigger:R}=Id(g,w,y,{payload:l}),{getButtonProps:N,buttonRef:M}=vi({disabled:o,native:i}),S=Ku(m,{enabled:m!=null}),O=ra([S]),I={disabled:o,open:h},v=y.useState("triggerProps",R);return vt("button",t,{state:I,ref:[M,n,x,w],props:[O.getReferenceProps(),v,{[mi]:"",id:g},f,N],stateAttributesMapping:Kd})});let ro=(function(e){return e[e.open=qe.open]="open",e[e.closed=qe.closed]="closed",e[e.startingStyle=qe.startingStyle]="startingStyle",e[e.endingStyle=qe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const cf={...xn,...vn,nested(e){return e?{[ro.nested]:""}:null},nestedDialogOpen(e){return e?{[ro.nestedDialogOpen]:""}:null}},la=u.forwardRef(function(t,n){const{className:r,render:s,children:o,...i}=t,a=us(),{store:l}=tt(),d=l.useState("open"),f=l.useState("nested"),p=l.useState("transitionStatus"),y=l.useState("nestedOpenDialogCount"),g=l.useState("mounted"),m=y>0;return vt("div",t,{enabled:a||g,state:{open:d,nested:f,transitionStatus:p,nestedDialogOpen:m},ref:[n,l.useStateSetter("viewportElement")],stateAttributesMapping:cf,props:[{role:"presentation",hidden:!g,style:{pointerEvents:d?void 0:"none"},children:o},i]})});function uf(e){const t=u.useRef(!0);t.current&&(t.current=!1,e())}function ca(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:l,handle:d,triggerId:f,defaultTriggerId:p=null}=e,y=tt(!0),g=!!y,m=jt(()=>d?.store??new zd({open:r,openProp:n,activeTriggerId:p,triggerIdProp:f,modal:a,disablePointerDismissal:i,nested:g})).current;uf(()=>{n===void 0&&m.state.open===!1&&r===!0&&m.update({open:!0,activeTriggerId:p})}),m.useControlledProp("openProp",n),m.useControlledProp("triggerIdProp",f),m.useSyncedValues({disablePointerDismissal:i,nested:g,modal:a}),m.useContextCallback("onOpenChange",s),m.useContextCallback("onOpenChangeComplete",o);const h=m.useState("payload");Hd({store:m,actionsRef:l,parentContext:y?.store.context});const w=u.useMemo(()=>({store:m}),[m]);return c.jsx(sa.Provider,{value:w,children:typeof t=="function"?t({payload:h}):t})}function df(e){return c.jsx(ca,{...e})}function ff(e){return c.jsx(ia,{...e})}function pf(e){const{className:t,...n}=e;return c.jsx(Zd,{className:je("fixed inset-0 z-50 bg-black/50 transition-opacity","data-ending-style:opacity-0","data-starting-style:opacity-0",t),...n})}function hf(e){const{className:t,...n}=e;return c.jsx(la,{className:je("fixed inset-0 z-50 flex items-center justify-center",t),...n})}function mf(e){const{className:t,...n}=e;return c.jsx(sf,{className:je("w-full max-w-md rounded-xl border bg-white p-6 shadow-lg outline-none","data-ending-style:scale-95 data-ending-style:opacity-0","data-starting-style:scale-95 data-starting-style:opacity-0","transition-[opacity,transform] duration-150",t),...n})}function gf(e){const{className:t,...n}=e;return c.jsx(aa,{className:je("text-xl leading-none font-semibold tracking-tight",t),...n})}function bf(e){const{className:t,...n}=e;return c.jsx(ef,{className:je("text-[13px] text-gray-500",t),...n})}function yf(e){return c.jsx(Jd,{...e})}function vf(e){return c.jsxs(ff,{children:[c.jsx(pf,{forceRender:!0,className:"z-[100000000]"}),c.jsx(hf,{className:"z-[100000000]",children:c.jsx(mf,{...e})})]})}const so={Root:df,TopMostContent:vf,Title:gf,Description:bf,Close:yf};Array.from({length:60},(e,t)=>t);function Ge(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}let Ve=(function(e){return e.nestedDrawers="--nested-drawers",e.height="--drawer-height",e.frontmostHeight="--drawer-frontmost-height",e.swipeMovementX="--drawer-swipe-movement-x",e.swipeMovementY="--drawer-swipe-movement-y",e.snapPointOffset="--drawer-snap-point-offset",e.swipeStrength="--drawer-swipe-strength",e})({}),Et=(function(e){return e.swipeProgress="--drawer-swipe-progress",e})({});const wf={...xn,...vn},xf=u.forwardRef(function(t,n){const{render:r,className:s,forceRender:o=!1,...i}=t,{store:a}=tt(),l=a.useState("open"),d=a.useState("nested"),f=a.useState("mounted"),p=a.useState("transitionStatus");return vt("div",t,{state:{open:l,transitionStatus:p},ref:[a.context.backdropRef,n],stateAttributesMapping:wf,props:[{role:"presentation",hidden:!f,style:{pointerEvents:l?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[Et.swipeProgress]:"0",[Ve.swipeStrength]:"1"}},i],enabled:o||!d})}),Sf="data-drawer-content",Cf=u.createContext(void 0);function ua(e){return u.useContext(Cf)}let ft=(function(e){return e[e.open=qe.open]="open",e[e.closed=qe.closed]="closed",e[e.startingStyle=qe.startingStyle]="startingStyle",e[e.endingStyle=qe.endingStyle]="endingStyle",e.expanded="data-expanded",e.nestedDrawerOpen="data-nested-drawer-open",e.nestedDrawerSwiping="data-nested-drawer-swiping",e.swipeDismiss="data-swipe-dismiss",e.swipeDirection="data-swipe-direction",e.swiping="data-swiping",e})({});const da=u.createContext(void 0);function nr(e){const t=u.useContext(da);if(e===!1&&t===void 0)throw new Error(Xt(90));return t}
12function oo(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e=="number")return Number.isFinite(e)?e<=1?Ge(e,0,1)*t:e:null;const r=e.trim();if(r.endsWith("px")){const s=Number.parseFloat(r);return Number.isFinite(s)?s:null}if(r.endsWith("rem")){const s=Number.parseFloat(r);return Number.isFinite(s)?s*n:null}return null}function Ef(e,t){let n=null,r=1/0;for(const s of t){const o=Math.abs(s.height-e);o<r&&(r=o,n=s)}return n}function fa(){const{store:e}=tt(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:s}=nr(),o=e.useState("viewportElement"),[i,a]=u.useState(0),[l,d]=u.useState(16),f=fe(()=>{const m=Oe(o).documentElement;o&&a(o.offsetHeight),o||a(m.clientHeight);const h=parseFloat(getComputedStyle(m).fontSize);Number.isFinite(h)&&d(h)});Ne(()=>{if(f(),!o||typeof ResizeObserver!="function")return;const g=new ResizeObserver(f);return g.observe(o),()=>{g.disconnect()}},[f,o]);const p=u.useMemo(()=>{if(!t||t.length===0||i<=0||s<=0)return[];const g=Math.min(s,i);if(!Number.isFinite(g)||g<=0)return[];const m=t.map(x=>{const R=oo(x,i,l);if(R===null||!Number.isFinite(R))return null;const N=Ge(R,0,g);return{value:x,height:N,offset:Math.max(0,s-N)}}).filter(x=>!!x);if(m.length<=1)return m;const h=[],w=[];for(let x=m.length-1;x>=0;x-=1){const R=m[x];w.some(M=>Math.abs(M-R.height)<=1)||(w.push(R.height),h.push(R))}return h.reverse(),h},[s,l,t,i]),y=u.useMemo(()=>{if(n===void 0)return p[0];if(n===null)return;const g=p.find(x=>Object.is(x.value,n));if(g)return g;const m=Math.min(s,i),h=oo(n,i,l);if(h===null||!Number.isFinite(h))return;const w=Ge(h,0,m);return Ef(w,p)??void 0},[n,s,p,l,i]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:s,viewportHeight:i,resolvedSnapPoints:p,activeSnapPointOffset:y?.offset??null}}const pa=u.createContext(null);function Rf(e){return u.useContext(pa)}let io=!1;function kf(){io||(typeof CSS<"u"&&"registerProperty"in CSS&&([Ve.swipeMovementX,Ve.swipeMovementY,Ve.snapPointOffset].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:Et.swipeProgress,initialValue:"0"},{name:Ve.swipeStrength,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),io=!0)}const Tf={...xn,...vn,expanded(e){return e?{[ft.expanded]:""}:null},nestedDrawerOpen(e){return e?{[ft.nestedDrawerOpen]:""}:null},nestedDrawerSwiping(e){return e?{[ft.nestedDrawerSwiping]:""}:null},swipeDirection(e){return e?{[ft.swipeDirection]:e}:null},swiping(e){return e?{[ft.swiping]:""}:null}},Pf=u.forwardRef(function(t,n){const{className:r,finalFocus:s,initialFocus:o,render:i,...a}=t,{store:l}=tt(),{swipeDirection:d,frontmostHeight:f,hasNestedDrawer:p,nestedSwiping:y,nestedSwipeProgressStore:g,onPopupHeightChange:m,notifyParentFrontmostHeight:h,notifyParentHasNestedDrawer:w}
12=nr(),x=l.useState("descriptionElementId"),R=l.useState("disablePointerDismissal"),N=l.useState("floatingRootContext"),M=l.useState("popupProps"),S=l.useState("modal"),O=l.useState("mounted"),I=l.useState("nested"),v=l.useState("nestedOpenDialogCount"),T=l.useState("transitionStatus"),F=l.useState("open"),$=l.useState("openMethod"),K=l.useState("titleElementId"),W=l.useState("role"),ee=v>0,re=Rf(),oe=re?.swiping??!1,ue=re?.swipeStrength??null,{snapPoints:be,activeSnapPoint:L,activeSnapPointOffset:j}=fa();us();const[G,pe]=u.useState(0),de=u.useRef(0),he=fe(()=>{const A=l.context.popupRef.current;if(!A)return;const V=A.offsetHeight;if(de.current>0&&f>de.current&&V>de.current)return;if(de.current>0&&p){const J=de.current;pe(J),m(J);return}const me=V;me!==de.current&&(de.current=me,pe(me),m(me))});Ne(()=>{if(!O){de.current=0,pe(0),m(0);return}const A=l.context.popupRef.current;if(!A||(kf(),he(),typeof ResizeObserver!="function"))return;const V=new ResizeObserver(he);return V.observe(A),()=>{V.disconnect()}},[he,O,ee,m,l.context.popupRef]),Ne(()=>{const A=l.context.popupRef,V=()=>{const me=A.current;if(!me)return;const J=g.getSnapshot();J>0?me.style.setProperty(Et.swipeProgress,`${J}`):me.style.setProperty(Et.swipeProgress,"0")};V();const le=g.subscribe(V);return()=>{le();const me=A.current;me&&me.style.setProperty(Et.swipeProgress,"0")}},[g,l.context.popupRef]),u.useEffect(()=>{if(F)return h?.(f),()=>{h?.(0)}},[f,F,h]),u.useEffect(()=>w?(w(F||T==="ending"),()=>{w(!1)}):void 0,[w,F,T]),ls({open:F,ref:l.context.popupRef,onComplete(){F&&l.context.onOpenChangeComplete?.(!0)}});const Y=o===void 0?l.context.popupRef:o,Q={open:F,nested:I,transitionStatus:T,expanded:L===1,nestedDrawerOpen:ee,nestedDrawerSwiping:y,swipeDirection:d,swiping:oe};let ae;G&&!(!p&&T!=="ending")&&(ae=`${G}px`);const U=be&&be.length>0&&(d==="down"||d==="up");let ie=null;U&&j!==null&&(ie=d==="up"?-j:j);let Ce=re?re.getDragStyles():et;if(U&&d==="down"){const A=j??0,V=Number.parseFloat(String(Ce[Ve.swipeMovementY]??0)),le=Number.isFinite(V)?A+V:A,me=le<0;if(oe&&me&&Number.isFinite(V)){const J=Math.abs(le),C=-Math.sqrt(J)-A;Ce={...Ce,transform:void 0,[Ve.swipeMovementY]:`${C}px`}}else Ce={...Ce,transform:void 0}}const se=vt("div",t,{state:Q,props:[M,{"aria-labelledby":K,"aria-describedby":x,role:W,tabIndex:-1,hidden:!O,onKeyDown(A){zi.has(A.key)&&A.stopPropagation()},style:{...Ce,[Et.swipeProgress]:"0",[Ve.nestedDrawers]:v,[Ve.height]:ae,[Ve.snapPointOffset]:typeof ie=="number"?`${ie}px`:"0px",[Ve.frontmostHeight]:f?`${f}px`:void 0,[Ve.swipeStrength]:typeof ue=="number"&&Number.isFinite(ue)&&ue>0?`${ue}`:"1"}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:Tf});return c.jsx(Xi,{context:N,openInteractionType:$,disabled:!O,closeOnFocusOut:!R,initialFocus:Y,returnFocus:s,modal:S!==!1,restoreFocus:"popup",children:se})}),If=ia;var ao,lo;function Of(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:l,handle:d,triggerId:f,defaultTriggerId:p=null,swipeDirection:y="down",snapToSequentialPoints:g=!1,snapPoints:m,snapPoint:h,defaultSnapPoint:w,onSnapPointChange:x}=e,R=fe(x),N=nr(!0),M=N?.onNestedSwipeProgressChange,S=N?.onNestedFrontmostHeightChange,O=N?.onNestedSwipingChange,I=N?.onNestedDrawerPresenceChange,[v,T]=u.useState(0),[F,$]=u.useState(0),[K,W]=u.useState(!1),[ee,re]=u.useState(!1),[oe]=u.useState(Nf),ue=w!==void 0?w:m?.[0]??null,be=h!==void 0,[L,j]=oc({controlled:h,default:ue,name:"Drawer",state:"snapPoint"}),G=u.useRef(!1),pe=fe((se,A)=>{const V=A??ze(Oc);R?.(se,V),!V.isCanceled&&j(se)}),de=u.useMemo(()=>be||!m||m.length===0?L:L===null||!m.some(se=>Object.is(se,L))?ue:L,[L,be,ue,m]),he=fe(se=>{T(se),!G.current&&se>0&&$(se)}),Y=fe(se=>{if(se>0){G.current=!0,$(se);return}G.current=!1,v>0&&$(v)}),Q=fe(se=>{W(se)}),ae=fe(se=>{oe.set(se),M?.(se)}),Z=fe(se=>{re(se),O?.(se)}),U=fe((se,A)=>{s?.(se,A),!A.isCanceled&&!se&&m&&m.length>0&&pe(ue,ze(A.reason,A.event,A.trigger))}),ie=u.useMemo(()=>({swipeDirection:y,snapToSequentialPoints:g,snapPoints:m,activeSnapPoint:de,setActiveSnapPoint:pe,frontmostHeight:F,popupHeight:v,hasNestedDrawer:K,nestedSwiping:ee,nestedSwipeProgressStore:oe,onNestedDrawerPresenceChange:Q,onPopupHeightChange:he,onNestedFrontmostHeightChange:Y,onNestedSwipingChange:Z,onNestedSwipeProgressChange:ae,notifyParentFrontmostHeight:S,notifyParentSwipingChange:O,notifyParentSwipeProgressChange:M,notifyParentHasNestedDrawer:I}),[de,F,K,ee,oe,I,M,O,S,Q,Y,ae,Z,he,v,pe,m,g,y]),Ce=typeof t=="function"?se=>c.jsxs(u.Fragment,{children:[ao||(ao=c.jsx(co,{})),t(se)]}):c.jsxs(u.Fragment,{children:[lo||(lo=c.jsx(co,{})),t]});return c.jsx(da.Provider,{value:ie,children:c.jsx(ca,{open:n,defaultOpen:r,onOpenChange:U,onOpenChangeComplete:o,disablePointerDismissal:i,modal:
12a,actionsRef:l,handle:d,triggerId:f,defaultTriggerId:p,children:Ce})})}function Nf(){let e=0;const t=new Set;return{getSnapshot:()=>e,set(n){const r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(s=>{s()}))},subscribe(n){return t.add(n),()=>{t.delete(n)}}}}function co(){const e=yn(),t=ua(),n=tt(!1),r=n.store.useState("open"),s=n.store.useState("nestedOpenDialogCount"),o=n.store.useState("popupElement"),i=s===0;return u.useEffect(()=>{if(!(!t||e==null))return()=>{t.removeDrawer(e)}},[e,t]),u.useEffect(()=>{e!=null&&t?.setDrawerOpen(e,r)},[e,r,t]),u.useEffect(()=>{if(!r||!i||!Vn)return;const l=at(o).CloseWatcher;if(!l)return;function d(p){n.store.select("open")&&n.store.setOpen(!1,ze(Ac,p))}const f=new l;return f.addEventListener("close",d),()=>{f.removeEventListener("close",d),f.destroy()}},[n.store,i,r,o]),null}function zr(e,t){const n=er(e);if(t==="vertical"){const s=n.overflowY;return(s==="auto"||s==="scroll")&&e.scrollHeight>e.clientHeight}const r=n.overflowX;return(r==="auto"||r==="scroll")&&e.scrollWidth>e.clientWidth}function Mf(e,t,n){let r=e;for(;r&&r!==t;){for(const s of n)if(zr(r,s))return!0;r=r.parentElement}return!1}function Qt(e,t,n="vertical"){let r=yt(e)?e:null;for(;r&&r!==t;){if(zr(r,n))return r;r=r.parentElement}return zr(t,n)?t:null}function Ln(e,t,n){return typeof e?.elementFromPoint=="function"?e.elementFromPoint(t,n):null}const jf=40,Af=10,Df=1,Lf=50,uo=16,Ff=80,_f='button,a,input,select,textarea,label,[role="button"]';function wr(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Uf(e){const n=window.getComputedStyle(e).transform;let r=0,s=0,o=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const a=i[1].split(", ").map(parseFloat);a.length===6?(r=a[4],s=a[5],o=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],s=a[13],o=a[0])}}return{x:r,y:s,scale:o}}function Mn(e){return Number.isFinite(e)&&e>0?e:null}function Bf(e){return e%2===1}function xr(e,t,n){const r=e[n];if(typeof r=="function")try{r.call(e,t)}catch(s){if(s&&typeof s=="object"&&"name"in s&&s.name==="NotFoundError")return;throw s}}function Hf(e){const{enabled:t,directions:n,elementRef:r,movementCssVars:s,canStart:o,ignoreSelectorWhenTouch:i=!0,ignoreScrollableAncestors:a=!1,swipeThreshold:l,onDismiss:d,onProgress:f,onSwipeStart:p,onRelease:y,onSwipingChange:g,trackDrag:m=!0}=e,h=_f,w=n.length===1?n[0]:void 0,x=Math.max(0,typeof l=="number"?l:jf),R=n.includes("left"),N=n.includes("right"),M=n.includes("up"),S=n.includes("down"),O=R||N,I=M||S,v=u.useMemo(()=>{const E=[];return I&&E.push("vertical"),O&&E.push("horizontal"),E},[O,I]),[T,F]=u.useState(void 0),[$,K]=u.useState(!1),[W,ee]=u.useState(!1),[re,oe]=u.useState(!1),[ue,be]=u.useState({x:0,y:0}),[L,j]=u.useState({x:0,y:0,scale:1}),[G,pe]=u.useState(null),de=u.useRef({x:0,y:0}),he=u.useRef({x:0,y:0}),Y=u.useRef(null),Q=u.useRef({x:0,y:0,scale:1}),ae=u.useRef(void 0),Z=u.useRef(0),U=u.useRef(!1),ie=u.useRef({x:0,y:0}),Ce=u.useRef(!1),se=u.useRef(!1),A=u.useRef(null),V=u.useRef(!1),le=u.useRef(!1),me=u.useRef({width:0,height:0}),J=u.useRef(0),X=u.useRef(x),C=u.useRef(null),P=u.useRef(null),b=u.useRef({x:0,y:0}),k=u.useRef(null),B=u.useRef(!1),_=fe(E=>{B.current!==E&&(B.current=E,K(E),g?.(E))});function ne(E){if(!E)return;if(typeof l!="function"){X.current=x;return}const D=r.current;if(!D)return;const q=l({element:D,direction:E});X.current=Math.max(0,q)}const te=fe((E,D)=>{const q=Number.isFinite(E)?Ge(E,0,1):0,ke=q!==J.current;let we=!1;if(D){const Ee=k.current;we=!Ee||Ee.deltaX!==D.deltaX||Ee.deltaY!==D.deltaY||Ee.direction!==D.direction}!ke&&!we||(J.current=q,D?k.current=D:ke&&(k.current=null),f?.(q,D))});function Pe(E,D){if(D===null)return;const q=P.current;if(q&&D>q.time){const ke=Math.max(D-q.time,uo);b.current={x:(E.x-q.x)/ke,y:(E.y-q.y)/ke}}P.current={x:E.x,y:E.y,time:D}}const Fe=u.useCallback(()=>{F(void 0),_(!1),ee(!1),oe(!1),be({x:0,y:0}),j({x:0,y:0,scale:1}),pe(null),te(0),X.current=x,de.current={x:0,y:0},he.current={x:0,y:0},Q.current={x:0,y:0,scale:1},ae.current=void 0,Z.current=0,U.current=!1,ie.current={x:0,y:0},Ce.current=!1,Y.current=null,se.current=!1,A.current=null,V.current=!1,le.current=!1,me.current={width:0,height:0},C.current=null,P.current=null,b.current={x:0,y:0},k.current=null},[_,x,te]);u.useEffect(()=>{typeof l!="function"&&(X.current=x)},[x,l]);function ye(E){if("touches"in E){const D=E.touches[0];return D?{x:D.clientX,y:D.clientY}:null}return{x:E.clientX,y:E.clientY}}function ve(E){return"touches"in E?!0:E.pointerType==="touch"}function Ae(E,D){const q=Oe(r.current);return Ln(q,E.x,E.y)??it(D)}function nt(E,D){return O&&!I?Qt(E,D,"horizontal"):I&&!O?Qt(E,D,"vertical"):Qt(E,D,"vertical")??Qt(E,D,"horizontal")}function Be(E,D,q){V.current=!1;const ke=ve(E),we=Ae(D,E.nativeEvent),Ie=Oe(r.current).body,_e=ke&&Ie?nt(we,Ie):null,ce=q?.ignoreScrollableTarget??!1;if(_e&&!ce||(V.current=!!(_e&&ce),(we?we.closest(h):!1)&&(!ke||i)))return!1;const Me=r.current;if(a&&Me&&we&&v.length>0&&!(q?.ignoreScrollableAncestors??!1)&&Mf(we,Me,v))return!1;if(U.current=!1,ae.current=void 0,Z.current=0,de.current=D,C.current=Mn(E.timeStamp),ie.current=D,Y.current=D,Me){me.current={width:Me.offsetWidth,height:Me.offsetHeight},ne(w);const Le=Uf(Me);Q.current=Le,he.current={x:Le.x,y:Le.y},j(Le),be({x:Le.x,y:Le.y}),Pe({x:Le.x,y:Le.y},C.current),"touches"in E||xr(Me,E.pointerId,"setPointerCapture")}return p?.(E.nativeEvent),_(!0),ee(!1),pe(null),Ce.current=!0,te(0),!0}function Ye(){lt(),V.current=!1,Y.current=null}function lt(){se.current=!1,A.current=null}function kt(E){if(Ye(),!B.current)return;_(!1),ee(!1),pe(null);const D=m?L:Q.current;he.current={x:D.x,y:D.y},be({x:D.x,y:D.y}),F(void 0),le.current=!1;const q=r.current;q&&xr(q,E.pointerId,"releasePointerCapture"),te(0,{deltaX:0,deltaY:0,direction:void 0})}function We(E,D){const q=Ie=>Ie>=0?Ie**.5:-(Math.abs(Ie)**.5),ke=(Ie,_e,ce)=>!_e&&Ie<0||!ce&&Ie>0?q(Ie):Ie,we=O?ke(E,R,N):q(E),Ee=I?ke(D,M,S):q(D);return{x:we,y:Ee}}function wt(E,D,q){const ke=Math.abs(D),we=Math.abs(q);if(I&&q!==0&&(!O||we>=ke)){const _e=Math.max(0,E.scrollHeight-E.clientHeight),ce=E.scrollTop<=0,xe=E.scrollTop>=_e,Me=q>0,Le=q<0;return Me&&ce&&S||Le&&xe&&M}
12if(O&&D!==0&&(!I||ke>we)){const _e=Math.max(0,E.scrollWidth-E.clientWidth),ce=E.scrollLeft<=0,xe=E.scrollLeft>=_e,Me=D>0,Le=D<0;return Me&&ce&&N||Le&&xe&&R}return null}const Xe=fe(E=>{if(!t||E.defaultPrevented||E.nativeEvent.defaultPrevented||!("touches"in E)&&E.button!==0)return;const D=ye(E);!D||(se.current=!0,A.current=D,V.current=!1,le.current=!1,!(o?o(D,{nativeEvent:E.nativeEvent,direction:w}):!0))||Be(E,D)&<()});function At(E,D,q){if(!t||!B.current)return;const ke=it(E.nativeEvent);if(ve(E)&&!V.current){const st=E.currentTarget;if(nt(ke,st))return}if("touches"in E||E.preventDefault(),Ce.current){de.current=D;const st=Mn(E.timeStamp);st!==null&&(C.current=st),Ce.current=!1}const we=D.x,Ee=D.y,Ie=q.x,_e=q.y;(_e<0&&Ee>ie.current.y||_e>0&&Ee<ie.current.y)&&(ie.current={x:ie.current.x,y:Ee}),(Ie<0&&we>ie.current.x||Ie>0&&we<ie.current.x)&&(ie.current={x:we,y:ie.current.y});const ce=we-de.current.x,xe=Ee-de.current.y,Me=Ee-ie.current.y,Le=we-ie.current.x;if(!W&&Math.sqrt(ce*ce+xe*xe)>=Df&&(ee(!0),G===null&&O&&I)){const Kt=Math.abs(ce),rr=Math.abs(xe);pe(Kt>rr?"horizontal":"vertical")}let Te;if(!ae.current)G==="vertical"?xe>0?Te="down":xe<0&&(Te="up"):G==="horizontal"?ce>0?Te="right":ce<0&&(Te="left"):Math.abs(ce)>=Math.abs(xe)?Te=ce>0?"right":"left":Te=xe>0?"down":"up",Te&&(Te==="left"&&R||Te==="right"&&N||Te==="up"&&M||Te==="down"&&S)&&(ae.current=Te,Z.current=wr(Te,ce,xe),F(Te),ne(Te));else{const st=ae.current,Kt=wr(st,Le,Me);Kt>X.current?(U.current=!1,F(st)):!(R&&N)&&!(M&&S)&&Z.current-Kt>=Af&&(U.current=!0)}const ht=We(ce,xe);let ct=Q.current.x,Qe=Q.current.y;G==="horizontal"?O&&(ct+=ht.x):(G==="vertical"||O&&(ct+=ht.x),I&&(Qe+=ht.y)),he.current={x:ct,y:Qe},m&&be({x:ct,y:Qe}),Pe({x:ct,y:Qe},Mn(E.timeStamp));const Tt=ct-Q.current.x,mt=Qe-Q.current.y,Lt=ae.current,Ft=w??ae.current;if(!Ft){te(0,{deltaX:Tt,deltaY:mt,direction:Lt});return}const gt=Ft==="left"||Ft==="right"?me.current.width:me.current.height,ut=Q.current.scale||1;if(gt<=0||ut<=0){te(0,{deltaX:Tt,deltaY:mt,direction:Lt});return}const _t=wr(Ft,ct-Q.current.x,Qe-Q.current.y);if(_t<=0){te(0,{deltaX:Tt,deltaY:mt,direction:Lt});return}te(_t/(gt*ut),{deltaX:Tt,deltaY:mt,direction:Lt})}const rt=fe(E=>{const D=ye(E);if(!D)return;if(!("touches"in E)){const we=Bf(E.buttons);we&&(le.current=!0);const Ee=E.buttons===0&&le.current;if(E.buttons!==0&&!we||Ee){kt(E);return}}if(!$&&se.current){if(!ve(E)&&(E.defaultPrevented||E.nativeEvent.defaultPrevented)){Ye();return}if(o?o(D,{nativeEvent:E.nativeEvent,direction:w}):!0){const Ee=A.current;let Ie=!1;if(ve(E)){const ce=r.current;if(Ee&&ce){const xe=Ae(D,E.nativeEvent),Le=Oe(ce).body,Te=Le?nt(xe,Le):null;if(Te&&(Se(ce,Te)||Se(Te,ce))){const ht=D.x-Ee.x,ct=D.y-Ee.y,Qe=wt(Te,ht,ct);if(Qe===!1)return;Qe===!0&&(Ie=!0)}}}Be(E,D,{ignoreScrollableTarget:Ie,ignoreScrollableAncestors:Ie})&&(Ee&&Ie?(lt(),de.current=Ee,ie.current=Ee,Y.current=Ee,Ce.current=!1):(lt(),V.current=!1))}}const q=Y.current,ke=q===null?{x:0,y:0}:{x:D.x-q.x,y:D.y-q.y};Y.current=D,At(E,D,ke)}),Dt=fe(E=>{if(!t)return;const D=he.current,q=Q.current,ke=D.x-q.x,we=D.y-q.y,Ee={deltaX:ke,deltaY:we,direction:T??ae.current};if(!B.current){Ye(),te(0,Ee);return}_(!1),ee(!1),pe(null),Ye(),le.current=!1;const Ie=r.current;Ie&&("touches"in E||xr(Ie,E.pointerId,"releasePointerCapture"));const _e=ke,ce=we,xe=C.current,Me=Mn(E.timeStamp),Le=xe!==null&&Me!==null&&Me>xe?Me-xe:0,Te=Le>0?Math.max(Le,Lf):0,ht=Te>0?_e/Te:0,ct=Te>0?ce/Te:0;let Qe=b.current.x,Tt=b.current.y;const mt=P.current;if(mt&&Me!==null&&Me>=mt.time){const _t=Me-mt.time;if(_t<=Ff){const st=Math.max(_t,uo),Kt=D.x-mt.x,rr=D.y-mt.y,hs=Kt/st,ms=rr/st;hs!==0&&(Qe=hs),ms!==0&&(Tt=ms)}else Qe=0,Tt=0}const Lt=y?.({event:E.nativeEvent,direction:T??ae.current,deltaX:_e,deltaY:ce,velocityX:ht,velocityY:ct,releaseVelocityX:Qe,releaseVelocityY:Tt}),Ft=typeof Lt=="boolean";if(U.current&&!Ft){he.current={x:q.x,y:q.y},be({x:q.x,y:q.y}),F(void 0),te(0,Ee);return}let gt=!1,ut;if(Ft)gt=Lt,ut=T??ae.current??w;else for(const _t of n){switch(_t){case"right":_e>X.current&&(gt=!0,ut="right");break;case"left":_e<-X.current&&(gt=!0,ut="left");break;case"down":ce>X.current&&(gt=!0,ut="down");break;case"up":ce<-X.current&&(gt=!0,ut="up");break}if(gt)break}gt&&ut?(F(ut),oe(!0),d?.(E.nativeEvent,{direction:ut})):(he.current={x:q.x,y:q.y},be({x:q.x,y:q.y}),F(void 0),te(0,Ee))}),ps=u.useCallback(()=>{const E=m?ue:he.current,D=m?L:Q.current;if(!$&&E.x===D.x&&E.y===D.y&&!re)return{[s.x]:"0px",[s.y]:"0px"};const q=E.x-D.x,ke=E.y-D.y;return{transition:$?"none":void 0,transform:$?`translateX(${E.x}px) translateY(${E.y}px) scale(${D.scale})`:void 0,[s.x]:`${q}px`,[s.y]:`${ke}px`}},[re,ue,L,$,s,m]),De=u.useCallback(()=>t?{onPointerDown:Xe,onPointerMove:rt,onPointerUp:Dt,onPointerCancel:Dt}:{},[t,Dt,rt,Xe]),Ke=u.useCallback(()=>t?{onTouchStart:Xe,onTouchMove:rt,onTouchEnd:Dt,onTouchCancel:Dt}:{},[t,Dt,rt,Xe]);return{swiping:$,swipeDirection:T,dragDismissed:re,getPointerProps:De,getTouchProps:Ke,getDragStyles:ps,reset:Fe}}const Vf=aa,zf=lf,Wr=10,fo=.5,po=.5,Wf=300,ho=4,mo=.2,$f=4,Sr=80,go=360,Cr=.1,bo=1,Gf=`[${Sf}]`,qf=u.forwardRef(function(t,n){const{className:r,render:s,children:o,...i}=t,{store:a}=tt(),{swipeDirection:l,notifyParentSwipingChange:d,notifyParentSwipeProgressChange:f,frontmostHeight:p,snapToSequentialPoints:y}=nr(),m=ua()?.visualStateStore,h=a.useState("open"),w=a.useState("mounted"),x=a.useState("nested"),R=a.useState("nestedOpenDialogCount"),N=a.useState("viewportElement"),M=a.useState("popupElement"),S=R>0,O=l==="left"||l==="right"?"horizontal":"vertical",I=O==="vertical",v=I?"horizontal":"vertical",{snapPoints:T,resolvedSnapPoints:F,activeSnapPoint:$,activeSnapPointOffset:K,setActiveSnapPoint:W,popupHeight:ee}=fa(),[re,oe]=u.useState(null),ue=u.useRef(void 0),be=u.useRef(null),L=Qn(),j=u.useRef(!1),G=u.useRef(""),pe=u.useRef(!1),de=u.useRef(!1),he=u.useRef(null),Y=u.useMemo(()=>
12{if(!T||T.length<2||l!=="down"&&l!=="up"||F.length<2)return null;const C=F.map(_=>_.offset).filter(_=>Number.isFinite(_)).sort((_,ne)=>_-ne);if(C.length<2)return null;const P=C[0],b=C[1],k=C[C.length-1];let B=b-P;if(!Number.isFinite(B)||B<=0){const _=k-P;if(!Number.isFinite(_)||_<=0)return null;B=_}return{minOffset:P,range:B}},[F,T,l]),Q=u.useMemo(()=>!Y||K===null?null:Ge((K-Y.minOffset)/Y.range,0,1),[K,Y]),ae=u.useMemo(()=>T&&T.length>0&&(l==="down"||l==="up")?l==="down"?["down","up"]:["up","down"]:[l],[T,l]),Z=fe(C=>{yo(a.context.popupRef.current,a.context.backdropRef.current,C)}),U=fe(()=>{Z(!1),a.context.popupRef.current?.removeAttribute(Gt.endingStyle),oe(null)}),ie=fe(({resolvedProgress:C,shouldTrackProgress:P,notifyParent:b})=>{const k=h&&!x&&P,B=k?C:0;b&&f&&f(h&&P?C:0),m?.set({swipeProgress:B,frontmostHeight:B>0?p:0});const _=a.context.backdropRef.current;if(_){if(!k||B<=0){_.style.setProperty(Et.swipeProgress,"0"),_.style.removeProperty(Ve.height);return}_.style.setProperty(Et.swipeProgress,`${B}`),p>0?_.style.setProperty(Ve.height,`${p}px`):_.style.removeProperty(Ve.height)}});function Ce({direction:C,deltaX:P,deltaY:b,velocityX:k,velocityY:B,releaseVelocityX:_,releaseVelocityY:ne}){if(!C)return null;const te=a.context.popupRef.current;if(!te)return null;const Pe=C==="left"||C==="right"?te.offsetWidth:te.offsetHeight;if(!Number.isFinite(Pe)||Pe<=0)return null;const Fe=C==="left"||C==="right"?P:b,ye=T&&T.length>0?K??0:0;let ve=0;C==="down"?ve=ye:C==="up"&&(ve=-ye);const Ae=ve+Fe,nt=C==="left"||C==="up"?-Ae:Ae,Be=Math.max(0,Pe-nt);if(!Number.isFinite(Be)||Be<=0)return null;const Ye=C==="left"||C==="right"?_:ne,lt=C==="left"||C==="right"?k:B,kt=Math.abs(Ye)>0&&Number.isFinite(Ye)?Ye:lt,We=C==="left"||C==="up"?-kt:kt;if(!Number.isFinite(We)||We<=mo)return null;const wt=Ge(We,mo,$f),Xe=Ge(Be/wt,Sr,go);if(!Number.isFinite(Xe))return null;const At=(Xe-Sr)/(go-Sr),rt=Ge(Cr+At*(bo-Cr),Cr,bo);return!Number.isFinite(rt)||rt<=0?null:rt}function se(C){if(j.current||!C)return;const P=C.direction??l,b=P==="left"||P==="right"?C.deltaX:C.deltaY;!Number.isFinite(b)||Math.abs(b)<Wr||(j.current=!0,d?.(!0))}const A=Hf({enabled:w&&!S,directions:ae,elementRef:a.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:Ve.swipeMovementX,y:Ve.swipeMovementY},onSwipeStart(C){if("touches"in C||"pointerType"in C&&C.pointerType==="touch")return;const P=a.context.popupRef.current;if(!P)return;const k=Oe(P).getSelection?.();if(!k||k.isCollapsed)return;const B=pt(k.anchorNode)?k.anchorNode:k.anchorNode?.parentElement,_=pt(k.focusNode)?k.focusNode:k.focusNode?.parentElement;!Se(P,B)&&!Se(P,_)||k.removeAllRanges()},onSwipingChange(C){vo(a.context.backdropRef.current,C),C||(j.current=!1,d?.(!1))},swipeThreshold({element:C,direction:P}){return wo(C,P)},canStart(C,P){const b=a.context.popupRef.current;if(!b)return!1;const k=b.ownerDocument,B=Ln(k,C.x,C.y);if(!B||!Se(b,B))return!1;const _=P.nativeEvent;return!(("touches"in _||"pointerType"in _&&_.pointerType==="touch")&&So(k,b)||_.type==="touchstart"&&Er(B))},onProgress(C,P){se(P);const b=P?.direction??A.swipeDirection,k=b===void 0||b===l,B=!!(T&&T.length>0),ne=B&&(l==="down"||l==="up")||!B||l==="left"||l==="right"||k;let te=C;if(Y&&ee>0){if(P&&Number.isFinite(P.deltaY)){const Pe=K??Y.minOffset,Fe=Ge(Pe+P.deltaY,0,ee);te=Ge((Fe-Y.minOffset)/Y.range,0,1)}else if(Q!==null)te=Q;else if(b==="down"||b==="up"){const Pe=C*ee,Fe=K??Y.minOffset,ye=b==="down"?Fe+Pe:Fe-Pe;te=Ge((ye-Y.minOffset)/Y.range,0,1)}}ie({resolvedProgress:te,shouldTrackProgress:ne,notifyParent:!0})},onRelease({event:C,deltaX:P,deltaY:b,direction:k,velocityX:B,velocityY:_,releaseVelocityX:ne,releaseVelocityY:te}){const Pe={deltaX:P,deltaY:b,velocityX:B,velocityY:_,releaseVelocityX:ne,releaseVelocityY:te};function Fe(De){const Ke=a.context.popupRef.current;Ke&&(d?.(!1),Z(!0),Ke.style.removeProperty("transition"),Ke.setAttribute(Gt.endingStyle,""),Kn.flushSync(()=>{oe(Ce({direction:De,...Pe}))}))}if(!T||T.length===0){if(!k){U();return}const De=a.context.popupRef.current;if(!De){U();return}const Ke=wo(De,k),E=k==="left"||k==="right"?P:b;if(!Number.isFinite(E)){U();return}const D=k==="left"||k==="up"?-E:E;if(D<=0)return U(),!1;const q=k==="left"||k==="right"?B:_;if((k==="left"||k==="up"?-q:q)>=fo&&D>0)return Fe(k),!0;const we=D>Ke;return we?Fe(k):U(),we}if(l!=="down"&&l!=="up"){U();return}if(!ee||F.length===0){U();return}const ye=l==="down"?b:-b;if(!Number.isFinite(ye)){U();return}const ve=Math.sign(ye),Ae=l==="down"?te:-te,nt=l==="down"?_:-_;let Be=Number.isFinite(Ae)?Ae:nt;if(ve!==0&&Math.abs(ye)>=Wr&&Number.isFinite(Be)){const De=Math.sign(Be);De!==0&&De!==ve&&(Be=nt)}const Ye=K??0,lt=Ge(Ye+ye,0,ee),kt=Number.isFinite(Be)&&Math.abs(Be)>=po?Ge(Be,-ho,ho)*Wf:0,We=y?lt:Ge(lt+kt,0,ee),wt=ze(kn,C),Xe=()=>(ue.current=$,W?.(null,wt),Fe(l),!0);if(y){const De=[...F].sort((ce,xe)=>ce.offset-xe.offset);if(De.length===0)return U(),!1;let Ke=0,E=Math.abs(Ye-De[0].offset);for(let ce=1;ce<De.length;ce+=1){const xe=Math.abs(Ye-De[ce].offset);xe<E&&(E=xe,Ke=ce)}let D=De[0];E=Math.abs(We-D.offset);for(const ce of De){const xe=Math.abs(We-ce.offset);xe<E&&(E=xe,D=ce)}const q=Math.sign(Be),ke=ve!==0&&q!==0&&q===ve&&Math.abs(Be)>=po;let we=We;if(ke){const ce=Ge(Ke+ve,0,De.length-1);if(ce!==Ke){const xe=De[ce];(ve>0?We<xe.offset:We>xe.offset)&&(D=xe,we=xe.offset)}else if(ve>0)return Xe()}const Ie=Math.abs(we-ee),_e=Math.abs(we-D.offset);return Ie<_e?Xe():(W?.(D.value,wt),U(),!1)}if(Be>=fo&&ye>0)return Xe();let At=F[0],rt=Math.abs(We-At.offset);for(const De of F){const Ke=Math.abs(We-De.offset);Ke<rt&&(rt=Ke,At=De)}return Math.abs(We-ee)<rt?Xe():(W?.(At.value,wt),U(),!1)},onDismiss(C){m?.set({swipeProgress:0,frontmostHeight:0});const P=a.context.backdropRef.current;P&&(P.style.setProperty(Et.swipeProgress,"0"),P.style.removeProperty(Ve.height));const b=ze(kn,C);if(a.setOpen(!1,b),b.isCanceled){const k=ue.current;k!==void 0&&W?.(k,ze(kn,C)),ue.current=void 0,be.current?.(),U();return}if(a.select("open")){const k=C;L.request(()=>{if(a.select("open")){const B=ue.current;B!==void 0&&W?.(B,ze(kn,k)),ue.current=void 0,U(),be.current?.()}else ue.current=void 0});return}ue.current=void 0,Z(!0)}}),V=A.getPointerProps(),le=A.getTouchProps(),me=A.reset;be.current=me,u.useEffect(()=>{const C=N??M;if(!C)return;const P=C,b=Oe(P),k=at(b);function B(_){if(de.current)return;const ne=he.current,te=_.touches[0];if(!te||!ne)return;const Pe=I?te.clientY-ne.lastY:te.clientX-ne.lastX;
12if(ha(_,k)){ne.allowSwipe=!1,Bt(ne,te);return}if(_.touches.length===2){Bt(ne,te);return}if(So(b,P)||!h||!w||S){Bt(ne,te);return}if(Qf(ne,te,I)){Bt(ne,te);return}const ye=ne.scrollTarget;if(!ye||ye===b.documentElement||ye===b.body){_.cancelable&&_.preventDefault(),Bt(ne,te);return}if(!Zf(ye,O)){_.cancelable&&_.preventDefault(),Bt(ne,te);return}const Ae=Pe;if(Ae!==0){const nt=ep(ye,O,l,Ae);ne.allowSwipe?_.cancelable&&_.preventDefault():_.cancelable&&nt?(ne.allowSwipe=!0,_.preventDefault()):ne.allowSwipe=!1}Bt(ne,te)}return b.addEventListener("touchmove",B,{passive:!1,capture:!0}),()=>{b.removeEventListener("touchmove",B,{capture:!0})}},[w,S,h,M,I,O,l,N]),u.useEffect(()=>{if(!Y||A.swiping)return;ie({resolvedProgress:!h||x?0:Q??0,shouldTrackProgress:!0,notifyParent:!1})},[ie,p,x,f,h,Q,Y,A.swiping,a,m]),u.useEffect(()=>{if(f)return h||f(0),()=>{f(0)}},[f,h]),u.useEffect(()=>{h&&(me(),U())},[U,h,me]),u.useEffect(()=>()=>{m?.set({swipeProgress:0,frontmostHeight:0}),vo(a.context.backdropRef.current,!1),d?.(!1)},[d,a,m]);const J=u.useMemo(()=>({swiping:A.swiping,getDragStyles:A.getDragStyles,swipeStrength:re??null,setSwipeDismissed(C){yo(a.context.popupRef.current,a.context.backdropRef.current,C)}}),[a,A.getDragStyles,A.swiping,re]);function X(){de.current=!1,he.current=null,G.current="",pe.current=!1}return c.jsx(la,{ref:n,className:r,render:s,...rs(i,{onPointerDown(C){if(G.current=C.pointerType,pe.current=C.pointerType==="pen",!h||!w||S)return;const P=Oe(C.currentTarget),b=Ln(P,C.clientX,C.clientY);Er(b)||Yf(b)||C.pointerType!=="touch"&&V.onPointerDown?.(C)},onPointerMove(C){C.pointerType!=="touch"&&V.onPointerMove?.(C)},onPointerUp(C){G.current===C.pointerType&&(G.current=""),C.pointerType!=="touch"&&V.onPointerUp?.(C)},onPointerCancel(C){G.current===C.pointerType&&(G.current=""),C.pointerType!=="touch"&&V.onPointerCancel?.(C)},onTouchStart(C){if(G.current==="pen"&&pe.current){pe.current=!1,de.current=!1,he.current=null;return}if(!h||!w||S){de.current=!1,he.current=null;return}const b=C.touches[0];if(!b)return;if(Co(C)){de.current=!1,he.current=null;return}const k=Oe(C.currentTarget),B=Ln(k,b.clientX,b.clientY);if(de.current=Er(B),de.current){he.current=null;return}const _=N??M,ne=pt(C.target)?C.target:null;let te=null,Pe=!1;_&&ne&&Se(_,ne)&&(te=Qt(ne,_,O),Pe=Qt(ne,_,v)!=null);let Fe=null;te&&(Fe=Jf(te,O,l)?null:!1),he.current={startX:b.clientX,startY:b.clientY,lastX:b.clientX,lastY:b.clientY,scrollTarget:te,hasCrossAxisScrollableContent:Pe,allowSwipe:Fe,preserveNativeCrossAxisScroll:!1},le.onTouchStart?.(C)},onTouchMove(C){if(de.current||Co(C))return;const P=he.current;P?.preserveNativeCrossAxisScroll||P?.allowSwipe===!1||P?.scrollTarget!=null&&!P.allowSwipe||le.onTouchMove?.(C)},onTouchEnd(C){X(),le.onTouchEnd?.(C)},onTouchCancel(C){X(),le.onTouchCancel?.(C)},"data-nested-dialog-open":void 0}),children:c.jsx(pa.Provider,{value:J,children:o})})});function yo(e,t,n){if(n){e?.setAttribute(ft.swipeDismiss,""),t?.setAttribute(ft.swipeDismiss,"");return}e?.removeAttribute(ft.swipeDismiss),t?.removeAttribute(ft.swipeDismiss)}function vo(e,t){if(e){if(t){e.setAttribute(ft.swiping,"");return}e.removeAttribute(ft.swiping)}}function Er(e){return!!e?.closest(Ec)}function Yf(e){return!!e?.closest(Gf)}function wo(e,t){const n=t==="left"||t==="right"?e.offsetWidth:e.offsetHeight;return Math.max(n*.5,Wr)}function xo(e,t){return e instanceof t.HTMLInputElement&&e.type==="range"}function Xf(e){return pt(e)?e.tagName==="INPUT"||e.tagName==="TEXTAREA":!1}function Kf(e,t){const n=pt(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=pt(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||Se(t,n)||Se(t,r)}function So(e,t){const n=e.activeElement;if(!!(n&&Se(t,n))&&Xf(n)){const{selectionStart:o,selectionEnd:i}=n;if(o!=null&&i!=null&&o<i)return!0}const s=e.getSelection?.();return!s||s.isCollapsed?!1:Kf(s,t)}function ha(e,t){const n=e.composedPath();return n?n.some(r=>xo(r,t)):xo(e.target,t)}function Co(e){return ha(e.nativeEvent,at(e.currentTarget))}function Bt(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function Qf(e,t,n){if(e.preserveNativeCrossAxisScroll)return!0;
12if(e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;const r=n?t.clientY-e.startY:t.clientX-e.startX,s=n?t.clientX-e.startX:t.clientY-e.startY,o=Math.abs(r),i=Math.abs(s);return i<6||i<=o+2?!1:(e.preserveNativeCrossAxisScroll=!0,!0)}function Zf(e,t){return t==="vertical"?e.scrollHeight>e.clientHeight:e.scrollWidth>e.clientWidth}function ma(e,t){if(t==="vertical"){const r=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:r}}const n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function Jf(e,t,n){const{offset:r,max:s}=ma(e,t),o=ga(n,t);return o===null?!1:o?r<=0:r>=s}function ep(e,t,n,r){const{offset:s,max:o}=ma(e,t),i=ga(n,t);return i===null||!(i?r>0:r<0)?!1:i?s<=0:s>=o}function ga(e,t){return t==="vertical"?e==="down"?!0:e==="up"?!1:null:e==="right"?!0:e==="left"?!1:null}function tp(e){return c.jsx(Of,{...e})}function np(e){return c.jsx(zf,{...e})}function rp(e){return c.jsx(If,{...e})}function sp(e){const{className:t,...n}=e;return c.jsx(xf,{className:je("fixed inset-0 z-50 bg-black/50 transition-opacity","data-ending-style:opacity-0","data-starting-style:opacity-0",t),...n})}function op(e){const{className:t,...n}=e;return c.jsx(qf,{className:je("fixed inset-0 z-50",t),...n})}function ip(e){const{className:t,...n}=e;return c.jsx(Pf,{className:je("fixed z-50 bg-white shadow-xl outline-none transition-transform duration-300","data-ending-style:translate-x-full data-starting-style:translate-x-full",t),...n})}function ap(e){return c.jsxs(rp,{children:[c.jsx(sp,{}),c.jsx(op,{children:c.jsx(ip,{...e})})]})}function lp(e){const{className:t,...n}=e;return c.jsx(Vf,{className:je("text-lg font-semibold",t),...n})}const jn={Root:tp,Trigger:np,Content:ap,Title:lp};function $r(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",className:je(t),...n,children:c.jsx("path",{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5m0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5",fill:"currentColor"})})}function tn(e){return c.jsx(Pa,{...e})}function ds(e){const{children:t,className:n}=e;return c.jsx("div",{className:je("mx-auto max-w-container",n),children:t})}function cp(e){const{onClose:t}=e,[n]=Ia(),r=u.useRef(null),s=n.get("q")||"";u.useEffect(()=>{r.current?.focus()},[]);const o=i=>{i.preventDefault();const l=new FormData(i.currentTarget).get("q")?.trim();l&&(window.location.assign(`/search/?q=${encodeURIComponent(l)}`),t())};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 -z-1 backdrop-blur-sm",onClick:t}),c.jsx("div",{className:"absolute top-full left-0 right-0 bg-white px-6 py-4 shadow-lg",children:c.jsx(ds,{children:c.jsxs("form",{onSubmit:o,className:"flex items-center rounded-full border border-gray-400 pr-1",children:[c.jsx("input",{ref:r,type:"search",name:"q",defaultValue:s,placeholder:"Search",className:"flex-1 bg-transparent py-3 pl-6 text-base text-gray-900 outline-none placeholder:text-gray-400"}),c.jsx("button",{type:"submit",className:"flex size-10 shrink-0 items-center justify-center rounded-full text-brand transition-colors hover:bg-gray-100",children:c.jsx($r,{className:"size-5"})})]})})})]})}const up="https://accounts.google.com/gsi/client";let Ht=null,Eo=!1,Gr=!1;function dp(){return Ht||(typeof google<"u"&&google.accounts?.id?(Ht=Promise.resolve(),Ht):(Ht=new Promise((e,t)=>{const n=document.createElement("script");n.src=up,n.async=!0,n.onload=()=>e(),n.onerror=()=>{Ht=null,t(new Error("Failed to load Google Identity Services"))},document.head.appendChild(n)}),Ht))}function fs(){typeof google<"u"&&google.accounts?.id&&google.accounts.id.cancel()}function Rh(){return Gr=!0,fs(),()=>{Gr=!1}}async function fp(e){const{clientId:t,autoSelect:n=!1}=e;if(await dp(),await new Promise(r=>setTimeout(r,0)),Gr)throw new Error("Google prompt suppressed");return new Promise((r,s)=>{let o=!1;Eo||(google.accounts.id.initialize({client_id:t,callback:i=>{o||(o=!0,i.credential?r(i.credential):s(new Error("Google login failed: no credential returned")))}
12,auto_select:n,use_fedcm_for_prompt:!0}),Eo=!0),google.accounts.id.prompt(i=>{o||(i.isNotDisplayed()?(o=!0,s(new Error("Google prompt not displayed"))):i.isSkippedMoment()?(o=!0,s(new Error("Google prompt skipped"))):i.isDismissedMoment()&&i.getDismissedReason()!=="credential_returned"&&(o=!0,s(new Error("Google prompt dismissed"))))})})}function pp(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24","aria-hidden":"true",className:t,...n,children:c.jsx("path",{fill:"currentColor",d:"M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12 5.7 16.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z"})})}async function Rt(e,t,n,r){const s={"Content-Type":"application/json",...n?.headers||{}};r?.appId&&(s["X-App-ID"]=r.appId),r?.token&&(s.Authorization=`Bearer ${r.token}`);const o={...n,headers:s};r?.appId||(o.credentials="include");const i=await fetch(`${e}${t}`,o);if(!i.ok){const a=await i.json().catch(()=>null),l=a?.errors?.[0]?.message||a?.message||a?.error||`Request failed with status ${i.status}`;throw new Error(l)}return i.json()}async function hp(e){const{apiUrl:t,email:n,origin:r,auth:s}=e;return Rt(t,"/api/accounts/subscribe",{method:"POST",body:JSON.stringify({email:n,origin:r})},s)}async function mp(e,t,n){return Rt(e,"/api/accounts/login/init-otc-login",{method:"POST",body:JSON.stringify({email:t})},n)}async function gp(e){const{apiUrl:t,flowId:n,otc:r,email:s,origin:o,auth:i}=e;return(await Rt(t,"/api/accounts/login/verify-otc-login",{method:"POST",body:JSON.stringify({flow_id:n,otc:r,email:s,origin:o})},i)).data.token}async function bp(e){const{apiUrl:t,credential:n,origin:r,auth:s}=e;return(await Rt(t,"/api/accounts/login/google/fedcm",{method:"POST",body:JSON.stringify({credential:n,origin:r})},s)).token}async function ba(e){const{apiUrl:t,token:n,origin:r,auth:s}=e;return(await Rt(t,"/api/accounts/login/set-session",{method:"POST",body:JSON.stringify({token:n,origin:r})},s)).data.token}async function gn(e,t){return(await Rt(e,"/api/accounts/me",{method:"GET"},t)).user}async function yp(e,t,n,r){await Rt(e,`/api/accounts/${t}`,{method:"PATCH",body:JSON.stringify(n)},r)}async function vp(e){const{apiUrl:t,id:n,newsletters:r,origin:s,auth:o}=e;await Rt(t,`/api/accounts/${n}/newsletter-subscriptions`,{method:"POST",body:JSON.stringify({newsletters:r,origin:s})},o)}async function wp(e,t){await Rt(e,"/api/accounts/logout",{method:"POST"},t)}function xp(e){const{oauthBaseUrl:t,provider:n,appId:r,host:s,origin:o}=e,i=new URLSearchParams;return r?i.set("app_id",r):s&&i.set("host",s),o&&i.set("signup_origin",JSON.stringify(o)),`${t}/api/accounts/login/${n}?${i.toString()}`}function Sp(e){const r=window.screenX+(window.outerWidth-500)/2,s=window.screenY+(window.outerHeight-600)/2;return window.open(e,"_blank",`width=500,height=600,left=${r},top=${s},popup=yes`)}function Cp(e,t){function n(r){const s=r.data;s?.type==="imgjs-oauth-success"&&e(s.token),s?.type==="imgjs-oauth-error"&&t(s.error)}return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}}const ya="img_origin",Ep=720*60*60*1e3;function nn(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(ya);if(!e)return null;const t=JSON.parse(e),n=Date.now()-new Date(t?.capturedAt??"").getTime();return!Number.isFinite(n)||n>Ep?null:t}catch{return null}}function bn(){if(!(typeof window>"u"))try{window.localStorage.removeItem(ya)}catch{return}}function Zt(e){const{isInvalid:t=!1,className:n,...r}=e;return c.jsx("input",{className:`mb-1 w-full rounded border px-2 py-2 text-sm text-slate-900 outline-none transition-colors placeholder:text-slate-400 focus:border-slate-400 ${t?"border-red-400":"border-slate-300"} ${n||""}`,...r})}function Ro(e){const{icon:t,children:n,onClick:r}=e;return c.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center justify-center gap-2 rounded border border-slate-200 bg-white px-3 py-3 text-sm font-medium text-slate-800 transition-colors hover:bg-slate-50",children:[t,n]})}function Rp(e){const{label:t="Loading..."}=e;return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx("div",{className:"mb-3 h-8 w-8 animate-spin rounded-full border-2 border-slate-200 border-t-slate-600"}),c.jsx("p",{className:"text-sm text-slate-600",children:t})]})}function Sn(e){const{children:t,className:n,...r}=e;return c.jsx("button",{className:`w-full rounded bg-[#345876] py-3 text-sm font-medium uppercase text-white transition-colors hover:bg-[#2a4760] disabled:opacity-60 ${n||""}`,...r,children:t})}function kp(e){const{className:t,...n}=e;return c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 48 48","aria-hidden":"true",className:t,...n,children:[c.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),c.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),c.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),c.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"})]})}function Tp(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24","aria-hidden":"true",className:t,...n,children:c.jsx("path",{fill:"currentColor",d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function Pp(e){const{mode:t,apiUrl:n,oauthBaseUrl:r,cta:s,buttonLabel:o,privacyPolicyUrl:i,termsOfUseUrl:a,auth:l,onToken:d,onClose:f,onVerify:p,onOAuthSuccess:y,onError:g,onSwitchMode:m}=e,[h,w]=u.useState(""),[x,R]=u.useState(!1),[N,M]=u.useState(!1),S=u.useRef(null);u.useEffect(()=>()=>{S.current&&S.current()},[]);const O=async v=>{v.preventDefault();const T=h.trim();if(T){R(!0);try{if(t==="subscribe"){const F=await hp({apiUrl:n,email:T,origin:nn(),auth:l});F.data.otc_login_flow_id&&p(T,F.data.otc_login_flow_id)}else{const F=await mp(n,T,l);p(T,F.data.otc_login_flow_id)}}catch(F){g(F instanceof Error?F.message:"Something went wrong")}finally{R(!1)}}},I=v=>{const T=xp({oauthBaseUrl:r,provider:v,appId:l?.appId,host:new URL(n).host,origin:nn()});Sp(T),M(!0),S.current&&S.current(),S.current=Cp(async F=>{try{if(l?.appId){d?.(F);const $=await gn(n,{...l,token:F});$?(bn(),y($)):g("Failed to fetch account after login")}
12else{await ba({apiUrl:n,token:F,origin:nn()});const $=await gn(n);$?(bn(),y($)):g("Failed to fetch account after login")}}catch($){g($ instanceof Error?$.message:"Login failed")}finally{M(!1)}},F=>{g(F),M(!1)})};return N?c.jsx(Rp,{label:"Signing you in..."}):c.jsxs("div",{children:[c.jsxs("div",{className:"mb-3 space-y-2",children:[c.jsx(Ro,{icon:c.jsx(kp,{}),onClick:()=>I("google"),children:"Continue with Google"}),c.jsx(Ro,{icon:c.jsx(Tp,{}),onClick:()=>I("github"),children:"Continue with GitHub"})]}),c.jsxs("div",{className:"my-3 flex items-center gap-2.5",children:[c.jsx("div",{className:"h-px flex-1 bg-slate-200"}),c.jsx("span",{className:"text-xs text-slate-400",children:"or"}),c.jsx("div",{className:"h-px flex-1 bg-slate-200"})]}),c.jsx("p",{className:"mb-2.5 text-[15px] text-slate-900",children:s}),c.jsxs("form",{onSubmit:O,children:[c.jsx(Zt,{type:"email",placeholder:"Email address",value:h,onChange:v=>w(v.target.value),required:!0}),c.jsx(Sn,{type:"submit",disabled:x,children:x?"Sending...":o})]}),c.jsx("button",{type:"button",onClick:m,className:"mt-2 block w-full text-center text-xs text-blue-500 transition-colors hover:text-blue-700",children:t==="login"?"Create an account":"Already have an account? Login"}),(i||a)&&c.jsxs("div",{className:"mt-8 flex justify-center gap-2.5 text-xs",children:[i&&c.jsx("a",{href:i,target:"_blank",rel:"noopener nofollow",className:"text-slate-400 transition-colors hover:text-slate-900",children:"Privacy Policy"}),a&&c.jsx("a",{href:a,target:"_blank",rel:"noopener nofollow",className:"text-slate-400 transition-colors hover:text-slate-900",children:"Terms of Use"})]})]})}function Ip(e){const{apiUrl:t,user:n,newsletters:r,cta:s,subscribeButtonLabel:o,skipButtonLabel:i,auth:a,onComplete:l,onError:d}=e,[f,p]=u.useState(()=>new Set(r.map(x=>x.id))),[y,g]=u.useState(!1),m=x=>{p(R=>{const N=new Set(R);return N.has(x)?N.delete(x):N.add(x),N})},h=async()=>{g(!0);try{f.size>0&&await vp({apiUrl:t,id:n.author_id,newsletters:[...f],origin:nn(),auth:a}),bn(),l()}catch(x){d(x instanceof Error?x.message:"Failed to update newsletter subscriptions")}finally{g(!1)}},w=f.size>0;return c.jsxs("div",{children:[c.jsx("p",{className:"mb-3 text-[15px] text-slate-900",children:s}),c.jsx("div",{className:"mb-3 space-y-2",children:r.map(x=>c.jsxs("label",{htmlFor:`newsletter-${x.id}`,className:"flex cursor-pointer items-center gap-3 rounded border border-slate-200 p-3 transition-colors hover:bg-slate-50",children:[x.logo&&c.jsx("img",{src:x.logo,alt:x.name,width:48,height:48,className:"flex-shrink-0 rounded"}),c.jsx("span",{className:"flex-1 text-sm text-slate-700",children:x.label}),c.jsx("input",{type:"checkbox",id:`newsletter-${x.id}`,checked:f.has(x.id),onChange:()=>m(x.id),className:"h-4 w-4 flex-shrink-0 accent-[#345876]"})]},x.id))}),c.jsx(Sn,{type:"button",onClick:h,disabled:y,children:y?"Saving...":w?o:i})]})}const Op=["Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cabo Verde","Cambodia","Cameroon","Canada","Cayman Islands","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo","Congo (Democratic Republic)","Cook Islands","Costa Rica","Côte d'Ivoire","Croatia","Cuba","Curaçao","Cyprus","Czechia","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Fiji","Finland","France","French Guiana","French Polynesia","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","North Macedonia","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puerto Rico","Qatar","Réunion","Romania","Russia","Rwanda","Samoa","San Marino","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Korea","Spain","Sri Lanka","Sudan","Suriname","Swede
12n","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Venezuela","Vietnam","Virgin Islands (U.S.)","Yemen","Zambia","Zimbabwe"],Np=[{value:"advertising-marketing",label:"Advertising/Marketing"},{value:"aerospace-aviation",label:"Aerospace/Aviation"},{value:"agriculture",label:"Agriculture"},{value:"automotive",label:"Automotive"},{value:"biotech-pharma",label:"Biotech/Pharmaceutical"},{value:"business-services",label:"Business Services (accounting, consulting, etc.)"},{value:"computers-it",label:"Computers/Information Technology"},{value:"construction",label:"Construction"},{value:"education",label:"Education"},{value:"facilities",label:"Facilities/Service Industry"},{value:"fintech",label:"Finance/Financial Services (banking, insurance, etc.)"},{value:"government",label:"Government"},{value:"healthcare",label:"Healthcare"},{value:"human-resources",label:"Human Resources"},{value:"legal",label:"Legal"},{value:"life-sciences",label:"Life sciences (biotech, pharmaceuticals, etc.)"},{value:"manufacturing",label:"Manufacturing"},{value:"media",label:"Media"},{value:"non-profit",label:"Non-profit"},{value:"real-estate",label:"Real Estate"},{value:"retail-consumer-goods",label:"Retail/Consumer Goods"},{value:"telecommunications",label:"Telecommunications"},{value:"transportation-logistics",label:"Transportation/Logistics"},{value:"travel-hospitality-entertainment",label:"Travel/Hospitality/Entertainment"},{value:"utilitiy-energy",label:"Utility/Energy"}],Mp=[{value:"it__applications__development",label:"IT - Applications / Development"},{value:"it__business_intelligence",label:"IT - Business Intelligence"},{value:"it__database",label:"IT - Database"}
12,{value:"it__desktop__help_desk",label:"IT - Desktop / Help Desk"},{value:"it__network",label:"IT - Network"},{value:"it__operations",label:"IT - Operations"},{value:"it__project_management",label:"IT - Project Management"},{value:"it__quality__testing",label:"IT - Quality / Testing"},{value:"it__server__storage",label:"IT - Server / Storage"},{value:"it__telecom",label:"IT - Telecom"},{value:"it__web",label:"IT - Web"},{value:"executive_office",label:"Executive Office"},{value:"finance",label:"Finance"},{value:"human_resources",label:"Human Resources"},{value:"legal",label:"Legal"},{value:"marketing_communications",label:"Marketing Communications"},{value:"research__development",label:"Research & Development"},{value:"sales",label:"Sales"}],jp=[{value:"ai-researcher",label:"AI Researcher / Research Scientist"},{value:"architect",label:"Architect"},{value:"business-development",label:"Business Development/Marketing/Sales"},{value:"community-manager-devrel",label:"Community Manager / Developer Advocate"},{value:"data-analyst",label:"Data Analyst / Business Intelligence Analyst"},{value:"data-engineer",label:"Data Engineer"},{value:"data-scientist",label:"Data Scientist"},{value:"developer-engineer",label:"Developer / Software Engineer"},{value:"devops-engineer",label:"DevOps Engineer"}
12,{value:"educator-instructor",label:"Educator / Instructor"},{value:"enthusiast-hobbyist",label:"Enthusiast/Hobbyist"},{value:"founder-investor-vc",label:"Founder / Entrepreneur / Investor / VC"},{value:"it-management-cio-ciso-cto",label:"IT management, including CIO/CISO/CTO/CDO"},{value:"machine-learning-engineer",label:"Machine Learning Engineer"},{value:"ml-ops-engineer",label:"MLOps Engineer / Infrastructure Engineer"},{value:"product-manager",label:"Product Manager"},{value:"security-professional",label:"Security / Privacy Professional"},{value:"statistician-quantitative-analyst",label:"Statistician / Quantitative Analyst"},{value:"student",label:"Student"},{value:"sysadmin-ops-sre",label:"SysAdmin/Operations/SRE"},{value:"technical-writer",label:"Technical Writer"},{value:"ui-ux-vis-designer",label:"UX / UI Designer / Data Visualization Specialist"}],ko=["+1","+7","+20","+27","+30","+31","+32","+33","+34","+36","+39","+40","+41","+43","+44","+45","+46","+47","+48","+49","+51","+52","+53","+54","+55","+56","+57","+58","+60","+61","+62","+63","+64","+65","+66","+81","+82","+84","+86","+90","+91","+92","+93","+94","+95","+98","+212","+213","+216","+218","+220","+221","+222","+223","+224","+225","+226","+227","+228","+229","+230","+231","+232","+233","+234","+235","+236","+237","+238","+239","+240","+241","+242","+243","+244","+245","+246","+247","+248","+249","+250","+251","+252","+253","+254","+255","+256","+257","+258","+260","+261","+262","+263","+264","+265","+266","+267","+268","+269","+290","+29
121","+297","+298","+299","+350","+351","+352","+353","+354","+355","+356","+357","+358","+359","+370","+371","+372","+373","+374","+375","+376","+377","+378","+380","+381","+382","+383","+385","+386","+387","+389","+420","+421","+423","+500","+501","+502","+503","+504","+505","+506","+507","+508","+509","+590","+591","+592","+593","+594","+595","+596","+597","+598","+599","+670","+672","+673","+674","+675","+676","+677","+678","+679","+680","+681","+682","+683","+684","+685"];function cn(e){const{className:t,children:n,...r}=e;return c.jsx("select",{className:`mb-1 w-full appearance-none rounded border border-slate-300 bg-white px-2 py-2 text-sm text-slate-900 outline-none transition-colors focus:border-slate-400 ${t||""}`,...r,children:n})}function $e(e){return e?.enabled!==!1}function Ot(e){return e?.required===!0}function Ap(e){const{apiUrl:t,user:n,cta:r,buttonLabel:s,fields:o,formOptions:i,auth:a,onComplete:l,onError:d}=e,[f,p]=u.useState(!1),[y,g]=u.useState(n.first_name||""),[m,h]=u.useState(n.last_name||""),[w,x]=u.useState(n.department||""),[R,N]=u.useState(n.job_title||""),[M,S]=u.useState(n.organization||""),[O,I]=u.useState(n.organization_industry||""),[v,T]=u.useState(n.country||""),[F,$]=u.useState("+1"),[K,W]=u.useState(""),ee=i?.jobRoles??[...jp],re=i?.departments??[...Mp],oe=i?.industries??[...Np],ue=i?.countries??[...Op];u.useState(()=>{if(n.phone_number){const L=n.phone_number.trim(),j=[...ko].sort((G,pe)=>pe.length-G.length);for(const G of j)if(L.startsWith(G)){$(G),W(L.substring(G.length).trim());return}W(L)}});const be=async L=>{L.preventDefault(),p(!0);try{const j={};$e(o.firstName)&&(j.first_name=y.trim()),$e(o.lastName)&&(j.last_name=m.trim()),$e(o.department)&&(j.department=w),$e(o.jobTitle)&&(j.job_title=R),$e(o.employer)&&(j.organization=M.trim()),$e(o.industry)&&(j.organization_industry=O),$e(o.country)&&(j.country=v),$e(o.phone)&&(j.phone_number=K.trim()?`${F}${K.trim()}`:""),await yp(t,n.author_id,j,a),l()}catch(j){d(j instanceof Error?j.message:"Failed to update profile")}finally{p(!1)}};return c.jsxs("div",{children:[c.jsx("p",{className:"mb-2.5 text-[15px] text-slate-900",children:r}),c.jsxs("form",{onSubmit:be,children:[$e(o.firstName)&&c.jsx(Zt,{type:"text",placeholder:"First name",value:y,onChange:L=>g(L.target.value),required:Ot(o.firstName)}),$e(o.lastName)&&c.jsx(Zt,{type:"text",placeholder:"Last name",value:m,onChange:L=>h(L.target.value),required:Ot(o.lastName)}),$e(o.department)&&c.jsxs(cn,{value:w,onChange:L=>x(L.target.value),required:Ot(o.department),children:[c.jsx("option",{value:"",children:"Department ..."}),re.map(L=>c.jsx("option",{value:L.value,children:L.label},L.value))]}),$e(o.jobTitle)&&c.jsxs(cn,{value:R,onChange:L=>N(L.target.value),required:Ot(o.jobTitle),children:[c.jsx("option",{value:"",children:"Job title ..."}),ee.map(L=>c.jsx("option",{value:L.value,children:L.label},L.value))]}),$e(o.employer)&&c.jsx(Zt,{type:"text",placeholder:"Employer",value:M,onChange:L=>S(L.target.value),required:Ot(o.employer)}),$e(o.industry)&&c.jsxs(cn,{value:O,onChange:L=>I(L.target.value),required:Ot(o.industry),children:[c.jsx("option",{value:"",children:"Industry ..."}),oe.map(L=>c.jsx("option",{value:L.value,children:L.label},L.value))]}),$e(o.country)&&c.jsxs(cn,{value:v,onChange:L=>T(L.target.value),required:Ot(o.country),children:[c.jsx("option",{value:"",children:"Country ..."}),ue.map(L=>c.jsx("option",{value:L,children:L},L))]}),$e(o.phone)&&c.jsxs("div",{className:"flex items-start gap-1",children:[c.jsx(cn,{value:F,onChange:L=>$(L.target.value),className:"!w-24 flex-shrink-0",children:ko.map(L=>c.jsx("option",{value:L,children:L},L))}),c.jsx(Zt,{type:"tel",placeholder:"Phone number",value:K,onChange:L=>W(L.target.value),required:Ot(o.phone),className:"min-w-0 flex-1"})]}),c.jsx(Sn,{type:"submit",disabled:f,children:f?"Saving...":s})]})]})}function Dp(e){const{apiUrl:t,email:n,flowId:r,prompt:s,buttonLabel:o,hint:i,auth:a,onToken:l,onVerified:d,onError:f,onBack:p}=e,[y,g]=u.useState(""),[m,h]=u.useState(!1),[w,x]=u.useState(!1),R=async N=>{N.preventDefault();const M=y.trim();if(!M){x(!0);return}h(!0),x(!1);try{const S=await gp({apiUrl:t,flowId:r,otc:M,email:n,origin:nn(),auth:a});S&&l?.(S);const O=S&&a?{...a,token:S}:a,I=await gn(t,O);I?(bn(),d(I)):f("Failed to fetch account after verification")}catch(S){x(!0),f(S instanceof Error?S.message:"Verification failed")}finally{h(!1)}};return c.jsxs("div",{children:[c.jsx("p",{className:"mb-2.5 text-[15px] text-slate-900",children:s}),c.jsxs("form",{onSubmit:R,children:[c.jsx(Zt,{type:"text",placeholder:"Verification code",value:y,onChange:N=>{g(N.target.value),x(!1)},isInvalid:w}),c.jsx(Sn,{type:"submit",disabled:m,children:m?"Verifying...":o})]}),i&&c.jsx("p",{className:"mt-3 text-xs text-slate-400",children:i}),c.jsx("button",{type:"button",onClick:p,className:"mt-2 block w-full text-center text-xs text-blue-500 transition-colors hover:text-blue-700",children:"Go back"})]})}function Lp(e){const{welcome:t,whatsNext:n,buttonLabel:r,socialLinks:s,onClose:o}=e,i=s&&Object.values(s).some(a=>a);return c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-[15px] text-slate-900",children:t}),i&&c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"mb-0 text-sm font-medium text-slate-900",children:"What's next?"}),c.jsx("p",{className:"mt-0 mb-3 text-sm text-slate-600",children:n}),c.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s?.bluesky&&c.jsx("a",{href:s.bluesky,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:text-slate-900",children:c.jsx("svg",{viewBox:"0 0 64 57",width:"20",height:"20",children:c.jsx("path",{fill:"currentColor",d:"M13.873 3.805C21.21 9.332 29.103 20.537 32 26.55v15.882c0-.338-.13.044-.41.867-1.512 4.456-7.418 21.847-20.923 7.944-7.111-7.32-3.819-14.64 9.125-16.85-7.405 1.264-15.73-.825-18.014-9.015C1.12 23.022 0 8.51 0 6.55 0-3.268 8.579-.182 13.873 3.805ZM50.127 3.805C42.79 9.332 34.897 20.537 32 26.55v15.882c0-.338.13.044.41.867 1.512 4.456 7.418 21.847 20.923 7.944 7.
12111-7.32 3.819-14.64-9.125-16.85 7.405 1.264 15.73-.825 18.014-9.015C62.88 23.022 64 8.51 64 6.55c0-9.818-8.578-6.732-13.873-2.745Z"})})}),s?.threads&&c.jsx("a",{href:s.threads,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:text-slate-900",children:c.jsx("svg",{fill:"currentColor",viewBox:"0 0 192 192",width:"20",height:"20",children:c.jsx("path",{d:"M141.537 88.988c-.71-.407-1.55-.788-2.401-1.153-1.482-27.307-16.403-42.94-41.457-43.1h-.224c-14.985 0-27.449 6.396-35.12 18.036l13.779 9.452c5.73-8.695 14.724-10.548 21.348-10.548h.132c8.25.053 14.474 2.452 18.503 7.129 2.932 3.405 4.893 8.111 5.864 14.053-7.314-1.243-15.224-1.626-23.701-1.14-23.82 1.371-39.134 15.264-38.105 34.568.521 9.792 5.4 18.216 13.735 23.719 7.047 4.652 16.124 6.927 25.557 6.412 12.458-.683 22.231-5.436 29.049-14.127 5.178-6.6 8.453-15.153 9.899-25.93 5.937 3.583 10.337 8.298 12.767 13.966 4.132 9.635 4.373 25.468-8.546 38.376-11.319 11.308-24.925 16.2-45.488 16.351-22.809-.169-40.06-7.484-51.275-21.742C35.236 139.966 29.808 120.682 29.605 96c.203-24.682 5.631-43.966 16.133-57.317C56.954 24.425 74.204 17.11 97.013 16.94c22.975.172 40.526 7.517 52.171 21.848 5.71 7.026 10.015 15.86 12.853 26.162l16.147-4.308c-3.44-12.68-8.853-23.606-16.219-32.668C147.036 9.607 125.202.195 97.07 0h-.14C68.882.194 47.292 9.642 32.788 28.08 19.882 44.486 13.224 67.316 13.001 95.932v.136c.224 28.616 6.882 51.446 19.788 67.852C47.292 182.358 68.882 191.806 96.957 192h.14c22.03-.173 39.624-6.708 54.118-22.189 18.963-18.945 18.392-42.692 12.142-57.27-4.484-10.454-13.033-18.945-24.367-24.553zM98.44 129.507c-10.44.588-21.286-4.098-21.821-14.135-.394-7.442 5.298-15.746 22.461-16.735 1.966-.113 3.895-.168 5.79-.168 6.235 0 12.068.606 17.371 1.765-1.978 24.702-13.576 28.735-23.801 29.273z"})})}),s?.linkedin&&c.jsx("a",{href:s.linkedin,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:text-slate-900",children:c.jsxs("svg",{viewBox:"0 0 17 17",fill:"currentColor",width:"18",height:"18",children:[c.jsx("path",{d:"M3.833 1.809A1.8 1.8 0 0 0 1.88 3.619 1.783 1.783 0 0 0 0 1.809 1.8 1.8 0 0 0 1.928 0a1.789 1.789 0 0 0 1.905 1.809M.1 5.047h3.614V16.689H.1z"}),c.jsx("path",{d:"M28.535 27.5c0-1.452-.047-2.666-.095-3.714h3.142l.167 1.619h.071a4.18 4.18 0 0 1 3.6-1.881c2.381 0 4.166 1.6 4.166 5.024v6.882h-3.623v-6.452c0-1.5-.524-2.523-1.833-2.523a1.987 1.987 0 0 0-1.857 1.357 2.6 2.6 0 0 0-.119.9v6.718h-3.619z",transform:"translate(-22.655 -18.741)"})]})}),s?.twitter&&c.jsx("a",{href:s.twitter,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:text-slate-900",children:c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c.jsx("path",{d:"M14.095 10.316 22.286 1h-1.94l-7.116 8.088L7.551 1H1l8.59 12.231L1 23h1.94l7.51-8.543L16.449 23H23zm-2.659 3.022-.871-1.218L3.927 2.219h2.981l5.59 7.821.868 1.219 7.265 10.166h-2.982z"})})}),s?.youtube&&c.jsx("a",{href:s.youtube,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:text-slate-900",children:c.jsx("svg",{viewBox:"0 0 310 310",fill:"currentColor",width:"20",height:"20",children:c.jsx("path",{d:"M297.917 64.645c-11.19-13.302-31.85-18.728-71.306-18.728H83.386c-40.359 0-61.369 5.776-72.517 19.938C0 79.663 0 100.008 0 128.166v53.669c0 54.551 12.896 82.248 83.386 82.248h143.226c34.216 0 53.176-4.788 65.442-16.527C304.633 235.518 310 215.863 310 181.835v-53.669c0-29.695-.841-50.16-12.083-63.521zm-98.896 97.765-65.038 33.991a5.603 5.603 0 0 1-4.632 1.137 5.603 5.603 0 0 1-5.181-1.446 5.603 5.603 0 0 1-4.819-8.554v-67.764a5.603 5.603 0 0 1 4.808-8.546 5.603 5.603 0 0 1 9.801-.328l65.038 33.772a5.603 5.603 0 0 1 5.392 8.861 5.603 5.603 0 0 1-5.369 8.877z"})})})]})]}),c.jsx(Sn,{type:"button",onClick:o,children:r})]})}const He={emailStep:{heading:{subscribe:"Sign up",login:"Login"},cta:{subscribe:"Enter your email below to receive a login code.",login:"Enter your email below to receive a login code."},buttonLabel:{subscribe:"Register",login:"Login"}},verifyStep:{heading:{subscribe:"Sign up",login:"Login"},prompt:{subscribe:"Enter the verification code sent to your email.",login:"Enter the code sent to your email to login to your account."},buttonLabel:{subscribe:"Verify",login:"Login"},hint:{subscribe:"",login:"Didn't receive a code? Make sure you have an account or try creating one."}},profileStep:{heading:{subscribe:"Complete your profile",login:"Update Your Profile"},cta:{subscribe:"Refine your profile to unlock insights and opportunities aligned with your skills and experience.",login:"Refine your profile to unlock insights and opportunities aligned with your skills and experience."},buttonLabel:{subscribe:"Update Profile",login:"Update Profile"}}
12,newsletterStep:{heading:"Stay in the loop",cta:"Based on your interests, we think you'll also enjoy these newsletters from our network.",subscribeButtonLabel:"Subscribe and Continue",skipButtonLabel:"Continue without subscribing"},welcomeStep:{heading:{subscribe:"Welcome!",login:"Welcome back!"},welcome:{subscribe:"You now have full access to our entire library of content. By joining our community, you'll be among the learners and leaders who are exploring and contributing to the advancement of AI and machine learning.",login:"You're now logged in."},whatsNext:{subscribe:"Follow us on your favorite social media networks.",login:"Follow us on your favorite social media networks."},buttonLabel:{subscribe:"OK",login:"OK"}}},Fp={firstName:{enabled:!0,required:!0},lastName:{enabled:!0,required:!0},department:{enabled:!1,required:!1},jobTitle:{enabled:!0,required:!1},employer:{enabled:!0,required:!0},industry:{enabled:!0,required:!0},country:{enabled:!0,required:!0},phone:{enabled:!0,required:!1}};function Ze(e,t,n){return e?.[n]??t?.[n]??""}function To(e){return!!e.first_name&&!!e.last_name&&!!e.country}function Po(e,t){if(t.length===0)return!1;const n=new Set(e?.weekly_subscriptions??[]);return t.some(r=>!n.has(r.id))}function va(e){const{isOpen:t,onClose:n,mode:r,apiUrl:s,oauthBaseUrl:o,googleClientId:i,initialUser:a,onLoginSuccess:l,onNewsletterSubscribed:d,newsletters:f=[],socialLinks:p,privacyPolicyUrl:y,termsOfUseUrl:g,copy:m,profileFields:h,formOptions:w,appId:x,onToken:R}=e,[N,M]=u.useState(void 0),S=u.useMemo(()=>x?{appId:x,token:N}:void 0,[x,N]),O=U=>{M(U),R?.(U)},[I,v]=u.useState("email"),[T,F]=u.useState(r),[$,K]=u.useState(""),[W,ee]=u.useState(""),[re,oe]=u.useState(null),[ue,be]=u.useState(null),L=u.useRef(!0);u.useEffect(()=>{if(!t){L.current=!0;return}L.current&&(L.current=!1,fs(),a?(oe(a),To(a)?v("welcome"):v("profile")):(v("email"),F(r),K(""),ee(""),oe(null),be(null)))},[t,a,r]);const j={...Fp,...h},G=()=>{switch(I){case"email":return Ze(m?.emailStep?.heading,He.emailStep.heading,T);case"verify":return Ze(m?.verifyStep?.heading,He.verifyStep.heading,T);case"profile":return Ze(m?.profileStep?.heading,He.profileStep.heading,T);case"newsletter":return m?.newsletterStep?.heading??He.newsletterStep.heading??"";case"welcome":return Ze(m?.welcomeStep?.heading,He.welcomeStep.heading,T)}},pe=()=>{n()},de=(U,ie)=>{K(U),ee(ie),be(null),v("verify")},he=U=>{oe(U),be(null),l(U),To(U)?T==="subscribe"&&Po(U,f)?v("newsletter"):v("welcome"):v("profile")},Y=()=>{be(null),Po(re,f)?v("newsletter"):v("welcome")},Q=()=>{be(null),re&&d?.(re),v("welcome")},ae=U=>{be(U)},Z=()=>{F(T==="login"?"subscribe":"login"),be(null)};return c.jsx(so.Root,{open:t,onOpenChange:pe,children:c.jsxs(so.TopMostContent,{className:"max-w-[420px] border-none p-5",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[c.jsx("h2",{className:"text-sm font-medium uppercase tracking-wide text-slate-900",children:G()}),c.jsx("button",{type:"button",onClick:pe,className:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-900",children:c.jsx(pp,{})})]}),ue&&c.jsx("div",{className:"mb-3 rounded border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700",children:ue}),I==="email"&&c.jsx(Pp,{mode:T,apiUrl:s,oauthBaseUrl:o,privacyPolicyUrl:y,termsOfUseUrl:g,cta:Ze(m?.emailStep?.cta,He.emailStep.cta,T),buttonLabel:Ze(m?.emailStep?.buttonLabel,He.emailStep.buttonLabel,T),auth:S,onToken:O,onClose:pe,onVerify:de,onOAuthSuccess:he,onError:ae,onSwitchMode:Z}),I==="verify"&&c.jsx(Dp,{apiUrl:s,email:$,flowId:W,prompt:Ze(m?.verifyStep?.prompt,He.verifyStep.prompt,T),buttonLabel:Ze(m?.verifyStep?.buttonLabel,He.verifyStep.buttonLabel,T),hint:Ze(m?.verifyStep?.hint,He.verifyStep.hint,T),auth:S,onToken:O,onVerified:he,onError:ae,onBack:()=>{v("email"),be(null)}}),I==="profile"&&re&&c.jsx(Ap,{apiUrl:s,user:re,cta:Ze(m?.profileStep?.cta,He.profileStep.cta,T),buttonLabel:Ze(m?.profileStep?.buttonLabel,He.profileStep.buttonLabel,T),fields:j,formOptions:w,auth:S,onComplete:Y,onError:ae}),I==="newsletter"&&re&&c.jsx(Ip,{apiUrl:s,user:re,newsletters:f,cta:m?.newsletterStep?.cta??He.newsletterStep.cta??"",subscribeButtonLabel:m?.newsletterStep?.subscribeButtonLabel??He.newsletterStep.subscribeButtonLabel??"",skipButtonLabel:m?.newsletterStep?.skipButtonLabel??He.newsletterStep.skipButtonLabel??"",auth:S,onComplete:Q,onError:ae}),I==="welcome"&&c.jsx(Lp,{socialLinks:p,welcome:Ze(m?.welcomeStep?.welcome,He.welcomeStep.welcome,T),whatsNext:Ze(m?.welcomeStep?.whatsNext,He.welcomeStep.whatsNext,T),buttonLabel:Ze(m?.welcomeStep?.buttonLabel,He.welcomeStep.buttonLabel,T),onClose:pe})]})})}
12function _p(e){const{googleClientId:t,apiUrl:n,isLoggedIn:r,isAuthLoading:s,onSuccess:o}=e,i=u.useRef(!1);u.useEffect(()=>{if(s||i.current)return;if(r){fs();return}i.current=!0;async function a(){try{const l=await fp({clientId:t,autoSelect:!0}),d=nn(),f=await bp({apiUrl:n,credential:l,origin:d});await ba({apiUrl:n,token:f,origin:d});const p=await gn(n);p&&(bn(),o(p))}catch{}}a()},[r,s,t,n,o])}var Up=(e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if(n.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}for(const s of["domain","path"])if(n[s]&&/[;\r\n]/.test(n[s]))throw new Error(`${s} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge=="number"&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!=="host"&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},Bp=(e,t,n)=>(t=encodeURIComponent(t),Up(e,t,n)),Hp=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),qr=(e,t)=>{for(const[n,r]of Object.entries(t)){const s=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(s,r?`/${r}`:"")}return e},Vp=e=>{const t=new URLSearchParams;for(const[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(const s of r)t.append(n,s);else t.set(n,r);return t},zp=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},wa=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,"/"):e.replace(/\/index(?=\?|$)/,"");function An(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xa(e,t){if(!An(e)&&!An(t))return t;const n={...e};for(const r in t){const s=t[r];An(n[r])&&An(s)?n[r]=xa(n[r],s):n[r]=s}return n}var Sa=(e,t)=>new Proxy(()=>{},{get(r,s){if(!(typeof s!="string"||s==="then"))return Sa(e,[...t,s])},apply(r,s,o){return e({path:t,args:o})}}),Wp=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){const a=new FormData;for(const[l,d]of Object.entries(e.form))if(d!==void 0)if(Array.isArray(d))for(const f of d)a.append(l,f);else a.append(l,d);this.rBody=a}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...e?.header,...typeof t?.headers=="function"?await t.headers():t?.headers};if(e?.cookie){const a=[];for(const[l,d]of Object.entries(e.cookie))a.push(Bp(l,d,{path:"/"}));r.Cookie=a.join(",")}this.cType&&(r["Content-Type"]=this.cType);const s=new Headers(r??void 0);let o=this.url;o=wa(o),o=qr(o,this.pathParams),this.queryParams&&(o=o+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const i=!(n==="GET"||n==="HEAD");return(t?.fetch||fetch)(o,{body:i?this.rBody:void 0,method:n,headers:s,...t?.init})}},$p=(e,t)=>Sa(function n(r){const s=t?.buildSearchParams??Vp,o=[...r.path],i=o.slice(-3).reverse();if(i[0]==="toString")return i[1]==="name"?i[2]||"":n.toString();if(i[0]==="valueOf")return i[1]==="name"?i[2]||"":n;let a="";if(/^\$/.test(i[0])){const p=o.pop();p&&(a=p.replace(/^\$/,""))}
12const l=o.join("/"),d=Hp(e,l);if(a==="url"||a==="path"){let p=d;return r.args[0]&&(r.args[0].param&&(p=qr(d,r.args[0].param)),r.args[0].query&&(p=p+"?"+s(r.args[0].query).toString())),p=wa(p),a==="url"?new URL(p):p.slice(e.replace(/\/+$/,"").length).replace(/^\/?/,"/")}if(a==="ws"){const p=zp(r.args[0]&&r.args[0].param?qr(d,r.args[0].param):d,"ws"),y=new URL(p),g=r.args[0]?.query;return g&&Object.entries(g).forEach(([h,w])=>{Array.isArray(w)?w.forEach(x=>y.searchParams.append(h,x)):y.searchParams.set(h,w)}),((...h)=>t?.webSocket!==void 0&&typeof t.webSocket=="function"?t.webSocket(...h):new WebSocket(...h))(y.toString())}const f=new Wp(d,a,{buildSearchParams:s});if(a){t??={};const p=xa(t,{...r.args[1]});return f.fetch(r.args[0],p)}return f},[]);const Ca="__TDS_JWT__";function Gp(){if(typeof document>"u")return null;const e=document.cookie.split(";");for(const t of e){const[n,r]=t.trim().split("=");if(n===Ca)return r}return null}function qp(){typeof document>"u"||(document.cookie=`${Ca}=; path=/; max-age=0`)}var Io={};class Wt extends Error{status;code;message;fieldErrors;constructor(t,n,r,s){super(r),this.status=t,this.code=n,this.message=r,this.fieldErrors=s}static isApiError(t){return t instanceof Wt}static isNotFound(t){return Wt.isApiError(t)?t.status===404||t.code==="NOT_FOUND":!1}static getErrorMessage(t,n="Something went wrong"){return Wt.isApiError(t)?t.message:n}static getFieldErrors(t){if(Wt.isApiError(t))return t.fieldErrors}}async function Yp(e,t){const n=Gp(),r=new Headers(t?.headers);r.set("Accept","application/json"),r.set("Platform-Slug",Je.platformSlug),n&&r.set("Authorization",`Bearer ${n}`);const s=typeof window>"u";s&&Io?.TDS_API_KEY&&r.set("x-tds-api-key",Io.TDS_API_KEY);let o=t?.signal??void 0;s&&(o=o?AbortSignal.any([o,AbortSignal.timeout(1e4)]):AbortSignal.timeout(1e4));const i=await fetch(e,{...t,signal:o,credentials:"include",headers:r});return i.status===401&&qp(),i}const Xp=$p(Je.writerApiUrl,{fetch:Yp});async function Kp(e){if(!e.ok){const n=e.headers?.get("content-type")??"";if(!n.includes("json"))throw new Wt(e.status,null,`Upstream returned ${e.status} with ${n||"no content-type"}`)}const t=await e.json();if(!e.ok){const n=t;throw new Wt(e.status,n.code??null,n.message||"An unexpected error occurred",n.fieldErrors)}return t}const Qp=Xp.v1.public.newsletters.$get,Zp={list:["newsletters","list"]};function Jp(){return{queryKey:Zp.list,queryFn:async()=>{const e=await Qp({query:{type:"tds"}});return Kp(e)},staleTime:300*1e3}}function Ea(){const{data:e}=Go(Jp());return e?.entries||[]}function eh(){return{queryKey:["auth","me"],queryFn:()=>gn(Je.accountsApiUrl),staleTime:300*1e3,retry:!1}}function Ra(){const{data:e,isLoading:t}=Go(eh());return{user:e??null,isLoggedIn:!!e,isLoading:t}}function Oo(){const{isLoggedIn:e,isLoading:t}=Ra(),n=Jr(),r=Ea(),[s,o]=u.useState(!1),[i,a]=u.useState(null),l=u.useCallback(p=>{n.invalidateQueries({queryKey:["auth","me"]}),a(p),o(!0)},[n]);_p({googleClientId:Je.googleClientId,apiUrl:Je.accountsApiUrl,isLoggedIn:e,isAuthLoading:t,onSuccess:l});const d=async()=>{await wp(Je.accountsApiUrl),n.setQueryData(["auth","me"],null)},f=()=>{o(!1),a(null)};return c.jsxs(c.Fragment,{children:[e?c.jsx("button",{type:"button",onClick:d,className:"text-brand-light text-sm tracking-button transition-colors hover:text-white hover:underline invisible pointer-events-none",children:"Sign out"}):c.jsx("button",{type:"button",onClick:()=>o(!0),className:`text-brand-light text-sm tracking-button transition-all duration-300 hover:text-white hover:underline ${t?"opacity-0":"opacity-100"}`,children:"Sign in"}),c.jsx(va,{isOpen:s,onClose:f,mode:"login",apiUrl:Je.accountsApiUrl,oauthBaseUrl:Je.accountsOAuthBaseUrl,googleClientId:Je.googleClientId,initialUser:i,newsletters:r,socialLinks:{...Ct},privacyPolicyUrl:"https://towardsdatascience.com/privacy-policy/",termsOfUseUrl:"https://towardsdatascience.com/website-terms-of-use/",copy:Yo,onLoginSuccess:p=>{n.invalidateQueries({queryKey:["auth","me"]}),Un(p.email,p.author_id)},onNewsletterSubscribed:p=>{Un(p.email,p.author_id)}})]})}function Fn(e){const{className:t,...n}=e;return c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"242",height:"77",viewBox:"0 0 242 77",fill:"none",className:je(t),...n,children:[c.jsx("path",{d:"M14.5923 27.651C15.6827 27.651 16.987 27.3817 18.5052 26.8431V32.747C17.4149 33.2166 16.3728 33.548 15.379 33.7414C14.399 33.9485 13.2466 34.0521 11.9216 34.0521C9.20251 34.0521 7.24259 33.3892 6.04182 32.0634C4.841 30.7238 4.24062 28.673 4.24062 25.9109V16.2368H1.40426V12.9431L5.00663 10.395L7.09768 5.46476H12.3977V10.16
1272H18.1533V16.2368H12.3977V25.3723C12.3977 26.8914 13.1292 27.651 14.5923 27.651ZM44.979 21.8507C44.979 25.6899 43.9439 28.6868 41.8735 30.8412C39.817 32.9818 36.9323 34.0521 33.2195 34.0521C29.6585 34.0521 26.8222 32.9541 24.7104 30.7583C22.6125 28.5625 21.5635 25.5933 21.5635 21.8507C21.5635 18.0252 22.5918 15.056 24.6483 12.9431C26.7187 10.8163 29.6171 9.75285 33.3437 9.75285C35.6487 9.75285 37.6845 10.2431 39.4512 11.2236C41.2179 12.2042 42.5774 13.6128 43.5298 15.4496C44.4958 17.2726 44.979 19.4063 44.979 21.8507ZM29.7828 21.8507C29.7828 23.867 30.0519 25.4068 30.5902 26.4702C31.1285 27.5198 32.0325 28.0446 33.3023 28.0446C34.5583 28.0446 35.4417 27.5198 35.9523 26.4702C36.4768 25.4068 36.7391 23.867 36.7391 21.8507C36.7391 19.8482 36.4768 18.336 35.9523 17.314C35.4279 16.292 34.5307 15.7811 33.2609 15.7811C32.0187 15.7811 31.1285 16.292 30.5902 17.314C30.0519 18.3222 29.7828 19.8344 29.7828 21.8507ZM69.7757 33.6378L67.1257 22.4514L66.5047 19.0748L66.0904 16.3611H65.9663C65.2901 20.2279 64.8348 22.6655 64.5998 23.6736L62.2192 33.6378H53.7099L47.3128 10.1672H55.2836L57.1881 19.1784C57.7954 22.2719 58.1474 24.8406 58.2441 26.8846H58.3682C58.4098 25.614 58.7892 23.1972 59.5069 19.6341L61.6808 10.1672H70.6246L72.6122 19.7584C73.2473 22.8105 73.6474 25.1859 73.8131 26.8846H73.9372C74.0202 25.835 74.158 24.5299 74.3515 22.9693C74.5445 21.3949 74.7582 20.1313 74.9932 19.1784L77.0633 10.1672H84.8685L78.4299 33.6378H69.7757ZM103.455 33.6378L101.902 30.5305H101.736C100.645 31.8838 99.5347 32.8091 98.4027 33.3063C97.2711 33.8035 95.8079 34.0521 94.0138 34.0521C91.8054 34.0521 90.0661 33.3892 88.7963 32.0634C87.5265 30.7376 86.8918 28.8732 86.8918 26.4702C86.8918 23.9706 87.7615 22.1131 89.5004 20.8978C91.2397 19.6686 93.7585 18.9781 97.0569 18.8262L100.97 18.7019V18.3705C100.97 16.437 100.018 15.4703 98.113 15.4703C96.4015 15.4703 94.2276 16.0503 91.5912 17.2104L89.2521 11.8658C91.9848 10.4572 95.4355 9.75285 99.6036 9.75285C102.613 9.75285 104.938 10.4986 106.581 11.9901C108.237 13.4816 109.065 15.567 109.065 18.2462V33.6378H103.455ZM97.4504 28.3346C98.4305 28.3346 99.2653 28.0239 99.9556 27.4024C100.66 26.781 101.012 25.973 101.012 24.9787V23.1557L99.1482 23.2386C96.4845 23.3353 95.1524 24.3158 95.1524 26.1802C95.1524 27.6165 95.9183 28.3346 97.4504 28.3346ZM128.707 9.75285C129.411 9.75285 130.08 9.80809 130.715 9.91857L131.17 10.0014L130.446 17.6454C129.783 17.4797 128.865 17.3969 127.692 17.3969C125.925 17.3969 124.642 17.8043 123.841 18.6191C123.041 19.4201 122.641 20.5801 122.641 22.0993V33.6378H114.546V10.1672H120.57L121.833 13.9167H122.226C122.903 12.6737 123.841 11.6725 125.042 10.9129C126.257 10.1395 127.478 9.75285 128.707 9.75285ZM141.723 34.0521C140.053 34.0521 138.59 33.5756 137.334 32.6227C136.092 31.6698 135.126 30.2681 134.436 28.4175C133.759 26.5669 133.422 24.4056 133.422 21.9335C133.422 18.1219 134.187 15.1389 135.72 12.9845C137.251 10.8301 139.356 9.75285 142.034 9.75285C143.345 9.75285 144.491 10.0153 145.471 10.5401C146.465 11.0648 147.369 11.9487 148.183 13.1916H148.348C148.086 11.3548 147.955 9.5181 147.955 7.6813V1.40454H156.112V33.6378H150.005L148.266 30.6755H147.955C146.561 32.9265 144.484 34.0521 141.723 34.0521ZM145.036 27.651C146.333 27.651 147.244 27.2436 147.769 26.4288C148.307 25.614 148.597 24.3572 148.638 22.6586V22.0164C148.638 19.9448 148.342 18.4741 147.748 17.604C147.154 16.7202 146.223 16.2782 144.953 16.2782C143.89 16.2782 143.062 16.7823 142.469 17.7904C141.889 18.7848 141.599 20.2073 141.599 22.0578C141.599 23.8808 141.896 25.2687 142.489 26.2217C143.083 27.1745 143.932 27.651 145.036 27.651ZM179.812 26.4288C179.812 28.9423 178.956 30.8412 177.245 32.1255C175.533 33.4099 173.076 34.0521 169.874 34.0521C168.135 34.0521 166.624 33.9554 165.34 33.762C164.056 33.5825 162.745 33.2442 161.406 32.747V26.2631C162.662 26.8155 164.036 27.2712 165.527 27.6303C167.031 27.9894 168.37 28.1689 169.543 28.1689C171.296 28.1689 172.172 27.7684 172.172 26.9674C172.172 26.5531 171.924 26.1871 171.427 25.8695C170.944 25.538 169.522 24.9028 167.162 23.9637C165.009 23.0798 163.504 22.0786 162.649 20.9599C161.793 19.8275 161.365 18.3981 161.365 16.6718C161.365 14.4898 162.207 12.7911 163.891 11.5758C165.575 10.3605 167.956 9.75285 171.033 9.75285C172.579 9.75285 174.029 9.92551 175.381 10.2707C176.748 10.6022 178.162 11.0925 179.625 11.7415L177.431 16.9618C176.354 16.4785 175.216 16.0711 174.015 15.7396C172.814 15.3944 171.834 15.2217 171.075 15.2217C169.75 15.2217 169.087 15.5463 169.087 16.1953C169.087 16.5959 169.315 16.9411 169.771 17.2311C170.24 17.5073
12171.579 18.0805 173.787 18.9505C175.429 19.6272 176.651 20.2901 177.452 20.9392C178.266 21.5883 178.859 22.3548 179.232 23.2386C179.619 24.1087 179.812 25.1721 179.812 26.4288Z",fill:"currentColor"}),c.jsx("path",{d:"M18.1119 72.1356H17.9256C16.3383 74.442 13.9643 75.5955 10.8036 75.5955C7.83609 75.5955 5.52425 74.5803 3.86798 72.5501C2.22549 70.5199 1.40426 67.6337 1.40426 63.891C1.40426 60.1483 2.23239 57.2412 3.88865 55.1699C5.54492 53.0982 7.84992 52.0627 10.8036 52.0627C13.8815 52.0627 16.2417 53.1812 17.8841 55.4183H18.1533L18.0084 53.7818L17.9256 52.1869V42.9475H21.3623V75.1809H18.5673L18.1119 72.1356ZM11.2383 72.7158C13.5848 72.7158 15.2824 72.0803 16.3314 70.8098C17.3942 69.5256 17.9256 67.4609 17.9256 64.6162V63.891C17.9256 60.6733 17.3872 58.3805 16.3107 57.0137C15.2479 55.6326 13.5433 54.9419 11.1969 54.9419C9.18182 54.9419 7.63597 55.729 6.5594 57.3036C5.4966 58.864 4.96523 61.0737 4.96523 63.9325C4.96523 66.8324 5.4966 69.0213 6.5594 70.4991C7.62219 71.9769 9.18182 72.7158 11.2383 72.7158ZM42.5981 75.1809L41.9149 71.9495H41.7493C40.6175 73.3717 39.4858 74.3386 38.354 74.8495C37.236 75.3467 35.835 75.5955 34.1512 75.5955C31.9014 75.5955 30.1347 75.0152 28.8511 73.8551C27.5813 72.6951 26.9464 71.0449 26.9464 68.9042C26.9464 64.3192 30.6109 61.916 37.9399 61.695L41.7907 61.5708V60.1624C41.7907 58.3805 41.4042 57.0689 40.6313 56.2261C39.8722 55.3701 38.6507 54.9419 36.9668 54.9419C35.0759 54.9419 32.9366 55.5221 30.5488 56.6822L29.4929 54.0514C30.6109 53.4433 31.8324 52.9669 33.1574 52.6218C34.4962 52.2766 35.835 52.1038 37.1739 52.1038C39.8791 52.1038 41.8804 52.7048 43.1777 53.906C44.4891 55.1076 45.1445 57.0344 45.1445 59.686V75.1809H42.5981ZM34.8344 72.7574C36.9737 72.7574 38.6507 72.1705 39.8653 70.9963C41.0937 69.8225 41.7079 68.179 41.7079 66.0661V64.0151L38.2712 64.1601C35.5383 64.2569 33.5646 64.6851 32.35 65.4448C31.1492 66.1903 30.5488 67.3575 30.5488 68.9457C30.5488 70.1885 30.9214 71.1346 31.6667 71.7834C32.4259 72.4326 33.4818 72.7574 34.8344 72.7574ZM59.5483 72.7574C60.1556 72.7574 60.7421 72.7158 61.3083 72.6328C61.8741 72.5364 62.3224 72.4396 62.6537 72.3429V74.9737C62.2813 75.1535 61.7293 75.2985 60.9974 75.409C60.2797 75.5331 59.6313 75.5955 59.0514 75.5955C54.6625 75.5955 52.4678 73.282 52.4678 68.6554V55.1491H49.2176V53.4919L52.4678 52.0627L53.917 47.2152H55.9045V52.4768H62.488V55.1491H55.9045V68.5104C55.9045 69.8778 56.2291 70.9274 56.8775 71.6592C57.5263 72.3915 58.4167 72.7574 59.5483 72.7574ZM81.1363 75.1809L80.453 71.9495H80.2874C79.1554 73.3717 78.0238 74.3386 76.8918 74.8495C75.774 75.3467 74.373 75.5955 72.6893 75.5955C70.4395 75.5955 68.6728 75.0152 67.3893 73.8551C66.1195 72.6951 65.4844 71.0449 65.4844 68.9042C65.4844 64.3192 69.1489 61.916 76.478 61.695L80.3289 61.5708V60.1624C80.3289 58.3805 79.9425 57.0689 79.1695 56.2261C78.4103 55.3701 77.1886 54.9419 75.505 54.9419C73.6142 54.9419 71.4747 55.5221 69.0871 56.6822L68.031 54.0514C69.1489 53.4433 70.3706 52.9669 71.6956 52.6218C73.0343 52.2766 74.373 52.1038 75.7121 52.1038C78.4174 52.1038 80.4186 52.7048 81.7158 53.906C83.0271 55.1076 83.6825 57.0344 83.6825 59.686V75.1809H81.1363ZM73.3726 72.7574C75.5116 72.7574 77.1886 72.1705 78.4032 70.9963C79.632 69.8225 80.2459 68.179 80.2459 66.0661V64.0151L76.8092 64.1601C74.0762 64.2569 72.1028 64.6851 70.8882 65.4448C69.6873 66.1903 69.0871 67.3575 69.0871 68.9457C69.0871 70.1885 69.4594 71.1346 70.2049 71.7834C70.9642 72.4326 72.0198 72.7574 73.3726 72.7574ZM116.383 68.9868C116.383 71.1001 115.596 72.7295 114.022 73.8759C112.449 75.0223 110.24 75.5955 107.397 75.5955C104.388 75.5955 102.042 75.1186 100.358 74.1658V70.9755C101.448 71.5279 102.615 71.9632 103.857 72.281C105.113 72.5983 106.32 72.7574 107.48 72.7574C109.274 72.7574 110.655 72.4741 111.62 71.908C112.587 71.3277 113.07 70.451 113.07 69.2772C113.07 68.3933 112.684 67.6407 111.911 67.0189C111.151 66.3839 109.661 65.6379 107.439 64.7819C105.327 63.9948 103.822 63.3111 102.925 62.7309C102.042 62.1369 101.379 61.4674 100.938 60.7214C100.51 59.9759 100.296 59.085 100.296 58.0491C100.296 56.1987 101.048 54.7417 102.553 53.6784C104.057 52.601 106.12 52.0627 108.743 52.0627C111.186 52.0627 113.574 52.5594 115.906 53.5538L114.685 56.3508C112.408 55.4117 110.344 54.9419 108.494 54.9419C106.866 54.9419 105.637 55.1973 104.809 55.7086C103.981 56.2195 103.567 56.9239 103.567 57.8215C103.567 58.4291 103.719 58.9471 104.022 59.3749C104.34 59.8031 104.844 60.2106 105.534 60.5973C106.224 60.9839 107.549 61.5434 109.509 62.2753C112.2 63.2559 114.015 64.2432 114.954 65.2375C115.906 66.2319 116.383 67.4816 116.383 68.9868ZM131.035 75.5955C127.75 75.5955 125.203 74.587 123.395 72.5709C121.601 70.5407 120.703
1267.6752 120.703 63.974C120.703 60.1761 121.615 57.2412 123.437 55.1699C125.272 53.0982 127.881 52.0627 131.263 52.0627C132.353 52.0627 133.443 52.1798 134.534 52.4145C135.624 52.6496 136.48 52.9258 137.101 53.2431L136.045 56.1643C135.286 55.8602 134.458 55.6119 133.561 55.4183C132.663 55.211 131.87 55.1076 131.179 55.1076C126.57 55.1076 124.265 58.0491 124.265 63.9325C124.265 66.722 124.824 68.8627 125.942 70.3542C127.073 71.8457 128.744 72.5917 130.952 72.5917C132.843 72.5917 134.782 72.1842 136.769 71.3693V74.4146C135.251 75.2017 133.34 75.5955 131.035 75.5955ZM145.583 75.1809H142.147V52.4768H145.583V75.1809ZM141.856 46.3243C141.856 45.5372 142.05 44.964 142.436 44.6047C142.823 44.2322 143.306 44.0457 143.885 44.0457C144.438 44.0457 144.914 44.2322 145.314 44.6047C145.714 44.9777 145.915 45.5509 145.915 46.3243C145.915 47.0976 145.714 47.6779 145.314 48.0646C144.914 48.4371 144.438 48.6236 143.885 48.6236C143.306 48.6236 142.823 48.4371 142.436 48.0646C142.05 47.6779 141.856 47.0976 141.856 46.3243ZM162.43 75.5955C159.076 75.5955 156.426 74.5733 154.48 72.5294C152.548 70.4854 151.582 67.6474 151.582 64.0151C151.582 60.3555 152.479 57.4485 154.273 55.2941C156.081 53.1397 158.503 52.0627 161.54 52.0627C164.383 52.0627 166.633 53.0014 168.289 54.8796C169.945 56.7441 170.774 59.2092 170.774 62.2753V64.4504H155.142C155.211 67.1157 155.881 69.1389 157.151 70.5199C158.434 71.9009 160.235 72.5917 162.554 72.5917C164.997 72.5917 167.412 72.0803 169.801 71.0586V74.1243C168.586 74.6493 167.433 75.0223 166.343 75.2432C165.266 75.4779 163.962 75.5955 162.43 75.5955ZM161.498 54.9419C159.677 54.9419 158.22 55.5358 157.13 56.7233C156.054 57.9112 155.418 59.5547 155.225 61.6539H167.088C167.088 59.4854 166.605 57.8281 165.639 56.6822C164.673 55.5221 163.293 54.9419 161.498 54.9419ZM192.154 75.1809V60.4938C192.154 58.643 191.733 57.262 190.891 56.3508C190.049 55.4391 188.731 54.9834 186.937 54.9834C184.563 54.9834 182.824 55.6256 181.72 56.9098C180.615 58.194 180.063 60.314 180.063 63.2696V75.1809H176.627V52.4768H179.421L179.981 55.584H180.146C180.85 54.4655 181.837 53.6024 183.107 52.9947C184.377 52.3734 185.791 52.0627 187.351 52.0627C190.084 52.0627 192.14 52.7256 193.521 54.0514C194.901 55.363 195.591 57.4693 195.591 60.3692V75.1809H192.154ZM211.713 75.5955C208.428 75.5955 205.882 74.587 204.073 72.5709C202.279 70.5407 201.382 67.6752 201.382 63.974C201.382 60.1761 202.293 57.2412 204.115 55.1699C205.95 53.0982 208.559 52.0627 211.941 52.0627C213.031 52.0627 214.121 52.1798 215.212 52.4145C216.302 52.6496 217.158 52.9258 217.779 53.2431L216.723 56.1643C215.964 55.8602 215.136 55.6119 214.239 55.4183C213.342 55.211 212.548 55.1076 211.858 55.1076C207.248 55.1076 204.943 58.0491 204.943 63.9325C204.943 66.722 205.502 68.8627 206.62 70.3542C207.752 71.8457 209.422 72.5917 211.63 72.5917C213.521 72.5917 215.461 72.1842 217.448 71.3693V74.4146C215.93 75.2017 214.018 75.5955 211.713 75.5955ZM232.411 75.5955C229.057 75.5955 226.407 74.5733 224.461 72.5294C222.528 70.4854 221.562 67.6474 221.562 64.0151C221.562 60.3555 222.459 57.4485 224.253 55.2941C226.062 53.1397 228.484 52.0627 231.52 52.0627C234.364 52.0627 236.614 53.0014 238.27 54.8796C239.926 56.7441 240.754 59.2092 240.754 62.2753V64.4504H225.123C225.192 67.1157 225.862 69.1389 227.131 70.5199C228.415 71.9009 230.216 72.5917 232.535 72.5917C234.978 72.5917 237.393 72.0803 239.781 71.0586V74.1243C238.567 74.6493 237.414 75.0223 236.323 75.2432C235.247 75.4779 233.943 75.5955 232.411 75.5955ZM231.479 54.9419C229.657 54.9419 228.201 55.5358 227.111 56.7233C226.034 57.9112 225.399 59.5547 225.206 61.6539H237.069C237.069 59.4854 236.586 57.8281 235.62 56.6822C234.653 55.5221 233.273 54.9419 231.479 54.9419Z",fill:"currentColor"})]})}function ka(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",className:je(t),...n,children:c.jsx("path",{d:"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,
121.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z",fill:"currentColor"})})}function Ta(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",className:je(t),...n,children:c.jsx("path",{d:"M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z",fill:"currentColor"})})}function _n(e){const{children:t,className:n,as:r="button",...s}=e,o=je("text-brand-light flex items-center rounded-full border border-transparent p-2 transition-colors hover:bg-brand-light hover:text-brand",n);return r==="a"?c.jsx("a",{className:o,...s,children:t}):c.jsx("button",{type:"button",className:o,...s,children:t})}function un(e){const{to:t,children:n,className:r,reloadDocument:s}=e;return c.jsx(tn,{to:t,reloadDocument:s,className:je("text-brand-light pb-0.5 text-base uppercase leading-6 tracking-nav transition-colors hover:text-white hover:underline",r),children:n})}const th={outline:"border-brand-light text-brand-light hover:border-white hover:bg-white hover:text-brand",solid:"border-brand-light bg-white text-brand hover:bg-brand hover:text-white",brand:"border-brand-light bg-brand text-brand-light hover:bg-brand-light hover:text-brand",tag:"border-gray-900 text-gray-900 hover:bg-gray-900 hover:text-white",cta:"border-2 border-brand bg-brand text-white font-semibold hover:bg-transparent hover:text-brand","cta-outline":"border-2 border-brand bg-transparent text-brand font-semibold hover:bg-brand hover:text-white"},nh="inline-flex cursor-pointer items-center justify-center rounded-full transition-all",rh={outline:"border px-4 py-2.5 text-sm tracking-button",solid:"border px-4 py-2.5 text-sm tracking-button",brand:"border px-4 py-2.5 text-sm tracking-button",tag:"border px-4 py-2.5 text-base",cta:"px-10 py-3.5 text-base","cta-outline":"px-10 py-3.5 text-base"};function Yr(e){const{children:t,className:n,variant:r="outline",as:s="button",...o}=e,i=je(nh,rh[r],th[r],n);if(s==="link"){const{to:a,...l}=o;return c.jsx(tn,{to:a,className:i,...l,children:t})}return s==="a"?c.jsx("a",{className:i,...o,children:t}):c.jsx("button",{type:"button",className:i,...o,children:t})}const No=[{label:"Latest",href:"/latest/"},{label:"Editor's Picks",href:"/tag/editors-pick/"},{label:"Newsletter",href:"/tag/the-variable/"},{label:"ShipAI",href:"/shipai/",reloadDocument:!0,preserveCase:!0}],Mo=[{label:"Write For TDS",href:"/submissions/"}],sh=[{label:"LinkedIn",href:Ct.linkedin,icon:ka},{label:"X",href:Ct.twitter,icon:Ta}];function kh(){const[e,t]=u.useState(!1),[n,r]=u.useState(!1),s=Oa();return u.useEffect(()=>{r(!1)},[s.pathname]),c.jsxs(jn.Root,{open:e,onOpenChange:t,swipeDirection:"right",children:[c.jsxs("div",{className:"relative z-50",children:[c.jsx("header",{className:"bg-brand px-6 pt-6 pb-4 text-white",children:c.jsxs(ds,{children:[c.jsxs("div",{className:"flex items-center justify-between md:hidden",children:[c.jsxs(_n,{onClick:()=>r(!n),children:[n?c.jsxs("svg",{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",children:[c.jsx("path",{d:"M18 6 6 18"}),c.jsx("path",{d:"m6 6 12 12"})]}):c.jsx($r,{className:"-rotate-90 scale-[1.18]"}),c.jsx("span",{className:"sr-only",children:"Toggle Search"})]}),c.jsx(tn,{to:"/",children:c.jsx(Fn,{className:"h-[50px] w-[158px] text-white"})}),c.jsxs(jn.Trigger,{className:"text-brand-light flex items-center rounded-full border border-transparent p-2 transition-colors hover:bg-brand-light hover:text-brand",children:[e?c.jsxs("svg",{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",children:[c.jsx("path",{d:"M18 6 6 18"}),c.jsx("path",{d:"m6 6 12 12"})]}):c.jsxs("svg",{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",children:[c.jsx("line",{x1:"4",x2:"20",y1:"6",y2:"6"}),c.jsx("line",{x1:"4",x2:"20",y1:"12",y2:"12"}),c.jsx("line",{x1:"4",x2:"20",y1:"18",y2:"18"})]}),c.jsx("span",{className:"sr-only",children:"Toggle Mobile Navigation"})]})]}),c.jsxs("div",{className:"hidden md:block",children:[c.jsxs("div",{className:"flex items-center justify-between gap-6",children:[c.jsxs("div",{className:"flex flex-col items-start gap-2",children:[c.jsx(tn,{to:"/",className:"mb-3",children:c.jsx(Fn,{className:"h-[50px] w-[158px] text-white"})}),c.jsx("p",{className:"text-xl leading-normal",children:"Publish AI, ML & data-science insights to a global community of data professionals."})]}),c.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-6",children:[c.jsx(Oo,{}),c.jsx(Yr,{as:"a",href:Je.writeAppRegisterUrl,variant:"outline",children:"Submit an Article"})]})]}),c.jsxs("div",{className:"mt-8 flex items-center justify-between gap-6",children:[c.jsxs("nav",{className:"flex flex-wrap items-center gap-x-6 gap-y-4",children:[No.map(o=>c.jsx(un,{to:o.href,reloadDocument:o.reloadDocument,className:je(o.preserveCase&&"normal-case"),children:o.label},o.href)),c.jsx("hr",{className:"h-6 w-px border-0 bg-brand-light"}),Mo.map(o=>c.jsx(un,{to:o.href,children:o.label},o.href))]}),c.jsxs("div",{className:"flex items-center gap-4",children:[sh.map(o=>c.jsxs(_n,{as:"a",href:o.href,target:"_blank",rel:"noopener nofollow",children:[c.jsx(o.icon,{}),c.jsx("span",{className:"sr-only",children:o.label})]},o.href)),c.jsxs(_n,{onClick:()=>r(!n),children:[n?c.jsxs("svg",{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",children:[c.jsx("path",{d:"M18 6 6 18"}),c.jsx("path",{d:"m6 6 12 12"})]}):c.jsx($r,{className:"-rotate-90 scale-[1.18]"}),c.jsx("span",{className:"sr-only",children:"Toggle Search"})]})]})]})]})]})}),n&&c.jsx(cp,{onClose:()=>r(!1)})]}),c.jsxs(jn.Content,{className:"top-0 right-0 flex h-full w-64 flex-col bg-brand px-8 pt-24 pb-8 md:hidden",children:[c.jsx(jn.Title,{className:"sr-only",children:"Navigation"}),c.jsx("div",{className:"flex flex-col gap-4",children:No.map(o=>c.jsx(un,{to:o.href,reloadDocument:o.reloadDocument,className:je("text-brand-light",o.preserveCase&&"normal-case"),children:o.label},o.href))}),c.jsx("hr",{className:"my-6 border-brand-light/30"}),c.jsx("div",{className:"flex flex-col gap-4",children:Mo.map(o=>c.jsx(un,{to:o.href,className:"text-brand-light",children:o.label},o.href))}),c.jsxs("div",{className:"mt-6 flex flex-col items-end gap-4",children:[c.jsx(Oo,{}),c.jsx(Yr,{as:"a",href:Je.writeAppRegisterUrl,variant:"outline",children:"Submit an Article"})]}),c.jsx("div",{className:"mt-auto",children:c.jsx(tn,{to:"/",children:c.jsx(Fn,{className:"h-[40px] w-[126px] text-white"})})})]})]},s.pathname)}function oh(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",className:je(t),...n,children:c.jsx("path",{d:"M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z",fill:"currentColor"})})}function ih(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",className:je(t),...n,children:c.jsx("path",{d:"M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4
12-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z",fill:"currentColor"})})}function ah(e){const{className:t,...n}=e;return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",className:je(t),...n,children:c.jsx("path",{d:"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z",fill:"currentColor"})})}function lh(){const{isLoggedIn:e}=Ra(),t=Jr(),n=Ea(),[r,s]=u.useState(!1),o=()=>{s(!1)};return c.jsxs(c.Fragment,{children:[c.jsx(Yr,{variant:"solid",onClick:()=>s(!0),className:e?"invisible pointer-events-none":"",children:"Subscribe to Our Newsletter"}),c.jsx(va,{isOpen:r,onClose:o,mode:"login",apiUrl:Je.accountsApiUrl,oauthBaseUrl:Je.accountsOAuthBaseUrl,googleClientId:Je.googleClientId,newsletters:n,socialLinks:{...Ct},privacyPolicyUrl:"https://towardsdatascience.com/privacy-policy/",termsOfUseUrl:"https://towardsdatascience.com/website-terms-of-use/",copy:Yo,onLoginSuccess:i=>{t.invalidateQueries({queryKey:["auth","me"]}),Un(i.email,i.author_id)},onNewsletterSubscribed:i=>{Un(i.email,i.author_id)}})]})}function ch(){return new Date().getFullYear()}function Th(e){return e?new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):""}const uh=[{label:"YouTube",href:Ct.youtube,icon:ah},{label:"X",href:Ct.twitter,icon:Ta},{label:"LinkedIn",href:Ct.linkedin,icon:ka},{label:"Threads",href:Ct.threads,icon:ih},{label:"Bluesky",href:Ct.bluesky,icon:oh}],jo=[{label:"Write For TDS",href:"/submissions/"},{label:"About",href:"/about-towards-data-science-d691af11cc2f/"},{label:"Advertise",href:"https://contact.towardsdatascience.com/advertise-with-towards-data-science",external:!0},{label:"Privacy Policy",href:"/privacy-policy/"},{label:"Terms of Use",href:"/website-terms-of-use/"}],dh=[{label:"The New Stack",href:"https://thenewstack.io"},{label:"roadmap.sh",href:"https://roadmap.sh"},{label:"Creator Network",href:"https://insightmediagroup.io/creator-network"}];function Ph(){return c.jsxs("footer",{className:"bg-brand px-6 py-8 text-brand-light",children:[c.jsx("div",{className:"flex justify-center",children:c.jsx("ul",{className:"flex flex-wrap items-center gap-4",children:uh.map(e=>c.jsx("li",{children:c.jsxs(_n,{as:"a",href:e.href,target:"_blank",rel:"noopener nofollow",className:"p-2 [&>svg]:size-9",children:[c.jsx(e.icon,{}),c.jsx("span",{className:"sr-only",children:e.label})]})},e.href))})}),c.jsxs(ds,{className:"mt-8",children:[c.jsxs("div",{className:"flex flex-col gap-6 md:flex-row",children:[c.jsxs("div",{className:"flex-1 wrap-break-word",children:[c.jsx(tn,{to:"/",children:c.jsx(Fn,{className:"h-[38px] w-[120px] text-white"})}),c.jsx("p",{className:"mt-6",children:"Your home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals."})]}),c.jsxs("div",{className:"flex flex-1 flex-col items-center wrap-break-word",children:[c.jsx(lh,{}),c.jsx("nav",{"aria-label":"Site Footer Navigation",className:"mt-6 flex flex-wrap justify-center sm:flex-row flex-col items-center sm:gap-2 gap-1",children:jo.map((e,t)=>c.jsxs(u.Fragment,{children:[c.jsx("span",{className:"flex items-center gap-2",children:"external"in e&&e.external?c.jsx("a",{href:e.href,target:"_blank",rel:"noopener nofollow",className:"text-brand-light pb-0.5 text-base uppercase leading-6 tracking-nav transition-colors hover:text-white hover:underline",children:e.label}):c.jsx(un,{to:e.href,children:e.label})}
12),t<jo.length-1&&c.jsx("span",{className:"text-brand-light text-2xs",children:"â¢"})]},e.href))})]})]}),c.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-x-3 gap-y-2",children:[c.jsxs("span",{children:[c.jsx("span",{children:"©"})," ",c.jsx("span",{children:"Insight Media Group, LLC"})," ",c.jsx("span",{children:ch()})]}),dh.map(e=>c.jsxs(u.Fragment,{children:[c.jsx("span",{className:"text-2xs",children:"â¢"}),c.jsxs("a",{href:e.href,target:"_blank",rel:"noopener",className:"tracking-nav inline-flex items-center gap-1 text-sm uppercase transition-colors hover:text-white hover:underline",children:[e.label,c.jsx(fl,{className:"size-3.5"})]})]},e.href))]})]})]})}export{va as A,wh as B,ds as C,mh as D,Bo as E,Ph as F,Ho as G,kh as H,Jt as I,hh as J,kr as K,tn as L,Kr as M,_o as N,ka as O,Yr as P,$a as Q,Wa as R,$r as S,so as T,_n as U,Eh as V,xh as W,Ta as X,ml as Y,bd as Z,sc as _,je as a,Xp as b,ul as c,Sh as d,Je as e,Th as f,Jr as g,Kp as h,Ea as i,Yo as j,Ct as k,Un as l,Ra as m,Fa as n,yh as o,bh as p,Ch as q,vh as r,Rh as s,za as t,sl as u,Qr as v,Xr as w,gh as x,pn as y,Aa as z};
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.