(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function t(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=t(l);fetch(l.href,o)}})();function lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hu={exports:{}},nl={},Qu={exports:{}},O={};/** * @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 Gt=Symbol.for("react.element"),oc=Symbol.for("react.portal"),ic=Symbol.for("react.fragment"),uc=Symbol.for("react.strict_mode"),sc=Symbol.for("react.profiler"),ac=Symbol.for("react.provider"),cc=Symbol.for("react.context"),fc=Symbol.for("react.forward_ref"),dc=Symbol.for("react.suspense"),pc=Symbol.for("react.memo"),mc=Symbol.for("react.lazy"),Mi=Symbol.iterator;function hc(e){return e===null||typeof e!="object"?null:(e=Mi&&e[Mi]||e["@@iterator"],typeof e=="function"?e:null)}var Ku={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Yu=Object.assign,Xu={};function st(e,n,t){this.props=e,this.context=n,this.refs=Xu,this.updater=t||Ku}st.prototype.isReactComponent={};st.prototype.setState=function(e,n){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,n,"setState")};st.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Gu(){}Gu.prototype=st.prototype;function $o(e,n,t){this.props=e,this.context=n,this.refs=Xu,this.updater=t||Ku}var Bo=$o.prototype=new Gu;Bo.constructor=$o;Yu(Bo,st.prototype);Bo.isPureReactComponent=!0;var Di=Array.isArray,Zu=Object.prototype.hasOwnProperty,Vo={current:null},Ju={key:!0,ref:!0,__self:!0,__source:!0};function qu(e,n,t){var r,l={},o=null,i=null;if(n!=null)for(r in n.ref!==void 0&&(i=n.ref),n.key!==void 0&&(o=""+n.key),n)Zu.call(n,r)&&!Ju.hasOwnProperty(r)&&(l[r]=n[r]);var u=arguments.length-2;if(u===1)l.children=t;else if(1>>1,Z=N[Q];if(0>>1;Ql(wl,R))Snl(nr,wl)?(N[Q]=nr,N[Sn]=R,Q=Sn):(N[Q]=wl,N[kn]=R,Q=kn);else if(Snl(nr,R))N[Q]=nr,N[Sn]=R,Q=Sn;else break e}}return j}function l(N,j){var R=N.sortIndex-j.sortIndex;return R!==0?R:N.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var s=[],f=[],h=1,m=null,p=3,y=!1,k=!1,x=!1,T=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(N){for(var j=t(f);j!==null;){if(j.callback===null)r(f);else if(j.startTime<=N)r(f),j.sortIndex=j.expirationTime,n(s,j);else break;j=t(f)}}function g(N){if(x=!1,d(N),!k)if(t(s)!==null)k=!0,gl(E);else{var j=t(f);j!==null&&yl(g,j.startTime-N)}}function E(N,j){k=!1,x&&(x=!1,c(S),S=-1),y=!0;var R=p;try{for(d(j),m=t(s);m!==null&&(!(m.expirationTime>j)||N&&!he());){var Q=m.callback;if(typeof Q=="function"){m.callback=null,p=m.priorityLevel;var Z=Q(m.expirationTime<=j);j=e.unstable_now(),typeof Z=="function"?m.callback=Z:m===t(s)&&r(s),d(j)}else r(s);m=t(s)}if(m!==null)var er=!0;else{var kn=t(f);kn!==null&&yl(g,kn.startTime-j),er=!1}return er}finally{m=null,p=R,y=!1}}var P=!1,v=null,S=-1,L=5,z=-1;function he(){return!(e.unstable_now()-zN||125Q?(N.sortIndex=R,n(f,N),t(s)===null&&N===t(f)&&(x?(c(S),S=-1):x=!0,yl(g,R-Q))):(N.sortIndex=Z,n(s,N),k||y||(k=!0,gl(E))),N},e.unstable_shouldYield=he,e.unstable_wrapCallback=function(N){var j=p;return function(){var R=p;p=j;try{return N.apply(this,arguments)}finally{p=R}}}})(rs);ts.exports=rs;var Pc=ts.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 zc=M,we=Pc;function w(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yl=Object.prototype.hasOwnProperty,Lc=/^[: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]*$/,Fi={},Ui={};function jc(e){return Yl.call(Ui,e)?!0:Yl.call(Fi,e)?!1:Lc.test(e)?Ui[e]=!0:(Fi[e]=!0,!1)}function Tc(e,n,t,r){if(t!==null&&t.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Rc(e,n,t,r){if(n===null||typeof n>"u"||Tc(e,n,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function ae(e,n,t,r,l,o,i){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=o,this.removeEmptyString=i}var ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ne[e]=new ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];ne[n]=new ae(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ne[e]=new ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ne[e]=new ae(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){ne[e]=new ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ne[e]=new ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ne[e]=new ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ne[e]=new ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ne[e]=new ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ho=/[\-:]([a-z])/g;function Qo(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 n=e.replace(Ho,Qo);ne[n]=new ae(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Ho,Qo);ne[n]=new ae(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Ho,Qo);ne[n]=new ae(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ne[e]=new ae(e,1,!1,e.toLowerCase(),null,!1,!1)});ne.xlinkHref=new ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ne[e]=new ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ko(e,n,t,r){var l=ne.hasOwnProperty(n)?ne[n]:null;(l!==null?l.type!==0:r||!(2u||l[i]!==o[u]){var s=` `+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{xl=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?wt(e):""}function Oc(e){switch(e.tag){case 5:return wt(e.type);case 16:return wt("Lazy");case 13:return wt("Suspense");case 19:return wt("SuspenseList");case 0:case 2:case 15:return e=El(e.type,!1),e;case 11:return e=El(e.type.render,!1),e;case 1:return e=El(e.type,!0),e;default:return""}}function Jl(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 Un:return"Fragment";case Fn:return"Portal";case Xl:return"Profiler";case Yo:return"StrictMode";case Gl:return"Suspense";case Zl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case is:return(e.displayName||"Context")+".Consumer";case os:return(e._context.displayName||"Context")+".Provider";case Xo:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Go:return n=e.displayName||null,n!==null?n:Jl(e.type)||"Memo";case be:n=e._payload,e=e._init;try{return Jl(e(n))}catch{}}return null}function Mc(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Jl(n);case 8:return n===Yo?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function mn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ss(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Dc(e){var n=ss(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var l=t.get,o=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function lr(e){e._valueTracker||(e._valueTracker=Dc(e))}function as(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=ss(e)?e.checked?"true":"false":e.value),e=r,e!==t?(n.setValue(e),!0):!1}function Tr(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 ql(e,n){var t=n.checked;return W({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??e._wrapperState.initialChecked})}function $i(e,n){var t=n.defaultValue==null?"":n.defaultValue,r=n.checked!=null?n.checked:n.defaultChecked;t=mn(n.value!=null?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function cs(e,n){n=n.checked,n!=null&&Ko(e,"checked",n,!1)}function bl(e,n){cs(e,n);var t=mn(n.value),r=n.type;if(t!=null)r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?eo(e,n.type,t):n.hasOwnProperty("defaultValue")&&eo(e,n.type,mn(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Bi(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!(r!=="submit"&&r!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}t=e.name,t!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,t!==""&&(e.name=t)}function eo(e,n,t){(n!=="number"||Tr(e.ownerDocument)!==e)&&(t==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}var kt=Array.isArray;function Gn(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l"+n.valueOf().toString()+"",n=or.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Ot(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&t.nodeType===3){t.nodeValue=n;return}}e.textContent=n}var Et={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},Ic=["Webkit","ms","Moz","O"];Object.keys(Et).forEach(function(e){Ic.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Et[n]=Et[e]})});function ms(e,n,t){return n==null||typeof n=="boolean"||n===""?"":t||typeof n!="number"||n===0||Et.hasOwnProperty(e)&&Et[e]?(""+n).trim():n+"px"}function hs(e,n){e=e.style;for(var t in n)if(n.hasOwnProperty(t)){var r=t.indexOf("--")===0,l=ms(t,n[t],r);t==="float"&&(t="cssFloat"),r?e.setProperty(t,l):e[t]=l}}var Fc=W({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 ro(e,n){if(n){if(Fc[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(w(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(w(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(w(61))}if(n.style!=null&&typeof n.style!="object")throw Error(w(62))}}function lo(e,n){if(e.indexOf("-")===-1)return typeof n.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 oo=null;function Zo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var io=null,Zn=null,Jn=null;function Hi(e){if(e=qt(e)){if(typeof io!="function")throw Error(w(280));var n=e.stateNode;n&&(n=il(n),io(e.stateNode,e.type,n))}}function vs(e){Zn?Jn?Jn.push(e):Jn=[e]:Zn=e}function gs(){if(Zn){var e=Zn,n=Jn;if(Jn=Zn=null,Hi(e),n)for(e=0;e>>=0,e===0?32:31-(Xc(e)/Gc|0)|0}var ir=64,ur=4194304;function St(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 Dr(e,n){var t=e.pendingLanes;if(t===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=t&268435455;if(i!==0){var u=i&~l;u!==0?r=St(u):(o&=i,o!==0&&(r=St(o)))}else i=t&~l,i!==0?r=St(i):o!==0&&(r=St(o));if(r===0)return 0;if(n!==0&&n!==r&&!(n&l)&&(l=r&-r,o=n&-n,l>=o||l===16&&(o&4194240)!==0))return n;if(r&4&&(r|=t&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=r;0t;t++)n.push(e);return n}function Zt(e,n,t){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Re(n),e[n]=t}function bc(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=_t),bi=" ",eu=!1;function Fs(e,n){switch(e){case"keyup":return zf.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Us(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var An=!1;function jf(e,n){switch(e){case"compositionend":return Us(n);case"keypress":return n.which!==32?null:(eu=!0,bi);case"textInput":return e=n.data,e===bi&&eu?null:e;default:return null}}function Tf(e,n){if(An)return e==="compositionend"||!li&&Fs(e,n)?(e=Ds(),xr=ni=rn=null,An=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:t,offset:n-e};e=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=lu(t)}}function Vs(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Vs(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Ws(){for(var e=window,n=Tr();n instanceof e.HTMLIFrameElement;){try{var t=typeof n.contentWindow.location.href=="string"}catch{t=!1}if(t)e=n.contentWindow;else break;n=Tr(e.document)}return n}function oi(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function $f(e){var n=Ws(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&Vs(t.ownerDocument.documentElement,t)){if(r!==null&&oi(t)){if(n=r.start,e=r.end,e===void 0&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if(e=(n=t.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var l=t.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=ou(t,o);var i=ou(t,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(n=n.createRange(),n.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(n),e.extend(i.node,i.offset)):(n.setEnd(i.node,i.offset),e.addRange(n)))}}for(n=[],e=t;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,$n=null,po=null,Pt=null,mo=!1;function iu(e,n,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;mo||$n==null||$n!==Tr(r)||(r=$n,"selectionStart"in r&&oi(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}),Pt&&At(Pt,r)||(Pt=r,r=Ur(po,"onSelect"),0Wn||(e.current=ko[Wn],ko[Wn]=null,Wn--)}function F(e,n){Wn++,ko[Wn]=e.current,e.current=n}var hn={},oe=gn(hn),de=gn(!1),Ln=hn;function tt(e,n){var t=e.type.contextTypes;if(!t)return hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in t)l[o]=n[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=l),l}function pe(e){return e=e.childContextTypes,e!=null}function $r(){A(de),A(oe)}function pu(e,n,t){if(oe.current!==hn)throw Error(w(168));F(oe,n),F(de,t)}function qs(e,n,t){var r=e.stateNode;if(n=n.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var l in r)if(!(l in n))throw Error(w(108,Mc(e)||"Unknown",l));return W({},t,r)}function Br(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hn,Ln=oe.current,F(oe,e),F(de,de.current),!0}function mu(e,n,t){var r=e.stateNode;if(!r)throw Error(w(169));t?(e=qs(e,n,Ln),r.__reactInternalMemoizedMergedChildContext=e,A(de),A(oe),F(oe,e)):A(de),F(de,t)}var Be=null,ul=!1,Fl=!1;function bs(e){Be===null?Be=[e]:Be.push(e)}function qf(e){ul=!0,bs(e)}function yn(){if(!Fl&&Be!==null){Fl=!0;var e=0,n=I;try{var t=Be;for(I=1;e>=i,l-=i,Ve=1<<32-Re(n)+l|t<S?(L=v,v=null):L=v.sibling;var z=p(c,v,d[S],g);if(z===null){v===null&&(v=L);break}e&&v&&z.alternate===null&&n(c,v),a=o(z,a,S),P===null?E=z:P.sibling=z,P=z,v=L}if(S===d.length)return t(c,v),$&&xn(c,S),E;if(v===null){for(;SS?(L=v,v=null):L=v.sibling;var he=p(c,v,z.value,g);if(he===null){v===null&&(v=L);break}e&&v&&he.alternate===null&&n(c,v),a=o(he,a,S),P===null?E=he:P.sibling=he,P=he,v=L}if(z.done)return t(c,v),$&&xn(c,S),E;if(v===null){for(;!z.done;S++,z=d.next())z=m(c,z.value,g),z!==null&&(a=o(z,a,S),P===null?E=z:P.sibling=z,P=z);return $&&xn(c,S),E}for(v=r(c,v);!z.done;S++,z=d.next())z=y(v,c,S,z.value,g),z!==null&&(e&&z.alternate!==null&&v.delete(z.key===null?S:z.key),a=o(z,a,S),P===null?E=z:P.sibling=z,P=z);return e&&v.forEach(function(Ze){return n(c,Ze)}),$&&xn(c,S),E}function T(c,a,d,g){if(typeof d=="object"&&d!==null&&d.type===Un&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case rr:e:{for(var E=d.key,P=a;P!==null;){if(P.key===E){if(E=d.type,E===Un){if(P.tag===7){t(c,P.sibling),a=l(P,d.props.children),a.return=c,c=a;break e}}else if(P.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===be&&gu(E)===P.type){t(c,P.sibling),a=l(P,d.props),a.ref=vt(c,P,d),a.return=c,c=a;break e}t(c,P);break}else n(c,P);P=P.sibling}d.type===Un?(a=zn(d.props.children,c.mode,g,d.key),a.return=c,c=a):(g=jr(d.type,d.key,d.props,null,c.mode,g),g.ref=vt(c,a,d),g.return=c,c=g)}return i(c);case Fn:e:{for(P=d.key;a!==null;){if(a.key===P)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){t(c,a.sibling),a=l(a,d.children||[]),a.return=c,c=a;break e}else{t(c,a);break}else n(c,a);a=a.sibling}a=Ql(d,c.mode,g),a.return=c,c=a}return i(c);case be:return P=d._init,T(c,a,P(d._payload),g)}if(kt(d))return k(c,a,d,g);if(ft(d))return x(c,a,d,g);mr(c,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(t(c,a.sibling),a=l(a,d),a.return=c,c=a):(t(c,a),a=Hl(d,c.mode,g),a.return=c,c=a),i(c)):t(c,a)}return T}var lt=ra(!0),la=ra(!1),Hr=gn(null),Qr=null,Kn=null,ai=null;function ci(){ai=Kn=Qr=null}function fi(e){var n=Hr.current;A(Hr),e._currentValue=n}function Eo(e,n,t){for(;e!==null;){var r=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,r!==null&&(r.childLanes|=n)):r!==null&&(r.childLanes&n)!==n&&(r.childLanes|=n),e===t)break;e=e.return}}function bn(e,n){Qr=e,ai=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(fe=!0),e.firstContext=null)}function Ne(e){var n=e._currentValue;if(ai!==e)if(e={context:e,memoizedValue:n,next:null},Kn===null){if(Qr===null)throw Error(w(308));Kn=e,Qr.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return n}var _n=null;function di(e){_n===null?_n=[e]:_n.push(e)}function oa(e,n,t,r){var l=n.interleaved;return l===null?(t.next=t,di(n)):(t.next=l.next,l.next=t),n.interleaved=t,Ye(e,r)}function Ye(e,n){e.lanes|=n;var t=e.alternate;for(t!==null&&(t.lanes|=n),t=e,e=e.return;e!==null;)e.childLanes|=n,t=e.alternate,t!==null&&(t.childLanes|=n),t=e,e=e.return;return t.tag===3?t.stateNode:null}var en=!1;function pi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ia(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function He(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function cn(e,n,t){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,D&2){var l=r.pending;return l===null?n.next=n:(n.next=l.next,l.next=n),r.pending=n,Ye(e,t)}return l=r.interleaved,l===null?(n.next=n,di(r)):(n.next=l.next,l.next=n),r.interleaved=n,Ye(e,t)}function Cr(e,n,t){if(n=n.updateQueue,n!==null&&(n=n.shared,(t&4194240)!==0)){var r=n.lanes;r&=e.pendingLanes,t|=r,n.lanes=t,qo(e,t)}}function yu(e,n){var t=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var l=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var i={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};o===null?l=o=i:o=o.next=i,t=t.next}while(t!==null);o===null?l=o=n:o=o.next=n}else l=o=n;t={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=t;return}e=t.lastBaseUpdate,e===null?t.firstBaseUpdate=n:e.next=n,t.lastBaseUpdate=n}function Kr(e,n,t,r){var l=e.updateQueue;en=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var s=u,f=s.next;s.next=null,i===null?o=f:i.next=f,i=s;var h=e.alternate;h!==null&&(h=h.updateQueue,u=h.lastBaseUpdate,u!==i&&(u===null?h.firstBaseUpdate=f:u.next=f,h.lastBaseUpdate=s))}if(o!==null){var m=l.baseState;i=0,h=f=s=null,u=o;do{var p=u.lane,y=u.eventTime;if((r&p)===p){h!==null&&(h=h.next={eventTime:y,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var k=e,x=u;switch(p=n,y=t,x.tag){case 1:if(k=x.payload,typeof k=="function"){m=k.call(y,m,p);break e}m=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=x.payload,p=typeof k=="function"?k.call(y,m,p):k,p==null)break e;m=W({},m,p);break e;case 2:en=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,p=l.effects,p===null?l.effects=[u]:p.push(u))}else y={eventTime:y,lane:p,tag:u.tag,payload:u.payload,callback:u.callback,next:null},h===null?(f=h=y,s=m):h=h.next=y,i|=p;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;p=u,u=p.next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}}while(!0);if(h===null&&(s=m),l.baseState=s,l.firstBaseUpdate=f,l.lastBaseUpdate=h,n=l.shared.interleaved,n!==null){l=n;do i|=l.lane,l=l.next;while(l!==n)}else o===null&&(l.shared.lanes=0);Rn|=i,e.lanes=i,e.memoizedState=m}}function wu(e,n,t){if(e=n.effects,n.effects=null,e!==null)for(n=0;nt?t:4,e(!0);var r=Al.transition;Al.transition={};try{e(!1),n()}finally{I=t,Al.transition=r}}function Ea(){return Pe().memoizedState}function td(e,n,t){var r=dn(e);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},Ca(e))_a(n,t);else if(t=oa(e,n,t,r),t!==null){var l=ue();Oe(t,e,r,l),Na(t,n,r)}}function rd(e,n,t){var r=dn(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(Ca(e))_a(n,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=n.lastRenderedReducer,o!==null))try{var i=n.lastRenderedState,u=o(i,t);if(l.hasEagerState=!0,l.eagerState=u,Me(u,i)){var s=n.interleaved;s===null?(l.next=l,di(n)):(l.next=s.next,s.next=l),n.interleaved=l;return}}catch{}finally{}t=oa(e,n,l,r),t!==null&&(l=ue(),Oe(t,e,r,l),Na(t,n,r))}}function Ca(e){var n=e.alternate;return e===V||n!==null&&n===V}function _a(e,n){zt=Xr=!0;var t=e.pending;t===null?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function Na(e,n,t){if(t&4194240){var r=n.lanes;r&=e.pendingLanes,t|=r,n.lanes=t,qo(e,t)}}var Gr={readContext:Ne,useCallback:te,useContext:te,useEffect:te,useImperativeHandle:te,useInsertionEffect:te,useLayoutEffect:te,useMemo:te,useReducer:te,useRef:te,useState:te,useDebugValue:te,useDeferredValue:te,useTransition:te,useMutableSource:te,useSyncExternalStore:te,useId:te,unstable_isNewReconciler:!1},ld={readContext:Ne,useCallback:function(e,n){return Ie().memoizedState=[e,n===void 0?null:n],e},useContext:Ne,useEffect:Su,useImperativeHandle:function(e,n,t){return t=t!=null?t.concat([e]):null,Nr(4194308,4,ya.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Nr(4194308,4,e,n)},useInsertionEffect:function(e,n){return Nr(4,2,e,n)},useMemo:function(e,n){var t=Ie();return n=n===void 0?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var r=Ie();return n=t!==void 0?t(n):n,r.memoizedState=r.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=td.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var n=Ie();return e={current:e},n.memoizedState=e},useState:ku,useDebugValue:Si,useDeferredValue:function(e){return Ie().memoizedState=e},useTransition:function(){var e=ku(!1),n=e[0];return e=nd.bind(null,e[1]),Ie().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,t){var r=V,l=Ie();if($){if(t===void 0)throw Error(w(407));t=t()}else{if(t=n(),q===null)throw Error(w(349));Tn&30||ca(r,n,t)}l.memoizedState=t;var o={value:t,getSnapshot:n};return l.queue=o,Su(da.bind(null,r,o,e),[e]),r.flags|=2048,Yt(9,fa.bind(null,r,o,t,n),void 0,null),t},useId:function(){var e=Ie(),n=q.identifierPrefix;if($){var t=We,r=Ve;t=(r&~(1<<32-Re(r)-1)).toString(32)+t,n=":"+n+"R"+t,t=Qt++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(t,{is:r.is}):(e=i.createElement(t),t==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,t),e[Fe]=n,e[Vt]=r,Ia(e,n,!1,!1),n.stateNode=e;e:{switch(i=lo(t,r),t){case"dialog":U("cancel",e),U("close",e),l=r;break;case"iframe":case"object":case"embed":U("load",e),l=r;break;case"video":case"audio":for(l=0;lut&&(n.flags|=128,r=!0,gt(o,!1),n.lanes=4194304)}else{if(!r)if(e=Yr(i),e!==null){if(n.flags|=128,r=!0,t=e.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),gt(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!$)return re(n),null}else 2*K()-o.renderingStartTime>ut&&t!==1073741824&&(n.flags|=128,r=!0,gt(o,!1),n.lanes=4194304);o.isBackwards?(i.sibling=n.child,n.child=i):(t=o.last,t!==null?t.sibling=i:n.child=i,o.last=i)}return o.tail!==null?(n=o.tail,o.rendering=n,o.tail=n.sibling,o.renderingStartTime=K(),n.sibling=null,t=B.current,F(B,r?t&1|2:t&1),n):(re(n),null);case 22:case 23:return Pi(),r=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(n.flags|=8192),r&&n.mode&1?ve&1073741824&&(re(n),n.subtreeFlags&6&&(n.flags|=8192)):re(n),null;case 24:return null;case 25:return null}throw Error(w(156,n.tag))}function dd(e,n){switch(ui(n),n.tag){case 1:return pe(n.type)&&$r(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ot(),A(de),A(oe),vi(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return hi(n),null;case 13:if(A(B),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(w(340));rt()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return A(B),null;case 4:return ot(),null;case 10:return fi(n.type._context),null;case 22:case 23:return Pi(),null;case 24:return null;default:return null}}var vr=!1,le=!1,pd=typeof WeakSet=="function"?WeakSet:Set,_=null;function Yn(e,n){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){H(e,n,r)}else t.current=null}function Ro(e,n,t){try{t()}catch(r){H(e,n,r)}}var Ru=!1;function md(e,n){if(ho=Ir,e=Ws(),oi(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{t=(t=e.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var i=0,u=-1,s=-1,f=0,h=0,m=e,p=null;n:for(;;){for(var y;m!==t||l!==0&&m.nodeType!==3||(u=i+l),m!==o||r!==0&&m.nodeType!==3||(s=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(y=m.firstChild)!==null;)p=m,m=y;for(;;){if(m===e)break n;if(p===t&&++f===l&&(u=i),p===o&&++h===r&&(s=i),(y=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=y}t=u===-1||s===-1?null:{start:u,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;for(vo={focusedElem:e,selectionRange:t},Ir=!1,_=n;_!==null;)if(n=_,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,_=e;else for(;_!==null;){n=_;try{var k=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var x=k.memoizedProps,T=k.memoizedState,c=n.stateNode,a=c.getSnapshotBeforeUpdate(n.elementType===n.type?x:Le(n.type,x),T);c.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=n.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(g){H(n,n.return,g)}if(e=n.sibling,e!==null){e.return=n.return,_=e;break}_=n.return}return k=Ru,Ru=!1,k}function Lt(e,n,t){var r=n.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Ro(n,t,o)}l=l.next}while(l!==r)}}function cl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function Oo(e){var n=e.ref;if(n!==null){var t=e.stateNode;switch(e.tag){case 5:e=t;break;default:e=t}typeof n=="function"?n(e):n.current=e}}function Aa(e){var n=e.alternate;n!==null&&(e.alternate=null,Aa(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Fe],delete n[Vt],delete n[wo],delete n[Zf],delete n[Jf])),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 $a(e){return e.tag===5||e.tag===3||e.tag===4}function Ou(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$a(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 Mo(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.nodeType===8?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(t.nodeType===8?(n=t.parentNode,n.insertBefore(e,t)):(n=t,n.appendChild(e)),t=t._reactRootContainer,t!=null||n.onclick!==null||(n.onclick=Ar));else if(r!==4&&(e=e.child,e!==null))for(Mo(e,n,t),e=e.sibling;e!==null;)Mo(e,n,t),e=e.sibling}function Do(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Do(e,n,t),e=e.sibling;e!==null;)Do(e,n,t),e=e.sibling}var b=null,je=!1;function qe(e,n,t){for(t=t.child;t!==null;)Ba(e,n,t),t=t.sibling}function Ba(e,n,t){if(Ue&&typeof Ue.onCommitFiberUnmount=="function")try{Ue.onCommitFiberUnmount(tl,t)}catch{}switch(t.tag){case 5:le||Yn(t,n);case 6:var r=b,l=je;b=null,qe(e,n,t),b=r,je=l,b!==null&&(je?(e=b,t=t.stateNode,e.nodeType===8?e.parentNode.removeChild(t):e.removeChild(t)):b.removeChild(t.stateNode));break;case 18:b!==null&&(je?(e=b,t=t.stateNode,e.nodeType===8?Il(e.parentNode,t):e.nodeType===1&&Il(e,t),Ft(e)):Il(b,t.stateNode));break;case 4:r=b,l=je,b=t.stateNode.containerInfo,je=!0,qe(e,n,t),b=r,je=l;break;case 0:case 11:case 14:case 15:if(!le&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Ro(t,n,i),l=l.next}while(l!==r)}qe(e,n,t);break;case 1:if(!le&&(Yn(t,n),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(u){H(t,n,u)}qe(e,n,t);break;case 21:qe(e,n,t);break;case 22:t.mode&1?(le=(r=le)||t.memoizedState!==null,qe(e,n,t),le=r):qe(e,n,t);break;default:qe(e,n,t)}}function Mu(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var t=e.stateNode;t===null&&(t=e.stateNode=new pd),n.forEach(function(r){var l=Ed.bind(null,e,r);t.has(r)||(t.add(r),r.then(l,l))})}}function ze(e,n){var t=n.deletions;if(t!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=K()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vd(r/1960))-r,10e?16:e,ln===null)var r=!1;else{if(e=ln,ln=null,qr=0,D&6)throw Error(w(331));var l=D;for(D|=4,_=e.current;_!==null;){var o=_,i=o.child;if(_.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sK()-_i?Pn(e,0):Ci|=t),me(e,n)}function Ga(e,n){n===0&&(e.mode&1?(n=ur,ur<<=1,!(ur&130023424)&&(ur=4194304)):n=1);var t=ue();e=Ye(e,n),e!==null&&(Zt(e,n,t),me(e,t))}function xd(e){var n=e.memoizedState,t=0;n!==null&&(t=n.retryLane),Ga(e,t)}function Ed(e,n){var t=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(t=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(w(314))}r!==null&&r.delete(n),Ga(e,t)}var Za;Za=function(e,n,t){if(e!==null)if(e.memoizedProps!==n.pendingProps||de.current)fe=!0;else{if(!(e.lanes&t)&&!(n.flags&128))return fe=!1,cd(e,n,t);fe=!!(e.flags&131072)}else fe=!1,$&&n.flags&1048576&&ea(n,Wr,n.index);switch(n.lanes=0,n.tag){case 2:var r=n.type;Pr(e,n),e=n.pendingProps;var l=tt(n,oe.current);bn(n,t),l=yi(null,n,r,e,l,t);var o=wi();return n.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,pe(r)?(o=!0,Br(n)):o=!1,n.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,pi(n),l.updater=al,n.stateNode=l,l._reactInternals=n,_o(n,r,e,t),n=zo(null,n,r,!0,o,t)):(n.tag=0,$&&o&&ii(n),ie(null,n,l,t),n=n.child),n;case 16:r=n.elementType;e:{switch(Pr(e,n),e=n.pendingProps,l=r._init,r=l(r._payload),n.type=r,l=n.tag=_d(r),e=Le(r,e),l){case 0:n=Po(null,n,r,e,t);break e;case 1:n=Lu(null,n,r,e,t);break e;case 11:n=Pu(null,n,r,e,t);break e;case 14:n=zu(null,n,r,Le(r.type,e),t);break e}throw Error(w(306,r,""))}return n;case 0:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Le(r,l),Po(e,n,r,l,t);case 1:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Le(r,l),Lu(e,n,r,l,t);case 3:e:{if(Oa(n),e===null)throw Error(w(387));r=n.pendingProps,o=n.memoizedState,l=o.element,ia(e,n),Kr(n,r,null,t);var i=n.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},n.updateQueue.baseState=o,n.memoizedState=o,n.flags&256){l=it(Error(w(423)),n),n=ju(e,n,r,t,l);break e}else if(r!==l){l=it(Error(w(424)),n),n=ju(e,n,r,t,l);break e}else for(ge=an(n.stateNode.containerInfo.firstChild),ye=n,$=!0,Te=null,t=la(n,null,r,t),n.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(rt(),r===l){n=Xe(e,n,t);break e}ie(e,n,r,t)}n=n.child}return n;case 5:return ua(n),e===null&&xo(n),r=n.type,l=n.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,go(r,l)?i=null:o!==null&&go(r,o)&&(n.flags|=32),Ra(e,n),ie(e,n,i,t),n.child;case 6:return e===null&&xo(n),null;case 13:return Ma(e,n,t);case 4:return mi(n,n.stateNode.containerInfo),r=n.pendingProps,e===null?n.child=lt(n,null,r,t):ie(e,n,r,t),n.child;case 11:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Le(r,l),Pu(e,n,r,l,t);case 7:return ie(e,n,n.pendingProps,t),n.child;case 8:return ie(e,n,n.pendingProps.children,t),n.child;case 12:return ie(e,n,n.pendingProps.children,t),n.child;case 10:e:{if(r=n.type._context,l=n.pendingProps,o=n.memoizedProps,i=l.value,F(Hr,r._currentValue),r._currentValue=i,o!==null)if(Me(o.value,i)){if(o.children===l.children&&!de.current){n=Xe(e,n,t);break e}}else for(o=n.child,o!==null&&(o.return=n);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=He(-1,t&-t),s.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?s.next=s:(s.next=h.next,h.next=s),f.pending=s}}o.lanes|=t,s=o.alternate,s!==null&&(s.lanes|=t),Eo(o.return,t,n),u.lanes|=t;break}s=s.next}}else if(o.tag===10)i=o.type===n.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(w(341));i.lanes|=t,u=i.alternate,u!==null&&(u.lanes|=t),Eo(i,t,n),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===n){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}ie(e,n,l.children,t),n=n.child}return n;case 9:return l=n.type,r=n.pendingProps.children,bn(n,t),l=Ne(l),r=r(l),n.flags|=1,ie(e,n,r,t),n.child;case 14:return r=n.type,l=Le(r,n.pendingProps),l=Le(r.type,l),zu(e,n,r,l,t);case 15:return ja(e,n,n.type,n.pendingProps,t);case 17:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Le(r,l),Pr(e,n),n.tag=1,pe(r)?(e=!0,Br(n)):e=!1,bn(n,t),Pa(n,r,l),_o(n,r,l,t),zo(null,n,r,!0,e,t);case 19:return Da(e,n,t);case 22:return Ta(e,n,t)}throw Error(w(156,n.tag))};function Ja(e,n){return Cs(e,n)}function Cd(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,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 Ce(e,n,t,r){return new Cd(e,n,t,r)}function Li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _d(e){if(typeof e=="function")return Li(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xo)return 11;if(e===Go)return 14}return 2}function pn(e,n){var t=e.alternate;return t===null?(t=Ce(e.tag,n,e.key,e.mode),t.elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=e.flags&14680064,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function jr(e,n,t,r,l,o){var i=2;if(r=e,typeof e=="function")Li(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Un:return zn(t.children,l,o,n);case Yo:i=8,l|=8;break;case Xl:return e=Ce(12,t,n,l|2),e.elementType=Xl,e.lanes=o,e;case Gl:return e=Ce(13,t,n,l),e.elementType=Gl,e.lanes=o,e;case Zl:return e=Ce(19,t,n,l),e.elementType=Zl,e.lanes=o,e;case us:return dl(t,l,o,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case os:i=10;break e;case is:i=9;break e;case Xo:i=11;break e;case Go:i=14;break e;case be:i=16,r=null;break e}throw Error(w(130,e==null?e:typeof e,""))}return n=Ce(i,t,n,l),n.elementType=e,n.type=r,n.lanes=o,n}function zn(e,n,t,r){return e=Ce(7,e,r,n),e.lanes=t,e}function dl(e,n,t,r){return e=Ce(22,e,r,n),e.elementType=us,e.lanes=t,e.stateNode={isHidden:!1},e}function Hl(e,n,t){return e=Ce(6,e,null,n),e.lanes=t,e}function Ql(e,n,t){return n=Ce(4,e.children!==null?e.children:[],e.key,n),n.lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Nd(e,n,t,r,l){this.tag=n,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=_l(0),this.expirationTimes=_l(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_l(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ji(e,n,t,r,l,o,i,u,s){return e=new Nd(e,n,t,u,s),n===1?(n=1,o===!0&&(n|=8)):n=0,o=Ce(3,null,null,n),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},pi(o),e}function Pd(e,n,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nc)}catch(e){console.error(e)}}nc(),ns.exports=ke;var Rd=ns.exports,Vu=Rd;Kl.createRoot=Vu.createRoot,Kl.hydrateRoot=Vu.hydrateRoot;function Od(e){const n=e==0?0:Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,n)).toFixed(2)*1+["B","kB","MB","GB","TB"][n]}function Md({text:e,percentage:n,total:t}){return n??(n=0),C.jsx("div",{className:"w-full bg-gray-100 dark:bg-gray-700 text-left rounded-lg overflow-hidden mb-0.5",children:C.jsxs("div",{className:"bg-blue-400 whitespace-nowrap px-1 text-sm",style:{width:`${n}%`},children:[e," (",n.toFixed(2),"%",isNaN(t)?"":` of ${Od(t)}`,")"]})})}const Dd="https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/hopper.webm",tc=M.forwardRef(({onInputChange:e,onTimeUpdate:n,...t},r)=>{var d,g,E,P;const[l,o]=M.useState(!1),i=M.useRef(null),u=M.useRef(null),s=M.useRef(null),f=M.useRef(0);M.useImperativeHandle(r,()=>({setMediaTime(v){var S,L;(S=u.current)!=null&&S.src?u.current.currentTime=v:(L=s.current)!=null&&L.src&&(s.current.currentTime=v),f.current=v}}));const h=(v,S)=>{const L=new Blob([v.slice(0)],{type:S}),z=URL.createObjectURL(L);T(v),S.startsWith("audio/")?(s.current.pause(),s.current.removeAttribute("src"),s.current.load(),u.current.src=z):S.startsWith("video/")?(u.current.pause(),u.current.removeAttribute("src"),u.current.load(),s.current.src=z):alert(`Unsupported file type: ${S}`)},m=v=>{if(!v)return;const S=new FileReader;S.onload=L=>{h(L.target.result,v.type)},S.readAsArrayBuffer(v)},p=v=>{m(v.target.files[0])},y=v=>{v.preventDefault()},k=v=>{v.preventDefault(),o(!1),m(v.dataTransfer.files[0])},x=v=>{v.target.tagName==="VIDEO"||v.target.tagName==="AUDIO"?(v.preventDefault(),i.current.click()):(v.target.tagName==="INPUT"||i.current.click(),v.stopPropagation())},T=async v=>{const S=new(window.AudioContext||window.webkitAudioContext)({sampleRate:16e3});try{const L=await S.decodeAudioData(v);let z;if(L.numberOfChannels===2){const he=Math.sqrt(2),Ze=L.getChannelData(0),wn=L.getChannelData(1);z=new Float32Array(Ze.length);for(let Je=0;Je{var S,L;let v;(S=u.current)!=null&&S.src?v=u.current:(L=s.current)!=null&&L.src&&(v=s.current),v&&f.current!==v.currentTime&&(f.current=v.currentTime,n(v.currentTime)),c.current=requestAnimationFrame(a)},[n]);return M.useEffect(()=>(c.current=requestAnimationFrame(a),()=>{cancelAnimationFrame(c.current)}),[a]),C.jsxs("div",{...t,onClick:x,onDragOver:y,onDrop:k,onDragEnter:v=>o(!0),onDragLeave:v=>o(!1),children:[C.jsx("input",{type:"file",accept:"audio/*,video/*",onChange:p,ref:i,className:"hidden"}),C.jsx("audio",{ref:u,controls:!0,style:{display:(d=u.current)!=null&&d.src?"block":"none"},className:"w-full max-h-full"}),C.jsx("video",{ref:s,controls:!0,style:{display:(g=s.current)!=null&&g.src?"block":"none"},className:"w-full max-h-full"}),!((E=u.current)!=null&&E.src)&&!((P=s.current)!=null&&P.src)&&C.jsxs("div",{className:"w-full flex flex-col items-center justify-center border-2 border-dashed border-gray-300 rounded-md h-[250px]",style:{borderColor:l?"blue":"lightgray"},children:[C.jsxs("span",{className:"text-gray-600 text-center",children:[C.jsx("u",{children:"Drag & drop"})," or ",C.jsx("u",{children:"click"}),C.jsx("br",{}),"to select media"]}),C.jsxs("span",{className:"text-gray-500 text-sm hover:text-gray-800 mt-2",onClick:async v=>{v.stopPropagation();const S=await fetch(Dd).then(L=>L.arrayBuffer());s.current.src=URL.createObjectURL(new Blob([S],{type:"video/mp4"})),h(S,"video/mp4")},children:["(or ",C.jsx("u",{children:"try an example"}),")"]})]})]})});tc.displayName="MediaInput";const Id=({chunk:e,currentTime:n,onClick:t,...r})=>{const l=M.useRef(null),{text:o,timestamp:i}=e,[u,s]=i,f=u<=n&&n{l.current&&f&&l.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},[f]),C.jsxs("span",{...r,children:[o.startsWith(" ")?" ":"",C.jsx("span",{ref:l,onClick:t,className:"text-md text-gray-600 cursor-pointer hover:text-red-600",title:i.map(h=>h.toFixed(2)).join(" → "),style:{textDecoration:f?"underline":"none",textShadow:f?"0 0 1px #000":"none"},children:o.trim()})]})},Fd=({transcript:e,segments:n,currentTime:t,setCurrentTime:r,...l})=>{const o=M.useMemo(()=>JSON.stringify({...e,segments:n},null,2).replace(/( {4}"timestamp": )\[\s+(\S+)\s+(\S+)\s+\]/gm,"$1[$2 $3]"),[e,n]),i=M.useMemo(()=>{let h=0;const m=e.chunks,p=[];for(const y of n){const{label:k,end:x}=y;if(k==="NO_SPEAKER")continue;const T=[];for(let c=h;c0&&p.push({...y,chunks:T})}return p},[e,n]),u=M.useMemo(()=>{let h=0;const m=e.chunks,p=[];let y=null,k="";for(const x of n){const{label:T,end:c}=x;if(T==="NO_SPEAKER")continue;const a=[];for(let d=h;d0&&p.push(`${y}: ${k.trim()}`),y=T,k=a.join(" "))}return y!==null&&k.trim().length>0&&p.push(`${y}: ${k.trim()}`),p.join(` `)},[e,n]),s=()=>{const h=new Blob([o],{type:"application/json"}),m=URL.createObjectURL(h),p=document.createElement("a");p.href=m,p.download="transcript.json",p.click(),URL.revokeObjectURL(m)},f=()=>{const h=new Blob([u],{type:"text/plain"}),m=URL.createObjectURL(h),p=document.createElement("a");p.href=m,p.download="transcript.txt",p.click(),URL.revokeObjectURL(m)};return C.jsxs(C.Fragment,{children:[C.jsx("div",{...l,children:i.map(({label:h,start:m,end:p,chunks:y},k)=>C.jsxs("div",{className:"border-t py-2",children:[C.jsxs("div",{className:"flex justify-between",children:[C.jsx("label",{className:"text-xs font-medium",children:h}),C.jsxs("label",{className:"text-xs",children:[m.toFixed(2)," → ",p.toFixed(2)]})]}),C.jsx("div",{children:y.map((x,T)=>C.jsx(Id,{chunk:x,currentTime:t,onClick:()=>r(x.timestamp[0])},T))})]},k))}),C.jsx("div",{className:"flex justify-center border-t text-sm text-gray-600 max-h-[150px] overflow-y-auto p-2 scrollbar-thin",children:C.jsxs("button",{className:"flex items-center border px-2 py-1 rounded-lg bg-green-400 text-white hover:bg-green-500",onClick:s,children:[C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mr-1",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Download transcript"]})}),C.jsx("div",{className:"flex justify-center border-t text-sm text-gray-600 max-h-[150px] overflow-y-auto p-2 scrollbar-thin",children:C.jsxs("button",{className:"flex items-center border px-2 py-1 rounded-lg bg-green-400 text-white hover:bg-green-500",onClick:f,children:[C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mr-1",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Download Text transcript"]})})]})};function Ud(e){return e=e.toLowerCase(),(e.match(/\w+.?/g)||[]).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}const Wu={en:"english",zh:"chinese",de:"german",es:"spanish/castilian",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan/valencian",nl:"dutch/flemish",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian/moldavian/moldovan",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi/panjabi",si:"sinhala/sinhalese",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole/haitian",ps:"pashto/pushto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish/letzeburgesch",my:"myanmar/burmese",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese"};function Ad({language:e,setLanguage:n,...t}){const r=o=>{n(o.target.value)},l=Object.values(Wu).map(Ud);return C.jsx("select",{...t,value:e,onChange:r,children:Object.keys(Wu).map((o,i)=>C.jsx("option",{value:o,children:l[i]},o))})}async function $d(){if(!navigator.gpu)return!1;try{return!!await navigator.gpu.requestAdapter()}catch{return!1}}function Bd(){const e=M.useRef(null),[n,t]=M.useState(null),[r,l]=M.useState(""),[o,i]=M.useState([]),u=M.useRef(null),[s,f]=M.useState(null),[h,m]=M.useState("en"),[p,y]=M.useState(null),[k,x]=M.useState(null),[T,c]=M.useState(0),[a,d]=M.useState("webgpu"),[g,E]=M.useState("gpu"in navigator?196:77);M.useEffect(()=>{$d().then(v=>{E(v?196:77),d(v?"webgpu":"wasm")})},[]),M.useEffect(()=>{e.current||(e.current=new Worker(new URL("/assets/worker-DBZk9nLo.js",import.meta.url),{type:"module"}));const v=S=>{switch(S.data.status){case"loading":t("loading"),l(S.data.data);break;case"initiate":i(L=>[...L,S.data]);break;case"progress":i(L=>L.map(z=>z.file===S.data.file?{...z,...S.data}:z));break;case"done":i(L=>L.filter(z=>z.file!==S.data.file));break;case"loaded":t("ready");break;case"complete":y(S.data.result),x(S.data.time),t("ready");break}};return e.current.addEventListener("message",v),()=>{e.current.removeEventListener("message",v)}},[]);const P=M.useCallback(()=>{y(null),x(null),n===null?(t("loading"),e.current.postMessage({type:"load",data:{device:a}})):(t("running"),e.current.postMessage({type:"run",data:{audio:s,language:h}}))},[n,s,h,a]);return C.jsxs("div",{className:"flex flex-col h-screen mx-auto text-gray-800 dark:text-gray-200 bg-white dark:bg-gray-900 max-w-[600px]",children:[n==="loading"&&C.jsx("div",{className:"flex justify-center items-center fixed w-screen h-screen bg-black z-10 bg-opacity-[92%] top-0 left-0",children:C.jsxs("div",{className:"w-[500px]",children:[C.jsx("p",{className:"text-center mb-1 text-white text-md",children:r}),o.map(({file:v,progress:S,total:L},z)=>C.jsx(Md,{text:v,percentage:S,total:L},z))]})}),C.jsxs("div",{className:"my-auto",children:[C.jsxs("div",{className:"flex flex-col items-center mb-2 text-center",children:[C.jsx("h1",{className:"text-5xl font-bold mb-2",children:"Whisper Diarization"}),C.jsxs("h2",{className:"text-xl font-semibold",children:["In-browser automatic speech recognition w/ ",C.jsx("br",{}),"word-level timestamps and speaker segmentation"]})]}),C.jsxs("div",{className:"w-full min-h-[220px] flex flex-col justify-center items-center",children:[!s&&C.jsxs("p",{className:"mb-2",children:["You are about to LOAD ",C.jsx("a",{href:"https://huggingface.co/onnx-community/whisper-base_timestamped",target:"_blank",rel:"noreferrer",className:"font-medium underline",children:"whisper-base"})," and ",C.jsx("a",{href:"https://huggingface.co/onnx-community/pyannote-segmentation-3.0",target:"_blank",rel:"noreferrer",className:"font-medium underline",children:"pyannote-segmentation-3.0"}),", two powerful speech recognition models for generating word-level timestamps and speaker segmentation, respectively. Once LOADED, the models (",g,"MB + 6MB) will be cached and reused when you revisit the page.",C.jsx("br",{}),C.jsx("br",{}),"Everything runs locally in your browser using ",C.jsx("a",{href:"https://huggingface.co/docs/transformers.js",target:"_blank",rel:"noreferrer",className:"underline",children:"🤗 Transformers.js"})," and ONNX Runtime Web, meaning no API calls are made to a server for inference. You can even disconnect from the internet after the model has loaded!",C.jsx("br",{}),"After you RUN MODEL, you can download the results in JSON or TEXT output. Expect about 1 seconds model runtime for 10 seconds audio input."]}),C.jsxs("div",{className:"flex flex-col w-full m-3 max-w-[520px]",children:[C.jsx("span",{className:"text-sm mb-0.5",children:"Input audio/video"}),C.jsx(tc,{ref:u,className:"flex items-center border rounded-md cursor-pointer min-h-[100px] max-h-[500px] overflow-hidden",onInputChange:v=>{y(null),f(v)},onTimeUpdate:v=>c(v)})]}),C.jsxs("div",{className:"relative w-full flex justify-center items-center",children:[C.jsx("button",{className:"border px-4 py-2 rounded-lg bg-blue-400 text-white hover:bg-blue-500 disabled:bg-blue-100 disabled:cursor-not-allowed select-none",onClick:P,disabled:n==="running"||n!==null&&s===null,children:n===null?"Load model":n==="running"?"Running...":"Run model"}),n!==null&&C.jsxs("div",{className:"absolute right-0 bottom-0",children:[C.jsx("span",{className:"text-xs",children:"Language:"}),C.jsx("br",{}),C.jsx(Ad,{className:"border rounded-lg p-1 max-w-[100px]",language:h,setLanguage:m})]})]}),p&&k&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"w-full mt-4 border rounded-md",children:C.jsx(Fd,{className:"p-2 max-h-[200px] overflow-y-auto scrollbar-thin select-none",transcript:p.transcript,segments:p.segments,currentTime:T,setCurrentTime:v=>{c(v),u.current.setMediaTime(v)}})}),C.jsxs("p",{className:"text-sm text-gray-600 text-end p-1",children:["Generation time: ",C.jsxs("span",{className:"text-gray-800 font-semibold",children:[k.toFixed(2),"ms"]})]})]})]})]})]})}Kl.createRoot(document.getElementById("root")).render(C.jsx(kc.StrictMode,{children:C.jsx(Bd,{})}));