diff --git "a/dist/public/assets/index.js" "b/dist/public/assets/index.js" new file mode 100644--- /dev/null +++ "b/dist/public/assets/index.js" @@ -0,0 +1,342 @@ +var df=e=>{throw TypeError(e)};var pl=(e,t,n)=>t.has(e)||df("Cannot "+n);var k=(e,t,n)=>(pl(e,t,"read from private field"),n?n.call(e):t.get(e)),V=(e,t,n)=>t.has(e)?df("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(pl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(pl(e,t,"access private method"),n);var ei=(e,t,n,r)=>({set _(o){z(e,t,o,n)},get _(){return k(e,t,r)}});function O0(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function Nh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kh={exports:{}},Aa={},Eh={exports:{}},q={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Us=Symbol.for("react.element"),_0=Symbol.for("react.portal"),L0=Symbol.for("react.fragment"),F0=Symbol.for("react.strict_mode"),z0=Symbol.for("react.profiler"),$0=Symbol.for("react.provider"),U0=Symbol.for("react.context"),W0=Symbol.for("react.forward_ref"),H0=Symbol.for("react.suspense"),B0=Symbol.for("react.memo"),V0=Symbol.for("react.lazy"),ff=Symbol.iterator;function Q0(e){return e===null||typeof e!="object"?null:(e=ff&&e[ff]||e["@@iterator"],typeof e=="function"?e:null)}var jh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ph=Object.assign,Th={};function jo(e,t,n){this.props=e,this.context=t,this.refs=Th,this.updater=n||jh}jo.prototype.isReactComponent={};jo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};jo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rh(){}Rh.prototype=jo.prototype;function bu(e,t,n){this.props=e,this.context=t,this.refs=Th,this.updater=n||jh}var Nu=bu.prototype=new Rh;Nu.constructor=bu;Ph(Nu,jo.prototype);Nu.isPureReactComponent=!0;var pf=Array.isArray,Mh=Object.prototype.hasOwnProperty,ku={current:null},Ih={key:!0,ref:!0,__self:!0,__source:!0};function Ah(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)Mh.call(t,r)&&!Ih.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1>>1,K=P[W];if(0>>1;Wo(fn,_))_eo(Qe,fn)?(P[W]=Qe,P[_e]=_,W=_e):(P[W]=fn,P[Pe]=_,W=Pe);else if(_eo(Qe,_))P[W]=Qe,P[_e]=_,W=_e;else break e}}return T}function o(P,T){var _=P.sortIndex-T.sortIndex;return _!==0?_:P.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],f=1,d=null,h=3,x=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(P){for(var T=n(u);T!==null;){if(T.callback===null)r(u);else if(T.startTime<=P)r(u),T.sortIndex=T.expirationTime,t(c,T);else break;T=n(u)}}function C(P){if(v=!1,y(P),!w)if(n(c)!==null)w=!0,$(b);else{var T=n(u);T!==null&&R(C,T.startTime-P)}}function b(P,T){w=!1,v&&(v=!1,g(j),j=-1),x=!0;var _=h;try{for(y(T),d=n(c);d!==null&&(!(d.expirationTime>T)||P&&!L());){var W=d.callback;if(typeof W=="function"){d.callback=null,h=d.priorityLevel;var K=W(d.expirationTime<=T);T=e.unstable_now(),typeof K=="function"?d.callback=K:d===n(c)&&r(c),y(T)}else r(c);d=n(c)}if(d!==null)var ye=!0;else{var Pe=n(u);Pe!==null&&R(C,Pe.startTime-T),ye=!1}return ye}finally{d=null,h=_,x=!1}}var E=!1,N=null,j=-1,M=5,I=-1;function L(){return!(e.unstable_now()-IP||125W?(P.sortIndex=_,t(u,P),n(c)===null&&P===n(u)&&(v?(g(j),j=-1):v=!0,R(C,_-W))):(P.sortIndex=K,t(c,P),w||x||(w=!0,$(b))),P},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(P){var T=h;return function(){var _=h;h=T;try{return P.apply(this,arguments)}finally{h=_}}}})(zh);Fh.exports=zh;var rw=Fh.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ow=p,at=rw;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=Object.prototype.hasOwnProperty,sw=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mf={},gf={};function iw(e){return rc.call(gf,e)?!0:rc.call(mf,e)?!1:sw.test(e)?gf[e]=!0:(mf[e]=!0,!1)}function aw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lw(e,t,n,r){if(t===null||typeof t>"u"||aw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ve(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Ve(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Ve(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Ve(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Ve(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){je[e]=new Ve(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Ve(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Ve(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Ve(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Ve(e,5,!1,e.toLowerCase(),null,!1,!1)});var ju=/[\-:]([a-z])/g;function Pu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ju,Pu);je[t]=new Ve(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ju,Pu);je[t]=new Ve(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ju,Pu);je[t]=new Ve(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Ve(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Ve("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Ve(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tu(e,t,n,r){var o=je.hasOwnProperty(t)?je[t]:null;(o!==null?o.type!==0:r||!(2l||o[i]!==s[l]){var c=` +`+o[i].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{gl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ko(e):""}function cw(e){switch(e.tag){case 5:return Ko(e.type);case 16:return Ko("Lazy");case 13:return Ko("Suspense");case 19:return Ko("SuspenseList");case 0:case 2:case 15:return e=vl(e.type,!1),e;case 11:return e=vl(e.type.render,!1),e;case 1:return e=vl(e.type,!0),e;default:return""}}function ac(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Mr:return"Fragment";case Rr:return"Portal";case oc:return"Profiler";case Ru:return"StrictMode";case sc:return"Suspense";case ic:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Wh:return(e.displayName||"Context")+".Consumer";case Uh:return(e._context.displayName||"Context")+".Provider";case Mu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Iu:return t=e.displayName||null,t!==null?t:ac(e.type)||"Memo";case xn:t=e._payload,e=e._init;try{return ac(e(t))}catch{}}return null}function uw(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ac(t);case 8:return t===Ru?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dw(e){var t=Bh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ri(e){e._valueTracker||(e._valueTracker=dw(e))}function Vh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Bh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lc(e,t){var n=t.checked;return de({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Un(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qh(e,t){t=t.checked,t!=null&&Tu(e,"checked",t,!1)}function cc(e,t){Qh(e,t);var n=Un(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uc(e,t.type,n):t.hasOwnProperty("defaultValue")&&uc(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function uc(e,t,n){(t!=="number"||Vi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yo=Array.isArray;function Br(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=oi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ts={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fw=["Webkit","ms","Moz","O"];Object.keys(ts).forEach(function(e){fw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ts[t]=ts[e]})});function qh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ts.hasOwnProperty(e)&&ts[e]?(""+t).trim():t+"px"}function Xh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=qh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var pw=de({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pc(e,t){if(t){if(pw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function hc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mc=null;function Au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gc=null,Vr=null,Qr=null;function Cf(e){if(e=Bs(e)){if(typeof gc!="function")throw Error(A(280));var t=e.stateNode;t&&(t=Fa(t),gc(e.stateNode,e.type,t))}}function Zh(e){Vr?Qr?Qr.push(e):Qr=[e]:Vr=e}function Jh(){if(Vr){var e=Vr,t=Qr;if(Qr=Vr=null,Cf(e),t)for(e=0;e>>=0,e===0?32:31-(Nw(e)/kw|0)|0}var si=64,ii=4194304;function qo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Yi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~o;l!==0?r=qo(l):(s&=i,s!==0&&(r=qo(s)))}else i=n&~o,i!==0?r=qo(i):s!==0&&(r=qo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ws(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function Tw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=rs),Mf=" ",If=!1;function xm(e,t){switch(e){case"keyup":return r1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ir=!1;function s1(e,t){switch(e){case"compositionend":return wm(t);case"keypress":return t.which!==32?null:(If=!0,Mf);case"textInput":return e=t.data,e===Mf&&If?null:e;default:return null}}function i1(e,t){if(Ir)return e==="compositionend"||!Uu&&xm(e,t)?(e=vm(),Ti=Fu=Rn=null,Ir=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_f(n)}}function Nm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function km(){for(var e=window,t=Vi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vi(e.document)}return t}function Wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function m1(e){var t=km(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Nm(n.ownerDocument.documentElement,n)){if(r!==null&&Wu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Lf(n,s);var i=Lf(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ar=null,Cc=null,ss=null,bc=!1;function Ff(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bc||Ar==null||Ar!==Vi(r)||(r=Ar,"selectionStart"in r&&Wu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ss&&ws(ss,r)||(ss=r,r=Zi(Cc,"onSelect"),0_r||(e.current=Tc[_r],Tc[_r]=null,_r--)}function oe(e,t){_r++,Tc[_r]=e.current,e.current=t}var Wn={},Ae=Kn(Wn),Xe=Kn(!1),hr=Wn;function go(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ze(e){return e=e.childContextTypes,e!=null}function ea(){ae(Xe),ae(Ae)}function Vf(e,t,n){if(Ae.current!==Wn)throw Error(A(168));oe(Ae,t),oe(Xe,n)}function Dm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(A(108,uw(e)||"Unknown",o));return de({},n,r)}function ta(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,hr=Ae.current,oe(Ae,e),oe(Xe,Xe.current),!0}function Qf(e,t,n){var r=e.stateNode;if(!r)throw Error(A(169));n?(e=Dm(e,t,hr),r.__reactInternalMemoizedMergedChildContext=e,ae(Xe),ae(Ae),oe(Ae,e)):ae(Xe),oe(Xe,n)}var Xt=null,za=!1,Ml=!1;function Om(e){Xt===null?Xt=[e]:Xt.push(e)}function j1(e){za=!0,Om(e)}function Yn(){if(!Ml&&Xt!==null){Ml=!0;var e=0,t=re;try{var n=Xt;for(re=1;e>=i,o-=i,Zt=1<<32-jt(t)+o|n<j?(M=N,N=null):M=N.sibling;var I=h(g,N,y[j],C);if(I===null){N===null&&(N=M);break}e&&N&&I.alternate===null&&t(g,N),m=s(I,m,j),E===null?b=I:E.sibling=I,E=I,N=M}if(j===y.length)return n(g,N),le&&Jn(g,j),b;if(N===null){for(;jj?(M=N,N=null):M=N.sibling;var L=h(g,N,I.value,C);if(L===null){N===null&&(N=M);break}e&&N&&L.alternate===null&&t(g,N),m=s(L,m,j),E===null?b=L:E.sibling=L,E=L,N=M}if(I.done)return n(g,N),le&&Jn(g,j),b;if(N===null){for(;!I.done;j++,I=y.next())I=d(g,I.value,C),I!==null&&(m=s(I,m,j),E===null?b=I:E.sibling=I,E=I);return le&&Jn(g,j),b}for(N=r(g,N);!I.done;j++,I=y.next())I=x(N,g,j,I.value,C),I!==null&&(e&&I.alternate!==null&&N.delete(I.key===null?j:I.key),m=s(I,m,j),E===null?b=I:E.sibling=I,E=I);return e&&N.forEach(function(O){return t(g,O)}),le&&Jn(g,j),b}function S(g,m,y,C){if(typeof y=="object"&&y!==null&&y.type===Mr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ni:e:{for(var b=y.key,E=m;E!==null;){if(E.key===b){if(b=y.type,b===Mr){if(E.tag===7){n(g,E.sibling),m=o(E,y.props.children),m.return=g,g=m;break e}}else if(E.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===xn&&Yf(b)===E.type){n(g,E.sibling),m=o(E,y.props),m.ref=Ho(g,E,y),m.return=g,g=m;break e}n(g,E);break}else t(g,E);E=E.sibling}y.type===Mr?(m=pr(y.props.children,g.mode,C,y.key),m.return=g,g=m):(C=Li(y.type,y.key,y.props,null,g.mode,C),C.ref=Ho(g,m,y),C.return=g,g=C)}return i(g);case Rr:e:{for(E=y.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(g,m.sibling),m=o(m,y.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=zl(y,g.mode,C),m.return=g,g=m}return i(g);case xn:return E=y._init,S(g,m,E(y._payload),C)}if(Yo(y))return w(g,m,y,C);if(Fo(y))return v(g,m,y,C);pi(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(g,m.sibling),m=o(m,y),m.return=g,g=m):(n(g,m),m=Fl(y,g.mode,C),m.return=g,g=m),i(g)):n(g,m)}return S}var yo=zm(!0),$m=zm(!1),oa=Kn(null),sa=null,zr=null,Qu=null;function Gu(){Qu=zr=sa=null}function Ku(e){var t=oa.current;ae(oa),e._currentValue=t}function Ic(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Kr(e,t){sa=e,Qu=zr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qe=!0),e.firstContext=null)}function yt(e){var t=e._currentValue;if(Qu!==e)if(e={context:e,memoizedValue:t,next:null},zr===null){if(sa===null)throw Error(A(308));zr=e,sa.dependencies={lanes:0,firstContext:e}}else zr=zr.next=e;return t}var nr=null;function Yu(e){nr===null?nr=[e]:nr.push(e)}function Um(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Yu(t)):(n.next=o.next,o.next=n),t.interleaved=n,sn(e,r)}function sn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var wn=!1;function qu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function en(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _n(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,sn(e,n)}return o=r.interleaved,o===null?(t.next=t,Yu(r)):(t.next=o.next,o.next=t),r.interleaved=t,sn(e,n)}function Mi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ou(e,n)}}function qf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ia(e,t,n,r){var o=e.updateQueue;wn=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,i===null?s=u:i.next=u,i=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==i&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=c))}if(s!==null){var d=o.baseState;i=0,f=u=c=null,l=s;do{var h=l.lane,x=l.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,v=l;switch(h=t,x=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(x,d,h);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,h=typeof w=="function"?w.call(x,d,h):w,h==null)break e;d=de({},d,h);break e;case 2:wn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else x={eventTime:x,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=x,c=d):f=f.next=x,i|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(f===null&&(c=d),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);vr|=i,e.lanes=i,e.memoizedState=d}}function Xf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Al.transition;Al.transition={};try{e(!1),t()}finally{re=n,Al.transition=r}}function sg(){return xt().memoizedState}function M1(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ig(e))ag(t,n);else if(n=Um(e,t,n,r),n!==null){var o=He();Pt(n,e,r,o),lg(n,t,r)}}function I1(e,t,n){var r=Fn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ig(e))ag(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(o.hasEagerState=!0,o.eagerState=l,Tt(l,i)){var c=t.interleaved;c===null?(o.next=o,Yu(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Um(e,t,o,r),n!==null&&(o=He(),Pt(n,e,r,o),lg(n,t,r))}}function ig(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function ag(e,t){is=la=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ou(e,n)}}var ca={readContext:yt,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},A1={readContext:yt,useCallback:function(e,t){return Ot().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:Jf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ai(4194308,4,eg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ai(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ai(4,2,e,t)},useMemo:function(e,t){var n=Ot();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ot();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=M1.bind(null,ue,e),[r.memoizedState,e]},useRef:function(e){var t=Ot();return e={current:e},t.memoizedState=e},useState:Zf,useDebugValue:od,useDeferredValue:function(e){return Ot().memoizedState=e},useTransition:function(){var e=Zf(!1),t=e[0];return e=R1.bind(null,e[1]),Ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ue,o=Ot();if(le){if(n===void 0)throw Error(A(407));n=n()}else{if(n=t(),be===null)throw Error(A(349));gr&30||Qm(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,Jf(Km.bind(null,r,s,e),[e]),r.flags|=2048,Ps(9,Gm.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ot(),t=be.identifierPrefix;if(le){var n=Jt,r=Zt;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Es++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[$t]=t,e[bs]=r,yg(e,t,!1,!1),t.stateNode=e;e:{switch(i=hc(n,r),n){case"dialog":ie("cancel",e),ie("close",e),o=r;break;case"iframe":case"object":case"embed":ie("load",e),o=r;break;case"video":case"audio":for(o=0;oSo&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304)}else{if(!r)if(e=aa(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!le)return Re(t),null}else 2*me()-s.renderingStartTime>So&&n!==1073741824&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=me(),t.sibling=null,n=ce.current,oe(ce,r?n&1|2:n&1),t):(Re(t),null);case 22:case 23:return ud(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(Re(t),t.subtreeFlags&6&&(t.flags|=8192)):Re(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function U1(e,t){switch(Bu(t),t.tag){case 1:return Ze(t.type)&&ea(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),ae(Xe),ae(Ae),Ju(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zu(t),null;case 13:if(ae(ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(ce),null;case 4:return xo(),null;case 10:return Ku(t.type._context),null;case 22:case 23:return ud(),null;case 24:return null;default:return null}}var mi=!1,Ie=!1,W1=typeof WeakSet=="function"?WeakSet:Set,F=null;function $r(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function Uc(e,t,n){try{n()}catch(r){pe(e,t,r)}}var up=!1;function H1(e,t){if(Nc=qi,e=km(),Wu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,c=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var x;d!==n||o!==0&&d.nodeType!==3||(l=i+o),d!==s||r!==0&&d.nodeType!==3||(c=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(x=d.firstChild)!==null;)h=d,d=x;for(;;){if(d===e)break t;if(h===n&&++u===o&&(l=i),h===s&&++f===r&&(c=i),(x=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(kc={focusedElem:e,selectionRange:n},qi=!1,F=t;F!==null;)if(t=F,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,F=e;else for(;F!==null;){t=F;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,S=w.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:St(t.type,v),S);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(C){pe(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,F=e;break}F=t.return}return w=up,up=!1,w}function as(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&Uc(t,n,s)}o=o.next}while(o!==r)}}function Wa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Sg(e){var t=e.alternate;t!==null&&(e.alternate=null,Sg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$t],delete t[bs],delete t[Pc],delete t[k1],delete t[E1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cg(e){return e.tag===5||e.tag===3||e.tag===4}function dp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ji));else if(r!==4&&(e=e.child,e!==null))for(Hc(e,t,n),e=e.sibling;e!==null;)Hc(e,t,n),e=e.sibling}function Bc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Bc(e,t,n),e=e.sibling;e!==null;)Bc(e,t,n),e=e.sibling}var Ne=null,bt=!1;function pn(e,t,n){for(n=n.child;n!==null;)bg(e,t,n),n=n.sibling}function bg(e,t,n){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Da,n)}catch{}switch(n.tag){case 5:Ie||$r(n,t);case 6:var r=Ne,o=bt;Ne=null,pn(e,t,n),Ne=r,bt=o,Ne!==null&&(bt?(e=Ne,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ne.removeChild(n.stateNode));break;case 18:Ne!==null&&(bt?(e=Ne,n=n.stateNode,e.nodeType===8?Rl(e.parentNode,n):e.nodeType===1&&Rl(e,n),ys(e)):Rl(Ne,n.stateNode));break;case 4:r=Ne,o=bt,Ne=n.stateNode.containerInfo,bt=!0,pn(e,t,n),Ne=r,bt=o;break;case 0:case 11:case 14:case 15:if(!Ie&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Uc(n,t,i),o=o.next}while(o!==r)}pn(e,t,n);break;case 1:if(!Ie&&($r(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){pe(n,t,l)}pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:n.mode&1?(Ie=(r=Ie)||n.memoizedState!==null,pn(e,t,n),Ie=r):pn(e,t,n);break;default:pn(e,t,n)}}function fp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new W1),t.forEach(function(r){var o=Z1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function wt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~s}if(r=o,r=me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*V1(r/1960))-r,10e?16:e,Mn===null)var r=!1;else{if(e=Mn,Mn=null,fa=0,J&6)throw Error(A(331));var o=J;for(J|=4,F=e.current;F!==null;){var s=F,i=s.child;if(F.flags&16){var l=s.deletions;if(l!==null){for(var c=0;cme()-ld?fr(e,0):ad|=n),Je(e,t)}function Mg(e,t){t===0&&(e.mode&1?(t=ii,ii<<=1,!(ii&130023424)&&(ii=4194304)):t=1);var n=He();e=sn(e,t),e!==null&&(Ws(e,t,n),Je(e,n))}function X1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mg(e,n)}function Z1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(A(314))}r!==null&&r.delete(t),Mg(e,n)}var Ig;Ig=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xe.current)qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qe=!1,z1(e,t,n);qe=!!(e.flags&131072)}else qe=!1,le&&t.flags&1048576&&_m(t,ra,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Di(e,t),e=t.pendingProps;var o=go(t,Ae.current);Kr(t,n),o=td(null,t,r,e,o,n);var s=nd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ze(r)?(s=!0,ta(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,qu(t),o.updater=Ua,t.stateNode=o,o._reactInternals=t,Dc(t,r,e,n),t=Lc(null,t,r,!0,s,n)):(t.tag=0,le&&s&&Hu(t),ze(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Di(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=eS(r),e=St(r,e),o){case 0:t=_c(null,t,r,e,n);break e;case 1:t=ap(null,t,r,e,n);break e;case 11:t=sp(null,t,r,e,n);break e;case 14:t=ip(null,t,r,St(r.type,e),n);break e}throw Error(A(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),_c(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),ap(e,t,r,o,n);case 3:e:{if(mg(t),e===null)throw Error(A(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Wm(e,t),ia(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=wo(Error(A(423)),t),t=lp(e,t,r,n,o);break e}else if(r!==o){o=wo(Error(A(424)),t),t=lp(e,t,r,n,o);break e}else for(rt=On(t.stateNode.containerInfo.firstChild),st=t,le=!0,Nt=null,n=$m(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vo(),r===o){t=an(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return Hm(t),e===null&&Mc(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Ec(r,o)?i=null:s!==null&&Ec(r,s)&&(t.flags|=32),hg(e,t),ze(e,t,i,n),t.child;case 6:return e===null&&Mc(t),null;case 13:return gg(e,t,n);case 4:return Xu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yo(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),sp(e,t,r,o,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,oe(oa,r._currentValue),r._currentValue=i,s!==null)if(Tt(s.value,i)){if(s.children===o.children&&!Xe.current){t=an(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){i=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=en(-1,n&-n),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ic(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(A(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ic(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}ze(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Kr(t,n),o=yt(o),r=r(o),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,o=St(r,t.pendingProps),o=St(r.type,o),ip(e,t,r,o,n);case 15:return fg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:St(r,o),Di(e,t),t.tag=1,Ze(r)?(e=!0,ta(t)):e=!1,Kr(t,n),cg(t,r,o),Dc(t,r,o,n),Lc(null,t,r,!0,e,n);case 19:return vg(e,t,n);case 22:return pg(e,t,n)}throw Error(A(156,t.tag))};function Ag(e,t){return im(e,t)}function J1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mt(e,t,n,r){return new J1(e,t,n,r)}function fd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function eS(e){if(typeof e=="function")return fd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mu)return 11;if(e===Iu)return 14}return 2}function zn(e,t){var n=e.alternate;return n===null?(n=mt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Li(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")fd(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Mr:return pr(n.children,o,s,t);case Ru:i=8,o|=8;break;case oc:return e=mt(12,n,t,o|2),e.elementType=oc,e.lanes=s,e;case sc:return e=mt(13,n,t,o),e.elementType=sc,e.lanes=s,e;case ic:return e=mt(19,n,t,o),e.elementType=ic,e.lanes=s,e;case Hh:return Ba(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Uh:i=10;break e;case Wh:i=9;break e;case Mu:i=11;break e;case Iu:i=14;break e;case xn:i=16,r=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=mt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function pr(e,t,n,r){return e=mt(7,e,r,t),e.lanes=n,e}function Ba(e,t,n,r){return e=mt(22,e,r,t),e.elementType=Hh,e.lanes=n,e.stateNode={isHidden:!1},e}function Fl(e,t,n){return e=mt(6,e,null,t),e.lanes=n,e}function zl(e,t,n){return t=mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tS(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xl(0),this.expirationTimes=xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function pd(e,t,n,r,o,s,i,l,c){return e=new tS(e,t,n,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=mt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qu(s),e}function nS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lg)}catch(e){console.error(e)}}Lg(),Lh.exports=lt;var Qs=Lh.exports;const aS=Nh(Qs);var Fg,wp=Qs;Fg=wp.createRoot,wp.hydrateRoot;function lS(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,o,s,i=[],l="",c=e.split("/");for(c[0]||c.shift();o=c.shift();)n=o[0],n==="*"?(i.push(n),l+=o[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=o.indexOf("?",1),s=o.indexOf(".",1),i.push(o.substring(1,~r?r:~s?s:o.length)),l+=~r&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(l+=(~r?"?":"")+"\\"+o.substring(s))):l+="/"+o;return{keys:i,pattern:new RegExp("^"+l+(t?"(?=$|/)":"/?$"),"i")}}var zg={exports:{}},$g={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Co=p;function cS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uS=typeof Object.is=="function"?Object.is:cS,dS=Co.useState,fS=Co.useEffect,pS=Co.useLayoutEffect,hS=Co.useDebugValue;function mS(e,t){var n=t(),r=dS({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return pS(function(){o.value=n,o.getSnapshot=t,$l(o)&&s({inst:o})},[e,n,t]),fS(function(){return $l(o)&&s({inst:o}),e(function(){$l(o)&&s({inst:o})})},[e]),hS(n),n}function $l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uS(e,n)}catch{return!0}}function gS(e,t){return t()}var vS=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gS:mS;$g.useSyncExternalStore=Co.useSyncExternalStore!==void 0?Co.useSyncExternalStore:vS;zg.exports=$g;var yS=zg.exports;const xS=Oh.useInsertionEffect,wS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",SS=wS?p.useLayoutEffect:p.useEffect,CS=xS||SS,Ug=e=>{const t=p.useRef([e,(...n)=>t[0](...n)]).current;return CS(()=>{t[0]=e}),t[1]},bS="popstate",vd="pushState",yd="replaceState",NS="hashchange",Sp=[bS,vd,yd,NS],kS=e=>{for(const t of Sp)addEventListener(t,e);return()=>{for(const t of Sp)removeEventListener(t,e)}},Wg=(e,t)=>yS.useSyncExternalStore(kS,e,t),ES=()=>location.search,jS=({ssrSearch:e=""}={})=>Wg(ES,()=>e),Cp=()=>location.pathname,PS=({ssrPath:e}={})=>Wg(Cp,e?()=>e:Cp),TS=(e,{replace:t=!1,state:n=null}={})=>history[t?yd:vd](n,"",e),RS=(e={})=>[PS(e),TS],bp=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[bp]>"u"){for(const e of[vd,yd]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,bp,{value:!0})}const MS=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Hg=(e="")=>e==="/"?"":e,IS=(e,t)=>e[0]==="~"?e.slice(1):Hg(t)+e,AS=(e="",t)=>MS(Np(Hg(e)),Np(t)),Np=e=>{try{return decodeURI(e)}catch{return e}},Bg={hook:RS,searchHook:jS,parser:lS,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},Vg=p.createContext(Bg),Ro=()=>p.useContext(Vg),Qg={},Gg=p.createContext(Qg),DS=()=>p.useContext(Gg),Ya=e=>{const[t,n]=e.hook(e);return[AS(e.base,t),Ug((r,o)=>n(IS(r,e.base),o))]},xd=()=>Ya(Ro()),wd=(e,t,n,r)=>{const{pattern:o,keys:s}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),i=o.exec(n)||[],[l,...c]=i;return l!==void 0?[!0,(()=>{const u=s!==!1?Object.fromEntries(s.map((d,h)=>[d,c[h]])):i.groups;let f={...c};return u&&Object.assign(f,u),f})(),...r?[l]:[]]:[!1,null]},OS=e=>wd(Ro().parser,e,xd()[0]),_S=({children:e,...t})=>{var f,d;const n=Ro(),r=t.hook?Bg:n;let o=r;const[s,i]=((f=t.ssrPath)==null?void 0:f.split("?"))??[];i&&(t.ssrSearch=i,t.ssrPath=s),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let l=p.useRef({}),c=l.current,u=c;for(let h in r){const x=h==="base"?r[h]+(t[h]||""):t[h]||r[h];c===u&&x!==u[h]&&(l.current=u={...u}),u[h]=x,x!==r[h]&&(o=u)}return p.createElement(Vg.Provider,{value:o,children:e})},kp=({children:e,component:t},n)=>t?p.createElement(t,{params:n}):typeof e=="function"?e(n):e,LS=e=>{let t=p.useRef(Qg),n=t.current;for(const r in e)e[r]!==n[r]&&(n=e);return Object.keys(e).length===0&&(n=e),t.current=n},Er=({path:e,nest:t,match:n,...r})=>{const o=Ro(),[s]=Ya(o),[i,l,c]=n??wd(o.parser,e,s,t),u=LS({...DS(),...l});if(!i)return null;const f=c?p.createElement(_S,{base:c},kp(r,u)):kp(r,u);return p.createElement(Gg.Provider,{value:u,children:f})},Kg=p.forwardRef((e,t)=>{const n=Ro(),[r,o]=Ya(n),{to:s="",href:i=s,onClick:l,asChild:c,children:u,className:f,replace:d,state:h,...x}=e,w=Ug(S=>{S.ctrlKey||S.metaKey||S.altKey||S.shiftKey||S.button!==0||(l==null||l(S),S.defaultPrevented||(S.preventDefault(),o(i,e)))}),v=n.hrefs(i[0]==="~"?i.slice(1):n.base+i,n);return c&&p.isValidElement(u)?p.cloneElement(u,{onClick:w,href:v}):p.createElement("a",{...x,onClick:w,href:v,className:f!=null&&f.call?f(r===i):f,children:u,ref:t})}),Yg=e=>Array.isArray(e)?e.flatMap(t=>Yg(t&&t.type===p.Fragment?t.props.children:t)):[e],FS=({children:e,location:t})=>{const n=Ro(),[r]=Ya(n);for(const o of Yg(e)){let s=0;if(p.isValidElement(o)&&(s=wd(n.parser,o.props.path,t||r,o.props.nest))[0])return p.cloneElement(o,{match:s})}return null};var Gs=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(){}},xr=typeof window>"u"||"Deno"in globalThis;function ft(){}function zS(e,t){return typeof e=="function"?e(t):e}function Yc(e){return typeof e=="number"&&e>=0&&e!==1/0}function qg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qr(e,t){return typeof e=="function"?e(t):e}function kt(e,t){return typeof e=="function"?e(t):e}function Ep(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==Sd(i,t.options))return!1}else if(!Ms(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||s&&!s(t))}function jp(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Rs(t.options.mutationKey)!==Rs(s))return!1}else if(!Ms(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Sd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rs)(e)}function Rs(e){return JSON.stringify(e,(t,n)=>Xc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ms(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ms(e[n],t[n])):!1}function Xg(e,t){if(e===t)return e;const n=Pp(e)&&Pp(t);if(n||Xc(e)&&Xc(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,l=n?[]:{};let c=0;for(let u=0;u{setTimeout(t,e)})}function Zc(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Xg(e,t):t}function US(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function WS(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Cd=Symbol();function Zg(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Cd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var sr,bn,to,mh,HS=(mh=class extends Gs{constructor(){super();V(this,sr);V(this,bn);V(this,to);z(this,to,t=>{if(!xr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,bn)||this.setEventListener(k(this,to))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,bn))==null||t.call(this),z(this,bn,void 0))}setEventListener(t){var n;z(this,to,t),(n=k(this,bn))==null||n.call(this),z(this,bn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,sr)!==t&&(z(this,sr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,sr)=="boolean"?k(this,sr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sr=new WeakMap,bn=new WeakMap,to=new WeakMap,mh),bd=new HS,no,Nn,ro,gh,BS=(gh=class extends Gs{constructor(){super();V(this,no,!0);V(this,Nn);V(this,ro);z(this,ro,t=>{if(!xr&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,Nn)||this.setEventListener(k(this,ro))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Nn))==null||t.call(this),z(this,Nn,void 0))}setEventListener(t){var n;z(this,ro,t),(n=k(this,Nn))==null||n.call(this),z(this,Nn,t(this.setOnline.bind(this)))}setOnline(t){k(this,no)!==t&&(z(this,no,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,no)}},no=new WeakMap,Nn=new WeakMap,ro=new WeakMap,gh),ma=new BS;function Jc(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function VS(e){return Math.min(1e3*2**e,3e4)}function Jg(e){return(e??"online")==="online"?ma.isOnline():!0}var ev=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ul(e){return e instanceof ev}function tv(e){let t=!1,n=0,r=!1,o;const s=Jc(),i=v=>{var S;r||(h(new ev(v)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>bd.isFocused()&&(e.networkMode==="always"||ma.isOnline())&&e.canRun(),f=()=>Jg(e.networkMode)&&e.canRun(),d=v=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,v),o==null||o(),s.resolve(v))},h=v=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,v),o==null||o(),s.reject(v))},x=()=>new Promise(v=>{var S;o=g=>{(r||u())&&v(g)},(S=e.onPause)==null||S.call(e)}).then(()=>{var v;o=void 0,r||(v=e.onContinue)==null||v.call(e)}),w=()=>{if(r)return;let v;const S=n===0?e.initialPromise:void 0;try{v=S??e.fn()}catch(g){v=Promise.reject(g)}Promise.resolve(v).then(d).catch(g=>{var E;if(r)return;const m=e.retry??(xr?0:3),y=e.retryDelay??VS,C=typeof y=="function"?y(n,g):y,b=m===!0||typeof m=="number"&&nu()?void 0:x()).then(()=>{t?h(g):w()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:l,continueRetry:c,canStart:f,start:()=>(f()?w():x().then(w),s)}}function QS(){let e=[],t=0,n=l=>{l()},r=l=>{l()},o=l=>setTimeout(l,0);const s=l=>{t?e.push(l):o(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&o(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{o=l}}}var ke=QS(),ir,vh,nv=(vh=class{constructor(){V(this,ir)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yc(this.gcTime)&&z(this,ir,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xr?1/0:5*60*1e3))}clearGcTimeout(){k(this,ir)&&(clearTimeout(k(this,ir)),z(this,ir,void 0))}},ir=new WeakMap,vh),oo,so,dt,Me,Ls,ar,Ct,Yt,yh,GS=(yh=class extends nv{constructor(t){super();V(this,Ct);V(this,oo);V(this,so);V(this,dt);V(this,Me);V(this,Ls);V(this,ar);z(this,ar,!1),z(this,Ls,t.defaultOptions),this.setOptions(t.options),this.observers=[],z(this,dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,z(this,oo,KS(this.options)),this.state=t.state??k(this,oo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=k(this,Me))==null?void 0:t.promise}setOptions(t){this.options={...k(this,Ls),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,dt).remove(this)}setData(t,n){const r=Zc(this.state.data,t,this.options);return X(this,Ct,Yt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){X(this,Ct,Yt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=k(this,Me))==null?void 0:r.promise;return(o=k(this,Me))==null||o.cancel(t),n?n.then(ft).catch(ft):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,oo))}isActive(){return this.observers.some(t=>kt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!qg(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,Me))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,Me))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,Me)&&(k(this,ar)?k(this,Me).cancel({revert:!0}):k(this,Me).cancelRetry()),this.scheduleGc()),k(this,dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,Ct,Yt).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,Me))return k(this,Me).continueRetry(),k(this,Me).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(z(this,ar,!0),r.signal)})},s=()=>{const d=Zg(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return o(h),z(this,ar,!1),this.options.persister?this.options.persister(d,h,this):d(h)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(i),(c=this.options.behavior)==null||c.onFetch(i,this),z(this,so,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&X(this,Ct,Yt).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta});const l=d=>{var h,x,w,v;Ul(d)&&d.silent||X(this,Ct,Yt).call(this,{type:"error",error:d}),Ul(d)||((x=(h=k(this,dt).config).onError)==null||x.call(h,d,this),(v=(w=k(this,dt).config).onSettled)==null||v.call(w,this.state.data,d,this)),this.scheduleGc()};return z(this,Me,tv({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,x,w,v;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(S){l(S);return}(x=(h=k(this,dt).config).onSuccess)==null||x.call(h,d,this),(v=(w=k(this,dt).config).onSettled)==null||v.call(w,d,this.state.error,this),this.scheduleGc()},onError:l,onFail:(d,h)=>{X(this,Ct,Yt).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{X(this,Ct,Yt).call(this,{type:"pause"})},onContinue:()=>{X(this,Ct,Yt).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),k(this,Me).start()}},oo=new WeakMap,so=new WeakMap,dt=new WeakMap,Me=new WeakMap,Ls=new WeakMap,ar=new WeakMap,Ct=new WeakSet,Yt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...rv(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Ul(o)&&o.revert&&k(this,so)?{...k(this,so),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ke.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,dt).notify({query:this,type:"updated",action:t})})},yh);function rv(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function KS(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 _t,xh,YS=(xh=class extends Gs{constructor(t={}){super();V(this,_t);this.config=t,z(this,_t,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Sd(o,n);let i=this.get(s);return i||(i=new GS({cache:this,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){k(this,_t).has(t.queryHash)||(k(this,_t).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,_t).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,_t).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,_t).get(t)}getAll(){return[...k(this,_t).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ep(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ep(t,r)):n}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},_t=new WeakMap,xh),Lt,Le,lr,Ft,vn,wh,qS=(wh=class extends nv{constructor(t){super();V(this,Ft);V(this,Lt);V(this,Le);V(this,lr);this.mutationId=t.mutationId,z(this,Le,t.mutationCache),z(this,Lt,[]),this.state=t.state||XS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,Lt).includes(t)||(k(this,Lt).push(t),this.clearGcTimeout(),k(this,Le).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){z(this,Lt,k(this,Lt).filter(n=>n!==t)),this.scheduleGc(),k(this,Le).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,Lt).length||(this.state.status==="pending"?this.scheduleGc():k(this,Le).remove(this))}continue(){var t;return((t=k(this,lr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,l,c,u,f,d,h,x,w,v,S,g,m,y,C,b,E,N;z(this,lr,tv({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,M)=>{X(this,Ft,vn).call(this,{type:"failed",failureCount:j,error:M})},onPause:()=>{X(this,Ft,vn).call(this,{type:"pause"})},onContinue:()=>{X(this,Ft,vn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,Le).canRun(this)}));const n=this.state.status==="pending",r=!k(this,lr).canStart();try{if(!n){X(this,Ft,vn).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=k(this,Le).config).onMutate)==null?void 0:s.call(o,t,this));const M=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t));M!==this.state.context&&X(this,Ft,vn).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const j=await k(this,lr).start();return await((u=(c=k(this,Le).config).onSuccess)==null?void 0:u.call(c,j,t,this.state.context,this)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,j,t,this.state.context)),await((x=(h=k(this,Le).config).onSettled)==null?void 0:x.call(h,j,null,this.state.variables,this.state.context,this)),await((v=(w=this.options).onSettled)==null?void 0:v.call(w,j,null,t,this.state.context)),X(this,Ft,vn).call(this,{type:"success",data:j}),j}catch(j){try{throw await((g=(S=k(this,Le).config).onError)==null?void 0:g.call(S,j,t,this.state.context,this)),await((y=(m=this.options).onError)==null?void 0:y.call(m,j,t,this.state.context)),await((b=(C=k(this,Le).config).onSettled)==null?void 0:b.call(C,void 0,j,this.state.variables,this.state.context,this)),await((N=(E=this.options).onSettled)==null?void 0:N.call(E,void 0,j,t,this.state.context)),j}finally{X(this,Ft,vn).call(this,{type:"error",error:j})}}finally{k(this,Le).runNext(this)}}},Lt=new WeakMap,Le=new WeakMap,lr=new WeakMap,Ft=new WeakSet,vn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ke.batch(()=>{k(this,Lt).forEach(r=>{r.onMutationUpdate(t)}),k(this,Le).notify({mutation:this,type:"updated",action:t})})},wh);function XS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var et,Fs,Sh,ZS=(Sh=class extends Gs{constructor(t={}){super();V(this,et);V(this,Fs);this.config=t,z(this,et,new Map),z(this,Fs,Date.now())}build(t,n,r){const o=new qS({mutationCache:this,mutationId:++ei(this,Fs)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){const n=yi(t),r=k(this,et).get(n)??[];r.push(t),k(this,et).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=yi(t);if(k(this,et).has(n)){const o=(r=k(this,et).get(n))==null?void 0:r.filter(s=>s!==t);o&&(o.length===0?k(this,et).delete(n):k(this,et).set(n,o))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=k(this,et).get(yi(t)))==null?void 0:r.find(o=>o.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=k(this,et).get(yi(t)))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...k(this,et).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>jp(n,r))}findAll(t={}){return this.getAll().filter(n=>jp(t,n))}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ke.batch(()=>Promise.all(t.map(n=>n.continue().catch(ft))))}},et=new WeakMap,Fs=new WeakMap,Sh);function yi(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Rp(e){return{onFetch:(t,n)=>{var f,d,h,x,w;const r=t.options,o=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,s=((x=t.state.data)==null?void 0:x.pages)||[],i=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let v=!1;const S=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},g=Zg(t.options,t.fetchOptions),m=async(y,C,b)=>{if(v)return Promise.reject();if(C==null&&y.pages.length)return Promise.resolve(y);const E={queryKey:t.queryKey,pageParam:C,direction:b?"backward":"forward",meta:t.options.meta};S(E);const N=await g(E),{maxPages:j}=t.options,M=b?WS:US;return{pages:M(y.pages,N,j),pageParams:M(y.pageParams,C,j)}};if(o&&s.length){const y=o==="backward",C=y?JS:Mp,b={pages:s,pageParams:i},E=C(r,b);l=await m(b,E,y)}else{const y=e??s.length;do{const C=c===0?i[0]??r.initialPageParam:Mp(r,l);if(c>0&&C==null)break;l=await m(l,C),c++}while(c{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Mp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function JS(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var fe,kn,En,io,ao,jn,lo,co,Ch,eC=(Ch=class{constructor(e={}){V(this,fe);V(this,kn);V(this,En);V(this,io);V(this,ao);V(this,jn);V(this,lo);V(this,co);z(this,fe,e.queryCache||new YS),z(this,kn,e.mutationCache||new ZS),z(this,En,e.defaultOptions||{}),z(this,io,new Map),z(this,ao,new Map),z(this,jn,0)}mount(){ei(this,jn)._++,k(this,jn)===1&&(z(this,lo,bd.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,fe).onFocus())})),z(this,co,ma.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,fe).onOnline())})))}unmount(){var e,t;ei(this,jn)._--,k(this,jn)===0&&((e=k(this,lo))==null||e.call(this),z(this,lo,void 0),(t=k(this,co))==null||t.call(this),z(this,co,void 0))}isFetching(e){return k(this,fe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,kn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,fe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=k(this,fe).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qr(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return k(this,fe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=k(this,fe).get(r.queryHash),s=o==null?void 0:o.state.data,i=zS(t,s);if(i!==void 0)return k(this,fe).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ke.batch(()=>k(this,fe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,fe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,fe);ke.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,fe),r={type:"active",...e};return ke.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=ke.batch(()=>k(this,fe).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(ft).catch(ft)}invalidateQueries(e={},t={}){return ke.batch(()=>{if(k(this,fe).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=ke.batch(()=>k(this,fe).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(ft)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(ft)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,fe).build(this,t);return n.isStaleByTime(qr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ft).catch(ft)}fetchInfiniteQuery(e){return e.behavior=Rp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ft).catch(ft)}ensureInfiniteQueryData(e){return e.behavior=Rp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ma.isOnline()?k(this,kn).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,fe)}getMutationCache(){return k(this,kn)}getDefaultOptions(){return k(this,En)}setDefaultOptions(e){z(this,En,e)}setQueryDefaults(e,t){k(this,io).set(Rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,io).values()];let n={};return t.forEach(r=>{Ms(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){k(this,ao).set(Rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,ao).values()];let n={};return t.forEach(r=>{Ms(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,En).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Sd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Cd&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,En).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,fe).clear(),k(this,kn).clear()}},fe=new WeakMap,kn=new WeakMap,En=new WeakMap,io=new WeakMap,ao=new WeakMap,jn=new WeakMap,lo=new WeakMap,co=new WeakMap,Ch),Ge,Z,zs,Fe,cr,uo,Pn,zt,$s,fo,po,ur,dr,Tn,ho,ne,Zo,eu,tu,nu,ru,ou,su,iu,ov,bh,tC=(bh=class extends Gs{constructor(t,n){super();V(this,ne);V(this,Ge);V(this,Z);V(this,zs);V(this,Fe);V(this,cr);V(this,uo);V(this,Pn);V(this,zt);V(this,$s);V(this,fo);V(this,po);V(this,ur);V(this,dr);V(this,Tn);V(this,ho,new Set);this.options=n,z(this,Ge,t),z(this,zt,null),z(this,Pn,Jc()),this.options.experimental_prefetchInRender||k(this,Pn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,Z).addObserver(this),Ip(k(this,Z),this.options)?X(this,ne,Zo).call(this):this.updateResult(),X(this,ne,ru).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return au(k(this,Z),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return au(k(this,Z),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,ne,ou).call(this),X(this,ne,su).call(this),k(this,Z).removeObserver(this)}setOptions(t,n){const r=this.options,o=k(this,Z);if(this.options=k(this,Ge).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kt(this.options.enabled,k(this,Z))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");X(this,ne,iu).call(this),k(this,Z).setOptions(this.options),r._defaulted&&!qc(this.options,r)&&k(this,Ge).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,Z),observer:this});const s=this.hasListeners();s&&Ap(k(this,Z),o,this.options,r)&&X(this,ne,Zo).call(this),this.updateResult(n),s&&(k(this,Z)!==o||kt(this.options.enabled,k(this,Z))!==kt(r.enabled,k(this,Z))||qr(this.options.staleTime,k(this,Z))!==qr(r.staleTime,k(this,Z)))&&X(this,ne,eu).call(this);const i=X(this,ne,tu).call(this);s&&(k(this,Z)!==o||kt(this.options.enabled,k(this,Z))!==kt(r.enabled,k(this,Z))||i!==k(this,Tn))&&X(this,ne,nu).call(this,i)}getOptimisticResult(t){const n=k(this,Ge).getQueryCache().build(k(this,Ge),t),r=this.createResult(n,t);return rC(this,r)&&(z(this,Fe,r),z(this,uo,this.options),z(this,cr,k(this,Z).state)),r}getCurrentResult(){return k(this,Fe)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){k(this,ho).add(t)}getCurrentQuery(){return k(this,Z)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,Ge).defaultQueryOptions(t),r=k(this,Ge).getQueryCache().build(k(this,Ge),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return X(this,ne,Zo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,Fe)))}createResult(t,n){var j;const r=k(this,Z),o=this.options,s=k(this,Fe),i=k(this,cr),l=k(this,uo),u=t!==r?t.state:k(this,zs),{state:f}=t;let d={...f},h=!1,x;if(n._optimisticResults){const M=this.hasListeners(),I=!M&&Ip(t,n),L=M&&Ap(t,r,n,o);(I||L)&&(d={...d,...rv(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:w,errorUpdatedAt:v,status:S}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(i==null?void 0:i.data)&&n.select===k(this,$s))x=k(this,fo);else try{z(this,$s,n.select),x=n.select(d.data),x=Zc(s==null?void 0:s.data,x,n),z(this,fo,x),z(this,zt,null)}catch(M){z(this,zt,M)}else x=d.data;if(n.placeholderData!==void 0&&x===void 0&&S==="pending"){let M;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))M=s.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((j=k(this,po))==null?void 0:j.state.data,k(this,po)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),z(this,zt,null)}catch(I){z(this,zt,I)}M!==void 0&&(S="success",x=Zc(s==null?void 0:s.data,M,n),h=!0)}k(this,zt)&&(w=k(this,zt),x=k(this,fo),v=Date.now(),S="error");const g=d.fetchStatus==="fetching",m=S==="pending",y=S==="error",C=m&&g,b=x!==void 0,N={status:S,fetchStatus:d.fetchStatus,isPending:m,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:x,dataUpdatedAt:d.dataUpdatedAt,error:w,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!m,isLoadingError:y&&!b,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:y&&b,isStale:Nd(t,n),refetch:this.refetch,promise:k(this,Pn)};if(this.options.experimental_prefetchInRender){const M=O=>{N.status==="error"?O.reject(N.error):N.data!==void 0&&O.resolve(N.data)},I=()=>{const O=z(this,Pn,N.promise=Jc());M(O)},L=k(this,Pn);switch(L.status){case"pending":t.queryHash===r.queryHash&&M(L);break;case"fulfilled":(N.status==="error"||N.data!==L.value)&&I();break;case"rejected":(N.status!=="error"||N.error!==L.reason)&&I();break}}return N}updateResult(t){const n=k(this,Fe),r=this.createResult(k(this,Z),this.options);if(z(this,cr,k(this,Z).state),z(this,uo,this.options),k(this,cr).data!==void 0&&z(this,po,k(this,Z)),qc(r,n))return;z(this,Fe,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!k(this,ho).size)return!0;const c=new Set(l??k(this,ho));return this.options.throwOnError&&c.add("error"),Object.keys(k(this,Fe)).some(u=>{const f=u;return k(this,Fe)[f]!==n[f]&&c.has(f)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),X(this,ne,ov).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,ne,ru).call(this)}},Ge=new WeakMap,Z=new WeakMap,zs=new WeakMap,Fe=new WeakMap,cr=new WeakMap,uo=new WeakMap,Pn=new WeakMap,zt=new WeakMap,$s=new WeakMap,fo=new WeakMap,po=new WeakMap,ur=new WeakMap,dr=new WeakMap,Tn=new WeakMap,ho=new WeakMap,ne=new WeakSet,Zo=function(t){X(this,ne,iu).call(this);let n=k(this,Z).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ft)),n},eu=function(){X(this,ne,ou).call(this);const t=qr(this.options.staleTime,k(this,Z));if(xr||k(this,Fe).isStale||!Yc(t))return;const r=qg(k(this,Fe).dataUpdatedAt,t)+1;z(this,ur,setTimeout(()=>{k(this,Fe).isStale||this.updateResult()},r))},tu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,Z)):this.options.refetchInterval)??!1},nu=function(t){X(this,ne,su).call(this),z(this,Tn,t),!(xr||kt(this.options.enabled,k(this,Z))===!1||!Yc(k(this,Tn))||k(this,Tn)===0)&&z(this,dr,setInterval(()=>{(this.options.refetchIntervalInBackground||bd.isFocused())&&X(this,ne,Zo).call(this)},k(this,Tn)))},ru=function(){X(this,ne,eu).call(this),X(this,ne,nu).call(this,X(this,ne,tu).call(this))},ou=function(){k(this,ur)&&(clearTimeout(k(this,ur)),z(this,ur,void 0))},su=function(){k(this,dr)&&(clearInterval(k(this,dr)),z(this,dr,void 0))},iu=function(){const t=k(this,Ge).getQueryCache().build(k(this,Ge),this.options);if(t===k(this,Z))return;const n=k(this,Z);z(this,Z,t),z(this,zs,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ov=function(t){ke.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,Fe))}),k(this,Ge).getQueryCache().notify({query:k(this,Z),type:"observerResultsUpdated"})})},bh);function nC(e,t){return kt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ip(e,t){return nC(e,t)||e.state.data!==void 0&&au(e,t,t.refetchOnMount)}function au(e,t,n){if(kt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Nd(e,t)}return!1}function Ap(e,t,n,r){return(e!==t||kt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Nd(e,n)}function Nd(e,t){return kt(t.enabled,e)!==!1&&e.isStaleByTime(qr(t.staleTime,e))}function rC(e,t){return!qc(e.getCurrentResult(),t)}var sv=p.createContext(void 0),oC=e=>{const t=p.useContext(sv);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sC=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(sv.Provider,{value:e,children:t})),iv=p.createContext(!1),iC=()=>p.useContext(iv);iv.Provider;function aC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var lC=p.createContext(aC()),cC=()=>p.useContext(lC);function uC(e,t){return typeof e=="function"?e(...t):!!e}function Dp(){}var dC=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},fC=e=>{p.useEffect(()=>{e.clearReset()},[e])},pC=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&uC(n,[e.error,r]),hC=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},mC=(e,t)=>e.isLoading&&e.isFetching&&!t,gC=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Op=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vC(e,t,n){var f,d,h,x,w;const r=oC(),o=iC(),s=cC(),i=r.defaultQueryOptions(e);(d=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||d.call(f,i),i._optimisticResults=o?"isRestoring":"optimistic",hC(i),dC(i,s),fC(s);const l=!r.getQueryCache().get(i.queryHash),[c]=p.useState(()=>new t(r,i)),u=c.getOptimisticResult(i);if(p.useSyncExternalStore(p.useCallback(v=>{const S=o?Dp:c.subscribe(ke.batchCalls(v));return c.updateResult(),S},[c,o]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setOptions(i,{listeners:!1})},[i,c]),gC(i,u))throw Op(i,c,s);if(pC({result:u,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash)}))throw u.error;if((x=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||x.call(h,i,u),i.experimental_prefetchInRender&&!xr&&mC(u,o)){const v=l?Op(i,c,s):(w=r.getQueryCache().get(i.queryHash))==null?void 0:w.promise;v==null||v.catch(Dp).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?u:c.trackResult(u)}function kd(e,t){return vC(e,tC)}async function yC(e){if(!e.ok){const t=await e.text()||e.statusText;throw new Error(`${e.status}: ${t}`)}}const xC=({on401:e})=>async({queryKey:t})=>{const n=await fetch(t.join("/"),{credentials:"include"});return e==="returnNull"&&n.status===401?null:(await yC(n),await n.json())},wC=new eC({defaultOptions:{queries:{queryFn:xC({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}}),SC=1,CC=1e6;let Wl=0;function bC(){return Wl=(Wl+1)%Number.MAX_SAFE_INTEGER,Wl.toString()}const Hl=new Map,_p=e=>{if(Hl.has(e))return;const t=setTimeout(()=>{Hl.delete(e),us({type:"REMOVE_TOAST",toastId:e})},CC);Hl.set(e,t)},NC=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,SC)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?_p(n):e.toasts.forEach(r=>{_p(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Fi=[];let zi={toasts:[]};function us(e){zi=NC(zi,e),Fi.forEach(t=>{t(zi)})}function kC({...e}){const t=bC(),n=o=>us({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>us({type:"DISMISS_TOAST",toastId:t});return us({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function qn(){const[e,t]=p.useState(zi);return p.useEffect(()=>(Fi.push(t),()=>{const n=Fi.indexOf(t);n>-1&&Fi.splice(n,1)}),[e]),{...e,toast:kC,dismiss:n=>us({type:"DISMISS_TOAST",toastId:n})}}function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Lp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qa(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Lp(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o{const{children:i,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function dn(e,t=[]){let n=[];function r(s,i){const l=p.createContext(i),c=n.length;n=[...n,i];const u=d=>{var g;const{scope:h,children:x,...w}=d,v=((g=h==null?void 0:h[e])==null?void 0:g[c])||l,S=p.useMemo(()=>w,Object.values(w));return a.jsx(v.Provider,{value:S,children:x})};u.displayName=s+"Provider";function f(d,h){var v;const x=((v=h==null?void 0:h[e])==null?void 0:v[c])||l,w=p.useContext(x);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const o=()=>{const s=n.map(i=>p.createContext(i));return function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,jC(o,...t)]}function jC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:c,scopeName:u})=>{const d=c(s)[`__scope${u}`];return{...l,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function bo(e){const t=TC(e),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,l=p.Children.toArray(s),c=l.find(MC);if(c){const u=c.props.children,f=l.map(d=>d===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...i,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,f):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var PC=bo("Slot");function TC(e){const t=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=AC(o),l=IC(s,o.props);return o.type!==p.Fragment&&(l.ref=r?qa(r,i):i),p.cloneElement(o,l)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var av=Symbol("radix.slottable");function RC(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=av,t}function MC(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===av}function IC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function AC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ed(e){const t=e+"CollectionProvider",[n,r]=dn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:S,children:g}=v,m=gn.useRef(null),y=gn.useRef(new Map).current;return a.jsx(o,{scope:S,itemMap:y,collectionRef:m,children:g})};i.displayName=t;const l=e+"CollectionSlot",c=bo(l),u=gn.forwardRef((v,S)=>{const{scope:g,children:m}=v,y=s(l,g),C=ge(S,y.collectionRef);return a.jsx(c,{ref:C,children:m})});u.displayName=l;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=bo(f),x=gn.forwardRef((v,S)=>{const{scope:g,children:m,...y}=v,C=gn.useRef(null),b=ge(S,C),E=s(f,g);return gn.useEffect(()=>(E.itemMap.set(C,{ref:C,...y}),()=>void E.itemMap.delete(C))),a.jsx(h,{[d]:"",ref:b,children:m})});x.displayName=f;function w(v){const S=s(e+"CollectionConsumer",v);return gn.useCallback(()=>{const m=S.collectionRef.current;if(!m)return[];const y=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((E,N)=>y.indexOf(E.ref.current)-y.indexOf(N.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:i,Slot:u,ItemSlot:x},w,r]}var DC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ee=DC.reduce((e,t)=>{const n=bo(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function jd(e,t){e&&Qs.flushSync(()=>e.dispatchEvent(t))}function De(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function OC(e,t=globalThis==null?void 0:globalThis.document){const n=De(e);p.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var _C="DismissableLayer",lu="dismissableLayer.update",LC="dismissableLayer.pointerDownOutside",FC="dismissableLayer.focusOutside",Fp,lv=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ks=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,u=p.useContext(lv),[f,d]=p.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=p.useState({}),w=ge(t,N=>d(N)),v=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(S),m=f?v.indexOf(f):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,C=m>=g,b=$C(N=>{const j=N.target,M=[...u.branches].some(I=>I.contains(j));!C||M||(o==null||o(N),i==null||i(N),N.defaultPrevented||l==null||l())},h),E=UC(N=>{const j=N.target;[...u.branches].some(I=>I.contains(j))||(s==null||s(N),i==null||i(N),N.defaultPrevented||l==null||l())},h);return OC(N=>{m===u.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},h),p.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Fp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),zp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Fp)}},[f,h,n,u]),p.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),zp())},[f,u]),p.useEffect(()=>{const N=()=>x({});return document.addEventListener(lu,N),()=>document.removeEventListener(lu,N)},[]),a.jsx(ee.div,{...c,ref:w,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,E.onFocusCapture),onBlurCapture:U(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,b.onPointerDownCapture)})});Ks.displayName=_C;var zC="DismissableLayerBranch",cv=p.forwardRef((e,t)=>{const n=p.useContext(lv),r=p.useRef(null),o=ge(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),a.jsx(ee.div,{...e,ref:o})});cv.displayName=zC;function $C(e,t=globalThis==null?void 0:globalThis.document){const n=De(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let c=function(){uv(LC,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function UC(e,t=globalThis==null?void 0:globalThis.document){const n=De(e),r=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!r.current&&uv(FC,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zp(){const e=new CustomEvent(lu);document.dispatchEvent(e)}function uv(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?jd(o,s):o.dispatchEvent(s)}var WC=Ks,HC=cv,Hn=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},BC="Portal",Xa=p.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,s]=p.useState(!1);Hn(()=>s(!0),[]);const i=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?aS.createPortal(a.jsx(ee.div,{...r,ref:t}),i):null});Xa.displayName=BC;function VC(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var It=e=>{const{present:t,children:n}=e,r=QC(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=ge(r.ref,GC(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};It.displayName="Presence";function QC(e){const[t,n]=p.useState(),r=p.useRef({}),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[l,c]=VC(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=xi(r.current);s.current=l==="mounted"?u:"none"},[l]),Hn(()=>{const u=r.current,f=o.current;if(f!==e){const h=s.current,x=xi(u);e?c("MOUNT"):x==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&h!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Hn(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=x=>{const v=xi(r.current).includes(x.animationName);if(x.target===t&&v&&(c("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},h=x=>{x.target===t&&(s.current=xi(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function xi(e){return(e==null?void 0:e.animationName)||"none"}function GC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=KC({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,l=De(n),c=p.useCallback(u=>{if(s){const d=typeof u=="function"?u(e):u;d!==e&&l(d)}else o(u)},[s,e,o,l]);return[i,c]}function KC({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,o=p.useRef(r),s=De(t);return p.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var YC="VisuallyHidden",Za=p.forwardRef((e,t)=>a.jsx(ee.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Za.displayName=YC;var qC=Za,Pd="ToastProvider",[Td,XC,ZC]=Ed("Toast"),[dv,uP]=dn("Toast",[ZC]),[JC,Ja]=dv(Pd),fv=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[l,c]=p.useState(null),[u,f]=p.useState(0),d=p.useRef(!1),h=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Pd}\`. Expected non-empty \`string\`.`),a.jsx(Td.Provider,{scope:t,children:a.jsx(JC,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:p.useCallback(()=>f(x=>x+1),[]),onToastRemove:p.useCallback(()=>f(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:i})})};fv.displayName=Pd;var pv="ToastViewport",eb=["F8"],cu="toast.viewportPause",uu="toast.viewportResume",hv=p.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=eb,label:o="Notifications ({hotkey})",...s}=e,i=Ja(pv,n),l=XC(n),c=p.useRef(null),u=p.useRef(null),f=p.useRef(null),d=p.useRef(null),h=ge(t,d,i.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=i.toastCount>0;p.useEffect(()=>{const S=g=>{var y;r.length!==0&&r.every(C=>g[C]||g.code===C)&&((y=d.current)==null||y.focus())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),p.useEffect(()=>{const S=c.current,g=d.current;if(w&&S&&g){const m=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(cu);g.dispatchEvent(E),i.isClosePausedRef.current=!0}},y=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(uu);g.dispatchEvent(E),i.isClosePausedRef.current=!1}},C=E=>{!S.contains(E.relatedTarget)&&y()},b=()=>{S.contains(document.activeElement)||y()};return S.addEventListener("focusin",m),S.addEventListener("focusout",C),S.addEventListener("pointermove",m),S.addEventListener("pointerleave",b),window.addEventListener("blur",m),window.addEventListener("focus",y),()=>{S.removeEventListener("focusin",m),S.removeEventListener("focusout",C),S.removeEventListener("pointermove",m),S.removeEventListener("pointerleave",b),window.removeEventListener("blur",m),window.removeEventListener("focus",y)}}},[w,i.isClosePausedRef]);const v=p.useCallback(({tabbingDirection:S})=>{const m=l().map(y=>{const C=y.ref.current,b=[C,...pb(C)];return S==="forwards"?b:b.reverse()});return(S==="forwards"?m.reverse():m).flat()},[l]);return p.useEffect(()=>{const S=d.current;if(S){const g=m=>{var b,E,N;const y=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!y){const j=document.activeElement,M=m.shiftKey;if(m.target===S&&M){(b=u.current)==null||b.focus();return}const O=v({tabbingDirection:M?"backwards":"forwards"}),G=O.findIndex(D=>D===j);Bl(O.slice(G+1))?m.preventDefault():M?(E=u.current)==null||E.focus():(N=f.current)==null||N.focus()}};return S.addEventListener("keydown",g),()=>S.removeEventListener("keydown",g)}},[l,v]),a.jsxs(HC,{ref:c,role:"region","aria-label":o.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&a.jsx(du,{ref:u,onFocusFromOutsideViewport:()=>{const S=v({tabbingDirection:"forwards"});Bl(S)}}),a.jsx(Td.Slot,{scope:n,children:a.jsx(ee.ol,{tabIndex:-1,...s,ref:h})}),w&&a.jsx(du,{ref:f,onFocusFromOutsideViewport:()=>{const S=v({tabbingDirection:"backwards"});Bl(S)}})]})});hv.displayName=pv;var mv="ToastFocusProxy",du=p.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Ja(mv,n);return a.jsx(Za,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const l=i.relatedTarget;!((u=s.viewport)!=null&&u.contains(l))&&r()}})});du.displayName=mv;var el="Toast",tb="toast.swipeStart",nb="toast.swipeMove",rb="toast.swipeCancel",ob="toast.swipeEnd",gv=p.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[l=!0,c]=Mo({prop:r,defaultProp:o,onChange:s});return a.jsx(It,{present:n||l,children:a.jsx(ab,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:De(e.onPause),onResume:De(e.onResume),onSwipeStart:U(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:U(e.onSwipeMove,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:U(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:U(e.onSwipeEnd,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),c(!1)})})})});gv.displayName=el;var[sb,ib]=dv(el,{onClose(){}}),ab=p.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:x,...w}=e,v=Ja(el,n),[S,g]=p.useState(null),m=ge(t,D=>g(D)),y=p.useRef(null),C=p.useRef(null),b=o||v.duration,E=p.useRef(0),N=p.useRef(b),j=p.useRef(0),{onToastAdd:M,onToastRemove:I}=v,L=De(()=>{var B;(S==null?void 0:S.contains(document.activeElement))&&((B=v.viewport)==null||B.focus()),i()}),O=p.useCallback(D=>{!D||D===1/0||(window.clearTimeout(j.current),E.current=new Date().getTime(),j.current=window.setTimeout(L,D))},[L]);p.useEffect(()=>{const D=v.viewport;if(D){const B=()=>{O(N.current),u==null||u()},$=()=>{const R=new Date().getTime()-E.current;N.current=N.current-R,window.clearTimeout(j.current),c==null||c()};return D.addEventListener(cu,$),D.addEventListener(uu,B),()=>{D.removeEventListener(cu,$),D.removeEventListener(uu,B)}}},[v.viewport,b,c,u,O]),p.useEffect(()=>{s&&!v.isClosePausedRef.current&&O(b)},[s,b,v.isClosePausedRef,O]),p.useEffect(()=>(M(),()=>I()),[M,I]);const G=p.useMemo(()=>S?bv(S):null,[S]);return v.viewport?a.jsxs(a.Fragment,{children:[G&&a.jsx(lb,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:G}),a.jsx(sb,{scope:n,onClose:L,children:Qs.createPortal(a.jsx(Td.ItemSlot,{scope:n,children:a.jsx(WC,{asChild:!0,onEscapeKeyDown:U(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||L(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(ee.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection,...w,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:U(e.onKeyDown,D=>{D.key==="Escape"&&(l==null||l(D.nativeEvent),D.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:U(e.onPointerDown,D=>{D.button===0&&(y.current={x:D.clientX,y:D.clientY})}),onPointerMove:U(e.onPointerMove,D=>{if(!y.current)return;const B=D.clientX-y.current.x,$=D.clientY-y.current.y,R=!!C.current,P=["left","right"].includes(v.swipeDirection),T=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,_=P?T(0,B):0,W=P?0:T(0,$),K=D.pointerType==="touch"?10:2,ye={x:_,y:W},Pe={originalEvent:D,delta:ye};R?(C.current=ye,wi(nb,d,Pe,{discrete:!1})):$p(ye,v.swipeDirection,K)?(C.current=ye,wi(tb,f,Pe,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(B)>K||Math.abs($)>K)&&(y.current=null)}),onPointerUp:U(e.onPointerUp,D=>{const B=C.current,$=D.target;if($.hasPointerCapture(D.pointerId)&&$.releasePointerCapture(D.pointerId),C.current=null,y.current=null,B){const R=D.currentTarget,P={originalEvent:D,delta:B};$p(B,v.swipeDirection,v.swipeThreshold)?wi(ob,x,P,{discrete:!0}):wi(rb,h,P,{discrete:!0}),R.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),lb=e=>{const{__scopeToast:t,children:n,...r}=e,o=Ja(el,t),[s,i]=p.useState(!1),[l,c]=p.useState(!1);return db(()=>i(!0)),p.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:a.jsx(Xa,{asChild:!0,children:a.jsx(Za,{...r,children:s&&a.jsxs(a.Fragment,{children:[o.label," ",n]})})})},cb="ToastTitle",vv=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(ee.div,{...r,ref:t})});vv.displayName=cb;var ub="ToastDescription",yv=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(ee.div,{...r,ref:t})});yv.displayName=ub;var xv="ToastAction",wv=p.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?a.jsx(Cv,{altText:n,asChild:!0,children:a.jsx(Rd,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${xv}\`. Expected non-empty \`string\`.`),null)});wv.displayName=xv;var Sv="ToastClose",Rd=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=ib(Sv,n);return a.jsx(Cv,{asChild:!0,children:a.jsx(ee.button,{type:"button",...r,ref:t,onClick:U(e.onClick,o.onClose)})})});Rd.displayName=Sv;var Cv=p.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return a.jsx(ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function bv(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),fb(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...bv(r))}}),t}function wi(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?jd(o,s):o.dispatchEvent(s)}var $p=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function db(e=()=>{}){const t=De(e);Hn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function fb(e){return e.nodeType===e.ELEMENT_NODE}function pb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Bl(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var hb=fv,Nv=hv,kv=gv,Ev=vv,jv=yv,Pv=wv,Tv=Rd;function Rv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,Wp=Mv,Iv=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Wp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const f=n==null?void 0:n[u],d=s==null?void 0:s[u];if(f===null)return null;const h=Up(f)||Up(d);return o[u][h]}),l=n&&Object.entries(n).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:h,...x}=f;return Object.entries(x).every(w=>{let[v,S]=w;return Array.isArray(S)?S.includes({...s,...l}[v]):{...s,...l}[v]===S})?[...u,d,h]:u},[]);return Wp(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Av=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var gb={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"};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vb=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},c)=>p.createElement("svg",{ref:c,...gb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Av("lucide",o),...l},[...i.map(([u,f])=>p.createElement(u,f)),...Array.isArray(s)?s:[s]]));/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q=(e,t)=>{const n=p.forwardRef(({className:r,...o},s)=>p.createElement(vb,{ref:s,iconNode:t,className:Av(`lucide-${mb(e)}`,r),...o}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hp=Q("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dv=Q("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yb=Q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xb=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wb=Q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sb=Q("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fu=Q("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ov=Q("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cb=Q("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tn=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bb=Q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nb=Q("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ot=Q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _v=Q("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kb=Q("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eb=Q("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jb=Q("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pb=Q("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tb=Q("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lv=Q("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fv=Q("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zv=Q("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rb=Q("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bp=Q("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ds=Q("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mb=Q("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ib=Q("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $v=Q("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uv=Q("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ga=Q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const va=Q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vp=Q("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xr=Q("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ya=Q("Share",[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ab=Q("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Db=Q("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ob=Q("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _b=Q("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lb=Q("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fs=Q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qp=Q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fb=Q("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tl=Q("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zb=Q("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wv=Q("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Is=Q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Md="-",$b=e=>{const t=Wb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(Md);return l[0]===""&&l.length!==1&&l.shift(),Hv(l,t)||Ub(i)},getConflictingClassGroupIds:(i,l)=>{const c=n[i]||[];return l&&r[i]?[...c,...r[i]]:c}}},Hv=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Hv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Md);return(i=t.validators.find(({validator:l})=>l(s)))==null?void 0:i.classGroupId},Gp=/^\[(.+)\]$/,Ub=e=>{if(Gp.test(e)){const t=Gp.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Wb=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Bb(Object.entries(e.classGroups),n).forEach(([s,i])=>{pu(i,r,s,t)}),r},pu=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Kp(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Hb(o)){pu(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{pu(i,Kp(t,s),n,r)})})},Kp=(e,t)=>{let n=e;return t.split(Md).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Hb=e=>e.isThemeGetter,Bb=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,l])=>[t+i,l])):s);return[n,o]}):e,Vb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Bv="!",Qb=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=l=>{const c=[];let u=0,f=0,d;for(let S=0;Sf?d-f:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:i}):i},Gb=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Kb=e=>({cache:Vb(e.cacheSize),parseClassName:Qb(e),...$b(e)}),Yb=/\s+/,qb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Yb);let l="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:x}=n(u);let w=!!x,v=r(w?h.substring(0,x):h);if(!v){if(!w){l=u+(l.length>0?" "+l:l);continue}if(v=r(h),!v){l=u+(l.length>0?" "+l:l);continue}w=!1}const S=Gb(f).join(":"),g=d?S+Bv:S,m=g+v;if(s.includes(m))continue;s.push(m);const y=o(v,w);for(let C=0;C0?" "+l:l)}return l};function Xb(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(f),e());return n=Kb(u),r=n.cache.get,o=n.cache.set,s=l,l(c)}function l(c){const u=r(c);if(u)return u;const f=qb(c,n);return o(c,f),f}return function(){return s(Xb.apply(null,arguments))}}const se=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Qv=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jb=/^\d+\/\d+$/,eN=new Set(["px","full","screen"]),tN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nN=/\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$/,rN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,oN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kt=e=>Zr(e)||eN.has(e)||Jb.test(e),hn=e=>Io(e,"length",pN),Zr=e=>!!e&&!Number.isNaN(Number(e)),Vl=e=>Io(e,"number",Zr),Qo=e=>!!e&&Number.isInteger(Number(e)),iN=e=>e.endsWith("%")&&Zr(e.slice(0,-1)),Y=e=>Qv.test(e),mn=e=>tN.test(e),aN=new Set(["length","size","percentage"]),lN=e=>Io(e,aN,Gv),cN=e=>Io(e,"position",Gv),uN=new Set(["image","url"]),dN=e=>Io(e,uN,mN),fN=e=>Io(e,"",hN),Go=()=>!0,Io=(e,t,n)=>{const r=Qv.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},pN=e=>nN.test(e)&&!rN.test(e),Gv=()=>!1,hN=e=>oN.test(e),mN=e=>sN.test(e),gN=()=>{const e=se("colors"),t=se("spacing"),n=se("blur"),r=se("brightness"),o=se("borderColor"),s=se("borderRadius"),i=se("borderSpacing"),l=se("borderWidth"),c=se("contrast"),u=se("grayscale"),f=se("hueRotate"),d=se("invert"),h=se("gap"),x=se("gradientColorStops"),w=se("gradientColorStopPositions"),v=se("inset"),S=se("margin"),g=se("opacity"),m=se("padding"),y=se("saturate"),C=se("scale"),b=se("sepia"),E=se("skew"),N=se("space"),j=se("translate"),M=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Y,t],O=()=>[Y,t],G=()=>["",Kt,hn],D=()=>["auto",Zr,Y],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],T=()=>["","0",Y],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[Zr,Y];return{cacheSize:500,separator:":",theme:{colors:[Go],spacing:[Kt,hn],blur:["none","",mn,Y],brightness:W(),borderColor:[e],borderRadius:["none","","full",mn,Y],borderSpacing:O(),borderWidth:G(),contrast:W(),grayscale:T(),hueRotate:W(),invert:T(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[iN,hn],inset:L(),margin:L(),opacity:W(),padding:O(),saturate:W(),scale:W(),sepia:T(),skew:W(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[mn]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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"],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:[...B(),Y]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qo,Y]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",Qo,Y]}],"grid-cols":[{"grid-cols":[Go]}],"col-start-end":[{col:["auto",{span:["full",Qo,Y]},Y]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Go]}],"row-start-end":[{row:["auto",{span:[Qo,Y]},Y]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[mn]},mn]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",mn,hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vl]}],"font-family":[{font:[Go]}],"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:["tighter","tight","normal","wide","wider","widest",Y]}],"line-clamp":[{"line-clamp":["none",Zr,Vl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kt,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kt,hn]}],"underline-offset":[{"underline-offset":["auto",Kt,Y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),cN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Kt,Y]}],"outline-w":[{outline:[Kt,hn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Kt,hn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",mn,fN]}],"shadow-color":[{shadow:[Go]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...R(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",mn,Y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Qo,Y]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kt,hn,Vl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},vN=Zb(gN);function te(...e){return vN(Mv(e))}const yN=hb,Kv=p.forwardRef(({className:e,...t},n)=>a.jsx(Nv,{ref:n,className:te("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Kv.displayName=Nv.displayName;const xN=Iv("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Yv=p.forwardRef(({className:e,variant:t,...n},r)=>a.jsx(kv,{ref:r,className:te(xN({variant:t}),e),...n}));Yv.displayName=kv.displayName;const wN=p.forwardRef(({className:e,...t},n)=>a.jsx(Pv,{ref:n,className:te("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));wN.displayName=Pv.displayName;const qv=p.forwardRef(({className:e,...t},n)=>a.jsx(Tv,{ref:n,className:te("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(Is,{className:"h-4 w-4"})}));qv.displayName=Tv.displayName;const Xv=p.forwardRef(({className:e,...t},n)=>a.jsx(Ev,{ref:n,className:te("text-sm font-semibold",e),...t}));Xv.displayName=Ev.displayName;const Zv=p.forwardRef(({className:e,...t},n)=>a.jsx(jv,{ref:n,className:te("text-sm opacity-90",e),...t}));Zv.displayName=jv.displayName;function SN(){const{toasts:e}=qn();return a.jsxs(yN,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return a.jsxs(Yv,{...s,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(Xv,{children:n}),r&&a.jsx(Zv,{children:r})]}),o,a.jsx(qv,{})]},t)}),a.jsx(Kv,{})]})}var CN=Oh[" useId ".trim().toString()]||(()=>{}),bN=0;function nn(e){const[t,n]=p.useState(CN());return Hn(()=>{e||n(r=>r??String(bN++))},[e]),e||(t?`radix-${t}`:"")}const NN=["top","right","bottom","left"],Bn=Math.min,nt=Math.max,xa=Math.round,Si=Math.floor,Bt=e=>({x:e,y:e}),kN={left:"right",right:"left",bottom:"top",top:"bottom"},EN={start:"end",end:"start"};function hu(e,t,n){return nt(e,Bn(t,n))}function ln(e,t){return typeof e=="function"?e(t):e}function cn(e){return e.split("-")[0]}function Ao(e){return e.split("-")[1]}function Id(e){return e==="x"?"y":"x"}function Ad(e){return e==="y"?"height":"width"}function Vn(e){return["top","bottom"].includes(cn(e))?"y":"x"}function Dd(e){return Id(Vn(e))}function jN(e,t,n){n===void 0&&(n=!1);const r=Ao(e),o=Dd(e),s=Ad(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=wa(i)),[i,wa(i)]}function PN(e){const t=wa(e);return[mu(e),t,mu(t)]}function mu(e){return e.replace(/start|end/g,t=>EN[t])}function TN(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function RN(e,t,n,r){const o=Ao(e);let s=TN(cn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(mu)))),s}function wa(e){return e.replace(/left|right|bottom|top/g,t=>kN[t])}function MN(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jv(e){return typeof e!="number"?MN(e):{top:e,right:e,bottom:e,left:e}}function Sa(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Yp(e,t,n){let{reference:r,floating:o}=e;const s=Vn(t),i=Dd(t),l=Ad(i),c=cn(t),u=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let x;switch(c){case"top":x={x:f,y:r.y-o.height};break;case"bottom":x={x:f,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:d};break;case"left":x={x:r.x-o.width,y:d};break;default:x={x:r.x,y:r.y}}switch(Ao(t)){case"start":x[i]-=h*(n&&u?-1:1);break;case"end":x[i]+=h*(n&&u?-1:1);break}return x}const IN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Yp(u,r,c),h=r,x={},w=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:f=0}=ln(e,t)||{};if(u==null)return{};const d=Jv(f),h={x:n,y:r},x=Dd(o),w=Ad(x),v=await i.getDimensions(u),S=x==="y",g=S?"top":"left",m=S?"bottom":"right",y=S?"clientHeight":"clientWidth",C=s.reference[w]+s.reference[x]-h[x]-s.floating[w],b=h[x]-s.reference[x],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let N=E?E[y]:0;(!N||!await(i.isElement==null?void 0:i.isElement(E)))&&(N=l.floating[y]||s.floating[w]);const j=C/2-b/2,M=N/2-v[w]/2-1,I=Bn(d[g],M),L=Bn(d[m],M),O=I,G=N-v[w]-L,D=N/2-v[w]/2+j,B=hu(O,D,G),$=!c.arrow&&Ao(o)!=null&&D!==B&&s.reference[w]/2-(DD<=0)){var L,O;const D=(((L=s.flip)==null?void 0:L.index)||0)+1,B=N[D];if(B)return{data:{index:D,overflows:I},reset:{placement:B}};let $=(O=I.filter(R=>R.overflows[0]<=0).sort((R,P)=>R.overflows[1]-P.overflows[1])[0])==null?void 0:O.placement;if(!$)switch(x){case"bestFit":{var G;const R=(G=I.filter(P=>{if(E){const T=Vn(P.placement);return T===m||T==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(T=>T>0).reduce((T,_)=>T+_,0)]).sort((P,T)=>P[1]-T[1])[0])==null?void 0:G[0];R&&($=R);break}case"initialPlacement":$=l;break}if(o!==$)return{reset:{placement:$}}}return{}}}};function qp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xp(e){return NN.some(t=>e[t]>=0)}const ON=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ln(e,t);switch(r){case"referenceHidden":{const s=await As(t,{...o,elementContext:"reference"}),i=qp(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Xp(i)}}}case"escaped":{const s=await As(t,{...o,altBoundary:!0}),i=qp(s,n.floating);return{data:{escapedOffsets:i,escaped:Xp(i)}}}default:return{}}}}};async function _N(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=cn(n),l=Ao(n),c=Vn(n)==="y",u=["left","top"].includes(i)?-1:1,f=s&&c?-1:1,d=ln(t,e);let{mainAxis:h,crossAxis:x,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof w=="number"&&(x=l==="end"?w*-1:w),c?{x:x*f,y:h*u}:{x:h*u,y:x*f}}const LN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,c=await _N(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},FN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:S=>{let{x:g,y:m}=S;return{x:g,y:m}}},...c}=ln(e,t),u={x:n,y:r},f=await As(t,c),d=Vn(cn(o)),h=Id(d);let x=u[h],w=u[d];if(s){const S=h==="y"?"top":"left",g=h==="y"?"bottom":"right",m=x+f[S],y=x-f[g];x=hu(m,x,y)}if(i){const S=d==="y"?"top":"left",g=d==="y"?"bottom":"right",m=w+f[S],y=w-f[g];w=hu(m,w,y)}const v=l.fn({...t,[h]:x,[d]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:s,[d]:i}}}}}},zN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ln(e,t),f={x:n,y:r},d=Vn(o),h=Id(d);let x=f[h],w=f[d];const v=ln(l,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=h==="y"?"height":"width",C=s.reference[h]-s.floating[y]+S.mainAxis,b=s.reference[h]+s.reference[y]-S.mainAxis;xb&&(x=b)}if(u){var g,m;const y=h==="y"?"width":"height",C=["top","left"].includes(cn(o)),b=s.reference[d]-s.floating[y]+(C&&((g=i.offset)==null?void 0:g[d])||0)+(C?0:S.crossAxis),E=s.reference[d]+s.reference[y]+(C?0:((m=i.offset)==null?void 0:m[d])||0)-(C?S.crossAxis:0);wE&&(w=E)}return{[h]:x,[d]:w}}}},$N=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...u}=ln(e,t),f=await As(t,u),d=cn(o),h=Ao(o),x=Vn(o)==="y",{width:w,height:v}=s.floating;let S,g;d==="top"||d==="bottom"?(S=d,g=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,S=h==="end"?"top":"bottom");const m=v-f.top-f.bottom,y=w-f.left-f.right,C=Bn(v-f[S],m),b=Bn(w-f[g],y),E=!t.middlewareData.shift;let N=C,j=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=m),E&&!h){const I=nt(f.left,0),L=nt(f.right,0),O=nt(f.top,0),G=nt(f.bottom,0);x?j=w-2*(I!==0||L!==0?I+L:nt(f.left,f.right)):N=v-2*(O!==0||G!==0?O+G:nt(f.top,f.bottom))}await c({...t,availableWidth:j,availableHeight:N});const M=await i.getDimensions(l.floating);return w!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function nl(){return typeof window<"u"}function Do(e){return ey(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gt(e){var t;return(t=(ey(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ey(e){return nl()?e instanceof Node||e instanceof it(e).Node:!1}function Rt(e){return nl()?e instanceof Element||e instanceof it(e).Element:!1}function Qt(e){return nl()?e instanceof HTMLElement||e instanceof it(e).HTMLElement:!1}function Zp(e){return!nl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof it(e).ShadowRoot}function Ys(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function UN(e){return["table","td","th"].includes(Do(e))}function rl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Od(e){const t=_d(),n=Rt(e)?Mt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function WN(e){let t=Qn(e);for(;Qt(t)&&!No(t);){if(Od(t))return t;if(rl(t))return null;t=Qn(t)}return null}function _d(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function No(e){return["html","body","#document"].includes(Do(e))}function Mt(e){return it(e).getComputedStyle(e)}function ol(e){return Rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qn(e){if(Do(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zp(e)&&e.host||Gt(e);return Zp(t)?t.host:t}function ty(e){const t=Qn(e);return No(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qt(t)&&Ys(t)?t:ty(t)}function Ds(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ty(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=it(o);if(s){const l=gu(i);return t.concat(i,i.visualViewport||[],Ys(o)?o:[],l&&n?Ds(l):[])}return t.concat(o,Ds(o,[],n))}function gu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ny(e){const t=Mt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=xa(n)!==s||xa(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Ld(e){return Rt(e)?e:e.contextElement}function Jr(e){const t=Ld(e);if(!Qt(t))return Bt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ny(t);let i=(s?xa(n.width):n.width)/r,l=(s?xa(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const HN=Bt(0);function ry(e){const t=it(e);return!_d()||!t.visualViewport?HN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function BN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==it(e)?!1:t}function wr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ld(e);let i=Bt(1);t&&(r?Rt(r)&&(i=Jr(r)):i=Jr(e));const l=BN(s,n,r)?ry(s):Bt(0);let c=(o.left+l.x)/i.x,u=(o.top+l.y)/i.y,f=o.width/i.x,d=o.height/i.y;if(s){const h=it(s),x=r&&Rt(r)?it(r):r;let w=h,v=gu(w);for(;v&&r&&x!==w;){const S=Jr(v),g=v.getBoundingClientRect(),m=Mt(v),y=g.left+(v.clientLeft+parseFloat(m.paddingLeft))*S.x,C=g.top+(v.clientTop+parseFloat(m.paddingTop))*S.y;c*=S.x,u*=S.y,f*=S.x,d*=S.y,c+=y,u+=C,w=it(v),v=gu(w)}}return Sa({width:f,height:d,x:c,y:u})}function Fd(e,t){const n=ol(e).scrollLeft;return t?t.left+n:wr(Gt(e)).left+n}function oy(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Fd(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function VN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Gt(r),l=t?rl(t.floating):!1;if(r===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Bt(1);const f=Bt(0),d=Qt(r);if((d||!d&&!s)&&((Do(r)!=="body"||Ys(i))&&(c=ol(r)),Qt(r))){const x=wr(r);u=Jr(r),f.x=x.x+r.clientLeft,f.y=x.y+r.clientTop}const h=i&&!d&&!s?oy(i,c,!0):Bt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-c.scrollTop*u.y+f.y+h.y}}function QN(e){return Array.from(e.getClientRects())}function GN(e){const t=Gt(e),n=ol(e),r=e.ownerDocument.body,o=nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Fd(e);const l=-n.scrollTop;return Mt(r).direction==="rtl"&&(i+=nt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}function KN(e,t){const n=it(e),r=Gt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(o){s=o.width,i=o.height;const u=_d();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:l,y:c}}function YN(e,t){const n=wr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Qt(e)?Jr(e):Bt(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:l,x:c,y:u}}function Jp(e,t,n){let r;if(t==="viewport")r=KN(e,n);else if(t==="document")r=GN(Gt(e));else if(Rt(t))r=YN(t,n);else{const o=ry(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Sa(r)}function sy(e,t){const n=Qn(e);return n===t||!Rt(n)||No(n)?!1:Mt(n).position==="fixed"||sy(n,t)}function qN(e,t){const n=t.get(e);if(n)return n;let r=Ds(e,[],!1).filter(l=>Rt(l)&&Do(l)!=="body"),o=null;const s=Mt(e).position==="fixed";let i=s?Qn(e):e;for(;Rt(i)&&!No(i);){const l=Mt(i),c=Od(i);!c&&l.position==="fixed"&&(o=null),(s?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ys(i)&&!c&&sy(e,i))?r=r.filter(f=>f!==i):o=l,i=Qn(i)}return t.set(e,r),r}function XN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?rl(t)?[]:qN(t,this._c):[].concat(n),r],l=i[0],c=i.reduce((u,f)=>{const d=Jp(t,f,o);return u.top=nt(d.top,u.top),u.right=Bn(d.right,u.right),u.bottom=Bn(d.bottom,u.bottom),u.left=nt(d.left,u.left),u},Jp(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ZN(e){const{width:t,height:n}=ny(e);return{width:t,height:n}}function JN(e,t,n){const r=Qt(t),o=Gt(t),s=n==="fixed",i=wr(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Bt(0);if(r||!r&&!s)if((Do(t)!=="body"||Ys(o))&&(l=ol(t)),r){const h=wr(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=Fd(o));const u=o&&!r&&!s?oy(o,l):Bt(0),f=i.left+l.scrollLeft-c.x-u.x,d=i.top+l.scrollTop-c.y-u.y;return{x:f,y:d,width:i.width,height:i.height}}function Ql(e){return Mt(e).position==="static"}function eh(e,t){if(!Qt(e)||Mt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gt(e)===n&&(n=n.ownerDocument.body),n}function iy(e,t){const n=it(e);if(rl(e))return n;if(!Qt(e)){let o=Qn(e);for(;o&&!No(o);){if(Rt(o)&&!Ql(o))return o;o=Qn(o)}return n}let r=eh(e,t);for(;r&&UN(r)&&Ql(r);)r=eh(r,t);return r&&No(r)&&Ql(r)&&!Od(r)?n:r||WN(e)||n}const ek=async function(e){const t=this.getOffsetParent||iy,n=this.getDimensions,r=await n(e.floating);return{reference:JN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tk(e){return Mt(e).direction==="rtl"}const nk={convertOffsetParentRelativeRectToViewportRelativeRect:VN,getDocumentElement:Gt,getClippingRect:XN,getOffsetParent:iy,getElementRects:ek,getClientRects:QN,getDimensions:ZN,getScale:Jr,isElement:Rt,isRTL:tk};function ay(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rk(e,t){let n=null,r;const o=Gt(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:f,top:d,width:h,height:x}=u;if(l||t(),!h||!x)return;const w=Si(d),v=Si(o.clientWidth-(f+h)),S=Si(o.clientHeight-(d+x)),g=Si(f),y={rootMargin:-w+"px "+-v+"px "+-S+"px "+-g+"px",threshold:nt(0,Bn(1,c))||1};let C=!0;function b(E){const N=E[0].intersectionRatio;if(N!==c){if(!C)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!ay(u,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(b,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,y)}n.observe(e)}return i(!0),s}function ok(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Ld(e),f=o||s?[...u?Ds(u):[],...Ds(t)]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=u&&l?rk(u,n):null;let h=-1,x=null;i&&(x=new ResizeObserver(g=>{let[m]=g;m&&m.target===u&&x&&(x.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(t)})),n()}),u&&!c&&x.observe(u),x.observe(t));let w,v=c?wr(e):null;c&&S();function S(){const g=wr(e);v&&!ay(v,g)&&n(),v=g,w=requestAnimationFrame(S)}return n(),()=>{var g;f.forEach(m=>{o&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),d==null||d(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(w)}}const sk=LN,ik=FN,ak=DN,lk=$N,ck=ON,th=AN,uk=zN,dk=(e,t,n)=>{const r=new Map,o={platform:nk,...n},s={...o.platform,_c:r};return IN(e,t,{...o,platform:s})};var $i=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Ca(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ca(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ca(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ly(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nh(e,t){const n=ly(e);return Math.round(t*n)/n}function Gl(e){const t=p.useRef(e);return $i(()=>{t.current=e}),t}function fk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,x]=p.useState(r);Ca(h,r)||x(r);const[w,v]=p.useState(null),[S,g]=p.useState(null),m=p.useCallback(P=>{P!==E.current&&(E.current=P,v(P))},[]),y=p.useCallback(P=>{P!==N.current&&(N.current=P,g(P))},[]),C=s||w,b=i||S,E=p.useRef(null),N=p.useRef(null),j=p.useRef(f),M=c!=null,I=Gl(c),L=Gl(o),O=Gl(u),G=p.useCallback(()=>{if(!E.current||!N.current)return;const P={placement:t,strategy:n,middleware:h};L.current&&(P.platform=L.current),dk(E.current,N.current,P).then(T=>{const _={...T,isPositioned:O.current!==!1};D.current&&!Ca(j.current,_)&&(j.current=_,Qs.flushSync(()=>{d(_)}))})},[h,t,n,L,O]);$i(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[u]);const D=p.useRef(!1);$i(()=>(D.current=!0,()=>{D.current=!1}),[]),$i(()=>{if(C&&(E.current=C),b&&(N.current=b),C&&b){if(I.current)return I.current(C,b,G);G()}},[C,b,G,I,M]);const B=p.useMemo(()=>({reference:E,floating:N,setReference:m,setFloating:y}),[m,y]),$=p.useMemo(()=>({reference:C,floating:b}),[C,b]),R=p.useMemo(()=>{const P={position:n,left:0,top:0};if(!$.floating)return P;const T=nh($.floating,f.x),_=nh($.floating,f.y);return l?{...P,transform:"translate("+T+"px, "+_+"px)",...ly($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:_}},[n,l,$.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:G,refs:B,elements:$,floatingStyles:R}),[f,G,B,$,R])}const pk=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?th({element:r.current,padding:o}).fn(n):{}:r?th({element:r,padding:o}).fn(n):{}}}},hk=(e,t)=>({...sk(e),options:[e,t]}),mk=(e,t)=>({...ik(e),options:[e,t]}),gk=(e,t)=>({...uk(e),options:[e,t]}),vk=(e,t)=>({...ak(e),options:[e,t]}),yk=(e,t)=>({...lk(e),options:[e,t]}),xk=(e,t)=>({...ck(e),options:[e,t]}),wk=(e,t)=>({...pk(e),options:[e,t]});var Sk="Arrow",cy=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return a.jsx(ee.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});cy.displayName=Sk;var Ck=cy;function bk(e){const[t,n]=p.useState(void 0);return Hn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,l=u.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zd="Popper",[uy,sl]=dn(zd),[Nk,dy]=uy(zd),fy=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return a.jsx(Nk,{scope:t,anchor:r,onAnchorChange:o,children:n})};fy.displayName=zd;var py="PopperAnchor",hy=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=dy(py,n),i=p.useRef(null),l=ge(t,i);return p.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:a.jsx(ee.div,{...o,ref:l})});hy.displayName=py;var $d="PopperContent",[kk,Ek]=uy($d),my=p.forwardRef((e,t)=>{var Qe,Oo,ut,_o,lf,cf;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:x="optimized",onPlaced:w,...v}=e,S=dy($d,n),[g,m]=p.useState(null),y=ge(t,Lo=>m(Lo)),[C,b]=p.useState(null),E=bk(C),N=(E==null?void 0:E.width)??0,j=(E==null?void 0:E.height)??0,M=r+(s!=="center"?"-"+s:""),I=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},L=Array.isArray(u)?u:[u],O=L.length>0,G={padding:I,boundary:L.filter(Pk),altBoundary:O},{refs:D,floatingStyles:B,placement:$,isPositioned:R,middlewareData:P}=fk({strategy:"fixed",placement:M,whileElementsMounted:(...Lo)=>ok(...Lo,{animationFrame:x==="always"}),elements:{reference:S.anchor},middleware:[hk({mainAxis:o+j,alignmentAxis:i}),c&&mk({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?gk():void 0,...G}),c&&vk({...G}),yk({...G,apply:({elements:Lo,rects:uf,availableWidth:M0,availableHeight:I0})=>{const{width:A0,height:D0}=uf.reference,Js=Lo.floating.style;Js.setProperty("--radix-popper-available-width",`${M0}px`),Js.setProperty("--radix-popper-available-height",`${I0}px`),Js.setProperty("--radix-popper-anchor-width",`${A0}px`),Js.setProperty("--radix-popper-anchor-height",`${D0}px`)}}),C&&wk({element:C,padding:l}),Tk({arrowWidth:N,arrowHeight:j}),h&&xk({strategy:"referenceHidden",...G})]}),[T,_]=yy($),W=De(w);Hn(()=>{R&&(W==null||W())},[R,W]);const K=(Qe=P.arrow)==null?void 0:Qe.x,ye=(Oo=P.arrow)==null?void 0:Oo.y,Pe=((ut=P.arrow)==null?void 0:ut.centerOffset)!==0,[fn,_e]=p.useState();return Hn(()=>{g&&_e(window.getComputedStyle(g).zIndex)},[g]),a.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:R?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fn,"--radix-popper-transform-origin":[(_o=P.transformOrigin)==null?void 0:_o.x,(lf=P.transformOrigin)==null?void 0:lf.y].join(" "),...((cf=P.hide)==null?void 0:cf.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(kk,{scope:n,placedSide:T,onArrowChange:b,arrowX:K,arrowY:ye,shouldHideArrow:Pe,children:a.jsx(ee.div,{"data-side":T,"data-align":_,...v,ref:y,style:{...v.style,animation:R?void 0:"none"}})})})});my.displayName=$d;var gy="PopperArrow",jk={top:"bottom",right:"left",bottom:"top",left:"right"},vy=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Ek(gy,r),i=jk[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(Ck,{...o,ref:n,style:{...o.style,display:"block"}})})});vy.displayName=gy;function Pk(e){return e!==null}var Tk=e=>({name:"transformOrigin",options:e,fn(t){var S,g,m;const{placement:n,rects:r,middlewareData:o}=t,i=((S=o.arrow)==null?void 0:S.centerOffset)!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,f]=yy(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(((g=o.arrow)==null?void 0:g.x)??0)+l/2,x=(((m=o.arrow)==null?void 0:m.y)??0)+c/2;let w="",v="";return u==="bottom"?(w=i?d:`${h}px`,v=`${-c}px`):u==="top"?(w=i?d:`${h}px`,v=`${r.floating.height+c}px`):u==="right"?(w=`${-c}px`,v=i?d:`${x}px`):u==="left"&&(w=`${r.floating.width+c}px`,v=i?d:`${x}px`),{data:{x:w,y:v}}}});function yy(e){const[t,n="center"]=e.split("-");return[t,n]}var xy=fy,wy=hy,Sy=my,Cy=vy,[il,dP]=dn("Tooltip",[sl]),Ud=sl(),by="TooltipProvider",Rk=700,rh="tooltip.open",[Mk,Ny]=il(by),ky=e=>{const{__scopeTooltip:t,delayDuration:n=Rk,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(Mk,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:s})};ky.displayName=by;var Ey="Tooltip",[fP,al]=il(Ey),vu="TooltipTrigger",Ik=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=al(vu,n),s=Ny(vu,n),i=Ud(n),l=p.useRef(null),c=ge(t,l,o.onTriggerChange),u=p.useRef(!1),f=p.useRef(!1),d=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.jsx(wy,{asChild:!0,...i,children:a.jsx(ee.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:U(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:U(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:U(e.onBlur,o.onClose),onClick:U(e.onClick,o.onClose)})})});Ik.displayName=vu;var Ak="TooltipPortal",[pP,Dk]=il(Ak,{forceMount:void 0}),ko="TooltipContent",jy=p.forwardRef((e,t)=>{const n=Dk(ko,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=al(ko,e.__scopeTooltip);return a.jsx(It,{present:r||i.open,children:i.disableHoverableContent?a.jsx(Py,{side:o,...s,ref:t}):a.jsx(Ok,{side:o,...s,ref:t})})}),Ok=p.forwardRef((e,t)=>{const n=al(ko,e.__scopeTooltip),r=Ny(ko,e.__scopeTooltip),o=p.useRef(null),s=ge(t,o),[i,l]=p.useState(null),{trigger:c,onClose:u}=n,f=o.current,{onPointerInTransitChange:d}=r,h=p.useCallback(()=>{l(null),d(!1)},[d]),x=p.useCallback((w,v)=>{const S=w.currentTarget,g={x:w.clientX,y:w.clientY},m=$k(g,S.getBoundingClientRect()),y=Uk(g,m),C=Wk(v.getBoundingClientRect()),b=Bk([...y,...C]);l(b),d(!0)},[d]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(c&&f){const w=S=>x(S,f),v=S=>x(S,c);return c.addEventListener("pointerleave",w),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",v)}}},[c,f,x,h]),p.useEffect(()=>{if(i){const w=v=>{const S=v.target,g={x:v.clientX,y:v.clientY},m=(c==null?void 0:c.contains(S))||(f==null?void 0:f.contains(S)),y=!Hk(g,i);m?h():y&&(h(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,f,i,u,h]),a.jsx(Py,{...e,ref:s})}),[_k,Lk]=il(Ey,{isInside:!1}),Fk=RC("TooltipContent"),Py=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...l}=e,c=al(ko,n),u=Ud(n),{onClose:f}=c;return p.useEffect(()=>(document.addEventListener(rh,f),()=>document.removeEventListener(rh,f)),[f]),p.useEffect(()=>{if(c.trigger){const d=h=>{const x=h.target;x!=null&&x.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),a.jsx(Ks,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:a.jsxs(Sy,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Fk,{children:r}),a.jsx(_k,{scope:n,isInside:!0,children:a.jsx(qC,{id:c.contentId,role:"tooltip",children:o||r})})]})})});jy.displayName=ko;var Ty="TooltipArrow",zk=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ud(n);return Lk(Ty,n).isInside?null:a.jsx(Cy,{...o,...r,ref:t})});zk.displayName=Ty;function $k(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Uk(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Wk(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Hk(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=f>r&&n<(u-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function Bk(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),Vk(t)}function Vk(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Qk=ky,Ry=jy;const Gk=Qk,Kk=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(Ry,{ref:r,sideOffset:t,className:te("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));Kk.displayName=Ry.displayName;const Yk=Iv("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),H=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?PC:"button";return a.jsx(i,{className:te(Yk({variant:t,size:n,className:e})),ref:s,...o})});H.displayName="Button";const he={PLAYLISTS:"velin_playlists",WATCH_LATER:"velin_watch_later",HISTORY:"velin_history",DOWNLOADS:"velin_downloads",PODCAST_DATA:"velin_podcast_data"},Vt={save:e=>{const t=$n(he.PODCAST_DATA,{}),n={id:qk(e.url),...e,uploaderAvatar:e.uploaderAvatar||null};return t[n.id]=n,Ye(he.PODCAST_DATA,t),n.id},get:e=>$n(he.PODCAST_DATA,{})[e]||null,getMultiple:e=>{const t=$n(he.PODCAST_DATA,{});return e.map(n=>t[n]).filter(Boolean)}},$e={getAll:()=>$n(he.PLAYLISTS,[]),create:(e,t)=>{const n=$e.getAll(),r={id:ll(),name:e,description:t||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),podcastIds:[]};return n.push(r),Ye(he.PLAYLISTS,n),r},update:(e,t)=>{const n=$e.getAll(),r=n.findIndex(o=>o.id===e);return r!==-1?(n[r]={...n[r],...t,updatedAt:new Date().toISOString()},Ye(he.PLAYLISTS,n),n[r]):null},delete:e=>{const n=$e.getAll().filter(r=>r.id!==e);Ye(he.PLAYLISTS,n)},addPodcast:(e,t)=>{const n=Vt.save(t),r=$e.getAll(),o=r.find(s=>s.id===e);o&&!o.podcastIds.includes(n)&&(o.podcastIds.push(n),o.updatedAt=new Date().toISOString(),Ye(he.PLAYLISTS,r))},removePodcast:(e,t)=>{const n=$e.getAll(),r=n.find(o=>o.id===e);r&&(r.podcastIds=r.podcastIds.filter(o=>o!==t),r.updatedAt=new Date().toISOString(),Ye(he.PLAYLISTS,n))}},We={getAll:()=>$n(he.WATCH_LATER,[]),add:e=>{const t=Vt.save(e),n=We.getAll();if(!n.find(r=>r.podcastId===t)){const r={id:ll(),podcastId:t,addedAt:new Date().toISOString()};n.push(r),Ye(he.WATCH_LATER,n)}},remove:e=>{const n=We.getAll().filter(r=>r.podcastId!==e);Ye(he.WATCH_LATER,n)},exists:e=>We.getAll().some(n=>n.podcastId===e)},ba={getAll:()=>$n(he.HISTORY,[]).sort((e,t)=>new Date(t.watchedAt).getTime()-new Date(e.watchedAt).getTime()),add:(e,t=0,n=0)=>{const r=Vt.save(e),s=$n(he.HISTORY,[]).filter(c=>c.podcastId!==r),i={id:ll(),podcastId:r,watchedAt:new Date().toISOString(),duration:t,totalDuration:n,completed:n>0&&t>=n*.9};s.unshift(i);const l=s.slice(0,100);Ye(he.HISTORY,l)},clear:()=>{Ye(he.HISTORY,[])},remove:e=>{const n=ba.getAll().filter(r=>r.podcastId!==e);Ye(he.HISTORY,n)}},xe={getAll:()=>$n(he.DOWNLOADS,[]),add:(e,t,n)=>{const r=Vt.save(e),o=xe.getAll();if(!o.find(s=>s.podcastId===r)){const s={id:ll(),podcastId:r,audioUrl:t,downloadedAt:new Date().toISOString(),fileSize:n,isAvailable:!0};o.push(s),Ye(he.DOWNLOADS,o)}},remove:e=>{const n=xe.getAll().filter(r=>r.podcastId!==e);Ye(he.DOWNLOADS,n)},exists:e=>xe.getAll().some(n=>n.podcastId===e&&n.isAvailable),get:e=>xe.getAll().find(n=>n.podcastId===e&&n.isAvailable)||null,update:(e,t)=>{const n=xe.getAll(),r=n.findIndex(o=>o.podcastId===e);return r!==-1?(n[r]={...n[r],...t},Ye(he.DOWNLOADS,n),n[r]):null}};function $n(e,t){try{const n=localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function Ye(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(n){console.error("Failed to save to localStorage:",n)}}function ll(){return Date.now().toString(36)+Math.random().toString(36).substr(2)}function qk(e){return e.includes("/watch?v=")?e.split("/watch?v=")[1].split("&")[0]:e.replace(/.*\//,"")}class or{constructor(){this.registration=null,this.isRegistered=!1}static getInstance(){return or.instance||(or.instance=new or),or.instance}async register(){if(!("serviceWorker"in navigator))return console.log("Service Worker not supported"),!1;try{return this.registration=await navigator.serviceWorker.register("/sw.js",{scope:"/"}),this.isRegistered=!0,console.log("Service Worker registered successfully"),this.registration.addEventListener("updatefound",()=>{var n;const t=(n=this.registration)==null?void 0:n.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&navigator.serviceWorker.controller&&console.log("New service worker available")})}),!0}catch(t){return console.error("Service Worker registration failed:",t),!1}}isActive(){return this.isRegistered&&!!navigator.serviceWorker.controller}async cacheAudio(t){var n;if(!this.isActive())return console.warn("Service Worker not active"),!1;try{(n=navigator.serviceWorker.controller)==null||n.postMessage({type:"CACHE_AUDIO",url:t});try{const r=await caches.open("velin-audio-cache-v1"),o=await fetch(t);if(o.ok)return await r.put(t,o.clone()),console.log("Audio cached successfully via Cache API:",t),!0}catch(r){console.error("Direct cache failed:",r)}return!1}catch(r){return console.error("Error caching audio:",r),!1}}async isAudioCached(t){try{return!!await(await caches.open("velin-audio-cache-v1")).match(t)}catch(n){return console.error("Error checking cache:",n),!1}}async getCachedAudioUrl(t){try{const r=await(await caches.open("velin-audio-cache-v1")).match(t);if(r){const o=await r.blob();return URL.createObjectURL(o)}return null}catch(n){return console.error("Error getting cached audio:",n),null}}async clearCache(){var t;try{this.isActive()&&((t=navigator.serviceWorker.controller)==null||t.postMessage({type:"CLEAR_CACHE"}));const n=await caches.keys();await Promise.all(n.map(r=>caches.delete(r))),console.log("All caches cleared")}catch(n){console.error("Error clearing cache:",n)}}async getCacheSize(){if(!this.isActive())return 0;try{return new Promise(t=>{var r;const n=new MessageChannel;n.port1.onmessage=o=>{t(o.data.size||0)},(r=navigator.serviceWorker.controller)==null||r.postMessage({type:"GET_CACHE_SIZE"},[n.port2]),setTimeout(()=>t(0),5e3)})}catch(t){return console.error("Error getting cache size:",t),0}}formatCacheSize(t){const n=["B","KB","MB","GB"];let r=t,o=0;for(;r>=1024&&ot.isAvailable)}isPodcastAvailableOffline(t){return xe.exists(t)}async getOfflineAudioUrl(t){if(Et.isActive()){const r=`/api/download-audio/${t}`;if(await Et.isAudioCached(r))return console.log("Audio available in Service Worker cache"),r}const n=xe.get(t);if(n&&n.audioUrl)return n.audioUrl;try{const r=await this.getAudioFromIndexedDB(t);if(r){const o=URL.createObjectURL(r);return n&&(n.audioUrl=o,xe.update(t,n)),o}}catch(r){console.error("Failed to get audio from IndexedDB:",r)}return null}async downloadPodcast(t){try{const n=t.url.match(/[?&]v=([^&]+)/);if(!n)throw new Error("Invalid podcast URL");const r=n[1],o=`/api/download-audio/${r}`;if(Et.isActive()&&(console.log("Using Service Worker for download caching"),await Et.cacheAudio(o))){if(t.thumbnail)try{await fetch(t.thumbnail),console.log("Thumbnail cached for offline use")}catch(u){console.warn("Failed to cache thumbnail:",u)}return xe.add(t,o,0),await this.storePodcastMetadata(r,t),!0}console.log("Falling back to IndexedDB download method");const s=await fetch(o);if(!s.ok)throw new Error("Failed to get audio stream");const i=await s.blob();await this.storeAudioInIndexedDB(r,i);const l=URL.createObjectURL(i);return xe.add(t,l,i.size),await this.storePodcastMetadata(r,t),!0}catch(n){return console.error("Download failed:",n),!1}}async storePodcastMetadata(t,n){return new Promise((r,o)=>{const s=indexedDB.open("VelinAudioCache",1);s.onupgradeneeded=()=>{const i=s.result;i.objectStoreNames.contains("audio")||i.createObjectStore("audio",{keyPath:"id"}),i.objectStoreNames.contains("metadata")||i.createObjectStore("metadata",{keyPath:"id"})},s.onsuccess=()=>{const i=s.result;if(!i.objectStoreNames.contains("metadata")){console.warn("Metadata store not found, skipping metadata storage"),r();return}const l=i.transaction(["metadata"],"readwrite");l.objectStore("metadata").put({id:t,podcast:n,timestamp:Date.now()}),l.oncomplete=()=>r(),l.onerror=()=>o(l.error)},s.onerror=()=>o(s.error)})}async getPodcastMetadata(t){return new Promise(n=>{const r=indexedDB.open("VelinAudioCache",1);r.onupgradeneeded=()=>{const o=r.result;o.objectStoreNames.contains("audio")||o.createObjectStore("audio",{keyPath:"id"}),o.objectStoreNames.contains("metadata")||o.createObjectStore("metadata",{keyPath:"id"})},r.onsuccess=()=>{const o=r.result;if(!o.objectStoreNames.contains("metadata")){n(null);return}const l=o.transaction(["metadata"],"readonly").objectStore("metadata").get(t);l.onsuccess=()=>{const c=l.result;n(c?c.podcast:null)},l.onerror=()=>n(null)},r.onerror=()=>n(null)})}async storeAudioInIndexedDB(t,n){return new Promise((r,o)=>{const s=indexedDB.open("VelinAudioCache",1);s.onerror=()=>o(s.error),s.onsuccess=()=>{const l=s.result.transaction(["audio"],"readwrite");l.objectStore("audio").put({id:t,audio:n,timestamp:Date.now()}),l.oncomplete=()=>r(),l.onerror=()=>o(l.error)},s.onupgradeneeded=()=>{const i=s.result;i.objectStoreNames.contains("audio")||i.createObjectStore("audio",{keyPath:"id"}),i.objectStoreNames.contains("metadata")||i.createObjectStore("metadata",{keyPath:"id"})}})}async getAudioFromIndexedDB(t){return new Promise(n=>{const r=indexedDB.open("VelinAudioCache",1);r.onupgradeneeded=()=>{const o=r.result;o.objectStoreNames.contains("audio")||o.createObjectStore("audio",{keyPath:"id"}),o.objectStoreNames.contains("metadata")||o.createObjectStore("metadata",{keyPath:"id"})},r.onsuccess=()=>{const o=r.result;if(!o.objectStoreNames.contains("audio")){n(null);return}const l=o.transaction(["audio"],"readonly").objectStore("audio").get(t);l.onsuccess=()=>{const c=l.result;n(c?c.audio:null)},l.onerror=()=>n(null)},r.onerror=()=>n(null)})}removeDownload(t){const n=xe.get(t);n&&(URL.revokeObjectURL(n.audioUrl),xe.remove(t))}getDownloadProgress(t){return xe.get(t)?100:0}async getStorageUsage(){if("storage"in navigator&&"estimate"in navigator.storage){const t=await navigator.storage.estimate();return{used:t.usage||0,quota:t.quota||0}}return{used:0,quota:0}}clearAllDownloads(){xe.getAll().forEach(n=>{URL.revokeObjectURL(n.audioUrl)}),localStorage.removeItem("velin_downloads"),"caches"in window&&caches.open("velin-v1").then(n=>{n.keys().then(r=>{r.forEach(o=>{(o.url.includes("audio")||o.url.includes(".mp3")||o.url.includes(".mp4"))&&n.delete(o)})})})}async setupOfflineListeners(){window.addEventListener("online",()=>{console.log("App is now online"),this.syncWhenOnline()}),window.addEventListener("offline",()=>{console.log("App is now offline"),this.showOfflineNotification()}),Et.isActive()||await Et.register()}async syncWhenOnline(){console.log("Syncing data...")}showOfflineNotification(){const t=document.createElement("div");t.className="fixed top-4 right-4 bg-yellow-500 text-white px-4 py-2 rounded-lg text-sm z-50",t.textContent="You're offline. Only downloaded content is available.",document.body.appendChild(t),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},5e3)}}const Ue=Wr.getInstance();var Xk=p.createContext(void 0);function Wd(e){const t=p.useContext(Xk);return e||t||"ltr"}var Kl=0;function My(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??oh()),document.body.insertAdjacentElement("beforeend",e[1]??oh()),Kl++,()=>{Kl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kl--}},[])}function oh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yl="focusScope.autoFocusOnMount",ql="focusScope.autoFocusOnUnmount",sh={bubbles:!1,cancelable:!0},Zk="FocusScope",Hd=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,c]=p.useState(null),u=De(o),f=De(s),d=p.useRef(null),h=ge(t,v=>c(v)),x=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(y){if(x.paused||!l)return;const C=y.target;l.contains(C)?d.current=C:yn(d.current,{select:!0})},S=function(y){if(x.paused||!l)return;const C=y.relatedTarget;C!==null&&(l.contains(C)||yn(d.current,{select:!0}))},g=function(y){if(document.activeElement===document.body)for(const b of y)b.removedNodes.length>0&&yn(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const m=new MutationObserver(g);return l&&m.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),m.disconnect()}}},[r,l,x.paused]),p.useEffect(()=>{if(l){ah.add(x);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent(Yl,sh);l.addEventListener(Yl,u),l.dispatchEvent(g),g.defaultPrevented||(Jk(oE(Iy(l)),{select:!0}),document.activeElement===v&&yn(l))}return()=>{l.removeEventListener(Yl,u),setTimeout(()=>{const g=new CustomEvent(ql,sh);l.addEventListener(ql,f),l.dispatchEvent(g),g.defaultPrevented||yn(v??document.body,{select:!0}),l.removeEventListener(ql,f),ah.remove(x)},0)}}},[l,u,f,x]);const w=p.useCallback(v=>{if(!n&&!r||x.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(S&&g){const m=v.currentTarget,[y,C]=eE(m);y&&C?!v.shiftKey&&g===C?(v.preventDefault(),n&&yn(y,{select:!0})):v.shiftKey&&g===y&&(v.preventDefault(),n&&yn(C,{select:!0})):g===m&&v.preventDefault()}},[n,r,x.paused]);return a.jsx(ee.div,{tabIndex:-1,...i,ref:h,onKeyDown:w})});Hd.displayName=Zk;function Jk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function eE(e){const t=Iy(e),n=ih(t,e),r=ih(t.reverse(),e);return[n,r]}function Iy(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ih(e,t){for(const n of e)if(!tE(n,{upTo:t}))return n}function tE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nE(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nE(e)&&t&&e.select()}}var ah=rE();function rE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=lh(e,t),e.unshift(t)},remove(t){var n;e=lh(e,t),(n=e[0])==null||n.resume()}}}function lh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oE(e){return e.filter(t=>t.tagName!=="A")}var Xl="rovingFocusGroup.onEntryFocus",sE={bubbles:!1,cancelable:!0},cl="RovingFocusGroup",[yu,Ay,iE]=Ed(cl),[aE,ul]=dn(cl,[iE]),[lE,cE]=aE(cl),Dy=p.forwardRef((e,t)=>a.jsx(yu.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(yu.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(uE,{...e,ref:t})})}));Dy.displayName=cl;var uE=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,h=p.useRef(null),x=ge(t,h),w=Wd(s),[v=null,S]=Mo({prop:i,defaultProp:l,onChange:c}),[g,m]=p.useState(!1),y=De(u),C=Ay(n),b=p.useRef(!1),[E,N]=p.useState(0);return p.useEffect(()=>{const j=h.current;if(j)return j.addEventListener(Xl,y),()=>j.removeEventListener(Xl,y)},[y]),a.jsx(lE,{scope:n,orientation:r,dir:w,loop:o,currentTabStopId:v,onItemFocus:p.useCallback(j=>S(j),[S]),onItemShiftTab:p.useCallback(()=>m(!0),[]),onFocusableItemAdd:p.useCallback(()=>N(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>N(j=>j-1),[]),children:a.jsx(ee.div,{tabIndex:g||E===0?-1:0,"data-orientation":r,...d,ref:x,style:{outline:"none",...e.style},onMouseDown:U(e.onMouseDown,()=>{b.current=!0}),onFocus:U(e.onFocus,j=>{const M=!b.current;if(j.target===j.currentTarget&&M&&!g){const I=new CustomEvent(Xl,sE);if(j.currentTarget.dispatchEvent(I),!I.defaultPrevented){const L=C().filter($=>$.focusable),O=L.find($=>$.active),G=L.find($=>$.id===v),B=[O,G,...L].filter(Boolean).map($=>$.ref.current);Ly(B,f)}}b.current=!1}),onBlur:U(e.onBlur,()=>m(!1))})})}),Oy="RovingFocusGroupItem",_y=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,l=nn(),c=s||l,u=cE(Oy,n),f=u.currentTabStopId===c,d=Ay(n),{onFocusableItemAdd:h,onFocusableItemRemove:x}=u;return p.useEffect(()=>{if(r)return h(),()=>x()},[r,h,x]),a.jsx(yu.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:a.jsx(ee.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:U(e.onMouseDown,w=>{r?u.onItemFocus(c):w.preventDefault()}),onFocus:U(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:U(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){u.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const v=pE(w,u.orientation,u.dir);if(v!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let g=d().filter(m=>m.focusable).map(m=>m.ref.current);if(v==="last")g.reverse();else if(v==="prev"||v==="next"){v==="prev"&&g.reverse();const m=g.indexOf(w.currentTarget);g=u.loop?hE(g,m+1):g.slice(m+1)}setTimeout(()=>Ly(g))}})})})});_y.displayName=Oy;var dE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function fE(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pE(e,t,n){const r=fE(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return dE[r]}function Ly(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function hE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Fy=Dy,zy=_y,mE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jr=new WeakMap,Ci=new WeakMap,bi={},Zl=0,$y=function(e){return e&&(e.host||$y(e.parentNode))},gE=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$y(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},vE=function(e,t,n,r){var o=gE(t,Array.isArray(e)?e:[e]);bi[n]||(bi[n]=new WeakMap);var s=bi[n],i=[],l=new Set,c=new Set(o),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(l.has(h))f(h);else try{var x=h.getAttribute(r),w=x!==null&&x!=="false",v=(jr.get(h)||0)+1,S=(s.get(h)||0)+1;jr.set(h,v),s.set(h,S),i.push(h),v===1&&w&&Ci.set(h,!0),S===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return f(t),l.clear(),Zl++,function(){i.forEach(function(d){var h=jr.get(d)-1,x=s.get(d)-1;jr.set(d,h),s.set(d,x),h||(Ci.has(d)||d.removeAttribute(r),Ci.delete(d)),x||d.removeAttribute(n)}),Zl--,Zl||(jr=new WeakMap,jr=new WeakMap,Ci=new WeakMap,bi={})}},Uy=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=mE(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),vE(r,o,n,"aria-hidden")):function(){return null}},Ut=function(){return Ut=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return DE;var t=OE(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},LE=Vy(),eo="data-scroll-locked",FE=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(xE,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(l,"px ").concat(r,`; + } + body[`).concat(eo,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(i,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(l,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Ui,` { + right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(Wi,` { + margin-right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(Ui," .").concat(Ui,` { + right: 0 `).concat(r,`; + } + + .`).concat(Wi," .").concat(Wi,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(eo,`] { + `).concat(wE,": ").concat(l,`px; + } +`)},uh=function(){var e=parseInt(document.body.getAttribute(eo)||"0",10);return isFinite(e)?e:0},zE=function(){p.useEffect(function(){return document.body.setAttribute(eo,(uh()+1).toString()),function(){var e=uh()-1;e<=0?document.body.removeAttribute(eo):document.body.setAttribute(eo,e.toString())}},[])},$E=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;zE();var s=p.useMemo(function(){return _E(o)},[o]);return p.createElement(LE,{styles:FE(s,!t,o,n?"":"!important")})},xu=!1;if(typeof window<"u")try{var Ni=Object.defineProperty({},"passive",{get:function(){return xu=!0,!0}});window.addEventListener("test",Ni,Ni),window.removeEventListener("test",Ni,Ni)}catch{xu=!1}var Pr=xu?{passive:!1}:!1,UE=function(e){return e.tagName==="TEXTAREA"},Qy=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!UE(e)&&n[t]==="visible")},WE=function(e){return Qy(e,"overflowY")},HE=function(e){return Qy(e,"overflowX")},dh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Gy(e,r);if(o){var s=Ky(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},BE=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},VE=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Gy=function(e,t){return e==="v"?WE(t):HE(t)},Ky=function(e,t){return e==="v"?BE(t):VE(t)},QE=function(e,t){return e==="h"&&t==="rtl"?-1:1},GE=function(e,t,n,r,o){var s=QE(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,c=t.contains(l),u=!1,f=i>0,d=0,h=0;do{var x=Ky(e,l),w=x[0],v=x[1],S=x[2],g=v-S-s*w;(w||g)&&Gy(e,l)&&(d+=g,h+=w),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(f&&(Math.abs(d)<1||!o)||!f&&(Math.abs(h)<1||!o))&&(u=!0),u},ki=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fh=function(e){return[e.deltaX,e.deltaY]},ph=function(e){return e&&"current"in e?e.current:e},KE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YE=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},qE=0,Tr=[];function XE(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(qE++)[0],s=p.useState(Vy)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=yE([e.lockRef.current],(e.shards||[]).map(ph),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var g=ki(v),m=n.current,y="deltaX"in v?v.deltaX:m[0]-g[0],C="deltaY"in v?v.deltaY:m[1]-g[1],b,E=v.target,N=Math.abs(y)>Math.abs(C)?"h":"v";if("touches"in v&&N==="h"&&E.type==="range")return!1;var j=dh(N,E);if(!j)return!0;if(j?b=N:(b=N==="v"?"h":"v",j=dh(N,E)),!j)return!1;if(!r.current&&"changedTouches"in v&&(y||C)&&(r.current=b),!b)return!0;var M=r.current||b;return GE(M,S,v,M==="h"?y:C,!0)},[]),c=p.useCallback(function(v){var S=v;if(!(!Tr.length||Tr[Tr.length-1]!==s)){var g="deltaY"in S?fh(S):ki(S),m=t.current.filter(function(b){return b.name===S.type&&(b.target===S.target||S.target===b.shadowParent)&&KE(b.delta,g)})[0];if(m&&m.should){S.cancelable&&S.preventDefault();return}if(!m){var y=(i.current.shards||[]).map(ph).filter(Boolean).filter(function(b){return b.contains(S.target)}),C=y.length>0?l(S,y[0]):!i.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=p.useCallback(function(v,S,g,m){var y={name:v,delta:S,target:g,should:m,shadowParent:ZE(g)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(C){return C!==y})},1)},[]),f=p.useCallback(function(v){n.current=ki(v),r.current=void 0},[]),d=p.useCallback(function(v){u(v.type,fh(v),v.target,l(v,e.lockRef.current))},[]),h=p.useCallback(function(v){u(v.type,ki(v),v.target,l(v,e.lockRef.current))},[]);p.useEffect(function(){return Tr.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Pr),document.addEventListener("touchmove",c,Pr),document.addEventListener("touchstart",f,Pr),function(){Tr=Tr.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,Pr),document.removeEventListener("touchmove",c,Pr),document.removeEventListener("touchstart",f,Pr)}},[]);var x=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(s,{styles:YE(o)}):null,x?p.createElement($E,{gapMode:e.gapMode}):null)}function ZE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JE=jE(By,XE);var Bd=p.forwardRef(function(e,t){return p.createElement(dl,Ut({},e,{ref:t,sideCar:JE}))});Bd.classNames=dl.classNames;var wu=["Enter"," "],ej=["ArrowDown","PageUp","Home"],Yy=["ArrowUp","PageDown","End"],tj=[...ej,...Yy],nj={ltr:[...wu,"ArrowRight"],rtl:[...wu,"ArrowLeft"]},rj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},qs="Menu",[Os,oj,sj]=Ed(qs),[Nr,qy]=dn(qs,[sj,sl,ul]),Xs=sl(),Xy=ul(),[Zy,Xn]=Nr(qs),[ij,Zs]=Nr(qs),Jy=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,l=Xs(t),[c,u]=p.useState(null),f=p.useRef(!1),d=De(s),h=Wd(o);return p.useEffect(()=>{const x=()=>{f.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>f.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),a.jsx(xy,{...l,children:a.jsx(Zy,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:u,children:a.jsx(ij,{scope:t,onClose:p.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:h,modal:i,children:r})})})};Jy.displayName=qs;var aj="MenuAnchor",Vd=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xs(n);return a.jsx(wy,{...o,...r,ref:t})});Vd.displayName=aj;var Qd="MenuPortal",[lj,ex]=Nr(Qd,{forceMount:void 0}),tx=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Xn(Qd,t);return a.jsx(lj,{scope:t,forceMount:n,children:a.jsx(It,{present:n||s.open,children:a.jsx(Xa,{asChild:!0,container:o,children:r})})})};tx.displayName=Qd;var vt="MenuContent",[cj,Gd]=Nr(vt),nx=p.forwardRef((e,t)=>{const n=ex(vt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Xn(vt,e.__scopeMenu),i=Zs(vt,e.__scopeMenu);return a.jsx(Os.Provider,{scope:e.__scopeMenu,children:a.jsx(It,{present:r||s.open,children:a.jsx(Os.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(uj,{...o,ref:t}):a.jsx(dj,{...o,ref:t})})})})}),uj=p.forwardRef((e,t)=>{const n=Xn(vt,e.__scopeMenu),r=p.useRef(null),o=ge(t,r);return p.useEffect(()=>{const s=r.current;if(s)return Uy(s)},[]),a.jsx(Kd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),dj=p.forwardRef((e,t)=>{const n=Xn(vt,e.__scopeMenu);return a.jsx(Kd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),fj=bo("MenuContent.ScrollLock"),Kd=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:x,disableOutsideScroll:w,...v}=e,S=Xn(vt,n),g=Zs(vt,n),m=Xs(n),y=Xy(n),C=oj(n),[b,E]=p.useState(null),N=p.useRef(null),j=ge(t,N,S.onContentChange),M=p.useRef(0),I=p.useRef(""),L=p.useRef(0),O=p.useRef(null),G=p.useRef("right"),D=p.useRef(0),B=w?Bd:p.Fragment,$=w?{as:fj,allowPinchZoom:!0}:void 0,R=T=>{var Qe,Oo;const _=I.current+T,W=C().filter(ut=>!ut.disabled),K=document.activeElement,ye=(Qe=W.find(ut=>ut.ref.current===K))==null?void 0:Qe.textValue,Pe=W.map(ut=>ut.textValue),fn=Nj(Pe,_,ye),_e=(Oo=W.find(ut=>ut.textValue===fn))==null?void 0:Oo.ref.current;(function ut(_o){I.current=_o,window.clearTimeout(M.current),_o!==""&&(M.current=window.setTimeout(()=>ut(""),1e3))})(_),_e&&setTimeout(()=>_e.focus())};p.useEffect(()=>()=>window.clearTimeout(M.current),[]),My();const P=p.useCallback(T=>{var W,K;return G.current===((W=O.current)==null?void 0:W.side)&&Ej(T,(K=O.current)==null?void 0:K.area)},[]);return a.jsx(cj,{scope:n,searchRef:I,onItemEnter:p.useCallback(T=>{P(T)&&T.preventDefault()},[P]),onItemLeave:p.useCallback(T=>{var _;P(T)||((_=N.current)==null||_.focus(),E(null))},[P]),onTriggerLeave:p.useCallback(T=>{P(T)&&T.preventDefault()},[P]),pointerGraceTimerRef:L,onPointerGraceIntentChange:p.useCallback(T=>{O.current=T},[]),children:a.jsx(B,{...$,children:a.jsx(Hd,{asChild:!0,trapped:o,onMountAutoFocus:U(s,T=>{var _;T.preventDefault(),(_=N.current)==null||_.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(Ks,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:x,children:a.jsx(Fy,{asChild:!0,...y,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:E,onEntryFocus:U(c,T=>{g.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Sy,{role:"menu","aria-orientation":"vertical","data-state":xx(S.open),"data-radix-menu-content":"",dir:g.dir,...m,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:U(v.onKeyDown,T=>{const W=T.target.closest("[data-radix-menu-content]")===T.currentTarget,K=T.ctrlKey||T.altKey||T.metaKey,ye=T.key.length===1;W&&(T.key==="Tab"&&T.preventDefault(),!K&&ye&&R(T.key));const Pe=N.current;if(T.target!==Pe||!tj.includes(T.key))return;T.preventDefault();const _e=C().filter(Qe=>!Qe.disabled).map(Qe=>Qe.ref.current);Yy.includes(T.key)&&_e.reverse(),Cj(_e)}),onBlur:U(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(M.current),I.current="")}),onPointerMove:U(e.onPointerMove,_s(T=>{const _=T.target,W=D.current!==T.clientX;if(T.currentTarget.contains(_)&&W){const K=T.clientX>D.current?"right":"left";G.current=K,D.current=T.clientX}}))})})})})})})});nx.displayName=vt;var pj="MenuGroup",Yd=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(ee.div,{role:"group",...r,ref:t})});Yd.displayName=pj;var hj="MenuLabel",rx=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(ee.div,{...r,ref:t})});rx.displayName=hj;var Na="MenuItem",hh="menu.itemSelect",fl=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=p.useRef(null),i=Zs(Na,e.__scopeMenu),l=Gd(Na,e.__scopeMenu),c=ge(t,s),u=p.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(hh,{bubbles:!0,cancelable:!0});d.addEventListener(hh,x=>r==null?void 0:r(x),{once:!0}),jd(d,h),h.defaultPrevented?u.current=!1:i.onClose()}};return a.jsx(ox,{...o,ref:c,disabled:n,onClick:U(e.onClick,f),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),u.current=!0},onPointerUp:U(e.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:U(e.onKeyDown,d=>{const h=l.searchRef.current!=="";n||h&&d.key===" "||wu.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});fl.displayName=Na;var ox=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Gd(Na,n),l=Xy(n),c=p.useRef(null),u=ge(t,c),[f,d]=p.useState(!1),[h,x]=p.useState("");return p.useEffect(()=>{const w=c.current;w&&x((w.textContent??"").trim())},[s.children]),a.jsx(Os.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:a.jsx(zy,{asChild:!0,...l,focusable:!r,children:a.jsx(ee.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:U(e.onPointerMove,_s(w=>{r?i.onItemLeave(w):(i.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,_s(w=>i.onItemLeave(w))),onFocus:U(e.onFocus,()=>d(!0)),onBlur:U(e.onBlur,()=>d(!1))})})})}),mj="MenuCheckboxItem",sx=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return a.jsx(ux,{scope:e.__scopeMenu,checked:n,children:a.jsx(fl,{role:"menuitemcheckbox","aria-checked":ka(n)?"mixed":n,...o,ref:t,"data-state":Zd(n),onSelect:U(o.onSelect,()=>r==null?void 0:r(ka(n)?!0:!n),{checkForDefaultPrevented:!1})})})});sx.displayName=mj;var ix="MenuRadioGroup",[gj,vj]=Nr(ix,{value:void 0,onValueChange:()=>{}}),ax=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=De(r);return a.jsx(gj,{scope:e.__scopeMenu,value:n,onValueChange:s,children:a.jsx(Yd,{...o,ref:t})})});ax.displayName=ix;var lx="MenuRadioItem",cx=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=vj(lx,e.__scopeMenu),s=n===o.value;return a.jsx(ux,{scope:e.__scopeMenu,checked:s,children:a.jsx(fl,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Zd(s),onSelect:U(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});cx.displayName=lx;var qd="MenuItemIndicator",[ux,yj]=Nr(qd,{checked:!1}),dx=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=yj(qd,n);return a.jsx(It,{present:r||ka(s.checked)||s.checked===!0,children:a.jsx(ee.span,{...o,ref:t,"data-state":Zd(s.checked)})})});dx.displayName=qd;var xj="MenuSeparator",fx=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});fx.displayName=xj;var wj="MenuArrow",px=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xs(n);return a.jsx(Cy,{...o,...r,ref:t})});px.displayName=wj;var Xd="MenuSub",[Sj,hx]=Nr(Xd),mx=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Xn(Xd,t),i=Xs(t),[l,c]=p.useState(null),[u,f]=p.useState(null),d=De(o);return p.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),a.jsx(xy,{...i,children:a.jsx(Zy,{scope:t,open:r,onOpenChange:d,content:u,onContentChange:f,children:a.jsx(Sj,{scope:t,contentId:nn(),triggerId:nn(),trigger:l,onTriggerChange:c,children:n})})})};mx.displayName=Xd;var Jo="MenuSubTrigger",gx=p.forwardRef((e,t)=>{const n=Xn(Jo,e.__scopeMenu),r=Zs(Jo,e.__scopeMenu),o=hx(Jo,e.__scopeMenu),s=Gd(Jo,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>f,[f]),p.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),c(null)}},[l,c]),a.jsx(Vd,{asChild:!0,...u,children:a.jsx(ox,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":xx(n.open),...e,ref:qa(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,_s(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:U(e.onPointerLeave,_s(d=>{var x,w;f();const h=(x=n.content)==null?void 0:x.getBoundingClientRect();if(h){const v=(w=n.content)==null?void 0:w.dataset.side,S=v==="right",g=S?-5:5,m=h[S?"left":"right"],y=h[S?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+g,y:d.clientY},{x:m,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x:m,y:h.bottom}],side:v}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,d=>{var x;const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||nj[r.dir].includes(d.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),d.preventDefault())})})})});gx.displayName=Jo;var vx="MenuSubContent",yx=p.forwardRef((e,t)=>{const n=ex(vt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Xn(vt,e.__scopeMenu),i=Zs(vt,e.__scopeMenu),l=hx(vx,e.__scopeMenu),c=p.useRef(null),u=ge(t,c);return a.jsx(Os.Provider,{scope:e.__scopeMenu,children:a.jsx(It,{present:r||s.open,children:a.jsx(Os.Slot,{scope:e.__scopeMenu,children:a.jsx(Kd,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var d;i.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:U(e.onFocusOutside,f=>{f.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:U(e.onKeyDown,f=>{var x;const d=f.currentTarget.contains(f.target),h=rj[i.dir].includes(f.key);d&&h&&(s.onOpenChange(!1),(x=l.trigger)==null||x.focus(),f.preventDefault())})})})})})});yx.displayName=vx;function xx(e){return e?"open":"closed"}function ka(e){return e==="indeterminate"}function Zd(e){return ka(e)?"indeterminate":e?"checked":"unchecked"}function Cj(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nj(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=bj(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function kj(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=f>r&&n<(u-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function Ej(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return kj(n,t)}function _s(e){return t=>t.pointerType==="mouse"?e(t):void 0}var jj=Jy,Pj=Vd,Tj=tx,Rj=nx,Mj=Yd,Ij=rx,Aj=fl,Dj=sx,Oj=ax,_j=cx,Lj=dx,Fj=fx,zj=px,$j=mx,Uj=gx,Wj=yx,Jd="DropdownMenu",[Hj,hP]=dn(Jd,[qy]),Oe=qy(),[Bj,wx]=Hj(Jd),Sx=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,c=Oe(t),u=p.useRef(null),[f=!1,d]=Mo({prop:o,defaultProp:s,onChange:i});return a.jsx(Bj,{scope:t,triggerId:nn(),triggerRef:u,contentId:nn(),open:f,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(h=>!h),[d]),modal:l,children:a.jsx(jj,{...c,open:f,onOpenChange:d,dir:r,modal:l,children:n})})};Sx.displayName=Jd;var Cx="DropdownMenuTrigger",bx=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=wx(Cx,n),i=Oe(n);return a.jsx(Pj,{asChild:!0,...i,children:a.jsx(ee.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:qa(t,s.triggerRef),onPointerDown:U(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:U(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});bx.displayName=Cx;var Vj="DropdownMenuPortal",Nx=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Oe(t);return a.jsx(Tj,{...r,...n})};Nx.displayName=Vj;var kx="DropdownMenuContent",Ex=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=wx(kx,n),s=Oe(n),i=p.useRef(!1);return a.jsx(Rj,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:U(e.onCloseAutoFocus,l=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:U(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ex.displayName=kx;var Qj="DropdownMenuGroup",Gj=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Mj,{...o,...r,ref:t})});Gj.displayName=Qj;var Kj="DropdownMenuLabel",jx=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Ij,{...o,...r,ref:t})});jx.displayName=Kj;var Yj="DropdownMenuItem",Px=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Aj,{...o,...r,ref:t})});Px.displayName=Yj;var qj="DropdownMenuCheckboxItem",Tx=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Dj,{...o,...r,ref:t})});Tx.displayName=qj;var Xj="DropdownMenuRadioGroup",Zj=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Oj,{...o,...r,ref:t})});Zj.displayName=Xj;var Jj="DropdownMenuRadioItem",Rx=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(_j,{...o,...r,ref:t})});Rx.displayName=Jj;var e2="DropdownMenuItemIndicator",Mx=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Lj,{...o,...r,ref:t})});Mx.displayName=e2;var t2="DropdownMenuSeparator",Ix=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Fj,{...o,...r,ref:t})});Ix.displayName=t2;var n2="DropdownMenuArrow",r2=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(zj,{...o,...r,ref:t})});r2.displayName=n2;var o2=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=Oe(t),[l=!1,c]=Mo({prop:r,defaultProp:s,onChange:o});return a.jsx($j,{...i,open:l,onOpenChange:c,children:n})},s2="DropdownMenuSubTrigger",Ax=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Uj,{...o,...r,ref:t})});Ax.displayName=s2;var i2="DropdownMenuSubContent",Dx=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Oe(n);return a.jsx(Wj,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Dx.displayName=i2;var a2=Sx,l2=bx,c2=Nx,Ox=Ex,_x=jx,Lx=Px,Fx=Tx,zx=Rx,$x=Mx,Ux=Ix,u2=o2,Wx=Ax,Hx=Dx;const d2=a2,f2=l2,p2=u2,Bx=p.forwardRef(({className:e,inset:t,children:n,...r},o)=>a.jsxs(Wx,{ref:o,className:te("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,a.jsx(wb,{className:"ml-auto h-4 w-4"})]}));Bx.displayName=Wx.displayName;const Vx=p.forwardRef(({className:e,...t},n)=>a.jsx(Hx,{ref:n,className:te("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Vx.displayName=Hx.displayName;const Qx=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(c2,{children:a.jsx(Ox,{ref:r,sideOffset:t,className:te("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Qx.displayName=Ox.displayName;const es=p.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(Lx,{ref:r,className:te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));es.displayName=Lx.displayName;const h2=p.forwardRef(({className:e,children:t,checked:n,...r},o)=>a.jsxs(Fx,{ref:o,className:te("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx($x,{children:a.jsx(yb,{className:"h-4 w-4"})})}),t]}));h2.displayName=Fx.displayName;const m2=p.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(zx,{ref:r,className:te("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx($x,{children:a.jsx(Cb,{className:"h-2 w-2 fill-current"})})}),t]}));m2.displayName=zx.displayName;const g2=p.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(_x,{ref:r,className:te("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));g2.displayName=_x.displayName;const Gx=p.forwardRef(({className:e,...t},n)=>a.jsx(Ux,{ref:n,className:te("-mx-1 my-1 h-px bg-muted",e),...t}));Gx.displayName=Ux.displayName;function nc({podcast:e,onPlay:t,onShare:n,isNewest:r=!1}){const[o,s]=p.useState(!1),[i,l]=p.useState(!1),[c,u]=p.useState([]),{toast:f}=qn();p.useEffect(()=>{d(),u($e.getAll())},[e]);const d=()=>{const N=h(e.url);s(We.exists(N)),l(xe.exists(N))},h=N=>N.includes("/watch?v=")?N.split("/watch?v=")[1].split("&")[0]:N.replace(/.*\//,""),x=(N,j="mqdefault")=>`https://img.youtube.com/vi/${N}/${j}.jpg`,w=N=>{const j=Math.floor(N/3600),M=Math.floor(N%3600/60),I=N%60;return j>0?`${j}:${M.toString().padStart(2,"0")}:${I.toString().padStart(2,"0")}`:`${M}:${I.toString().padStart(2,"0")}`},v=N=>N>=1e6?`${(N/1e6).toFixed(1)}M views`:N>=1e3?`${(N/1e3).toFixed(1)}K views`:`${N} views`,S=()=>{const N=h(e.url);o?(We.remove(N),s(!1),f({title:"Removed from Watch Later",description:"Podcast removed successfully"})):(We.add(e),s(!0),f({title:"Added to Watch Later",description:"Podcast saved for later viewing"}))},g=async()=>{const N=h(e.url);if(i){Ue.removeDownload(N),l(!1),f({title:"Download Removed",description:"Podcast removed from downloads"});return}try{if(f({title:"Download Started",description:"Downloading podcast for offline playback..."}),await Ue.downloadPodcast(e))l(!0),f({title:"Download Complete",description:"Podcast is now available offline"});else throw new Error("Download failed")}catch{f({title:"Download Failed",description:"Could not download the podcast",variant:"destructive"})}},m=N=>{$e.addPodcast(N,e);const j=$e.getAll().find(M=>M.id===N);f({title:"Added to Playlist",description:`Podcast added to "${j==null?void 0:j.name}"`})},y=h(e.url),C=x(y),b=w(e.duration),E=v(e.views);return a.jsxs("div",{className:"group cursor-pointer",children:[a.jsxs("div",{className:"relative mb-3",onClick:()=>t(e),children:[a.jsx("img",{src:C,alt:e.title,className:"w-full aspect-video object-cover rounded-xl hover:rounded-lg transition-all duration-200",onError:N=>{const j=N.target;j.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDMyMCAxODAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIzMjAiIGhlaWdodD0iMTgwIiBmaWxsPSIjRjNGM0YzIi8+CjxwYXRoIGQ9Ik0xNDQgNzJMMTc2IDk2TDE0NCAxMjBWNzJaIiBmaWxsPSIjRkYwMDAwIi8+Cjwvc3ZnPgo="},loading:"lazy"}),a.jsx("div",{className:"absolute bottom-2 right-2 bg-black bg-opacity-80 text-white text-xs px-2 py-1 rounded font-medium",children:b}),a.jsxs("div",{className:"absolute top-2 left-2 flex space-x-1",children:[o&&a.jsx("div",{className:"bg-blue-600 text-white text-xs px-2 py-1 rounded font-medium",children:a.jsx(tn,{className:"h-3 w-3"})}),i&&a.jsx("div",{className:"bg-green-600 text-white text-xs px-2 py-1 rounded font-medium",children:a.jsx(ot,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-0 group-hover:bg-opacity-30 transition-all duration-200 rounded-xl",children:a.jsx(Ov,{className:"h-12 w-12 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-200"})})]}),a.jsxs("div",{className:"flex space-x-3",children:[a.jsx("div",{className:"flex-shrink-0",children:e.uploaderAvatar?a.jsx("img",{src:e.uploaderAvatar,alt:e.uploaderName,className:"w-9 h-9 rounded-full"}):a.jsx("div",{className:"w-9 h-9 rounded-full bg-primary flex items-center justify-center",children:a.jsx("svg",{className:"w-5 h-5 text-primary-foreground",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-medium text-base leading-5 mb-1 line-clamp-2 text-foreground",title:e.title,children:e.title}),a.jsxs("div",{className:"flex items-center space-x-1 mb-1",children:[a.jsx("span",{className:"text-sm text-muted-foreground hover:text-foreground truncate",children:e.uploaderName}),e.uploaderVerified&&a.jsx("svg",{className:"w-3 h-3 text-muted-foreground flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[E," • ",e.uploadedDate]})]}),a.jsx("div",{className:"flex-shrink-0",children:a.jsxs(d2,{children:[a.jsx(f2,{asChild:!0,children:a.jsx(H,{variant:"ghost",size:"icon",className:"md:opacity-0 md:group-hover:opacity-100 opacity-100 transition-opacity w-8 h-8 hover:bg-accent",children:a.jsx(_v,{className:"h-4 w-4"})})}),a.jsxs(Qx,{align:"end",className:"w-56",children:[a.jsxs(es,{onClick:S,children:[a.jsx(tn,{className:"mr-2 h-4 w-4"}),o?"Remove from Watch Later":"Add to Watch Later"]}),a.jsxs(es,{onClick:g,children:[a.jsx(ot,{className:"mr-2 h-4 w-4"}),i?"Remove Download":"Download"]}),c.length>0&&a.jsxs(p2,{children:[a.jsxs(Bx,{children:[a.jsx(va,{className:"mr-2 h-4 w-4"}),"Add to Playlist"]}),a.jsx(Vx,{children:c.map(N=>a.jsx(es,{onClick:()=>m(N.id),children:N.name},N.id))})]}),a.jsx(Gx,{}),a.jsxs(es,{onClick:()=>n(e),children:[a.jsx(ya,{className:"mr-2 h-4 w-4"}),"Share"]})]})]})})]})]})}const ef="https://backendmix.vercel.app";async function v2(){const e=await fetch(`${ef}/newest`);if(!e.ok)throw new Error("Failed to fetch newest podcasts");return await e.json()}async function y2(){const e=await fetch(`${ef}/featured`);if(!e.ok)throw new Error("Failed to fetch featured podcasts");return await e.json()}async function x2(e){const t=await fetch(`${ef}/search?q=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to search podcasts");return await t.json()}function Ea(e){return e.replace("/watch?v=","")}function ja(e,t="mqdefault"){return`https://img.youtube.com/vi/${e}/${t}.jpg`}function w2(){return kd({queryKey:["podcasts","newest"],queryFn:v2,staleTime:5*60*1e3})}function S2(){return kd({queryKey:["podcasts","featured"],queryFn:y2,staleTime:5*60*1e3})}function C2(e,t=!0){return kd({queryKey:["podcasts","search",e],queryFn:()=>x2(e),enabled:t&&!!e.trim(),staleTime:2*60*1e3})}function b2({onPlayPodcast:e,onSharePodcast:t,theme:n,onToggleTheme:r,searchQuery:o}){var j,M,I;const[s,i]=p.useState(o||""),[l,c]=p.useState(!1);p.useEffect(()=>{o!==void 0&&o!==s&&(i(o),c(!!o))},[o]);const{data:u,isLoading:f,error:d,refetch:h}=w2(),{data:x,isLoading:w,error:v,refetch:S}=S2(),{data:g,isLoading:m,error:y}=C2(s,l),C=()=>{i(""),c(!1)},b=f||w||l&&m,E=d||v||l&&y,N=()=>{h(),S()};return b&&!u&&!x?a.jsx("div",{className:"min-h-screen bg-background pt-16",children:a.jsx("main",{className:"max-w-[1600px] mx-auto px-4 py-8",children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ds,{className:"animate-spin h-12 w-12 text-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading podcasts..."})]})})}):E&&!u&&!x?a.jsx("div",{className:"min-h-screen bg-background pt-16",children:a.jsx("main",{className:"max-w-[1600px] mx-auto px-4 py-8",children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Qp,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Oops! Something went wrong"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Failed to load podcasts. Please try again."}),a.jsxs(H,{onClick:N,className:"bg-primary hover:bg-primary/90 text-primary-foreground",children:[a.jsx(ds,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):a.jsx("div",{className:"min-h-screen bg-background pt-16",children:a.jsx("main",{className:"max-w-[1600px] mx-auto px-4 py-8",children:l?a.jsxs("section",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center",children:[a.jsx(Xr,{className:"text-youtube-blue mr-2"}),"Search Results"]}),a.jsxs(H,{variant:"ghost",onClick:C,className:"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",children:[a.jsx(Is,{className:"mr-1 h-4 w-4"}),"Clear"]})]}),m?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(ds,{className:"animate-spin h-8 w-8 text-youtube-red mx-auto mb-4"}),a.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Searching..."})]}):y?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Qp,{className:"h-8 w-8 text-youtube-red mx-auto mb-4"}),a.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Search failed. Please try again."})]}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:((j=g==null?void 0:g.items)==null?void 0:j.map((L,O)=>a.jsx(nc,{podcast:L,onPlay:e,onShare:t},`${L.url}-${O}`)))||[]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"mb-16",children:[a.jsx("div",{className:"flex items-center justify-between mb-8",children:a.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Latest Episodes"})}),a.jsx("div",{className:"relative",children:a.jsx("div",{className:"flex space-x-6 overflow-x-auto scrollbar-hide pb-4",style:{scrollBehavior:"smooth"},children:((M=u==null?void 0:u.items)==null?void 0:M.map((L,O)=>a.jsx("div",{className:"flex-shrink-0 w-72",children:a.jsx(nc,{podcast:L,onPlay:e,onShare:t,isNewest:!0})},`newest-${L.url}-${O}`)))||[]})})]}),a.jsxs("section",{children:[a.jsx("div",{className:"flex items-center justify-between mb-8",children:a.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Recommended"})}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:((I=x==null?void 0:x.items)==null?void 0:I.map((L,O)=>a.jsx(nc,{podcast:L,onPlay:e,onShare:t},`featured-${L.url}-${O}`)))||[]})]})]})})})}const Eo=p.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:te("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Eo.displayName="Input";var tf="Dialog",[Kx,mP]=dn(tf),[N2,At]=Kx(tf),Yx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,l=p.useRef(null),c=p.useRef(null),[u=!1,f]=Mo({prop:r,defaultProp:o,onChange:s});return a.jsx(N2,{scope:t,triggerRef:l,contentRef:c,contentId:nn(),titleId:nn(),descriptionId:nn(),open:u,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(d=>!d),[f]),modal:i,children:n})};Yx.displayName=tf;var qx="DialogTrigger",Xx=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(qx,n),s=ge(t,o.triggerRef);return a.jsx(ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":of(o.open),...r,ref:s,onClick:U(e.onClick,o.onOpenToggle)})});Xx.displayName=qx;var nf="DialogPortal",[k2,Zx]=Kx(nf,{forceMount:void 0}),Jx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=At(nf,t);return a.jsx(k2,{scope:t,forceMount:n,children:p.Children.map(r,i=>a.jsx(It,{present:n||s.open,children:a.jsx(Xa,{asChild:!0,container:o,children:i})}))})};Jx.displayName=nf;var Pa="DialogOverlay",e0=p.forwardRef((e,t)=>{const n=Zx(Pa,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=At(Pa,e.__scopeDialog);return s.modal?a.jsx(It,{present:r||s.open,children:a.jsx(j2,{...o,ref:t})}):null});e0.displayName=Pa;var E2=bo("DialogOverlay.RemoveScroll"),j2=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(Pa,n);return a.jsx(Bd,{as:E2,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(ee.div,{"data-state":of(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sr="DialogContent",t0=p.forwardRef((e,t)=>{const n=Zx(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=At(Sr,e.__scopeDialog);return a.jsx(It,{present:r||s.open,children:s.modal?a.jsx(P2,{...o,ref:t}):a.jsx(T2,{...o,ref:t})})});t0.displayName=Sr;var P2=p.forwardRef((e,t)=>{const n=At(Sr,e.__scopeDialog),r=p.useRef(null),o=ge(t,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return Uy(s)},[]),a.jsx(n0,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:U(e.onFocusOutside,s=>s.preventDefault())})}),T2=p.forwardRef((e,t)=>{const n=At(Sr,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return a.jsx(n0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),n0=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,l=At(Sr,n),c=p.useRef(null),u=ge(t,c);return My(),a.jsxs(a.Fragment,{children:[a.jsx(Hd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Ks,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":of(l.open),...i,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(R2,{titleId:l.titleId}),a.jsx(I2,{contentRef:c,descriptionId:l.descriptionId})]})]})}),rf="DialogTitle",r0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(rf,n);return a.jsx(ee.h2,{id:o.titleId,...r,ref:t})});r0.displayName=rf;var o0="DialogDescription",s0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(o0,n);return a.jsx(ee.p,{id:o.descriptionId,...r,ref:t})});s0.displayName=o0;var i0="DialogClose",a0=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(i0,n);return a.jsx(ee.button,{type:"button",...r,ref:t,onClick:U(e.onClick,()=>o.onOpenChange(!1))})});a0.displayName=i0;function of(e){return e?"open":"closed"}var l0="DialogTitleWarning",[gP,c0]=EC(l0,{contentName:Sr,titleName:rf,docsSlug:"dialog"}),R2=({titleId:e})=>{const t=c0(l0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},M2="DialogDescriptionWarning",I2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c0(M2).contentName}}.`;return p.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},A2=Yx,D2=Xx,O2=Jx,u0=e0,d0=t0,f0=r0,p0=s0,_2=a0;const Su=A2,L2=D2,F2=O2,h0=p.forwardRef(({className:e,...t},n)=>a.jsx(u0,{ref:n,className:te("fixed inset-0 z-[200] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));h0.displayName=u0.displayName;const Ta=p.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(F2,{children:[a.jsx(h0,{}),a.jsxs(d0,{ref:r,className:te("fixed left-[50%] top-[50%] z-[210] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(_2,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Is,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ta.displayName=d0.displayName;const Ra=({className:e,...t})=>a.jsx("div",{className:te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ra.displayName="DialogHeader";const Ma=p.forwardRef(({className:e,...t},n)=>a.jsx(f0,{ref:n,className:te("text-lg font-semibold leading-none tracking-tight",e),...t}));Ma.displayName=f0.displayName;const z2=p.forwardRef(({className:e,...t},n)=>a.jsx(p0,{ref:n,className:te("text-sm text-muted-foreground",e),...t}));z2.displayName=p0.displayName;const Cu=p.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:te("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Cu.displayName="Textarea";var sf="Tabs",[$2,vP]=dn(sf,[ul]),m0=ul(),[U2,af]=$2(sf),g0=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:c="automatic",...u}=e,f=Wd(l),[d,h]=Mo({prop:r,onChange:o,defaultProp:s});return a.jsx(U2,{scope:n,baseId:nn(),value:d,onValueChange:h,orientation:i,dir:f,activationMode:c,children:a.jsx(ee.div,{dir:f,"data-orientation":i,...u,ref:t})})});g0.displayName=sf;var v0="TabsList",y0=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=af(v0,n),i=m0(n);return a.jsx(Fy,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:a.jsx(ee.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});y0.displayName=v0;var x0="TabsTrigger",w0=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=af(x0,n),l=m0(n),c=b0(i.baseId,r),u=N0(i.baseId,r),f=r===i.value;return a.jsx(zy,{asChild:!0,...l,focusable:!o,active:f,children:a.jsx(ee.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:U(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:U(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:U(e.onFocus,()=>{const d=i.activationMode!=="manual";!f&&!o&&d&&i.onValueChange(r)})})})});w0.displayName=x0;var S0="TabsContent",C0=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,l=af(S0,n),c=b0(l.baseId,r),u=N0(l.baseId,r),f=r===l.value,d=p.useRef(f);return p.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),a.jsx(It,{present:o||f,children:({present:h})=>a.jsx(ee.div,{"data-state":f?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&s})})});C0.displayName=S0;function b0(e,t){return`${e}-trigger-${t}`}function N0(e,t){return`${e}-content-${t}`}var W2=g0,k0=y0,E0=w0,j0=C0;const H2=W2,P0=p.forwardRef(({className:e,...t},n)=>a.jsx(k0,{ref:n,className:te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));P0.displayName=k0.displayName;const Hi=p.forwardRef(({className:e,...t},n)=>a.jsx(E0,{ref:n,className:te("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Hi.displayName=E0.displayName;const Bi=p.forwardRef(({className:e,...t},n)=>a.jsx(j0,{ref:n,className:te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Bi.displayName=j0.displayName;function Ia({podcast:e,onPlay:t,onShare:n,isNewest:r=!1}){const o=w=>w.replace("/watch?v=",""),s=(w,v="mqdefault")=>`https://img.youtube.com/vi/${w}/${v}.jpg`,i=w=>{const v=Math.floor(w/3600),S=Math.floor(w%3600/60),g=w%60;return v>0?`${v}:${S.toString().padStart(2,"0")}:${g.toString().padStart(2,"0")}`:`${S}:${g.toString().padStart(2,"0")}`},l=w=>w>=1e6?`${(w/1e6).toFixed(1)}M views`:w>=1e3?`${(w/1e3).toFixed(1)}K views`:`${w} views`,c=o(e.url),u=s(c),f=i(e.duration),d=l(e.views),h=()=>{t(e)},x=w=>{w.stopPropagation(),n(e)};return a.jsxs("div",{className:"group cursor-pointer",onClick:h,children:[a.jsxs("div",{className:"relative mb-3",children:[a.jsx("img",{src:u,alt:e.title,className:"w-full aspect-video object-cover rounded-xl hover:rounded-lg transition-all duration-200",onError:w=>{const v=w.target;v.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDMyMCAxODAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIzMjAiIGhlaWdodD0iMTgwIiBmaWxsPSIjRjNGM0YzIi8+CjxwYXRoIGQ9Ik0xNDQgNzJMMTc2IDk2TDE0NCAxMjBWNzJaIiBmaWxsPSIjRkYwMDAwIi8+Cjwvc3ZnPgo="},loading:"lazy"}),a.jsx("div",{className:"absolute bottom-2 right-2 bg-black bg-opacity-80 text-white text-xs px-2 py-1 rounded font-medium",children:f})]}),a.jsxs("div",{className:"flex space-x-3",children:[a.jsx("div",{className:"flex-shrink-0",children:e.uploaderAvatar?a.jsx("img",{src:e.uploaderAvatar,alt:e.uploaderName,className:"w-9 h-9 rounded-full"}):a.jsx("div",{className:"w-9 h-9 rounded-full bg-youtube-red flex items-center justify-center",children:a.jsx("svg",{className:"w-5 h-5 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-medium text-base leading-5 mb-1 line-clamp-2 text-gray-900 dark:text-white",title:e.title,children:e.title}),a.jsxs("div",{className:"flex items-center space-x-1 mb-1",children:[a.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white truncate",children:e.uploaderName}),e.uploaderVerified&&a.jsx("svg",{className:"w-3 h-3 text-gray-600 dark:text-gray-400 flex-shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),a.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:[d," • ",e.uploadedDate]})]}),a.jsx("div",{className:"flex-shrink-0",children:a.jsx(H,{onClick:x,variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 transition-opacity w-8 h-8 hover:bg-gray-100 dark:hover:bg-gray-800",children:a.jsx(_v,{className:"h-4 w-4 text-gray-600 dark:text-gray-300"})})})]})]})}function B2(){const[e,t]=p.useState(0),[n,r]=p.useState(!1),[o,s]=p.useState(!1),{toast:i}=qn();p.useEffect(()=>{r(or.isSupported()),s(Et.isActive()),Et.isActive()&&l()},[]);const l=async()=>{const u=await Et.getCacheSize();t(u)},c=async()=>{try{await Et.clearCache(),t(0),i({title:"Cache Cleared",description:"All offline audio has been removed"})}catch{i({title:"Error",description:"Failed to clear cache",variant:"destructive"})}};return n?a.jsx("div",{className:"bg-muted/50 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Pb,{className:"h-4 w-4"}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-sm font-medium",children:["Offline Storage: ",Et.formatCacheSize(e)]}),a.jsx("div",{className:"text-xs text-muted-foreground",children:o?"Service Worker Active":"Service Worker Inactive"})]})]}),e>0&&a.jsxs(H,{onClick:c,variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",children:[a.jsx(fs,{className:"h-3 w-3 mr-1"}),"Clear"]})]})}):a.jsx("div",{className:"bg-muted/50 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(ot,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Offline playback not supported in this browser"})]})})}function V2({onPlayPodcast:e,onSharePodcast:t,theme:n,onToggleTheme:r}){const[o,s]=p.useState([]),[i,l]=p.useState([]),[c,u]=p.useState([]),[f,d]=p.useState(null),[h,x]=p.useState(!1),[w,v]=p.useState(!1),[S,g]=p.useState(""),[m,y]=p.useState(""),[C,b]=p.useState("playlists");p.useState("");const{toast:E}=qn();p.useEffect(()=>{N()},[]);const N=()=>{s($e.getAll()),l(We.getAll()),u(xe.getAll())},j=()=>{if(!S.trim()){E({title:"Error",description:"Please enter a playlist name",variant:"destructive"});return}const R=$e.create(S.trim(),m.trim());s($e.getAll()),g(""),y(""),x(!1),E({title:"Success",description:`Playlist "${R.name}" created successfully`})},M=()=>{!f||!S.trim()||($e.update(f.id,{name:S.trim(),description:m.trim()}),s($e.getAll()),v(!1),d(null),g(""),y(""),E({title:"Success",description:"Playlist updated successfully"}))},I=R=>{confirm(`Are you sure you want to delete "${R.name}"?`)&&($e.delete(R.id),s($e.getAll()),E({title:"Success",description:`Playlist "${R.name}" deleted successfully`}))},L=R=>{d(R),g(R.name),y(R.description||""),v(!0)},O=R=>({url:R.url,type:R.type,title:R.title,thumbnail:R.thumbnail,uploaderName:R.uploaderName,uploaderUrl:R.uploaderUrl,uploaderAvatar:R.uploaderAvatar,uploadedDate:R.uploadedDate,shortDescription:R.shortDescription,duration:R.duration,views:R.views,uploaded:R.uploaded,uploaderVerified:R.uploaderVerified,isShort:R.isShort}),G=()=>{const R=i.map(T=>T.podcastId);return Vt.getMultiple(R).map(O)},D=()=>{const R=c.map(T=>T.podcastId);return Vt.getMultiple(R).map(O)},B=R=>{const P=R.url.includes("/watch?v=")?R.url.split("/watch?v=")[1].split("&")[0]:R.url.replace(/.*\//,"");We.remove(P),N(),E({title:"Removed",description:"Podcast removed from Watch Later"})},$=R=>{const P=R.url.includes("/watch?v=")?R.url.split("/watch?v=")[1].split("&")[0]:R.url.replace(/.*\//,"");xe.remove(P),N(),E({title:"Removed",description:"Download removed from library"})};return a.jsx("div",{className:"min-h-screen bg-background pt-16",children:a.jsxs("div",{className:"max-w-[1600px] mx-auto px-4 py-4 md:py-8",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between mb-6 md:mb-8 space-y-4 md:space-y-0",children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground",children:"Library"}),a.jsxs(Su,{open:h,onOpenChange:x,children:[a.jsx(L2,{asChild:!0,children:a.jsxs(H,{className:"flex items-center space-x-2",children:[a.jsx(va,{className:"h-4 w-4"}),a.jsx("span",{children:"Create Playlist"})]})}),a.jsxs(Ta,{className:"sm:max-w-md",children:[a.jsx(Ra,{children:a.jsx(Ma,{children:"Create New Playlist"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Eo,{placeholder:"Playlist name",value:S,onChange:R=>g(R.target.value)}),a.jsx(Cu,{placeholder:"Description (optional)",value:m,onChange:R=>y(R.target.value),rows:3}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx(H,{onClick:j,className:"flex-1",children:"Create"}),a.jsx(H,{variant:"outline",onClick:()=>{x(!1),g(""),y("")},className:"flex-1",children:"Cancel"})]})]})]})]})]}),a.jsxs(H2,{value:C,onValueChange:b,className:"w-full",children:[a.jsx("div",{className:"md:hidden mb-6",children:a.jsxs("div",{className:"flex flex-col space-y-2",children:[a.jsx("button",{onClick:()=>b("playlists"),className:`flex items-center justify-between p-4 rounded-lg transition-colors ${C==="playlists"?"bg-primary/10 border border-primary/20":"bg-muted/50 hover:bg-muted"}`,children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Bp,{className:`h-5 w-5 ${C==="playlists"?"text-primary":"text-muted-foreground"}`}),a.jsxs("div",{className:"text-left",children:[a.jsx("p",{className:`font-medium ${C==="playlists"?"text-primary":"text-foreground"}`,children:"Playlists"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[o.length," playlists"]})]})]})}),a.jsx("button",{onClick:()=>b("watchLater"),className:`flex items-center justify-between p-4 rounded-lg transition-colors ${C==="watchLater"?"bg-primary/10 border border-primary/20":"bg-muted/50 hover:bg-muted"}`,children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(tn,{className:`h-5 w-5 ${C==="watchLater"?"text-primary":"text-muted-foreground"}`}),a.jsxs("div",{className:"text-left",children:[a.jsx("p",{className:`font-medium ${C==="watchLater"?"text-primary":"text-foreground"}`,children:"Watch Later"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," podcasts"]})]})]})}),a.jsx("button",{onClick:()=>b("downloads"),className:`flex items-center justify-between p-4 rounded-lg transition-colors ${C==="downloads"?"bg-primary/10 border border-primary/20":"bg-muted/50 hover:bg-muted"}`,children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ot,{className:`h-5 w-5 ${C==="downloads"?"text-primary":"text-muted-foreground"}`}),a.jsxs("div",{className:"text-left",children:[a.jsx("p",{className:`font-medium ${C==="downloads"?"text-primary":"text-foreground"}`,children:"Downloads"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.length," podcasts"]})]})]})})]})}),a.jsxs(P0,{className:"hidden md:grid w-full grid-cols-3 mb-6 md:mb-8 h-auto",children:[a.jsxs(Hi,{value:"playlists",className:"flex items-center justify-center space-x-1 md:space-x-2 text-xs md:text-sm font-medium py-2 md:py-3",children:[a.jsx(Bp,{className:"h-3 w-3 md:h-4 md:w-4"}),a.jsxs("span",{children:["Playlists (",o.length,")"]})]}),a.jsxs(Hi,{value:"watchLater",className:"flex items-center justify-center space-x-1 md:space-x-2 text-xs md:text-sm font-medium py-2 md:py-3",children:[a.jsx(tn,{className:"h-3 w-3 md:h-4 md:w-4"}),a.jsxs("span",{children:["Watch Later (",i.length,")"]})]}),a.jsxs(Hi,{value:"downloads",className:"flex items-center justify-center space-x-1 md:space-x-2 text-xs md:text-sm font-medium py-2 md:py-3",children:[a.jsx(ot,{className:"h-3 w-3 md:h-4 md:w-4"}),a.jsxs("span",{children:["Downloads (",c.length,")"]})]})]}),a.jsx(Bi,{value:"playlists",className:"mt-4 md:mt-8",children:o.length===0?a.jsxs("div",{className:"text-center py-16",children:[a.jsx(jb,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No playlists yet"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Create your first playlist to organize your podcasts"}),a.jsxs(H,{onClick:()=>x(!0),children:[a.jsx(va,{className:"h-4 w-4 mr-2"}),"Create Playlist"]})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6",children:o.map(R=>{const P=R.podcastIds.length,T=P>0?Vt.get(R.podcastIds[0]):null;return a.jsxs("div",{className:"group cursor-pointer",children:[a.jsxs("div",{className:"relative mb-3",children:[T?a.jsx("img",{src:T.thumbnail,alt:R.name,className:"w-full aspect-video object-cover rounded-xl"}):a.jsx("div",{className:"w-full aspect-video bg-muted rounded-xl flex items-center justify-center",children:a.jsx($v,{className:"h-12 w-12 text-muted-foreground"})}),a.jsxs("div",{className:"absolute bottom-2 right-2 bg-black bg-opacity-80 text-white text-xs px-2 py-1 rounded font-medium",children:[P," podcast",P!==1?"s":""]})]}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-medium text-base leading-5 mb-1 line-clamp-2 text-foreground",children:R.name}),R.description&&a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-1",children:R.description}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created ",new Date(R.createdAt).toLocaleDateString()]})]}),a.jsxs("div",{className:"flex items-center space-x-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[a.jsx(H,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>L(R),children:a.jsx(_b,{className:"h-4 w-4"})}),a.jsx(H,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>I(R),children:a.jsx(fs,{className:"h-4 w-4"})})]})]})]},R.id)})})}),a.jsx(Bi,{value:"watchLater",className:"mt-4 md:mt-8",children:i.length===0?a.jsxs("div",{className:"text-center py-8 md:py-16",children:[a.jsx(tn,{className:"h-12 w-12 md:h-16 md:w-16 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-lg md:text-xl font-semibold mb-2",children:"No podcasts in Watch Later"}),a.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Save podcasts to watch them later"})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6",children:G().map((R,P)=>a.jsxs("div",{className:"relative",children:[a.jsx(Ia,{podcast:R,onPlay:e,onShare:t}),a.jsx(H,{variant:"secondary",size:"sm",className:"absolute top-2 right-2 z-10",onClick:()=>B(R),children:a.jsx(fs,{className:"h-3 w-3"})})]},`watchlater-${P}`))})}),a.jsxs(Bi,{value:"downloads",className:"mt-4 md:mt-8",children:[a.jsx("div",{className:"mb-6",children:a.jsx(B2,{})}),c.length===0?a.jsxs("div",{className:"text-center py-8 md:py-16",children:[a.jsx(ot,{className:"h-12 w-12 md:h-16 md:w-16 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-lg md:text-xl font-semibold mb-2",children:"No downloaded podcasts"}),a.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Download podcasts for offline listening"})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6",children:D().map((R,P)=>a.jsxs("div",{className:"relative",children:[a.jsx(Ia,{podcast:R,onPlay:e,onShare:t}),a.jsxs("div",{className:"absolute top-2 left-2 bg-green-600 text-white text-xs px-2 py-1 rounded font-medium z-10 flex items-center space-x-1",children:[a.jsx(ot,{className:"h-3 w-3"}),a.jsx("span",{children:"Offline"})]}),a.jsx(H,{variant:"secondary",size:"sm",className:"absolute top-2 right-2 z-10",onClick:()=>$(R),children:a.jsx(fs,{className:"h-3 w-3"})})]},`download-${P}`))})]})]}),a.jsx(Su,{open:w,onOpenChange:v,children:a.jsxs(Ta,{className:"sm:max-w-md",children:[a.jsx(Ra,{children:a.jsx(Ma,{children:"Edit Playlist"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Eo,{placeholder:"Playlist name",value:S,onChange:R=>g(R.target.value)}),a.jsx(Cu,{placeholder:"Description (optional)",value:m,onChange:R=>y(R.target.value),rows:3}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx(H,{onClick:M,className:"flex-1",children:"Save Changes"}),a.jsx(H,{variant:"outline",onClick:()=>{v(!1),d(null),g(""),y("")},className:"flex-1",children:"Cancel"})]})]})]})})]})})}function Q2({onPlayPodcast:e,onSharePodcast:t,theme:n,onToggleTheme:r}){const[o,s]=p.useState([]),[i,l]=p.useState([]),[c,u]=p.useState(""),[f,d]=p.useState("all"),{toast:h}=qn();p.useEffect(()=>{x()},[]),p.useEffect(()=>{w()},[o,c,f]);const x=()=>{const m=ba.getAll();s(m)},w=()=>{let m=o;f==="completed"?m=m.filter(y=>y.completed):f==="incomplete"&&(m=m.filter(y=>!y.completed)),c.trim()&&(m=m.filter(y=>{const C=Vt.get(y.podcastId);if(!C)return!1;const b=c.toLowerCase();return C.title.toLowerCase().includes(b)||C.uploaderName.toLowerCase().includes(b)})),l(m)},v=()=>{confirm("Are you sure you want to clear all history? This action cannot be undone.")&&(ba.clear(),s([]),h({title:"History Cleared",description:"All viewing history has been deleted"}))},S=m=>{const y=new Date(m),b=(new Date().getTime()-y.getTime())/(1e3*60*60);return b<24?`${Math.floor(b)} hours ago`:b<48?"Yesterday":y.toLocaleDateString()},g=m=>m.totalDuration===0?0:Math.round(m.duration/m.totalDuration*100);return a.jsx("div",{className:"min-h-screen bg-background pt-16",children:a.jsxs("div",{className:"max-w-[1600px] mx-auto px-4 py-4 md:py-8",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between mb-6 md:mb-8 space-y-4 md:space-y-0",children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground",children:"Watch History"}),a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs(H,{variant:"outline",onClick:v,disabled:o.length===0,children:[a.jsx(fs,{className:"h-4 w-4 mr-2"}),"Clear History"]})})]}),a.jsxs("div",{className:"mb-6 md:mb-8 space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Xr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(Eo,{placeholder:"Search history...",value:c,onChange:m=>u(m.target.value),className:"pl-10"})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs(H,{variant:f==="all"?"default":"outline",size:"sm",onClick:()=>d("all"),className:"text-xs md:text-sm",children:["All (",o.length,")"]}),a.jsxs(H,{variant:f==="completed"?"default":"outline",size:"sm",onClick:()=>d("completed"),className:"text-xs md:text-sm",children:[a.jsx(fu,{className:"h-3 w-3 md:h-4 md:w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Completed"}),a.jsx("span",{className:"sm:hidden",children:"Done"})," (",o.filter(m=>m.completed).length,")"]}),a.jsxs(H,{variant:f==="incomplete"?"default":"outline",size:"sm",onClick:()=>d("incomplete"),className:"text-xs md:text-sm",children:[a.jsx(Ov,{className:"h-3 w-3 md:h-4 md:w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"In Progress"}),a.jsx("span",{className:"sm:hidden",children:"Playing"})," (",o.filter(m=>!m.completed).length,")"]})]})]}),i.length===0?a.jsx("div",{className:"text-center py-16",children:o.length===0?a.jsxs(a.Fragment,{children:[a.jsx(tn,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No watch history"}),a.jsx("p",{className:"text-muted-foreground",children:"Your viewing history will appear here"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Xr,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No results found"}),a.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search or filter"})]})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6",children:i.map(m=>{const y=Vt.get(m.podcastId);if(!y)return null;const C=g(m),b={url:y.url,type:y.type,title:y.title,thumbnail:y.thumbnail,uploaderName:y.uploaderName,uploaderUrl:y.uploaderUrl,uploaderAvatar:y.uploaderAvatar,uploadedDate:y.uploadedDate,shortDescription:y.shortDescription,duration:y.duration,views:y.views,uploaded:y.uploaded,uploaderVerified:y.uploaderVerified,isShort:y.isShort};return a.jsxs("div",{className:"relative",children:[a.jsx(Ia,{podcast:b,onPlay:e,onShare:t}),m.duration>0&&a.jsx("div",{className:"absolute bottom-16 left-0 right-0 mx-3",children:a.jsx("div",{className:"bg-background/80 rounded-sm p-1",children:a.jsx("div",{className:"h-1 bg-primary rounded-sm",style:{width:`${C}%`}})})}),a.jsxs("div",{className:"absolute top-2 left-2 bg-background/90 text-foreground text-xs px-2 py-1 rounded font-medium z-10 flex items-center space-x-1",children:[a.jsx(Dv,{className:"h-3 w-3"}),a.jsx("span",{children:S(m.watchedAt)})]}),m.completed&&a.jsxs("div",{className:"absolute top-2 right-2 bg-green-600 text-white text-xs px-2 py-1 rounded font-medium z-10 flex items-center space-x-1",children:[a.jsx(fu,{className:"h-3 w-3"}),a.jsx("span",{className:"hidden sm:inline",children:"Done"})]})]},m.id)})})]})})}function G2(){return a.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("div",{className:"w-32 h-32 bg-gradient-to-br from-blue-600 to-purple-600 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx("span",{className:"text-white font-bold text-4xl",children:"S"})}),a.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"About VELIN"}),a.jsx("p",{className:"text-xl text-muted-foreground",children:"A modern podcast streaming experience built with passion"})]}),a.jsxs("div",{className:"bg-card rounded-xl p-6 mb-8 border border-border",children:[a.jsxs("h2",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:[a.jsx(bb,{className:"h-6 w-6"}),"About VELIN"]}),a.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"VELIN is a YouTube-style podcast streaming Progressive Web App (PWA) designed to provide an exceptional audio content discovery and playback experience. Built with modern web technologies, it offers seamless offline support, responsive design, and intuitive navigation for podcast enthusiasts."}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:[a.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Key Features"}),a.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsx("li",{children:"• Offline playback support"}),a.jsx("li",{children:"• Progressive Web App"}),a.jsx("li",{children:"• Responsive mobile-first design"}),a.jsx("li",{children:"• Advanced audio streaming"}),a.jsx("li",{children:"• Library management"})]})]}),a.jsxs("div",{className:"bg-muted/50 rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Technologies"}),a.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsx("li",{children:"• React with TypeScript"}),a.jsx("li",{children:"• Service Worker"}),a.jsx("li",{children:"• IndexedDB storage"}),a.jsx("li",{children:"• Modern React hooks"}),a.jsx("li",{children:"• Tailwind CSS"})]})]})]})]}),a.jsxs("div",{className:"bg-card rounded-xl p-6 border border-border",children:[a.jsxs("h2",{className:"text-2xl font-semibold text-foreground mb-4 flex items-center gap-2",children:[a.jsx(tl,{className:"h-6 w-6"}),"About the Developer"]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-green-500 to-blue-500 rounded-full flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-white font-bold text-xl",children:"S"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Shashwat"}),a.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Hi! I'm Shashwat, the developer behind VELIN. I'm passionate about creating intuitive and powerful web applications that enhance the way people consume digital content. This podcast player represents my vision of what modern audio streaming should look like."}),a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Tb,{className:"h-4 w-4"}),a.jsx("span",{children:"Passionate Developer"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Nb,{className:"h-4 w-4"}),a.jsx("span",{children:"Coffee Enthusiast"})]})]})]})]})]}),a.jsxs("div",{className:"text-center mt-12 p-6 bg-gradient-to-r from-blue-600/10 to-purple-600/10 rounded-xl",children:[a.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-4",children:"Mission"}),a.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed max-w-2xl mx-auto",children:"To democratize podcast consumption by providing a free, open, and accessible platform that works seamlessly across all devices, with or without an internet connection."})]})]})}const T0=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:te("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));T0.displayName="Card";const K2=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:te("flex flex-col space-y-1.5 p-6",e),...t}));K2.displayName="CardHeader";const Y2=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:te("text-2xl font-semibold leading-none tracking-tight",e),...t}));Y2.displayName="CardTitle";const q2=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:te("text-sm text-muted-foreground",e),...t}));q2.displayName="CardDescription";const R0=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:te("p-6 pt-0",e),...t}));R0.displayName="CardContent";const X2=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:te("flex items-center p-6 pt-0",e),...t}));X2.displayName="CardFooter";function Z2(){return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:a.jsx(T0,{className:"w-full max-w-md mx-4",children:a.jsxs(R0,{className:"pt-6",children:[a.jsxs("div",{className:"flex mb-4 gap-2",children:[a.jsx(Sb,{className:"h-8 w-8 text-red-500"}),a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),a.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function J2({onPlay:e}){const[t,n]=OS("/podcast/:id"),[r,o]=p.useState(null),[s,i]=p.useState(!0),[l,c]=p.useState(!1),[u,f]=p.useState(!1),{toast:d}=qn();p.useEffect(()=>{(async()=>{if(n!=null&&n.id){i(!0);try{const E=await Ue.getPodcastMetadata(n.id);if(E){o(E),c(We.exists(n.id)),f(Ue.isPodcastAvailableOffline(n.id)),i(!1);return}const N=await fetch(`https://backendmix.vercel.app/streams/${n.id}`);if(N.ok){const j=await N.json(),M={url:`https://www.youtube.com/watch?v=${n.id}`,type:"youtube",title:j.title||"Unknown Title",thumbnail:j.thumbnail||ja(n.id),uploaderName:j.uploader||"Unknown Creator",uploaderUrl:j.uploaderUrl||"",uploaderAvatar:j.uploaderAvatar||null,uploadedDate:j.uploadDate||"Unknown Date",shortDescription:j.description||"No description available",duration:j.duration||0,views:j.viewCount||0,uploaded:Date.now(),uploaderVerified:j.uploaderVerified||!1,isShort:!1};o(M),c(We.exists(n.id)),f(Ue.isPodcastAvailableOffline(n.id))}else throw new Error("Podcast not found")}catch(E){console.error("Failed to fetch podcast:",E),d({title:"Error",description:"Could not load podcast details",variant:"destructive"})}finally{i(!1)}}})()},[n==null?void 0:n.id,d]);const h=()=>{!r||!(n!=null&&n.id)||(l?(We.remove(n.id),c(!1),d({title:"Removed from Watch Later",description:"Podcast removed successfully"})):(We.add(r),c(!0),d({title:"Added to Watch Later",description:"Podcast saved for later viewing"})))},x=async()=>{if(!(!r||!(n!=null&&n.id))){if(u){Ue.removeDownload(n.id),f(!1),d({title:"Download Removed",description:"Podcast removed from downloads"});return}try{if(d({title:"Download Started",description:"Downloading podcast for offline playback..."}),await Ue.downloadPodcast(r))f(!0),d({title:"Download Complete",description:"Podcast is now available offline"});else throw new Error("Download failed")}catch{d({title:"Download Failed",description:"Could not download the podcast",variant:"destructive"})}}},w=async()=>{if(!r||!(n!=null&&n.id))return;const b={title:r.title,text:`Check out this podcast: ${r.title}`,url:`${window.location.origin}/podcast/${n.id}`};try{navigator.share?await navigator.share(b):(await navigator.clipboard.writeText(b.url),d({title:"Link Copied",description:"Podcast link copied to clipboard"}))}catch(E){console.error("Share failed:",E)}};if(s)return a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading podcast details..."})]})});if(!r)return a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Podcast Not Found"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"The podcast you're looking for doesn't exist or has been removed."}),a.jsxs(H,{onClick:()=>window.history.back(),children:[a.jsx(Hp,{className:"h-4 w-4 mr-2"}),"Go Back"]})]})});const v=Ea(r.url),S=ja(v),g=b=>{const E=Math.floor(b/60),N=Math.floor(b%60);return`${E}:${N.toString().padStart(2,"0")}`},m=b=>b>=1e6?`${(b/1e6).toFixed(1)}M`:b>=1e3?`${(b/1e3).toFixed(1)}K`:b.toString(),y=g(r.duration),C=m(r.views);return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("div",{className:"border-b border-border p-4",children:a.jsxs(H,{onClick:()=>window.history.back(),variant:"ghost",size:"sm",className:"mb-4",children:[a.jsx(Hp,{className:"h-4 w-4 mr-2"}),"Back"]})}),a.jsx("div",{className:"container mx-auto px-4 py-8",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsxs("div",{className:"relative aspect-video bg-muted rounded-xl overflow-hidden mb-6",children:[a.jsx("img",{src:S,alt:r.title,className:"w-full h-full object-cover",onError:b=>{const E=b.target;E.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjI4OCIgdmlld0JveD0iMCAwIDUxMiAyODgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iMjg4IiBmaWxsPSIjRjNGM0YzIi8+CjxwYXRoIGQ9Ik0yMTYgMTIwTDI5NiAxNDRMMjE2IDE2OFYxMjBaIiBmaWxsPSIjMDA3YmZmIi8+Cjwvc3ZnPgo="}}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-30",children:a.jsx(H,{onClick:()=>e(r),size:"lg",className:"bg-primary text-primary-foreground hover:bg-primary/90 rounded-full w-20 h-20 flex items-center justify-center shadow-lg",children:a.jsx(ga,{className:"h-8 w-8 ml-1"})})}),a.jsx("div",{className:"absolute bottom-4 right-4 bg-black bg-opacity-80 text-white text-sm px-2 py-1 rounded font-medium",children:y})]}),a.jsx("h1",{className:"text-2xl md:text-3xl font-bold mb-4",children:r.title}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground mb-6",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(kb,{className:"h-4 w-4"}),a.jsxs("span",{children:[C," views"]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Dv,{className:"h-4 w-4"}),a.jsx("span",{children:r.uploadedDate})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-3 mb-6",children:[a.jsxs(H,{onClick:()=>e(r),size:"lg",className:"bg-primary text-primary-foreground hover:bg-primary/90",children:[a.jsx(ga,{className:"h-4 w-4 mr-2"}),"Play Now"]}),a.jsxs(H,{onClick:h,variant:"outline",className:l?"text-blue-500 border-blue-500":"",children:[a.jsx(tn,{className:"h-4 w-4 mr-2"}),l?"Remove from Watch Later":"Watch Later"]}),a.jsxs(H,{onClick:x,variant:"outline",className:u?"text-green-500 border-green-500":"",children:[a.jsx(ot,{className:"h-4 w-4 mr-2"}),u?"Downloaded":"Download"]}),a.jsxs(H,{onClick:w,variant:"outline",children:[a.jsx(ya,{className:"h-4 w-4 mr-2"}),"Share"]})]}),a.jsxs("div",{className:"bg-muted rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold mb-2",children:"Description"}),a.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:r.shortDescription||"No description available."})]})]}),a.jsxs("div",{className:"lg:col-span-1",children:[a.jsx("div",{className:"bg-card border border-border rounded-lg p-4 mb-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[r.uploaderAvatar?a.jsx("img",{src:r.uploaderAvatar,alt:r.uploaderName,className:"w-12 h-12 rounded-full"}):a.jsx("div",{className:"w-12 h-12 rounded-full bg-primary flex items-center justify-center",children:a.jsx(tl,{className:"h-6 w-6 text-primary-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[a.jsx("h3",{className:"font-semibold truncate",children:r.uploaderName}),r.uploaderVerified&&a.jsx(fu,{className:"h-4 w-4 text-blue-500 flex-shrink-0"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Content Creator"})]})]})}),a.jsxs("div",{className:"space-y-3",children:[u&&a.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-center gap-2 text-green-700 dark:text-green-400",children:[a.jsx(ot,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Available Offline"})]})}),l&&a.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-center gap-2 text-blue-700 dark:text-blue-400",children:[a.jsx(tn,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"In Watch Later"})]})})]})]})]})})]})}function eP({podcast:e,isPlaying:t,isLoading:n,onTogglePlay:r,onOpenFullPlayer:o}){const s=Ea(e.url),i=ja(s);return a.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-card/95 backdrop-blur-lg border-t border-border z-50",children:a.jsxs("div",{className:"flex items-center gap-3 p-2",children:[a.jsx("div",{className:"cursor-pointer flex-shrink-0",onClick:o,children:a.jsx("img",{src:i,alt:e.title,className:"w-16 h-9 object-cover rounded-md",style:{aspectRatio:"16/9"},onError:l=>{const c=l.target;c.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iNDUiIHZpZXdCb3g9IjAgMCA4MCA0NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjQ1IiBmaWxsPSIjRjNGM0YzIi8+CjxwYXRoIGQ9Ik0zMiAxOEw0OCAyMi41TDMyIDI3VjE4WiIgZmlsbD0iIzAwN2JmZiIvPgo8L3N2Zz4K"}})}),a.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:o,children:[a.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:e.title}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:e.uploaderName})]}),a.jsx(H,{onClick:r,disabled:n,className:"bg-primary text-primary-foreground hover:bg-primary/90 rounded-full w-10 h-10 flex-shrink-0",size:"sm",children:n?a.jsx(ds,{className:"h-4 w-4 animate-spin"}):t?a.jsx(Uv,{className:"h-4 w-4"}):a.jsx(ga,{className:"h-4 w-4 ml-0.5"})})]})})}function tP({podcast:e,audioUrl:t,isOpen:n,isPlaying:r,isLoading:o,currentTime:s,duration:i,audioRef:l,onClose:c,onShare:u,onTogglePlay:f}){const[d,h]=p.useState(1),[x,w]=p.useState(!1),[v,S]=p.useState(!1),[g,m]=p.useState(!1),{toast:y}=qn(),C=Ea(e.url),b=i>0?s/i*100:0,E=Ea(e.url),N=ja(E);p.useEffect(()=>{S(We.exists(C)),m(Ue.isPodcastAvailableOffline(C))},[C]);const j=()=>{l.current&&(l.current.currentTime=Math.max(0,l.current.currentTime-10))},M=()=>{l.current&&(l.current.currentTime=Math.min(l.current.duration,l.current.currentTime+10))},I=B=>{if(!l.current||!i)return;const $=B.currentTarget.getBoundingClientRect(),P=Math.max(0,Math.min(1,(B.clientX-$.left)/$.width))*i;l.current.currentTime=P},L=B=>{const $=parseFloat(B.target.value);h($),l.current&&(l.current.volume=$)},O=B=>{if(!B||isNaN(B))return"0:00";const $=Math.floor(B/60),R=Math.floor(B%60);return`${$}:${R.toString().padStart(2,"0")}`},G=()=>{v?(We.remove(C),S(!1),y({title:"Removed from Watch Later",description:"Podcast removed successfully"})):(We.add(e),S(!0),y({title:"Added to Watch Later",description:"Podcast saved for later viewing"}))},D=async()=>{if(g){Ue.removeDownload(C),m(!1),y({title:"Download Removed",description:"Podcast removed from downloads"});return}try{if(y({title:"Download Started",description:"Downloading podcast for offline playback..."}),await Ue.downloadPodcast(e))m(!0),y({title:"Download Complete",description:"Podcast is now available offline"});else throw new Error("Download failed")}catch{y({title:"Download Failed",description:"Could not download the podcast",variant:"destructive"})}};return n?a.jsxs("div",{className:"fixed inset-0 bg-background z-[110] flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[a.jsx(H,{onClick:c,variant:"ghost",size:"icon",className:"hover:bg-accent transition-colors",children:a.jsx(xb,{className:"h-6 w-6"})}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Playing from Library"})}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(H,{onClick:()=>w(!x),variant:"ghost",size:"icon",className:"hover:bg-accent transition-colors",children:a.jsx(zb,{className:"h-5 w-5"})}),a.jsx(H,{onClick:u,variant:"ghost",size:"icon",className:"hover:bg-accent transition-colors",children:a.jsx(ya,{className:"h-5 w-5"})}),x&&a.jsx("div",{className:"absolute right-16 top-16 bg-card border border-border rounded-lg p-2 shadow-lg z-10",children:a.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:d,onChange:L,className:"w-20 h-1 bg-muted rounded-lg appearance-none cursor-pointer slider",style:{background:`linear-gradient(to right, #8b5cf6 0%, #8b5cf6 ${d*100}%, #e5e7eb ${d*100}%, #e5e7eb 100%)`}})})]})]}),a.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:a.jsx("div",{className:"max-w-2xl w-full aspect-video",children:a.jsx("img",{src:N,alt:e.title,className:"w-full h-full object-cover rounded-2xl shadow-2xl",onError:B=>{const $=B.target;$.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjI4OCIgdmlld0JveD0iMCAwIDUxMiAyODgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iMjg4IiBmaWxsPSIjRjNGM0YzIi8+CjxwYXRoIGQ9Ik0yMTYgMTIwTDI5NiAxNDRMMjE2IDE2OFYxMjBaIiBmaWxsPSIjMDA3YmZmIi8+Cjwvc3ZnPgo="}})})}),a.jsxs("div",{className:"px-8 py-4 text-center",children:[a.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e.title}),a.jsx("p",{className:"text-lg text-muted-foreground",children:e.uploaderName})]}),a.jsxs("div",{className:"flex items-center justify-center space-x-8 px-8 py-4",children:[a.jsx(H,{onClick:G,variant:"ghost",size:"icon",className:`hover:bg-accent transition-colors ${v?"text-blue-500":""}`,title:v?"Remove from Watch Later":"Add to Watch Later",children:a.jsx(tn,{className:"h-6 w-6"})}),a.jsx(H,{onClick:D,variant:"ghost",size:"icon",className:`hover:bg-accent transition-colors ${g?"text-green-500":""}`,title:g?"Remove Download":"Download for Offline",children:a.jsx(ot,{className:"h-6 w-6"})}),a.jsx(H,{variant:"ghost",size:"icon",className:"hover:bg-accent transition-colors",title:"Add to Playlist",children:a.jsx(va,{className:"h-6 w-6"})}),a.jsx(H,{onClick:u,variant:"ghost",size:"icon",className:"hover:bg-accent transition-colors",title:"Share",children:a.jsx(ya,{className:"h-6 w-6"})})]}),a.jsxs("div",{className:"px-8 py-4",children:[a.jsx("div",{className:"w-full h-2 bg-muted rounded-full cursor-pointer mb-2",onClick:I,children:a.jsx("div",{className:"h-full bg-primary rounded-full transition-all duration-300",style:{width:`${b}%`,background:"linear-gradient(to right, #8b5cf6, #a855f7)"}})}),a.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[a.jsx("span",{children:O(s)}),a.jsx("span",{children:O(i)})]})]}),a.jsxs("div",{className:"flex items-center justify-center space-x-8 pb-8",children:[a.jsx(H,{onClick:j,disabled:o,variant:"ghost",size:"icon",className:"hover:bg-accent transition-colors",children:a.jsx(Ab,{className:"h-8 w-8"})}),a.jsx(H,{onClick:f,disabled:o,className:"bg-primary text-primary-foreground hover:bg-primary/90 rounded-full w-16 h-16 flex items-center justify-center transition-all duration-200 shadow-lg",size:"icon",children:o?a.jsx(ds,{className:"h-8 w-8 animate-spin"}):r?a.jsx(Uv,{className:"h-8 w-8"}):a.jsx(ga,{className:"h-8 w-8 ml-1"})}),a.jsx(H,{onClick:M,disabled:o,variant:"ghost",size:"icon",className:"hover:bg-accent transition-colors",children:a.jsx(Db,{className:"h-8 w-8"})})]})]}):null}function nP({podcast:e,isOpen:t,onClose:n}){const{toast:r}=qn();if(!e)return null;const o=u=>u.includes("/watch?v=")?u.split("/watch?v=")[1].split("&")[0]:u.replace(/.*\//,""),s=async()=>{try{const u=o(e.url),f=`${window.location.origin}/podcast/${u}`;await navigator.clipboard.writeText(f),r({title:"Link copied!",description:"The podcast link has been copied to your clipboard."}),n()}catch{r({title:"Failed to copy",description:"Could not copy the link to clipboard.",variant:"destructive"})}},i=()=>{const u=o(e.url),f=`${window.location.origin}/podcast/${u}`,d=`Check out this podcast: ${e.title}`,h=`https://twitter.com/intent/tweet?text=${encodeURIComponent(d)}&url=${encodeURIComponent(f)}`;window.open(h,"_blank","width=550,height=420"),n()},l=()=>{const u=o(e.url),f=`${window.location.origin}/podcast/${u}`,d=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(f)}`;window.open(d,"_blank","width=626,height=436"),n()},c=()=>{const u=o(e.url),f=`${window.location.origin}/podcast/${u}`,d=`Check out this podcast: ${e.title} ${f}`,h=`https://wa.me/?text=${encodeURIComponent(d)}`;window.open(h,"_blank"),n()};return a.jsx(Su,{open:t,onOpenChange:n,children:a.jsxs(Ta,{className:"sm:max-w-md",children:[a.jsx(Ra,{children:a.jsx(Ma,{children:"Share Podcast"})}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs(H,{onClick:s,variant:"ghost",className:"w-full justify-start space-x-3 h-12",children:[a.jsx(Rb,{className:"h-5 w-5 text-youtube-blue"}),a.jsx("span",{children:"Copy Link"})]}),a.jsxs(H,{onClick:i,variant:"ghost",className:"w-full justify-start space-x-3 h-12",children:[a.jsx(Fb,{className:"h-5 w-5 text-blue-400"}),a.jsx("span",{children:"Share on Twitter"})]}),a.jsxs(H,{onClick:l,variant:"ghost",className:"w-full justify-start space-x-3 h-12",children:[a.jsx(Eb,{className:"h-5 w-5 text-blue-600"}),a.jsx("span",{children:"Share on Facebook"})]}),a.jsxs(H,{onClick:c,variant:"ghost",className:"w-full justify-start space-x-3 h-12",children:[a.jsx(Mb,{className:"h-5 w-5 text-green-500"}),a.jsx("span",{children:"Share on WhatsApp"})]})]})]})})}function rP({onSearch:e,onThemeToggle:t,searchQuery:n}){const[r,o]=p.useState(!1),[s,i]=p.useState(n),l=()=>{e(s.trim())},c=f=>{f.key==="Enter"&&l()},u=()=>{o(!r),r||setTimeout(()=>{const f=document.getElementById("searchInputMobile");f&&f.focus()},100)};return a.jsxs("header",{className:"fixed top-0 left-0 right-0 z-[100] bg-background/95 backdrop-blur-sm",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 h-16",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-white font-bold text-sm",children:"V"})}),a.jsx("span",{className:"text-xl font-semibold text-foreground",children:"VELIN"})]}),a.jsx("div",{className:"flex-1 max-w-2xl mx-8 hidden md:block",children:a.jsxs("div",{className:"relative",children:[a.jsx(Eo,{type:"text",placeholder:"Search podcasts...",value:s,onChange:f=>i(f.target.value),onKeyPress:c,className:"w-full pl-4 pr-12 rounded-full bg-input border-border focus:ring-2 focus:ring-primary focus:border-transparent placeholder:text-muted-foreground"}),a.jsx(H,{onClick:l,size:"icon",className:"absolute right-0 top-0 h-full rounded-r-full bg-secondary hover:bg-secondary/80 text-secondary-foreground",children:a.jsx(Xr,{className:"h-4 w-4"})})]})}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(H,{variant:"ghost",size:"icon",className:"md:hidden hover:bg-accent",onClick:u,children:a.jsx(Xr,{className:"h-5 w-5 text-foreground"})}),a.jsxs(H,{variant:"ghost",size:"icon",onClick:t,className:"hover:bg-accent",children:[a.jsx(Lb,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0 text-foreground"}),a.jsx(Ib,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 text-foreground"})]})]})]}),r&&a.jsx("div",{className:"md:hidden px-4 pb-4 border-t border-border",children:a.jsxs("div",{className:"relative",children:[a.jsx(Eo,{id:"searchInputMobile",type:"text",placeholder:"Search podcasts...",value:s,onChange:f=>i(f.target.value),onKeyPress:c,className:"w-full pl-4 pr-12 rounded-full bg-input border-border focus:ring-2 focus:ring-primary focus:border-transparent placeholder:text-muted-foreground"}),a.jsx(H,{onClick:l,size:"icon",className:"absolute right-0 top-0 h-full rounded-r-full bg-secondary hover:bg-secondary/80 text-secondary-foreground",children:a.jsx(Xr,{className:"h-4 w-4"})})]})})]})}function oP(){const[e]=xd();p.useState(!1);const[t,n]=p.useState(!navigator.onLine);p.useEffect(()=>{const o=()=>n(!1),s=()=>n(!0);return window.addEventListener("online",o),window.addEventListener("offline",s),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",s)}},[]);const r=[{path:"/",label:"Home",icon:Fv},{path:"/library",label:"Library",icon:zv},{path:"/history",label:"History",icon:Lv},{path:"/about",label:"About",icon:tl}];return a.jsx(a.Fragment,{children:a.jsxs("nav",{className:"hidden md:flex fixed left-0 top-16 h-[calc(100vh-4rem)] w-64 bg-background z-40 flex-col",children:[a.jsx("div",{className:"flex-1 px-3 py-4",children:r.map(({path:o,label:s,icon:i})=>a.jsx(Kg,{href:o,children:a.jsxs(H,{variant:e===o?"secondary":"ghost",className:"w-full justify-start mb-1 h-10",children:[a.jsx(i,{className:"h-5 w-5 mr-3"}),s]})},o))}),t&&a.jsxs("div",{className:"flex items-center justify-center space-x-1 text-orange-500 text-sm p-4",children:[a.jsx(Wv,{className:"h-4 w-4"}),a.jsx("span",{children:"Offline"})]})]})})}function sP(){const[e]=xd(),t=[{path:"/",label:"Home",icon:Fv},{path:"/library",label:"Library",icon:zv},{path:"/history",label:"History",icon:Lv},{path:"/about",label:"About",icon:tl}];return a.jsx("div",{className:"md:hidden fixed left-0 top-16 h-[calc(100vh-4rem)] w-12 bg-background z-40 flex flex-col items-center",children:a.jsx("div",{className:"flex flex-col space-y-6 mt-8",children:t.map(({path:n,label:r,icon:o})=>a.jsx(Kg,{href:n,children:a.jsx("div",{className:"flex flex-col items-center cursor-pointer group",children:a.jsx("span",{className:`text-sm font-bold transition-colors vertical-text ${e===n?"text-primary":"text-muted-foreground group-hover:text-foreground"}`,children:r})})},n))})})}function iP(){const[e,t]=p.useState(null),[n,r]=p.useState(!1),[o,s]=p.useState(!1),[i,l]=p.useState(!1);p.useEffect(()=>{s((()=>{const g=window.matchMedia("(display-mode: standalone)").matches,m=window.navigator.standalone===!0;return g||m})());const w=g=>{g.preventDefault(),t(g);const m=localStorage.getItem("install-prompt-dismissed"),y=Date.now(),C=24*60*60*1e3;(!m||y-parseInt(m)>C)&&setTimeout(()=>r(!0),2e3)},v=()=>{console.log("PWA was installed"),s(!0),r(!1),t(null)};window.addEventListener("beforeinstallprompt",w),window.addEventListener("appinstalled",v);const S=setTimeout(()=>{if(!e&&!o&&c()){const g=localStorage.getItem("install-prompt-dismissed"),m=Date.now(),y=24*60*60*1e3;(!g||m-parseInt(g)>y)&&l(!0)}},5e3);return()=>{window.removeEventListener("beforeinstallprompt",w),window.removeEventListener("appinstalled",v),clearTimeout(S)}},[e,o]);const c=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),u=()=>/iPad|iPhone|iPod/.test(navigator.userAgent),f=async()=>{if(e)try{await e.prompt();const{outcome:x}=await e.userChoice;console.log(`User ${x} the install prompt`),t(null),r(!1)}catch(x){console.error("Install prompt failed:",x)}},d=()=>{r(!1),l(!1),localStorage.setItem("install-prompt-dismissed",Date.now().toString())},h=()=>{r(!1),l(!0)};return o?null:i?a.jsx("div",{className:"fixed bottom-4 left-4 right-4 md:left-auto md:right-4 md:w-96 bg-card border border-border rounded-lg shadow-lg z-50 p-4",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"bg-primary/10 p-2 rounded-lg",children:a.jsx(Ob,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold text-foreground mb-1",children:"Install VELIN"}),u()?a.jsxs("div",{className:"text-sm text-muted-foreground mb-3 space-y-1",children:[a.jsx("p",{children:"To install on iOS:"}),a.jsx("p",{children:"1. Tap the Share button (□↑)"}),a.jsx("p",{children:'2. Scroll down and tap "Add to Home Screen"'}),a.jsx("p",{children:'3. Tap "Add" to confirm'})]}):a.jsxs("div",{className:"text-sm text-muted-foreground mb-3 space-y-1",children:[a.jsx("p",{children:"To install on Android:"}),a.jsx("p",{children:"1. Tap the menu (⋮) in your browser"}),a.jsx("p",{children:'2. Look for "Add to Home Screen" or "Install App"'}),a.jsx("p",{children:'3. Tap "Add" or "Install"'})]}),a.jsx(H,{onClick:d,variant:"outline",size:"sm",className:"w-full",children:"Got it"})]}),a.jsx(H,{onClick:d,variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(Is,{className:"h-4 w-4"})})]})}):!n||!e?null:a.jsx("div",{className:"fixed bottom-4 left-4 right-4 md:left-auto md:right-4 md:w-80 bg-card border border-border rounded-lg shadow-lg z-50 p-4",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"bg-primary/10 p-2 rounded-lg",children:a.jsx(ot,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold text-foreground mb-1",children:"Install VELIN"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Install our app for a better experience with offline playback and quick access."}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx(H,{onClick:f,size:"sm",className:"flex-1",children:"Install"}),a.jsx(H,{onClick:h,variant:"outline",size:"sm",children:"How?"}),a.jsx(H,{onClick:d,variant:"ghost",size:"sm",children:"Later"})]})]}),a.jsx(H,{onClick:d,variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(Is,{className:"h-4 w-4"})})]})})}function aP({onPlayPodcast:e,onSharePodcast:t}){const[n,r]=p.useState([]),[o,s]=p.useState([]);p.useEffect(()=>{i()},[]);const i=async()=>{const f=xe.getAll();r(f);const d=[];for(const h of f)try{let x=Vt.get(h.podcastId);x||(x=await Ue.getPodcastMetadata(h.podcastId)),x?d.push({...x,url:x.url||`https://youtube.com/watch?v=${h.podcastId}`,type:x.type||"video",title:x.title||"Unknown Title",thumbnail:x.thumbnail||"",uploaderName:x.uploaderName||"Unknown",uploaderUrl:x.uploaderUrl||"",uploaderAvatar:x.uploaderAvatar||null,uploadedDate:x.uploadedDate||"",shortDescription:x.shortDescription||"",duration:x.duration||0,views:x.views||0,uploaded:x.uploaded||0,uploaderVerified:x.uploaderVerified||!1,isShort:x.isShort||!1}):d.push({url:`https://youtube.com/watch?v=${h.podcastId}`,type:"video",title:"Downloaded Podcast",thumbnail:"",uploaderName:"Unknown",uploaderUrl:"",uploaderAvatar:null,uploadedDate:"",shortDescription:"",duration:0,views:0,uploaded:0,uploaderVerified:!1,isShort:!1})}catch(x){console.error("Error loading offline podcast data:",x),d.push({url:`https://youtube.com/watch?v=${h.podcastId}`,type:"video",title:"Downloaded Podcast",thumbnail:"",uploaderName:"Unknown",uploaderUrl:"",uploaderAvatar:null,uploadedDate:"",shortDescription:"",duration:0,views:0,uploaded:0,uploaderVerified:!1,isShort:!1})}s(d)},l=()=>{window.location.reload()},c=()=>o,u=async f=>{if(e){const d=f.url.match(/[?&]v=([^&]+)/);if(d){const h=d[1],x=await Ue.getOfflineAudioUrl(h);if(x){const w={...f,offlineAudioUrl:x};e(w)}else console.warn("No offline audio available for:",f.title),e(f)}else e(f)}};return a.jsx("div",{className:"min-h-[calc(100vh-4rem)] bg-background text-foreground p-4",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsx("div",{className:"mb-6 p-4 bg-orange-50 dark:bg-orange-950/20 border border-orange-200 dark:border-orange-800 rounded-lg",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Wv,{className:"h-5 w-5 text-orange-600 dark:text-orange-400"}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-medium text-orange-800 dark:text-orange-200",children:"You're Offline"}),a.jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"No internet connection. You can still listen to downloaded podcasts."})]}),a.jsxs(H,{onClick:l,variant:"outline",size:"sm",className:"ml-auto",children:[a.jsx(Vp,{className:"h-3 w-3 mr-1"}),"Retry"]})]})}),n.length>0?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Downloads"}),a.jsxs("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground",children:[a.jsx(ot,{className:"h-4 w-4"}),a.jsxs("span",{children:[n.length," available offline"]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:c().map((f,d)=>a.jsxs("div",{className:"relative",children:[a.jsx(Ia,{podcast:f,onPlay:u,onShare:t||(()=>{})}),a.jsxs("div",{className:"absolute top-2 left-2 bg-green-600 text-white text-xs px-2 py-1 rounded font-medium z-10 flex items-center space-x-1",children:[a.jsx(ot,{className:"h-3 w-3"}),a.jsx("span",{children:"Offline"})]})]},d))})]}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"mx-auto w-24 h-24 bg-muted rounded-full flex items-center justify-center mb-4",children:a.jsx($v,{className:"h-12 w-12 text-muted-foreground"})}),a.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"No Downloads Available"}),a.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"You don't have any podcasts downloaded for offline listening. When you're back online, you can download podcasts to listen to them without an internet connection."}),a.jsxs(H,{onClick:l,children:[a.jsx(Vp,{className:"h-4 w-4 mr-2"}),"Check Connection"]})]})]})})}class Hr{constructor(){this.currentPodcast=null,this.isPlaying=!1,this.setupMediaSession()}static getInstance(){return Hr.instance||(Hr.instance=new Hr),Hr.instance}setupMediaSession(){if(!("mediaSession"in navigator)){console.log("Media Session API not supported");return}navigator.mediaSession.setActionHandler("play",()=>{var t;(t=this.onPlayCallback)==null||t.call(this)}),navigator.mediaSession.setActionHandler("pause",()=>{var t;(t=this.onPauseCallback)==null||t.call(this)}),navigator.mediaSession.setActionHandler("seekbackward",t=>{var r;const n=t.seekOffset||10;(r=this.onSeekCallback)==null||r.call(this,-n)}),navigator.mediaSession.setActionHandler("seekforward",t=>{var r;const n=t.seekOffset||10;(r=this.onSeekCallback)==null||r.call(this,n)}),navigator.mediaSession.setActionHandler("previoustrack",()=>{var t;(t=this.onPreviousCallback)==null||t.call(this)}),navigator.mediaSession.setActionHandler("nexttrack",()=>{var t;(t=this.onNextCallback)==null||t.call(this)}),navigator.mediaSession.setActionHandler("seekto",t=>{var n;t.seekTime!==void 0&&((n=this.onSeekCallback)==null||n.call(this,t.seekTime))})}setCallbacks(t){this.onPlayCallback=t.onPlay,this.onPauseCallback=t.onPause,this.onSeekCallback=t.onSeek,this.onPreviousCallback=t.onPrevious,this.onNextCallback=t.onNext}updateMetadata(t){"mediaSession"in navigator&&(this.currentPodcast=t,navigator.mediaSession.metadata=new MediaMetadata({title:t.title,artist:t.uploaderName,album:"VELIN Podcast",artwork:[{src:t.thumbnail,sizes:"320x180",type:"image/jpeg"},{src:t.thumbnail.replace("hqdefault","maxresdefault"),sizes:"1280x720",type:"image/jpeg"}]}))}updatePlaybackState(t){"mediaSession"in navigator&&(this.isPlaying=t==="playing",navigator.mediaSession.playbackState=t)}updatePositionInfo(t,n,r=1){!("mediaSession"in navigator)||!("setPositionState"in navigator.mediaSession)||navigator.mediaSession.setPositionState({duration:n,playbackRate:r,position:t})}clear(){"mediaSession"in navigator&&(navigator.mediaSession.metadata=null,navigator.mediaSession.playbackState="none",this.currentPodcast=null,this.isPlaying=!1)}}const Zn=Hr.getInstance();function lP(){const e=p.useRef(null),[t,n]=p.useState("light"),[r,o]=p.useState(null),[s,i]=p.useState(""),[l,c]=p.useState(!1),[u,f]=p.useState(!1),[d,h]=p.useState(!1),[x,w]=p.useState(!1),[v,S]=p.useState(null),[g,m]=p.useState(0),[y,C]=p.useState(0),[b,E]=p.useState(navigator.onLine),[N,j]=p.useState("");p.useEffect(()=>{const R=localStorage.getItem("theme");if(R)n(R);else{const _=window.matchMedia("(prefers-color-scheme: dark)").matches;n(_?"dark":"light")}const P=window.matchMedia("(prefers-color-scheme: dark)"),T=_=>{localStorage.getItem("theme")||n(_.matches?"dark":"light")};return P.addEventListener("change",T),()=>P.removeEventListener("change",T)},[]),p.useEffect(()=>{t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",t)},[t]),p.useEffect(()=>{Ue.setupOfflineListeners();const R=()=>E(!0),P=()=>E(!1);return window.addEventListener("online",R),window.addEventListener("offline",P),Zn.setCallbacks({onPlay:L,onPause:L,onSeek:T=>{e.current&&(T<0?e.current.currentTime=Math.max(0,e.current.currentTime+T):T>100?e.current.currentTime=T:e.current.currentTime=Math.min(e.current.duration||0,e.current.currentTime+T))}}),()=>{window.removeEventListener("online",R),window.removeEventListener("offline",P)}},[]);const M=()=>{n(t==="light"?"dark":"light")},I=async R=>{o(R),f(!0),ba.add(R);try{const P=R.url.match(/[?&]v=([^&]+)/);if(!P){console.error("Could not extract video ID from URL:",R.url),f(!1);return}const T=P[1];if(Ue.isOffline()){try{const K=await Ue.getOfflineAudioUrl(T);if(K){console.log("Playing offline version"),i(K),f(!1),Zn.updateMetadata(R);return}}catch(K){console.error("Failed to get offline audio:",K)}throw f(!1),new Error("This podcast is not available offline. Please download it first or go online.")}console.log("Fetching audio for video ID:",T);const _=await fetch(`https://backendmix.vercel.app/streams/${T}`);if(!_.ok)throw new Error(`API responded with status: ${_.status}`);const W=await _.json();if(console.log("API response:",W),W.audioStreams&&W.audioStreams.length>0){const K=W.audioStreams.find(ye=>ye.quality==="medium")||W.audioStreams.find(ye=>ye.quality==="high")||W.audioStreams[0];console.log("Selected audio stream:",K),i(K.url),Zn.updateMetadata(R),f(!1)}else console.error("No audio streams found in response:",W),f(!1)}catch(P){console.error("Failed to fetch audio stream:",P),f(!1)}},L=async()=>{if(!(!e.current||!s))try{l?e.current.pause():await e.current.play()}catch(R){console.error("Playback error:",R),c(!1),f(!1),Zn.updatePlaybackState("paused")}};p.useEffect(()=>{if(e.current&&s){const R=e.current;R.src=s,R.load();const P=async()=>{try{await R.play()}catch(T){console.error("Autoplay failed:",T),f(!1)}};return R.addEventListener("loadeddata",P,{once:!0}),()=>{R.removeEventListener("loadeddata",P)}}},[s]);const O=()=>{h(!0)},G=()=>{h(!1)},D=R=>{S(R),w(!0)},B=()=>{w(!1),S(null)},$=R=>{j(R)};return a.jsx(sC,{client:wC,children:a.jsxs(Gk,{children:[a.jsxs("div",{className:"min-h-screen bg-background text-foreground transition-colors duration-300",children:[a.jsx(rP,{onSearch:$,onThemeToggle:M,searchQuery:N}),a.jsx(oP,{}),a.jsx(sP,{}),a.jsx("div",{className:"md:ml-64 ml-12 pt-16",children:a.jsxs(FS,{children:[a.jsx(Er,{path:"/",children:b?a.jsx(b2,{onPlayPodcast:I,onSharePodcast:D,theme:t,onToggleTheme:M,searchQuery:N}):a.jsx(aP,{onPlayPodcast:I,onSharePodcast:D})}),a.jsx(Er,{path:"/library",children:a.jsx(V2,{onPlayPodcast:I,onSharePodcast:D,theme:t,onToggleTheme:M})}),a.jsx(Er,{path:"/history",children:a.jsx(Q2,{onPlayPodcast:I,onSharePodcast:D,theme:t,onToggleTheme:M})}),a.jsx(Er,{path:"/about",children:a.jsx(G2,{})}),a.jsx(Er,{path:"/podcast/:id",children:a.jsx(J2,{onPlay:I})}),a.jsx(Er,{component:Z2})]})}),r&&!d&&a.jsx("div",{className:"md:ml-64 ml-12",children:a.jsx(eP,{podcast:r,isPlaying:l,isLoading:u,onTogglePlay:L,onOpenFullPlayer:O})}),r&&a.jsx(tP,{podcast:r,audioUrl:s,isOpen:d,isPlaying:l,isLoading:u,currentTime:g,duration:y,audioRef:e,onClose:G,onShare:()=>D(r),onTogglePlay:L}),v&&a.jsx(nP,{podcast:v,isOpen:x,onClose:B}),a.jsx("audio",{ref:e,preload:"metadata",onTimeUpdate:R=>m(R.currentTarget.currentTime),onLoadedMetadata:R=>C(R.currentTarget.duration),onEnded:()=>{c(!1),Zn.updatePlaybackState("paused")},onPlay:()=>{c(!0),Zn.updatePlaybackState("playing")},onPause:()=>{c(!1),Zn.updatePlaybackState("paused")},onError:()=>{console.error("Audio error occurred"),c(!1),f(!1)}}),a.jsx(iP,{})]}),a.jsx(SN,{})]})})}Fg(document.getElementById("root")).render(a.jsx(lP,{}));