var bf=Object.defineProperty;var $f=(e,t,n)=>t in e?bf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zs=(e,t,n)=>$f(e,typeof t!="symbol"?t+"":t,n);function Oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ma={exports:{}},Qo={},za={exports:{}},I={};/** * @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 Pr=Symbol.for("react.element"),Bf=Symbol.for("react.portal"),Wf=Symbol.for("react.fragment"),Vf=Symbol.for("react.strict_mode"),Hf=Symbol.for("react.profiler"),Qf=Symbol.for("react.provider"),Gf=Symbol.for("react.context"),Kf=Symbol.for("react.forward_ref"),Yf=Symbol.for("react.suspense"),Xf=Symbol.for("react.memo"),Zf=Symbol.for("react.lazy"),Js=Symbol.iterator;function Jf(e){return e===null||typeof e!="object"?null:(e=Js&&e[Js]||e["@@iterator"],typeof e=="function"?e:null)}var Da={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ia=Object.assign,Aa={};function Dn(e,t,n){this.props=e,this.context=t,this.refs=Aa,this.updater=n||Da}Dn.prototype.isReactComponent={};Dn.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")};Dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ja(){}ja.prototype=Dn.prototype;function Ki(e,t,n){this.props=e,this.context=t,this.refs=Aa,this.updater=n||Da}var Yi=Ki.prototype=new ja;Yi.constructor=Ki;Ia(Yi,Dn.prototype);Yi.isPureReactComponent=!0;var qs=Array.isArray,Fa=Object.prototype.hasOwnProperty,Xi={current:null},Ua={key:!0,ref:!0,__self:!0,__source:!0};function ba(e,t,n){var r,o={},l=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(l=""+t.key),t)Fa.call(t,r)&&!Ua.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,ee=T[j];if(0>>1;jo(fl,z))zto(Dr,fl)?(T[j]=Dr,T[zt]=z,j=zt):(T[j]=fl,T[Mt]=z,j=Mt);else if(zto(Dr,z))T[j]=Dr,T[zt]=z,j=zt;else break e}}return O}function o(T,O){var z=T.sortIndex-O.sortIndex;return z!==0?z:T.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,s=i.now();e.unstable_now=function(){return i.now()-s}}var u=[],a=[],p=1,m=null,h=3,w=!1,S=!1,v=!1,E=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(T){for(var O=n(a);O!==null;){if(O.callback===null)r(a);else if(O.startTime<=T)r(a),O.sortIndex=O.expirationTime,t(u,O);else break;O=n(a)}}function g(T){if(v=!1,f(T),!S)if(n(u)!==null)S=!0,ot(x);else{var O=n(a);O!==null&&qt(g,O.startTime-T)}}function x(T,O){S=!1,v&&(v=!1,d(P),P=-1),w=!0;var z=h;try{for(f(O),m=n(u);m!==null&&(!(m.expirationTime>O)||T&&!Z());){var j=m.callback;if(typeof j=="function"){m.callback=null,h=m.priorityLevel;var ee=j(m.expirationTime<=O);O=e.unstable_now(),typeof ee=="function"?m.callback=ee:m===n(u)&&r(u),f(O)}else r(u);m=n(u)}if(m!==null)var zr=!0;else{var Mt=n(a);Mt!==null&&qt(g,Mt.startTime-O),zr=!1}return zr}finally{m=null,h=z,w=!1}}var N=!1,_=null,P=-1,L=5,M=-1;function Z(){return!(e.unstable_now()-MT||125j?(T.sortIndex=z,t(a,T),n(u)===null&&T===n(a)&&(v?(d(P),P=-1):v=!0,qt(g,z-j))):(T.sortIndex=ee,t(u,T),S||w||(S=!0,ot(x))),T},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(T){var O=h;return function(){var z=h;h=O;try{return T.apply(this,arguments)}finally{h=z}}}})(Ha);Va.exports=Ha;var cp=Va.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 dp=y,Ee=cp;function k(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"),Yl=Object.prototype.hasOwnProperty,fp=/^[: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]*$/,tu={},nu={};function pp(e){return Yl.call(nu,e)?!0:Yl.call(tu,e)?!1:fp.test(e)?nu[e]=!0:(tu[e]=!0,!1)}function hp(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 mp(e,t,n,r){if(t===null||typeof t>"u"||hp(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 pe(e,t,n,r,o,l,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=l,this.removeEmptyString=i}var le={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){le[e]=new pe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];le[t]=new pe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){le[e]=new pe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){le[e]=new pe(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){le[e]=new pe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){le[e]=new pe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){le[e]=new pe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){le[e]=new pe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){le[e]=new pe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ji=/[\-:]([a-z])/g;function qi(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(Ji,qi);le[t]=new pe(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(Ji,qi);le[t]=new pe(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(Ji,qi);le[t]=new pe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){le[e]=new pe(e,1,!1,e.toLowerCase(),null,!1,!1)});le.xlinkHref=new pe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){le[e]=new pe(e,1,!1,e.toLowerCase(),null,!0,!0)});function es(e,t,n,r){var o=le.hasOwnProperty(t)?le[t]:null;(o!==null?o.type!==0:r||!(2s||o[i]!==l[s]){var u=` `+o[i].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=i&&0<=s);break}}}finally{ml=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Kn(e):""}function vp(e){switch(e.tag){case 5:return Kn(e.type);case 16:return Kn("Lazy");case 13:return Kn("Suspense");case 19:return Kn("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 ql(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 ln:return"Fragment";case on:return"Portal";case Xl:return"Profiler";case ts:return"StrictMode";case Zl:return"Suspense";case Jl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ka:return(e.displayName||"Context")+".Consumer";case Ga:return(e._context.displayName||"Context")+".Provider";case ns:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rs:return t=e.displayName||null,t!==null?t:ql(e.type)||"Memo";case ct:t=e._payload,e=e._init;try{return ql(e(t))}catch{}}return null}function gp(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 ql(t);case 8:return t===ts?"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 Ct(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yp(e){var t=Xa(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,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,l.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 jr(e){e._valueTracker||(e._valueTracker=yp(e))}function Za(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function So(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 ei(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ou(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ct(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 Ja(e,t){t=t.checked,t!=null&&es(e,"checked",t,!1)}function ti(e,t){Ja(e,t);var n=Ct(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")?ni(e,t.type,n):t.hasOwnProperty("defaultValue")&&ni(e,t.type,Ct(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lu(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 ni(e,t,n){(t!=="number"||So(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yn=Array.isArray;function gn(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Fr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jn={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},wp=["Webkit","ms","Moz","O"];Object.keys(Jn).forEach(function(e){wp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jn[t]=Jn[e]})});function nc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jn.hasOwnProperty(e)&&Jn[e]?(""+t).trim():t+"px"}function rc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=nc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Sp=G({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 li(e,t){if(t){if(Sp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(k(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(k(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(k(61))}if(t.style!=null&&typeof t.style!="object")throw Error(k(62))}}function ii(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 si=null;function os(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ui=null,yn=null,wn=null;function uu(e){if(e=Lr(e)){if(typeof ui!="function")throw Error(k(280));var t=e.stateNode;t&&(t=Zo(t),ui(e.stateNode,e.type,t))}}function oc(e){yn?wn?wn.push(e):wn=[e]:yn=e}function lc(){if(yn){var e=yn,t=wn;if(wn=yn=null,uu(e),t)for(e=0;e>>=0,e===0?32:31-(Op(e)/Mp|0)|0}var Ur=64,br=4194304;function Xn(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 _o(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,l=e.pingedLanes,i=n&268435455;if(i!==0){var s=i&~o;s!==0?r=Xn(s):(l&=i,l!==0&&(r=Xn(l)))}else i=n&~o,i!==0?r=Xn(i):l!==0&&(r=Xn(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,l=t&-t,o>=l||o===16&&(l&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 Tr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ie(t),e[t]=n}function Ap(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=er),gu=" ",yu=!1;function Cc(e,t){switch(e){case"keyup":return ch.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sn=!1;function fh(e,t){switch(e){case"compositionend":return Nc(t);case"keypress":return t.which!==32?null:(yu=!0,gu);case"textInput":return e=t.data,e===gu&&yu?null:e;default:return null}}function ph(e,t){if(sn)return e==="compositionend"||!fs&&Cc(e,t)?(e=kc(),io=as=ht=null,sn=!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=Eu(n)}}function Lc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Oc(){for(var e=window,t=So();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=So(e.document)}return t}function ps(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 Eh(e){var t=Oc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Lc(n.ownerDocument.documentElement,n)){if(r!==null&&ps(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,l=Math.min(r.start,o);r=r.end===void 0?l:Math.min(r.end,o),!e.extend&&l>r&&(o=r,r=l,l=o),o=ku(n,l);var i=ku(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(),l>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,un=null,hi=null,nr=null,mi=!1;function _u(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mi||un==null||un!==So(r)||(r=un,"selectionStart"in r&&ps(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}),nr&&vr(nr,r)||(nr=r,r=Po(hi,"onSelect"),0dn||(e.current=xi[dn],xi[dn]=null,dn--)}function b(e,t){dn++,xi[dn]=e.current,e.current=t}var Nt={},ae=Rt(Nt),ve=Rt(!1),Bt=Nt;function Pn(e,t){var n=e.type.contextTypes;if(!n)return Nt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ge(e){return e=e.childContextTypes,e!=null}function Ro(){W(ve),W(ae)}function Ou(e,t,n){if(ae.current!==Nt)throw Error(k(168));b(ae,t),b(ve,n)}function bc(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(k(108,gp(e)||"Unknown",o));return G({},n,r)}function Lo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Nt,Bt=ae.current,b(ae,e),b(ve,ve.current),!0}function Mu(e,t,n){var r=e.stateNode;if(!r)throw Error(k(169));n?(e=bc(e,t,Bt),r.__reactInternalMemoizedMergedChildContext=e,W(ve),W(ae),b(ae,e)):W(ve),b(ve,n)}var Ge=null,Jo=!1,Ll=!1;function $c(e){Ge===null?Ge=[e]:Ge.push(e)}function Dh(e){Jo=!0,$c(e)}function Lt(){if(!Ll&&Ge!==null){Ll=!0;var e=0,t=U;try{var n=Ge;for(U=1;e>=i,o-=i,Ke=1<<32-Ie(t)+o|n<P?(L=_,_=null):L=_.sibling;var M=h(d,_,f[P],g);if(M===null){_===null&&(_=L);break}e&&_&&M.alternate===null&&t(d,_),c=l(M,c,P),N===null?x=M:N.sibling=M,N=M,_=L}if(P===f.length)return n(d,_),V&&Dt(d,P),x;if(_===null){for(;PP?(L=_,_=null):L=_.sibling;var Z=h(d,_,M.value,g);if(Z===null){_===null&&(_=L);break}e&&_&&Z.alternate===null&&t(d,_),c=l(Z,c,P),N===null?x=Z:N.sibling=Z,N=Z,_=L}if(M.done)return n(d,_),V&&Dt(d,P),x;if(_===null){for(;!M.done;P++,M=f.next())M=m(d,M.value,g),M!==null&&(c=l(M,c,P),N===null?x=M:N.sibling=M,N=M);return V&&Dt(d,P),x}for(_=r(d,_);!M.done;P++,M=f.next())M=w(_,d,P,M.value,g),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?P:M.key),c=l(M,c,P),N===null?x=M:N.sibling=M,N=M);return e&&_.forEach(function(F){return t(d,F)}),V&&Dt(d,P),x}function E(d,c,f,g){if(typeof f=="object"&&f!==null&&f.type===ln&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case Ar:e:{for(var x=f.key,N=c;N!==null;){if(N.key===x){if(x=f.type,x===ln){if(N.tag===7){n(d,N.sibling),c=o(N,f.props.children),c.return=d,d=c;break e}}else if(N.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===ct&&Iu(x)===N.type){n(d,N.sibling),c=o(N,f.props),c.ref=Wn(d,N,f),c.return=d,d=c;break e}n(d,N);break}else t(d,N);N=N.sibling}f.type===ln?(c=$t(f.props.children,d.mode,g,f.key),c.return=d,d=c):(g=mo(f.type,f.key,f.props,null,d.mode,g),g.ref=Wn(d,c,f),g.return=d,d=g)}return i(d);case on:e:{for(N=f.key;c!==null;){if(c.key===N)if(c.tag===4&&c.stateNode.containerInfo===f.containerInfo&&c.stateNode.implementation===f.implementation){n(d,c.sibling),c=o(c,f.children||[]),c.return=d,d=c;break e}else{n(d,c);break}else t(d,c);c=c.sibling}c=Fl(f,d.mode,g),c.return=d,d=c}return i(d);case ct:return N=f._init,E(d,c,N(f._payload),g)}if(Yn(f))return S(d,c,f,g);if(Fn(f))return v(d,c,f,g);Gr(d,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,c!==null&&c.tag===6?(n(d,c.sibling),c=o(c,f),c.return=d,d=c):(n(d,c),c=jl(f,d.mode,g),c.return=d,d=c),i(d)):n(d,c)}return E}var Rn=Hc(!0),Qc=Hc(!1),zo=Rt(null),Do=null,hn=null,gs=null;function ys(){gs=hn=Do=null}function ws(e){var t=zo.current;W(zo),e._currentValue=t}function _i(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 xn(e,t){Do=e,gs=hn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(me=!0),e.firstContext=null)}function Re(e){var t=e._currentValue;if(gs!==e)if(e={context:e,memoizedValue:t,next:null},hn===null){if(Do===null)throw Error(k(308));hn=e,Do.dependencies={lanes:0,firstContext:e}}else hn=hn.next=e;return t}var Ft=null;function Ss(e){Ft===null?Ft=[e]:Ft.push(e)}function Gc(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ss(t)):(n.next=o.next,o.next=n),t.interleaved=n,qe(e,r)}function qe(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 dt=!1;function xs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kc(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 Xe(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function St(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,A&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,qe(e,n)}return o=r.interleaved,o===null?(t.next=t,Ss(r)):(t.next=o.next,o.next=t),r.interleaved=t,qe(e,n)}function uo(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,is(e,n)}}function Au(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,l=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};l===null?o=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?o=l=t:l=l.next=t}else o=l=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:l,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 Io(e,t,n,r){var o=e.updateQueue;dt=!1;var l=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var u=s,a=u.next;u.next=null,i===null?l=a:i.next=a,i=u;var p=e.alternate;p!==null&&(p=p.updateQueue,s=p.lastBaseUpdate,s!==i&&(s===null?p.firstBaseUpdate=a:s.next=a,p.lastBaseUpdate=u))}if(l!==null){var m=o.baseState;i=0,p=a=u=null,s=l;do{var h=s.lane,w=s.eventTime;if((r&h)===h){p!==null&&(p=p.next={eventTime:w,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var S=e,v=s;switch(h=t,w=n,v.tag){case 1:if(S=v.payload,typeof S=="function"){m=S.call(w,m,h);break e}m=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=v.payload,h=typeof S=="function"?S.call(w,m,h):S,h==null)break e;m=G({},m,h);break e;case 2:dt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[s]:h.push(s))}else w={eventTime:w,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},p===null?(a=p=w,u=m):p=p.next=w,i|=h;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;h=s,s=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(p===null&&(u=m),o.baseState=u,o.firstBaseUpdate=a,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else l===null&&(o.shared.lanes=0);Ht|=i,e.lanes=i,e.memoizedState=m}}function ju(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ml.transition;Ml.transition={};try{e(!1),t()}finally{U=n,Ml.transition=r}}function dd(){return Le().memoizedState}function Fh(e,t,n){var r=Et(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fd(e))pd(t,n);else if(n=Gc(e,t,n,r),n!==null){var o=de();Ae(n,e,r,o),hd(n,t,r)}}function Uh(e,t,n){var r=Et(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fd(e))pd(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,s=l(i,n);if(o.hasEagerState=!0,o.eagerState=s,je(s,i)){var u=t.interleaved;u===null?(o.next=o,Ss(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=Gc(e,t,o,r),n!==null&&(o=de(),Ae(n,e,r,o),hd(n,t,r))}}function fd(e){var t=e.alternate;return e===Q||t!==null&&t===Q}function pd(e,t){rr=jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,is(e,n)}}var Fo={readContext:Re,useCallback:ie,useContext:ie,useEffect:ie,useImperativeHandle:ie,useInsertionEffect:ie,useLayoutEffect:ie,useMemo:ie,useReducer:ie,useRef:ie,useState:ie,useDebugValue:ie,useDeferredValue:ie,useTransition:ie,useMutableSource:ie,useSyncExternalStore:ie,useId:ie,unstable_isNewReconciler:!1},bh={readContext:Re,useCallback:function(e,t){return be().memoizedState=[e,t===void 0?null:t],e},useContext:Re,useEffect:Uu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,co(4194308,4,id.bind(null,t,e),n)},useLayoutEffect:function(e,t){return co(4194308,4,e,t)},useInsertionEffect:function(e,t){return co(4,2,e,t)},useMemo:function(e,t){var n=be();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=be();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=Fh.bind(null,Q,e),[r.memoizedState,e]},useRef:function(e){var t=be();return e={current:e},t.memoizedState=e},useState:Fu,useDebugValue:Rs,useDeferredValue:function(e){return be().memoizedState=e},useTransition:function(){var e=Fu(!1),t=e[0];return e=jh.bind(null,e[1]),be().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Q,o=be();if(V){if(n===void 0)throw Error(k(407));n=n()}else{if(n=t(),ne===null)throw Error(k(349));Vt&30||Jc(r,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,Uu(ed.bind(null,r,l,e),[e]),r.flags|=2048,_r(9,qc.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=be(),t=ne.identifierPrefix;if(V){var n=Ye,r=Ke;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Er++,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[$e]=t,e[wr]=r,_d(e,t,!1,!1),t.stateNode=e;e:{switch(i=ii(n,r),n){case"dialog":B("cancel",e),B("close",e),o=r;break;case"iframe":case"object":case"embed":B("load",e),o=r;break;case"video":case"audio":for(o=0;oMn&&(t.flags|=128,r=!0,Vn(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ao(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vn(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!V)return se(t),null}else 2*Y()-l.renderingStartTime>Mn&&n!==1073741824&&(t.flags|=128,r=!0,Vn(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(n=l.last,n!==null?n.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Y(),t.sibling=null,n=H.current,b(H,r?n&1|2:n&1),t):(se(t),null);case 22:case 23:return Is(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?we&1073741824&&(se(t),t.subtreeFlags&6&&(t.flags|=8192)):se(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function Kh(e,t){switch(ms(t),t.tag){case 1:return ge(t.type)&&Ro(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ln(),W(ve),W(ae),_s(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ks(t),null;case 13:if(W(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));Tn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return W(H),null;case 4:return Ln(),null;case 10:return ws(t.type._context),null;case 22:case 23:return Is(),null;case 24:return null;default:return null}}var Yr=!1,ue=!1,Yh=typeof WeakSet=="function"?WeakSet:Set,R=null;function mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){K(e,t,r)}else n.current=null}function zi(e,t,n){try{n()}catch(r){K(e,t,r)}}var Xu=!1;function Xh(e,t){if(vi=Co,e=Oc(),ps(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,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,s=-1,u=-1,a=0,p=0,m=e,h=null;t:for(;;){for(var w;m!==n||o!==0&&m.nodeType!==3||(s=i+o),m!==l||r!==0&&m.nodeType!==3||(u=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(w=m.firstChild)!==null;)h=m,m=w;for(;;){if(m===e)break t;if(h===n&&++a===o&&(s=i),h===l&&++p===r&&(u=i),(w=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=w}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(gi={focusedElem:e,selectionRange:n},Co=!1,R=t;R!==null;)if(t=R,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,R=e;else for(;R!==null;){t=R;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var v=S.memoizedProps,E=S.memoizedState,d=t.stateNode,c=d.getSnapshotBeforeUpdate(t.elementType===t.type?v:Me(t.type,v),E);d.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(g){K(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,R=e;break}R=t.return}return S=Xu,Xu=!1,S}function or(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 l=o.destroy;o.destroy=void 0,l!==void 0&&zi(t,n,l)}o=o.next}while(o!==r)}}function tl(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 Di(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 Pd(e){var t=e.alternate;t!==null&&(e.alternate=null,Pd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$e],delete t[wr],delete t[Si],delete t[Mh],delete t[zh])),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 Td(e){return e.tag===5||e.tag===3||e.tag===4}function Zu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Td(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 Ii(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=To));else if(r!==4&&(e=e.child,e!==null))for(Ii(e,t,n),e=e.sibling;e!==null;)Ii(e,t,n),e=e.sibling}function Ai(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(Ai(e,t,n),e=e.sibling;e!==null;)Ai(e,t,n),e=e.sibling}var re=null,ze=!1;function lt(e,t,n){for(n=n.child;n!==null;)Rd(e,t,n),n=n.sibling}function Rd(e,t,n){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(Go,n)}catch{}switch(n.tag){case 5:ue||mn(n,t);case 6:var r=re,o=ze;re=null,lt(e,t,n),re=r,ze=o,re!==null&&(ze?(e=re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):re.removeChild(n.stateNode));break;case 18:re!==null&&(ze?(e=re,n=n.stateNode,e.nodeType===8?Rl(e.parentNode,n):e.nodeType===1&&Rl(e,n),hr(e)):Rl(re,n.stateNode));break;case 4:r=re,o=ze,re=n.stateNode.containerInfo,ze=!0,lt(e,t,n),re=r,ze=o;break;case 0:case 11:case 14:case 15:if(!ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var l=o,i=l.destroy;l=l.tag,i!==void 0&&(l&2||l&4)&&zi(n,t,i),o=o.next}while(o!==r)}lt(e,t,n);break;case 1:if(!ue&&(mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){K(n,t,s)}lt(e,t,n);break;case 21:lt(e,t,n);break;case 22:n.mode&1?(ue=(r=ue)||n.memoizedState!==null,lt(e,t,n),ue=r):lt(e,t,n);break;default:lt(e,t,n)}}function Ju(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Yh),t.forEach(function(r){var o=lm.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Oe(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~l}if(r=o,r=Y()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Jh(r/1960))-r,10e?16:e,mt===null)var r=!1;else{if(e=mt,mt=null,$o=0,A&6)throw Error(k(331));var o=A;for(A|=4,R=e.current;R!==null;){var l=R,i=l.child;if(R.flags&16){var s=l.deletions;if(s!==null){for(var u=0;uY()-zs?bt(e,0):Ms|=n),ye(e,t)}function jd(e,t){t===0&&(e.mode&1?(t=br,br<<=1,!(br&130023424)&&(br=4194304)):t=1);var n=de();e=qe(e,t),e!==null&&(Tr(e,t,n),ye(e,n))}function om(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jd(e,n)}function lm(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(k(314))}r!==null&&r.delete(t),jd(e,n)}var Fd;Fd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ve.current)me=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return me=!1,Qh(e,t,n);me=!!(e.flags&131072)}else me=!1,V&&t.flags&1048576&&Bc(t,Mo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;fo(e,t),e=t.pendingProps;var o=Pn(t,ae.current);xn(t,n),o=Ns(null,t,r,e,o,n);var l=Ps();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,ge(r)?(l=!0,Lo(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,xs(t),o.updater=el,t.stateNode=o,o._reactInternals=t,Ni(t,r,e,n),t=Ri(null,t,r,!0,l,n)):(t.tag=0,V&&l&&hs(t),ce(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(fo(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=sm(r),e=Me(r,e),o){case 0:t=Ti(null,t,r,e,n);break e;case 1:t=Gu(null,t,r,e,n);break e;case 11:t=Hu(null,t,r,e,n);break e;case 14:t=Qu(null,t,r,Me(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Me(r,o),Ti(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Me(r,o),Gu(e,t,r,o,n);case 3:e:{if(xd(t),e===null)throw Error(k(387));r=t.pendingProps,l=t.memoizedState,o=l.element,Kc(e,t),Io(t,r,null,n);var i=t.memoizedState;if(r=i.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=On(Error(k(423)),t),t=Ku(e,t,r,n,o);break e}else if(r!==o){o=On(Error(k(424)),t),t=Ku(e,t,r,n,o);break e}else for(Se=wt(t.stateNode.containerInfo.firstChild),xe=t,V=!0,De=null,n=Qc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tn(),r===o){t=et(e,t,n);break e}ce(e,t,r,n)}t=t.child}return t;case 5:return Yc(t),e===null&&ki(t),r=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,i=o.children,yi(r,o)?i=null:l!==null&&yi(r,l)&&(t.flags|=32),Sd(e,t),ce(e,t,i,n),t.child;case 6:return e===null&&ki(t),null;case 13:return Ed(e,t,n);case 4:return Es(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Rn(t,null,r,n):ce(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Me(r,o),Hu(e,t,r,o,n);case 7:return ce(e,t,t.pendingProps,n),t.child;case 8:return ce(e,t,t.pendingProps.children,n),t.child;case 12:return ce(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,l=t.memoizedProps,i=o.value,b(zo,r._currentValue),r._currentValue=i,l!==null)if(je(l.value,i)){if(l.children===o.children&&!ve.current){t=et(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var s=l.dependencies;if(s!==null){i=l.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Xe(-1,n&-n),u.tag=2;var a=l.updateQueue;if(a!==null){a=a.shared;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),_i(l.return,n,t),s.lanes|=n;break}u=u.next}}else if(l.tag===10)i=l.type===t.type?null:l.child;else if(l.tag===18){if(i=l.return,i===null)throw Error(k(341));i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),_i(i,n,t),i=l.sibling}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===t){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}ce(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,xn(t,n),o=Re(o),r=r(o),t.flags|=1,ce(e,t,r,n),t.child;case 14:return r=t.type,o=Me(r,t.pendingProps),o=Me(r.type,o),Qu(e,t,r,o,n);case 15:return yd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Me(r,o),fo(e,t),t.tag=1,ge(r)?(e=!0,Lo(t)):e=!1,xn(t,n),md(t,r,o),Ni(t,r,o,n),Ri(null,t,r,!0,e,n);case 19:return kd(e,t,n);case 22:return wd(e,t,n)}throw Error(k(156,t.tag))};function Ud(e,t){return fc(e,t)}function im(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 Pe(e,t,n,r){return new im(e,t,n,r)}function js(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sm(e){if(typeof e=="function")return js(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ns)return 11;if(e===rs)return 14}return 2}function kt(e,t){var n=e.alternate;return n===null?(n=Pe(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 mo(e,t,n,r,o,l){var i=2;if(r=e,typeof e=="function")js(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case ln:return $t(n.children,o,l,t);case ts:i=8,o|=8;break;case Xl:return e=Pe(12,n,t,o|2),e.elementType=Xl,e.lanes=l,e;case Zl:return e=Pe(13,n,t,o),e.elementType=Zl,e.lanes=l,e;case Jl:return e=Pe(19,n,t,o),e.elementType=Jl,e.lanes=l,e;case Ya:return rl(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ga:i=10;break e;case Ka:i=9;break e;case ns:i=11;break e;case rs:i=14;break e;case ct:i=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=Pe(i,n,t,o),t.elementType=e,t.type=r,t.lanes=l,t}function $t(e,t,n,r){return e=Pe(7,e,r,t),e.lanes=n,e}function rl(e,t,n,r){return e=Pe(22,e,r,t),e.elementType=Ya,e.lanes=n,e.stateNode={isHidden:!1},e}function jl(e,t,n){return e=Pe(6,e,null,t),e.lanes=n,e}function Fl(e,t,n){return t=Pe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function um(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=yl(0),this.expirationTimes=yl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Fs(e,t,n,r,o,l,i,s,u){return e=new um(e,t,n,s,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Pe(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xs(l),e}function am(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wd)}catch(e){console.error(e)}}Wd(),Wa.exports=ke;var Bs=Wa.exports;const hm=Oa(Bs);var ia=Bs;Kl.createRoot=ia.createRoot,Kl.hydrateRoot=ia.hydrateRoot;function _t(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 mm(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Vd(...e){return t=>e.forEach(n=>mm(n,t))}function Jt(...e){return y.useCallback(Vd(...e),e)}function vm(e,t){const n=y.createContext(t),r=l=>{const{children:i,...s}=l,u=y.useMemo(()=>s,Object.values(s));return C.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(l){const i=y.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,o]}function gm(e,t=[]){let n=[];function r(l,i){const s=y.createContext(i),u=n.length;n=[...n,i];const a=m=>{var d;const{scope:h,children:w,...S}=m,v=((d=h==null?void 0:h[e])==null?void 0:d[u])||s,E=y.useMemo(()=>S,Object.values(S));return C.jsx(v.Provider,{value:E,children:w})};a.displayName=l+"Provider";function p(m,h){var v;const w=((v=h==null?void 0:h[e])==null?void 0:v[u])||s,S=y.useContext(w);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${l}\``)}return[a,p]}const o=()=>{const l=n.map(i=>y.createContext(i));return function(s){const u=(s==null?void 0:s[e])||l;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return o.scopeName=e,[r,ym(o,...t)]}function ym(...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(l){const i=r.reduce((s,{useScope:u,scopeName:a})=>{const m=u(l)[`__scope${a}`];return{...s,...m}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var $i=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{};function Nr(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var ul=y.forwardRef((e,t)=>{const{children:n,...r}=e,o=y.Children.toArray(n),l=o.find(Sm);if(l){const i=l.props.children,s=o.map(u=>u===l?y.Children.count(i)>1?y.Children.only(null):y.isValidElement(i)?i.props.children:null:u);return C.jsx(Bi,{...r,ref:t,children:y.isValidElement(i)?y.cloneElement(i,void 0,s):null})}return C.jsx(Bi,{...r,ref:t,children:n})});ul.displayName="Slot";var Bi=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const o=Em(n);return y.cloneElement(n,{...xm(r,n.props),ref:t?Vd(t,o):o})}return y.Children.count(n)>1?y.Children.only(null):null});Bi.displayName="SlotClone";var wm=({children:e})=>C.jsx(C.Fragment,{children:e});function Sm(e){return y.isValidElement(e)&&e.type===wm}function xm(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...s)=>{l(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function Em(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)}var km=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],nt=km.reduce((e,t)=>{const n=y.forwardRef((r,o)=>{const{asChild:l,...i}=r,s=l?ul:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(s,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _m(e,t){e&&Bs.flushSync(()=>e.dispatchEvent(t))}function Cm(e,t=globalThis==null?void 0:globalThis.document){const n=Nr(e);y.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 Nm="DismissableLayer",Wi="dismissableLayer.update",Pm="dismissableLayer.pointerDownOutside",Tm="dismissableLayer.focusOutside",sa,Hd=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qd=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:i,onDismiss:s,...u}=e,a=y.useContext(Hd),[p,m]=y.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=y.useState({}),S=Jt(t,_=>m(_)),v=Array.from(a.layers),[E]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),d=v.indexOf(E),c=p?v.indexOf(p):-1,f=a.layersWithOutsidePointerEventsDisabled.size>0,g=c>=d,x=Om(_=>{const P=_.target,L=[...a.branches].some(M=>M.contains(P));!g||L||(o==null||o(_),i==null||i(_),_.defaultPrevented||s==null||s())},h),N=Mm(_=>{const P=_.target;[...a.branches].some(M=>M.contains(P))||(l==null||l(_),i==null||i(_),_.defaultPrevented||s==null||s())},h);return Cm(_=>{c===a.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&s&&(_.preventDefault(),s()))},h),y.useEffect(()=>{if(p)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(sa=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(p)),a.layers.add(p),ua(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=sa)}},[p,h,n,a]),y.useEffect(()=>()=>{p&&(a.layers.delete(p),a.layersWithOutsidePointerEventsDisabled.delete(p),ua())},[p,a]),y.useEffect(()=>{const _=()=>w({});return document.addEventListener(Wi,_),()=>document.removeEventListener(Wi,_)},[]),C.jsx(nt.div,{...u,ref:S,style:{pointerEvents:f?g?"auto":"none":void 0,...e.style},onFocusCapture:_t(e.onFocusCapture,N.onFocusCapture),onBlurCapture:_t(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:_t(e.onPointerDownCapture,x.onPointerDownCapture)})});Qd.displayName=Nm;var Rm="DismissableLayerBranch",Lm=y.forwardRef((e,t)=>{const n=y.useContext(Hd),r=y.useRef(null),o=Jt(t,r);return y.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),C.jsx(nt.div,{...e,ref:o})});Lm.displayName=Rm;function Om(e,t=globalThis==null?void 0:globalThis.document){const n=Nr(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const l=s=>{if(s.target&&!r.current){let u=function(){Gd(Pm,n,a,{discrete:!0})};const a={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",l),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mm(e,t=globalThis==null?void 0:globalThis.document){const n=Nr(e),r=y.useRef(!1);return y.useEffect(()=>{const o=l=>{l.target&&!r.current&&Gd(Tm,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ua(){const e=new CustomEvent(Wi);document.dispatchEvent(e)}function Gd(e,t,n,{discrete:r}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?_m(o,l):o.dispatchEvent(l)}var Ul="focusScope.autoFocusOnMount",bl="focusScope.autoFocusOnUnmount",aa={bubbles:!1,cancelable:!0},zm="FocusScope",Kd=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...i}=e,[s,u]=y.useState(null),a=Nr(o),p=Nr(l),m=y.useRef(null),h=Jt(t,v=>u(v)),w=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let v=function(f){if(w.paused||!s)return;const g=f.target;s.contains(g)?m.current=g:at(m.current,{select:!0})},E=function(f){if(w.paused||!s)return;const g=f.relatedTarget;g!==null&&(s.contains(g)||at(m.current,{select:!0}))},d=function(f){if(document.activeElement===document.body)for(const x of f)x.removedNodes.length>0&&at(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",E);const c=new MutationObserver(d);return s&&c.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",E),c.disconnect()}}},[r,s,w.paused]),y.useEffect(()=>{if(s){da.add(w);const v=document.activeElement;if(!s.contains(v)){const d=new CustomEvent(Ul,aa);s.addEventListener(Ul,a),s.dispatchEvent(d),d.defaultPrevented||(Dm(Um(Yd(s)),{select:!0}),document.activeElement===v&&at(s))}return()=>{s.removeEventListener(Ul,a),setTimeout(()=>{const d=new CustomEvent(bl,aa);s.addEventListener(bl,p),s.dispatchEvent(d),d.defaultPrevented||at(v??document.body,{select:!0}),s.removeEventListener(bl,p),da.remove(w)},0)}}},[s,a,p,w]);const S=y.useCallback(v=>{if(!n&&!r||w.paused)return;const E=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,d=document.activeElement;if(E&&d){const c=v.currentTarget,[f,g]=Im(c);f&&g?!v.shiftKey&&d===g?(v.preventDefault(),n&&at(f,{select:!0})):v.shiftKey&&d===f&&(v.preventDefault(),n&&at(g,{select:!0})):d===c&&v.preventDefault()}},[n,r,w.paused]);return C.jsx(nt.div,{tabIndex:-1,...i,ref:h,onKeyDown:S})});Kd.displayName=zm;function Dm(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(at(r,{select:t}),document.activeElement!==n)return}function Im(e){const t=Yd(e),n=ca(t,e),r=ca(t.reverse(),e);return[n,r]}function Yd(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 ca(e,t){for(const n of e)if(!Am(n,{upTo:t}))return n}function Am(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 jm(e){return e instanceof HTMLInputElement&&"select"in e}function at(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jm(e)&&t&&e.select()}}var da=Fm();function Fm(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=fa(e,t),e.unshift(t)},remove(t){var n;e=fa(e,t),(n=e[0])==null||n.resume()}}}function fa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Um(e){return e.filter(t=>t.tagName!=="A")}var bm="Portal",Xd=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,l]=y.useState(!1);$i(()=>l(!0),[]);const i=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return i?hm.createPortal(C.jsx(nt.div,{...r,ref:t}),i):null});Xd.displayName=bm;function $m(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var al=e=>{const{present:t,children:n}=e,r=Bm(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),l=Jt(r.ref,Wm(o));return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:l}):null};al.displayName="Presence";function Bm(e){const[t,n]=y.useState(),r=y.useRef({}),o=y.useRef(e),l=y.useRef("none"),i=e?"mounted":"unmounted",[s,u]=$m(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const a=Jr(r.current);l.current=s==="mounted"?a:"none"},[s]),$i(()=>{const a=r.current,p=o.current;if(p!==e){const h=l.current,w=Jr(a);e?u("MOUNT"):w==="none"||(a==null?void 0:a.display)==="none"?u("UNMOUNT"):u(p&&h!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),$i(()=>{if(t){let a;const p=t.ownerDocument.defaultView??window,m=w=>{const v=Jr(r.current).includes(w.animationName);if(w.target===t&&v&&(u("ANIMATION_END"),!o.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",a=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},h=w=>{w.target===t&&(l.current=Jr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(a),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(a=>{a&&(r.current=getComputedStyle(a)),n(a)},[])}}function Jr(e){return(e==null?void 0:e.animationName)||"none"}function Wm(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)}var $l=0;function Vm(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pa()),document.body.insertAdjacentElement("beforeend",e[1]??pa()),$l++,()=>{$l===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$l--}},[])}function pa(){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 Be=function(){return Be=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return sv;var t=uv(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])}},cv=ef(),kn="data-scroll-locked",dv=function(e,t,n,r){var o=e.left,l=e.top,i=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(Qm,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } body[`).concat(kn,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(l,`px; padding-right: `).concat(i,`px; margin-left:0; margin-top:0; margin-right: `).concat(s,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(vo,` { right: `).concat(s,"px ").concat(r,`; } .`).concat(go,` { margin-right: `).concat(s,"px ").concat(r,`; } .`).concat(vo," .").concat(vo,` { right: 0 `).concat(r,`; } .`).concat(go," .").concat(go,` { margin-right: 0 `).concat(r,`; } body[`).concat(kn,`] { `).concat(Gm,": ").concat(s,`px; } `)},ma=function(){var e=parseInt(document.body.getAttribute(kn)||"0",10);return isFinite(e)?e:0},fv=function(){y.useEffect(function(){return document.body.setAttribute(kn,(ma()+1).toString()),function(){var e=ma()-1;e<=0?document.body.removeAttribute(kn):document.body.setAttribute(kn,e.toString())}},[])},pv=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;fv();var l=y.useMemo(function(){return av(o)},[o]);return y.createElement(cv,{styles:dv(l,!t,o,n?"":"!important")})},Vi=!1;if(typeof window<"u")try{var qr=Object.defineProperty({},"passive",{get:function(){return Vi=!0,!0}});window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{Vi=!1}var tn=Vi?{passive:!1}:!1,hv=function(e){return e.tagName==="TEXTAREA"},tf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hv(e)&&n[t]==="visible")},mv=function(e){return tf(e,"overflowY")},vv=function(e){return tf(e,"overflowX")},va=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=nf(e,r);if(o){var l=rf(e,r),i=l[1],s=l[2];if(i>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gv=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},yv=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},nf=function(e,t){return e==="v"?mv(t):vv(t)},rf=function(e,t){return e==="v"?gv(t):yv(t)},wv=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sv=function(e,t,n,r,o){var l=wv(e,window.getComputedStyle(t).direction),i=l*r,s=n.target,u=t.contains(s),a=!1,p=i>0,m=0,h=0;do{var w=rf(e,s),S=w[0],v=w[1],E=w[2],d=v-E-l*S;(S||d)&&nf(e,s)&&(m+=d,h+=S),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(p&&(Math.abs(m)<1||!o)||!p&&(Math.abs(h)<1||!o))&&(a=!0),a},eo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ga=function(e){return[e.deltaX,e.deltaY]},ya=function(e){return e&&"current"in e?e.current:e},xv=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ev=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},kv=0,nn=[];function _v(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(kv++)[0],l=y.useState(ef)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=Hm([e.lockRef.current],(e.shards||[]).map(ya),!0).filter(Boolean);return v.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(v,E){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var d=eo(v),c=n.current,f="deltaX"in v?v.deltaX:c[0]-d[0],g="deltaY"in v?v.deltaY:c[1]-d[1],x,N=v.target,_=Math.abs(f)>Math.abs(g)?"h":"v";if("touches"in v&&_==="h"&&N.type==="range")return!1;var P=va(_,N);if(!P)return!0;if(P?x=_:(x=_==="v"?"h":"v",P=va(_,N)),!P)return!1;if(!r.current&&"changedTouches"in v&&(f||g)&&(r.current=x),!x)return!0;var L=r.current||x;return Sv(L,E,v,L==="h"?f:g,!0)},[]),u=y.useCallback(function(v){var E=v;if(!(!nn.length||nn[nn.length-1]!==l)){var d="deltaY"in E?ga(E):eo(E),c=t.current.filter(function(x){return x.name===E.type&&(x.target===E.target||E.target===x.shadowParent)&&xv(x.delta,d)})[0];if(c&&c.should){E.cancelable&&E.preventDefault();return}if(!c){var f=(i.current.shards||[]).map(ya).filter(Boolean).filter(function(x){return x.contains(E.target)}),g=f.length>0?s(E,f[0]):!i.current.noIsolation;g&&E.cancelable&&E.preventDefault()}}},[]),a=y.useCallback(function(v,E,d,c){var f={name:v,delta:E,target:d,should:c,shadowParent:Cv(d)};t.current.push(f),setTimeout(function(){t.current=t.current.filter(function(g){return g!==f})},1)},[]),p=y.useCallback(function(v){n.current=eo(v),r.current=void 0},[]),m=y.useCallback(function(v){a(v.type,ga(v),v.target,s(v,e.lockRef.current))},[]),h=y.useCallback(function(v){a(v.type,eo(v),v.target,s(v,e.lockRef.current))},[]);y.useEffect(function(){return nn.push(l),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:h}),document.addEventListener("wheel",u,tn),document.addEventListener("touchmove",u,tn),document.addEventListener("touchstart",p,tn),function(){nn=nn.filter(function(v){return v!==l}),document.removeEventListener("wheel",u,tn),document.removeEventListener("touchmove",u,tn),document.removeEventListener("touchstart",p,tn)}},[]);var w=e.removeScrollBar,S=e.inert;return y.createElement(y.Fragment,null,S?y.createElement(l,{styles:Ev(o)}):null,w?y.createElement(pv,{gapMode:e.gapMode}):null)}function Cv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nv=ev(qd,_v);var of=y.forwardRef(function(e,t){return y.createElement(cl,Be({},e,{ref:t,sideCar:Nv}))});of.classNames=cl.classNames;var Pv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rn=new WeakMap,to=new WeakMap,no={},Hl=0,lf=function(e){return e&&(e.host||lf(e.parentNode))},Tv=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=lf(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})},Rv=function(e,t,n,r){var o=Tv(t,Array.isArray(e)?e:[e]);no[n]||(no[n]=new WeakMap);var l=no[n],i=[],s=new Set,u=new Set(o),a=function(m){!m||s.has(m)||(s.add(m),a(m.parentNode))};o.forEach(a);var p=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(h){if(s.has(h))p(h);else try{var w=h.getAttribute(r),S=w!==null&&w!=="false",v=(rn.get(h)||0)+1,E=(l.get(h)||0)+1;rn.set(h,v),l.set(h,E),i.push(h),v===1&&S&&to.set(h,!0),E===1&&h.setAttribute(n,"true"),S||h.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",h,d)}})};return p(t),s.clear(),Hl++,function(){i.forEach(function(m){var h=rn.get(m)-1,w=l.get(m)-1;rn.set(m,h),l.set(m,w),h||(to.has(m)||m.removeAttribute(r),to.delete(m)),w||m.removeAttribute(n)}),Hl--,Hl||(rn=new WeakMap,rn=new WeakMap,to=new WeakMap,no={})}},Lv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Pv(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Rv(r,o,n,"aria-hidden")):function(){return null}},sf="Dialog",[uf,dy]=gm(sf),[fy,Fe]=uf(sf),af="DialogTrigger",Ov=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fe(af,n),l=Jt(t,o.triggerRef);return C.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Hs(o.open),...r,ref:l,onClick:_t(e.onClick,o.onOpenToggle)})});Ov.displayName=af;var Ws="DialogPortal",[Mv,cf]=uf(Ws,{forceMount:void 0}),df=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,l=Fe(Ws,t);return C.jsx(Mv,{scope:t,forceMount:n,children:y.Children.map(r,i=>C.jsx(al,{present:n||l.open,children:C.jsx(Xd,{asChild:!0,container:o,children:i})}))})};df.displayName=Ws;var Vo="DialogOverlay",ff=y.forwardRef((e,t)=>{const n=cf(Vo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Fe(Vo,e.__scopeDialog);return l.modal?C.jsx(al,{present:r||l.open,children:C.jsx(zv,{...o,ref:t})}):null});ff.displayName=Vo;var zv=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fe(Vo,n);return C.jsx(of,{as:ul,allowPinchZoom:!0,shards:[o.contentRef],children:C.jsx(nt.div,{"data-state":Hs(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Gt="DialogContent",pf=y.forwardRef((e,t)=>{const n=cf(Gt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Fe(Gt,e.__scopeDialog);return C.jsx(al,{present:r||l.open,children:l.modal?C.jsx(Dv,{...o,ref:t}):C.jsx(Iv,{...o,ref:t})})});pf.displayName=Gt;var Dv=y.forwardRef((e,t)=>{const n=Fe(Gt,e.__scopeDialog),r=y.useRef(null),o=Jt(t,n.contentRef,r);return y.useEffect(()=>{const l=r.current;if(l)return Lv(l)},[]),C.jsx(hf,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&l.preventDefault()}),onFocusOutside:_t(e.onFocusOutside,l=>l.preventDefault())})}),Iv=y.forwardRef((e,t)=>{const n=Fe(Gt,e.__scopeDialog),r=y.useRef(!1),o=y.useRef(!1);return C.jsx(hf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),l.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:l=>{var u,a;(u=e.onInteractOutside)==null||u.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=l.target;((a=n.triggerRef.current)==null?void 0:a.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),hf=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...i}=e,s=Fe(Gt,n),u=y.useRef(null),a=Jt(t,u);return Vm(),C.jsxs(C.Fragment,{children:[C.jsx(Kd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:C.jsx(Qd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Hs(s.open),...i,ref:a,onDismiss:()=>s.onOpenChange(!1)})}),C.jsxs(C.Fragment,{children:[C.jsx(Av,{titleId:s.titleId}),C.jsx(Fv,{contentRef:u,descriptionId:s.descriptionId})]})]})}),Vs="DialogTitle",mf=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fe(Vs,n);return C.jsx(nt.h2,{id:o.titleId,...r,ref:t})});mf.displayName=Vs;var vf="DialogDescription",gf=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fe(vf,n);return C.jsx(nt.p,{id:o.descriptionId,...r,ref:t})});gf.displayName=vf;var yf="DialogClose",wf=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fe(yf,n);return C.jsx(nt.button,{type:"button",...r,ref:t,onClick:_t(e.onClick,()=>o.onOpenChange(!1))})});wf.displayName=yf;function Hs(e){return e?"open":"closed"}var Sf="DialogTitleWarning",[py,xf]=vm(Sf,{contentName:Gt,titleName:Vs,docsSlug:"dialog"}),Av=({titleId:e})=>{const t=xf(Sf),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 y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jv="DialogDescriptionWarning",Fv=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xf(jv).contentName}}.`;return y.useEffect(()=>{var l;const o=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Uv=df,Ef=ff,kf=pf,_f=mf,Cf=gf,bv=wf;/** * @license lucide-react v0.462.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=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Nf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Bv={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.462.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=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:i,...s},u)=>y.createElement("svg",{ref:u,...Bv,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Nf("lucide",o),...s},[...i.map(([a,p])=>y.createElement(a,p)),...Array.isArray(l)?l:[l]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dl=(e,t)=>{const n=y.forwardRef(({className:r,...o},l)=>y.createElement(Wv,{ref:l,iconNode:t,className:Nf(`lucide-${$v(e)}`,r),...o}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wa=dl("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vv=dl("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sa=dl("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hv=dl("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Pf(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;t{const t=Kv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const s=i.split(Qs);return s[0]===""&&s.length!==1&&s.shift(),Rf(s,t)||Gv(i)},getConflictingClassGroupIds:(i,s)=>{const u=n[i]||[];return s&&r[i]?[...u,...r[i]]:u}}},Rf=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Rf(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const l=e.join(Qs);return(i=t.validators.find(({validator:s})=>s(l)))==null?void 0:i.classGroupId},xa=/^\[(.+)\]$/,Gv=e=>{if(xa.test(e)){const t=xa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Kv=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Xv(Object.entries(e.classGroups),n).forEach(([l,i])=>{Hi(i,r,l,t)}),r},Hi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const l=o===""?t:Ea(t,o);l.classGroupId=n;return}if(typeof o=="function"){if(Yv(o)){Hi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([l,i])=>{Hi(i,Ea(t,l),n,r)})})},Ea=(e,t)=>{let n=e;return t.split(Qs).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Yv=e=>e.isThemeGetter,Xv=(e,t)=>t?e.map(([n,r])=>{const o=r.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([i,s])=>[t+i,s])):l);return[n,o]}):e,Zv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(l,i)=>{n.set(l,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let i=n.get(l);if(i!==void 0)return i;if((i=r.get(l))!==void 0)return o(l,i),i},set(l,i){n.has(l)?n.set(l,i):o(l,i)}}},Lf="!",Jv=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],l=t.length,i=s=>{const u=[];let a=0,p=0,m;for(let E=0;Ep?m-p:void 0;return{modifiers:u,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:v}};return n?s=>n({className:s,parseClassName:i}):i},qv=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},eg=e=>({cache:Zv(e.cacheSize),parseClassName:Jv(e),...Qv(e)}),tg=/\s+/,ng=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,l=[],i=e.trim().split(tg);let s="";for(let u=i.length-1;u>=0;u-=1){const a=i[u],{modifiers:p,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:w}=n(a);let S=!!w,v=r(S?h.substring(0,w):h);if(!v){if(!S){s=a+(s.length>0?" "+s:s);continue}if(v=r(h),!v){s=a+(s.length>0?" "+s:s);continue}S=!1}const E=qv(p).join(":"),d=m?E+Lf:E,c=d+v;if(l.includes(c))continue;l.push(c);const f=o(v,S);for(let g=0;g0?" "+s:s)}return s};function rg(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rm(p),e());return n=eg(a),r=n.cache.get,o=n.cache.set,l=s,s(u)}function s(u){const a=r(u);if(a)return a;const p=ng(u,n);return o(u,p),p}return function(){return l(rg.apply(null,arguments))}}const $=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Mf=/^\[(?:([a-z-]+):)?(.+)\]$/i,lg=/^\d+\/\d+$/,ig=new Set(["px","full","screen"]),sg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ug=/\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$/,ag=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=e=>_n(e)||ig.has(e)||lg.test(e),it=e=>jn(e,"length",wg),_n=e=>!!e&&!Number.isNaN(Number(e)),Ql=e=>jn(e,"number",_n),Qn=e=>!!e&&Number.isInteger(Number(e)),fg=e=>e.endsWith("%")&&_n(e.slice(0,-1)),D=e=>Mf.test(e),st=e=>sg.test(e),pg=new Set(["length","size","percentage"]),hg=e=>jn(e,pg,zf),mg=e=>jn(e,"position",zf),vg=new Set(["image","url"]),gg=e=>jn(e,vg,xg),yg=e=>jn(e,"",Sg),Gn=()=>!0,jn=(e,t,n)=>{const r=Mf.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},wg=e=>ug.test(e)&&!ag.test(e),zf=()=>!1,Sg=e=>cg.test(e),xg=e=>dg.test(e),Eg=()=>{const e=$("colors"),t=$("spacing"),n=$("blur"),r=$("brightness"),o=$("borderColor"),l=$("borderRadius"),i=$("borderSpacing"),s=$("borderWidth"),u=$("contrast"),a=$("grayscale"),p=$("hueRotate"),m=$("invert"),h=$("gap"),w=$("gradientColorStops"),S=$("gradientColorStopPositions"),v=$("inset"),E=$("margin"),d=$("opacity"),c=$("padding"),f=$("saturate"),g=$("scale"),x=$("sepia"),N=$("skew"),_=$("space"),P=$("translate"),L=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto",D,t],F=()=>[D,t],rt=()=>["",He,it],Ot=()=>["auto",_n,D],Mr=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ot=()=>["solid","dashed","dotted","double","none"],qt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",D],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[_n,D];return{cacheSize:500,separator:":",theme:{colors:[Gn],spacing:[He,it],blur:["none","",st,D],brightness:j(),borderColor:[e],borderRadius:["none","","full",st,D],borderSpacing:F(),borderWidth:rt(),contrast:j(),grayscale:O(),hueRotate:j(),invert:O(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[fg,it],inset:Z(),margin:Z(),opacity:j(),padding:F(),saturate:j(),scale:j(),sepia:O(),skew:j(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",D]}],container:["container"],columns:[{columns:[st]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...Mr(),D]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],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",Qn,D]}],basis:[{basis:Z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",D]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",Qn,D]}],"grid-cols":[{"grid-cols":[Gn]}],"col-start-end":[{col:["auto",{span:["full",Qn,D]},D]}],"col-start":[{"col-start":Ot()}],"col-end":[{"col-end":Ot()}],"grid-rows":[{"grid-rows":[Gn]}],"row-start-end":[{row:["auto",{span:[Qn,D]},D]}],"row-start":[{"row-start":Ot()}],"row-end":[{"row-end":Ot()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",D]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",D]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[c]}],px:[{px:[c]}],py:[{py:[c]}],ps:[{ps:[c]}],pe:[{pe:[c]}],pt:[{pt:[c]}],pr:[{pr:[c]}],pb:[{pb:[c]}],pl:[{pl:[c]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",D,t]}],"min-w":[{"min-w":[D,t,"min","max","fit"]}],"max-w":[{"max-w":[D,t,"none","full","min","max","fit","prose",{screen:[st]},st]}],h:[{h:[D,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[D,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[D,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[D,t,"auto","min","max","fit"]}],"font-size":[{text:["base",st,it]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ql]}],"font-family":[{font:[Gn]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",D]}],"line-clamp":[{"line-clamp":["none",_n,Ql]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",He,D]}],"list-image":[{"list-image":["none",D]}],"list-style-type":[{list:["none","disc","decimal",D]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[d]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[d]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ot(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",He,it]}],"underline-offset":[{"underline-offset":["auto",He,D]}],"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:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",D]}],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",D]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[d]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Mr(),mg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[d]}],"border-style":[{border:[...ot(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[d]}],"divide-style":[{divide:ot()}],"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:["",...ot()]}],"outline-offset":[{"outline-offset":[He,D]}],"outline-w":[{outline:[He,it]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:rt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[d]}],"ring-offset-w":[{"ring-offset":[He,it]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",st,yg]}],"shadow-color":[{shadow:[Gn]}],opacity:[{opacity:[d]}],"mix-blend":[{"mix-blend":[...qt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":qt()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",st,D]}],grayscale:[{grayscale:[a]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[f]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[a]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[d]}],"backdrop-saturate":[{"backdrop-saturate":[f]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"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",D]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",D]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",D]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[g]}],"scale-x":[{"scale-x":[g]}],"scale-y":[{"scale-y":[g]}],rotate:[{rotate:[Qn,D]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",D]}],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",D]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",D]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[He,it,Ql]}],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"]}}},kg=og(Eg);function Kt(...e){return kg(Tf(e))}const _g=Uv,Df=y.forwardRef(({className:e,...t},n)=>C.jsx(Ef,{ref:n,className:Kt("fixed inset-0 z-50 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}));Df.displayName=Ef.displayName;const Cg=y.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(_g,{children:[C.jsx(Df,{}),C.jsxs(kf,{ref:r,className:Kt("fixed left-[50%] top-[50%] z-50 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,C.jsxs(bv,{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:[C.jsx(Hv,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cg.displayName=kf.displayName;const Ng=y.forwardRef(({className:e,...t},n)=>C.jsx(_f,{ref:n,className:Kt("text-lg font-semibold leading-none tracking-tight",e),...t}));Ng.displayName=_f.displayName;const Pg=y.forwardRef(({className:e,...t},n)=>C.jsx(Cf,{ref:n,className:Kt("text-sm text-muted-foreground",e),...t}));Pg.displayName=Cf.displayName;const ka=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_a=Tf,Tg=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return _a(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,i=Object.keys(o).map(a=>{const p=n==null?void 0:n[a],m=l==null?void 0:l[a];if(p===null)return null;const h=ka(p)||ka(m);return o[a][h]}),s=n&&Object.entries(n).reduce((a,p)=>{let[m,h]=p;return h===void 0||(a[m]=h),a},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((a,p)=>{let{class:m,className:h,...w}=p;return Object.entries(w).every(S=>{let[v,E]=S;return Array.isArray(E)?E.includes({...l,...s}[v]):{...l,...s}[v]===E})?[...a,m,h]:a},[]);return _a(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},Rg=Tg("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"}}),yo=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},l)=>{const i=r?ul:"button";return C.jsx(i,{className:Kt(Rg({variant:t,size:n,className:e})),ref:l,...o})});yo.displayName="Button";const ut=()=>{if(typeof window<"u"&&window.appContext)return window.appContext;const e=new URLSearchParams(window.location.search);return{auth_token:e.get("auth_token")||void 0,user_id:e.get("user_id")||void 0,gallery_api_url:e.get("api_url")||void 0}},Cn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Pt=globalThis,sr="10.22.0";function If(){return Gs(Pt),Pt}function Gs(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||sr,t[sr]=t[sr]||{}}function Ks(e,t,n=Pt){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[sr]=r[sr]||{};return o[e]||(o[e]=t())}const Lg="Sentry Logger ",Ca={};function Og(e){if(!("console"in Pt))return e();const t=Pt.console,n={},r=Object.keys(Ca);r.forEach(o=>{const l=Ca[o];n[o]=t[o],t[o]=l});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Mg(){Xs().enabled=!0}function zg(){Xs().enabled=!1}function Af(){return Xs().enabled}function Dg(...e){Ys("log",...e)}function Ig(...e){Ys("warn",...e)}function Ag(...e){Ys("error",...e)}function Ys(e,...t){Cn&&Af()&&Og(()=>{Pt.console[e](`${Lg}[${e}]:`,...t)})}function Xs(){return Cn?Ks("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const wo={enable:Mg,disable:zg,isEnabled:Af,log:Dg,warn:Ig,error:Ag},jg=Object.prototype.toString;function Fg(e,t){return jg.call(e)===`[object ${t}]`}function Ug(e){return Fg(e,"Object")}function bg(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function $g(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Bg(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Cn&&wo.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Wg(){const e=Pt;return e.crypto||e.msCrypto}let Gl;function Vg(){return Math.random()*16}function ur(e=Wg()){try{if(e!=null&&e.randomUUID)return e.randomUUID().replace(/-/g,"")}catch{}return Gl||(Gl="10000000100040008000"+1e11),Gl.replace(/[018]/g,t=>(t^(Vg()&15)>>t/4).toString(16))}const jf=1e3;function Ff(){return Date.now()/jf}function Hg(){const{performance:e}=Pt;if(!(e!=null&&e.now)||!e.timeOrigin)return Ff;const t=e.timeOrigin;return()=>(t+e.now())/jf}let Na;function Qg(){return(Na??(Na=Hg()))()}function Gg(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Qg(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:ur()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Uf(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Uf(r[o],t[o],n-1));return r}function Pa(){return ur()}const Qi="_sentrySpan";function Ta(e,t){t?Bg(e,Qi,t):delete e[Qi]}function Ra(e){return e[Qi]}const Kg=100;class Yt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Pa(),sampleRand:Math.random()}}clone(){const t=new Yt;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Ta(t,Ra(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Gg(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof Yt?n.getScopeData():Ug(n)?t:void 0,{tags:o,extra:l,user:i,contexts:s,level:u,fingerprint:a=[],propagationContext:p}=r||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...l},this._contexts={...this._contexts,...s},i&&Object.keys(i).length&&(this._user=i),u&&(this._level=u),a.length&&(this._fingerprint=a),p&&(this._propagationContext=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,Ta(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Pa(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var l;const r=typeof n=="number"?n:Kg;if(r<=0)return this;const o={timestamp:Ff(),...t,message:t.message?$g(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(l=this._client)==null||l.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ra(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Uf(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||ur();if(!this._client)return Cn&&wo.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=(r==null?void 0:r.event_id)||ur();if(!this._client)return Cn&&wo.warn("No client configured on scope - will not capture message!"),o;const l=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:l,...r,event_id:o},this),o}captureEvent(t,n){const r=(n==null?void 0:n.event_id)||ur();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Cn&&wo.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function Yg(){return Ks("defaultCurrentScope",()=>new Yt)}function Xg(){return Ks("defaultIsolationScope",()=>new Yt)}class Zg{constructor(t,n){let r;t?r=t:r=new Yt;let o;n?o=n:o=new Yt,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return bg(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function zn(){const e=If(),t=Gs(e);return t.stack=t.stack||new Zg(Yg(),Xg())}function Jg(e){return zn().withScope(e)}function qg(e,t){const n=zn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function La(e){return zn().withScope(()=>e(zn().getIsolationScope()))}function ey(){return{withIsolationScope:La,withScope:Jg,withSetScope:qg,withSetIsolationScope:(e,t)=>La(t),getCurrentScope:()=>zn().getScope(),getIsolationScope:()=>zn().getIsolationScope()}}function ty(e){const t=Gs(e);return t.acs?t.acs:ey()}function ny(){const e=If();return ty(e).getCurrentScope()}function ry(e,t){return ny().captureException(e,void 0)}class oy{static getHeaders(t){const n=ut(),r={"Content-Type":"application/json"};return n.auth_token&&(r.Authorization=`Bearer ${n.auth_token}`,t&&delete r["Content-Type"]),r}static async completeUpload(t,n){const l=`${ut().upload_api_url}/api/upload/chunk-upload/${t}`,i=await fetch(l,{method:"PUT",headers:this.getHeaders(!1),body:JSON.stringify({parts:n}),credentials:"include"});if(!i.ok)throw new Error(`Failed to complete upload for ${t}`);return await i.json()}static async saveVideoMetadata(t,n,r){const i=`${ut().upload_api_url}/api/video/${t}/metadata`;function s(u){const a=atob(u.split(",")[1]),p=u.split(",")[0].split(":")[1].split(";")[0],m=new ArrayBuffer(a.length),h=new Uint8Array(m);for(let w=0;w{const l=new FormData;l.append("file",t);const i=new XMLHttpRequest;i.addEventListener("load",()=>{if(i.status>=200&&i.status<300)try{const p=JSON.parse(i.responseText);r(p)}catch{o(new Error("Invalid server response"))}else o(new Error(`Upload failed: ${i.status} ${i.statusText}`))}),i.addEventListener("error",()=>o(new Error("Network error"))),i.addEventListener("abort",()=>o(new Error("Upload cancelled"))),n&&i.upload.addEventListener("progress",p=>{if(p.lengthComputable){const m=Math.round(p.loaded/p.total*100);n(m)}});const s=ut(),a=`${s.upload_api_url}/api/upload/single-upload`;i.open("POST",a),i.withCredentials=!0,s.auth_token&&i.setRequestHeader("Authorization",`Bearer ${s.auth_token}`),i.send(l)})}}const ly=({isOpen:e,onClose:t,videoUrl:n,currentThumbnail:r,videoId:o,onSelect:l})=>{const[i,s]=y.useState([]),[u,a]=y.useState(!1),[p,m]=y.useState(r||null),[h,w]=y.useState(null),[S,v]=y.useState(r||null);y.useRef(null);const E=y.useRef(null);y.useEffect(()=>{const f=async()=>{if(a(!0),s([]),o)try{const L=await oy.getThumbnails(o);if(L.thumbnails&&L.thumbnails.length>0){s(L.thumbnails),m(L.thumbnails[0]),a(!1);return}}catch(L){console.warn("Failed to fetch thumbnails from API, falling back to generation:",L)}const g=document.createElement("video");if(g.src=n,g.crossOrigin="anonymous",g.muted=!0,g.playsInline=!0,await new Promise(L=>{g.onloadedmetadata=()=>L(!0),g.onerror=()=>{a(!1),L(!1)}}),!g.duration)return;const x=document.createElement("canvas"),N=x.getContext("2d"),_=[.25,.5,.75,.9].map(L=>g.duration*L),P=[];try{for(const L of _){await new Promise(Z=>{g.currentTime=L,g.onseeked=()=>Z(!0)}),x.width=g.videoWidth,x.height=g.videoHeight,N==null||N.drawImage(g,0,0,x.width,x.height);const M=await new Promise(Z=>x.toBlob(Z,"image/jpeg",.8));M&&P.push(URL.createObjectURL(M))}s(P),P.length>0&&m(P[0])}catch(L){console.error("Error generating thumbnails:",L)}finally{a(!1),g.remove()}};e&&n&&i.length===0&&f()},[e,n,i.length,o]);const d=f=>{var x;const g=(x=f.target.files)==null?void 0:x[0];if(g){const N=URL.createObjectURL(g);w(g),v(N),m(N)}},c=async()=>{if(p){if(p===S)h?l(p,h):l(p);else try{const g=await(await fetch(p)).blob(),x=new File([g],"thumbnail.jpg",{type:"image/jpeg"});l(p,x)}catch(f){console.error("Failed to convert blob to file",f),l(p)}t()}};return C.jsxs("div",{className:"flex flex-col h-full",children:[C.jsxs("div",{className:"space-y-6 px-2 py-4 flex-1 overflow-y-auto",children:[C.jsxs("div",{className:"space-y-2",children:[C.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"Current Thumbnail"}),C.jsxs("div",{className:"relative inline-block",children:[C.jsx("input",{type:"file",ref:E,className:"hidden",accept:"image/*",onChange:d}),C.jsx(yo,{variant:"outline",onClick:()=>{var f;S?m(S):(f=E.current)==null||f.click()},className:Kt("flex flex-col items-center justify-center gap-2 p-0 overflow-hidden",p===S?"border-primary ring-2 ring-primary ring-offset-1":""),style:{width:S?"auto":"8rem",height:"6rem",aspectRatio:S?"auto":void 0},title:S?"Use Custom Thumbnail":"Upload Custom Thumbnail",children:S?C.jsxs("div",{className:"relative h-full",children:[C.jsx("img",{src:S,alt:"Custom",className:"h-full w-auto object-contain rounded-md"}),p===S&&C.jsx("div",{className:"absolute inset-0 bg-primary/20 flex items-center justify-center rounded-md",children:C.jsx(wa,{className:"w-6 h-6 text-white drop-shadow-md"})})]}):C.jsxs(C.Fragment,{children:[C.jsx(Sa,{className:"w-6 h-6 text-muted-foreground"}),C.jsx("span",{className:"text-xs text-muted-foreground",children:"Custom"})]})}),S&&C.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:C.jsx("button",{onClick:f=>{var g;f.stopPropagation(),(g=E.current)==null||g.click()},style:{maxWidth:"20%",minWidth:"2rem"},className:"bg-white/90 text-black rounded-full p-2 shadow-lg hover:bg-white transition-transform hover:scale-110 pointer-events-auto",title:"Change custom thumbnail",children:C.jsx(Sa,{className:"w-4 h-4"})})})]})]}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"From Video"}),u?C.jsxs("div",{className:"flex items-center justify-center h-32 border rounded-lg bg-muted/50",children:[C.jsx(Vv,{className:"w-6 h-6 animate-spin text-muted-foreground"}),C.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Generating previews..."})]}):C.jsx("div",{className:"flex flex-wrap gap-2 items-start",children:i.map((f,g)=>C.jsxs("button",{onClick:()=>{m(f)},className:Kt("relative h-24 w-auto rounded-md overflow-hidden border-2 transition-all",p===f?"border-primary ring-2 ring-primary ring-offset-1":"border-transparent hover:border-muted-foreground/50"),children:[C.jsx("img",{src:f,alt:`Frame ${g+1}`,className:"h-full w-auto object-contain"}),p===f&&C.jsx("div",{className:"absolute inset-0 bg-primary/20 flex items-center justify-center",children:C.jsx(wa,{className:"w-6 h-6 text-white drop-shadow-md"})})]},g))})]})]}),C.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t mt-auto",children:[C.jsx(yo,{variant:"outline",onClick:t,children:"Cancel"}),C.jsx(yo,{onClick:c,disabled:!p,children:"Save Thumbnail"})]})]})},At=class At{constructor(){}static getInstance(){return At.instance||(At.instance=new At),At.instance}emit(t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0});window.dispatchEvent(r),console.debug(`[AnnBridge] Emitted: ${t}`,n)}on(t,n){const r=o=>{n(o)};return window.addEventListener(t,r),()=>{window.removeEventListener(t,r)}}};Zs(At,"instance");let Gi=At;const Ho=Gi.getInstance();window.AnnBridge||(window.AnnBridge=Ho);const iy=e=>{if(typeof window>"u")return;const t={upload:{},gallery:{},auth_token:e.authToken,user_id:e.userId};e.uploadUrl&&(t.upload_api_url=e.uploadUrl),e.mediaUrl&&(t.gallery_api_url=e.mediaUrl),e.callbacks&&(t.gallery={...t.gallery,callbacks:e.callbacks}),e.maxConcurrentUploads!==void 0&&(t.upload.maxConcurrentUploads=e.maxConcurrentUploads),e.retryAttempts!==void 0&&(t.upload.retryAttempts=e.retryAttempts),e.retryDelay!==void 0&&(t.upload.retryDelay=e.retryDelay),e.maxFileSizes&&(t.upload.maxFileSizes={...t.upload.maxFileSizes,...e.maxFileSizes}),e.allowedTypes&&(t.upload.allowedTypes={...t.upload.allowedTypes,...e.allowedTypes}),window.appContext=t},sy=e=>{y.useEffect(()=>{e.config&&iy(e.config)},[e.config]);const[t,n]=y.useState({isOpen:e.isOpen||!1,videoUrl:e.videoUrl||"",currentThumbnail:e.currentThumbnail,imageId:void 0});y.useEffect(()=>{e.isOpen!==void 0&&n(l=>({...l,isOpen:e.isOpen}))},[e.isOpen]),y.useEffect(()=>{e.videoUrl&&n(l=>({...l,videoUrl:e.videoUrl}))},[e.videoUrl]),y.useEffect(()=>{e.currentThumbnail!==void 0&&n(l=>({...l,currentThumbnail:e.currentThumbnail}))},[e.currentThumbnail]),y.useEffect(()=>Ho.on("ANN:OPEN_VIDEO_THUMBNAIL_SELECTOR",i=>{var u;const{image:s}=i.detail;console.log("[ThumbnailSelector] Received open request:",s),s&&(s.type==="video"||(u=s.type)!=null&&u.startsWith("video/"))&&n({isOpen:!0,videoUrl:s.play_url||s.url,currentThumbnail:s.thumbnail,imageId:s.id})}),[]);const r=()=>{e.onClose&&e.onClose(),n(l=>({...l,isOpen:!1}))},o=(l,i)=>{console.log("[ThumbnailSelector] Selected thumbnail:",l),e.onSelect&&e.onSelect(l,i),t.imageId&&Ho.emit("ANN:THUMBNAIL_SELECTED",{imageId:t.imageId,thumbnailUrl:l,file:i}),t.imageId&&n(s=>({...s,isOpen:!1})),r()};return t.isOpen?C.jsx(ly,{isOpen:t.isOpen,onClose:r,videoUrl:t.videoUrl,currentThumbnail:t.currentThumbnail,videoId:t.imageId,onSelect:o}):null},uy=(e,t,n)=>{const r=typeof e=="string"?document.querySelector(e):e;if(!r)return console.error("ThumbnailSelector: Container not found"),null;const o=Kl.createRoot(r);return o.render(C.jsx(rp.StrictMode,{children:C.jsx(sy,{...t,config:n})})),Ho.emit("ANN:GALLERY_MOUNTED",{containerId:r.id}),o},ay={roots:new Map,mount:function(e,t,n){const r=uy(e,t,n);return r&&this.roots.set(e,r),r},unmount:function(e){const t=this.roots.get(e);return t?(t.unmount(),this.roots.delete(e),!0):!1},cleanup:function(){this.roots.forEach(e=>e.unmount()),this.roots.clear()}};window.AnnThumbnailSelector=ay; //# sourceMappingURL=thumbnail-selector.js.map