From 08fcab085bbddde4eae097d2a0c1be078e796744 Mon Sep 17 00:00:00 2001 From: Ciaran O'Reilly Date: Wed, 13 Nov 2024 00:09:06 +0100 Subject: [PATCH] 1.2.15 - Updated editor --- functions.php | 2 +- static/js/subdub-editor.js | 92 +++++++++++++++++++------------------- style.css | 2 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/functions.php b/functions.php index d2e4b19..faa1c76 100644 --- a/functions.php +++ b/functions.php @@ -1,6 +1,6 @@ >>1,G=B[K];if(0>>1;Ko(ie,F))zo(ge,ie)?(B[K]=ge,B[z]=F,K=z):(B[K]=ie,B[J]=F,K=J);else if(zo(ge,F))B[K]=ge,B[z]=F,K=z;else break e}}return M}function o(B,M){var F=B.sortIndex-M.sortIndex;return F!==0?F:B.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],p=1,y=null,m=3,b=!1,P=!1,O=!1,N=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(B){for(var M=n(h);M!==null;){if(M.callback===null)r(h);else if(M.startTime<=B)r(h),M.sortIndex=M.expirationTime,t(f,M);else break;M=n(h)}}function C(B){if(O=!1,x(B),!P)if(n(f)!==null)P=!0,he(T);else{var M=n(h);M!==null&&ce(C,M.startTime-B)}}function T(B,M){P=!1,O&&(O=!1,_(A),A=-1),b=!0;var F=m;try{for(x(M),y=n(f);y!==null&&(!(y.expirationTime>M)||B&&!te());){var K=y.callback;if(typeof K=="function"){y.callback=null,m=y.priorityLevel;var G=K(y.expirationTime<=M);M=e.unstable_now(),typeof G=="function"?y.callback=G:y===n(f)&&r(f),x(M)}else r(f);y=n(f)}if(y!==null)var H=!0;else{var J=n(h);J!==null&&ce(C,J.startTime-M),H=!1}return H}finally{y=null,m=F,b=!1}}var k=!1,R=null,A=-1,W=5,Y=-1;function te(){return!(e.unstable_now()-YB||125K?(B.sortIndex=F,t(h,B),n(f)===null&&B===n(h)&&(O?(_(A),A=-1):O=!0,ce(C,F-K))):(B.sortIndex=G,t(f,B),P||b||(P=!0,he(T))),B},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(B){var M=m;return function(){var F=m;m=M;try{return B.apply(this,arguments)}finally{m=F}}}})(w1);y1.exports=w1;var eR=y1.exports;/** + */(function(e){function t(B,M){var F=B.length;B.push(M);e:for(;0>>1,G=B[K];if(0>>1;Ko(ie,F))zo(ge,ie)?(B[K]=ge,B[z]=F,K=z):(B[K]=ie,B[J]=F,K=J);else if(zo(ge,F))B[K]=ge,B[z]=F,K=z;else break e}}return M}function o(B,M){var F=B.sortIndex-M.sortIndex;return F!==0?F:B.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],p=1,w=null,m=3,b=!1,R=!1,O=!1,N=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(B){for(var M=n(h);M!==null;){if(M.callback===null)r(h);else if(M.startTime<=B)r(h),M.sortIndex=M.expirationTime,t(f,M);else break;M=n(h)}}function C(B){if(O=!1,x(B),!R)if(n(f)!==null)R=!0,de(k);else{var M=n(h);M!==null&&ce(C,M.startTime-B)}}function k(B,M){R=!1,O&&(O=!1,_(A),A=-1),b=!0;var F=m;try{for(x(M),w=n(f);w!==null&&(!(w.expirationTime>M)||B&&!te());){var K=w.callback;if(typeof K=="function"){w.callback=null,m=w.priorityLevel;var G=K(w.expirationTime<=M);M=e.unstable_now(),typeof G=="function"?w.callback=G:w===n(f)&&r(f),x(M)}else r(f);w=n(f)}if(w!==null)var W=!0;else{var J=n(h);J!==null&&ce(C,J.startTime-M),W=!1}return W}finally{w=null,m=F,b=!1}}var E=!1,P=null,A=-1,V=5,Q=-1;function te(){return!(e.unstable_now()-QB||125K?(B.sortIndex=F,t(h,B),n(f)===null&&B===n(h)&&(O?(_(A),A=-1):O=!0,ce(C,F-K))):(B.sortIndex=G,t(f,B),R||b||(R=!0,de(k))),B},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(B){var M=m;return function(){var F=m;m=M;try{return B.apply(this,arguments)}finally{m=F}}}})(w1);y1.exports=w1;var eR=y1.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var tR=j,Ln=eR;function ee(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"),Qd=Object.prototype.hasOwnProperty,nR=/^[: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]*$/,jv={},Bv={};function rR(e){return Qd.call(Bv,e)?!0:Qd.call(jv,e)?!1:nR.test(e)?Bv[e]=!0:(jv[e]=!0,!1)}function iR(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 oR(e,t,n,r){if(t===null||typeof t>"u"||iR(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 rn(e,t,n,r,o,a,l){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=a,this.removeEmptyString=l}var Ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ut[e]=new rn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ut[t]=new rn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ut[e]=new rn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ut[e]=new rn(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){Ut[e]=new rn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ut[e]=new rn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ut[e]=new rn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ut[e]=new rn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ut[e]=new rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ip=/[\-:]([a-z])/g;function op(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(ip,op);Ut[t]=new rn(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(ip,op);Ut[t]=new rn(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(ip,op);Ut[t]=new rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ut[e]=new rn(e,1,!1,e.toLowerCase(),null,!1,!1)});Ut.xlinkHref=new rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ut[e]=new rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function sp(e,t,n,r){var o=Ut.hasOwnProperty(t)?Ut[t]:null;(o!==null?o.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qd=Object.prototype.hasOwnProperty,nR=/^[: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]*$/,jv={},Bv={};function rR(e){return Qd.call(Bv,e)?!0:Qd.call(jv,e)?!1:nR.test(e)?Bv[e]=!0:(jv[e]=!0,!1)}function iR(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 oR(e,t,n,r){if(t===null||typeof t>"u"||iR(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 rn(e,t,n,r,o,a,l){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=a,this.removeEmptyString=l}var Ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ut[e]=new rn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ut[t]=new rn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ut[e]=new rn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ut[e]=new rn(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){Ut[e]=new rn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ut[e]=new rn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ut[e]=new rn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ut[e]=new rn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ut[e]=new rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ip=/[\-:]([a-z])/g;function op(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(ip,op);Ut[t]=new rn(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(ip,op);Ut[t]=new rn(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(ip,op);Ut[t]=new rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ut[e]=new rn(e,1,!1,e.toLowerCase(),null,!1,!1)});Ut.xlinkHref=new rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ut[e]=new rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function sp(e,t,n,r){var o=Ut.hasOwnProperty(t)?Ut[t]:null;(o!==null?o.type!==0:r||!(2c||o[l]!==a[c]){var f=` -`+o[l].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=l&&0<=c);break}}}finally{sd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hs(e):""}function sR(e){switch(e.tag){case 5:return Hs(e.type);case 16:return Hs("Lazy");case 13:return Hs("Suspense");case 19:return Hs("SuspenseList");case 0:case 2:case 15:return e=ad(e.type,!1),e;case 11:return e=ad(e.type.render,!1),e;case 1:return e=ad(e.type,!0),e;default:return""}}function eh(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 Do:return"Fragment";case Ao:return"Portal";case Zd:return"Profiler";case ap:return"StrictMode";case qd:return"Suspense";case Jd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _1:return(e.displayName||"Context")+".Consumer";case x1:return(e._context.displayName||"Context")+".Provider";case lp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case up:return t=e.displayName||null,t!==null?t:eh(e.type)||"Memo";case ci:t=e._payload,e=e._init;try{return eh(e(t))}catch{}}return null}function aR(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 eh(t);case 8:return t===ap?"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 Ci(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lR(e){var t=k1(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,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Al(e){e._valueTracker||(e._valueTracker=lR(e))}function C1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=k1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wu(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 th(e,t){var n=t.checked;return ft({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ci(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 E1(e,t){t=t.checked,t!=null&&sp(e,"checked",t,!1)}function nh(e,t){E1(e,t);var n=Ci(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")?rh(e,t.type,n):t.hasOwnProperty("defaultValue")&&rh(e,t.type,Ci(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vv(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 rh(e,t,n){(t!=="number"||wu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vs=Array.isArray;function Ko(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Dl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ys={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},uR=["Webkit","ms","Moz","O"];Object.keys(Ys).forEach(function(e){uR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ys[t]=Ys[e]})});function O1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}function L1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=O1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var cR=ft({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 sh(e,t){if(t){if(cR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function ah(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 lh=null;function cp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var uh=null,Go=null,Yo=null;function Yv(e){if(e=Pa(e)){if(typeof uh!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=rc(t),uh(e.stateNode,e.type,t))}}function A1(e){Go?Yo?Yo.push(e):Yo=[e]:Go=e}function D1(){if(Go){var e=Go,t=Yo;if(Yo=Go=null,Yv(e),t)for(e=0;e>>=0,e===0?32:31-(xR(e)/_R|0)|0}var $l=64,Il=4194304;function Ks(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 bu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,l=n&268435455;if(l!==0){var c=l&~o;c!==0?r=Ks(c):(a&=l,a!==0&&(r=Ks(a)))}else l=n&~o,l!==0?r=Ks(l):a!==0&&(r=Ks(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,a=t&-t,o>=a||o===16&&(a&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 Ta(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dr(t),e[t]=n}function ER(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=Qs),r0=String.fromCharCode(32),i0=!1;function J1(e,t){switch(e){case"keyup":return eP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ew(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $o=!1;function nP(e,t){switch(e){case"compositionend":return ew(t);case"keypress":return t.which!==32?null:(i0=!0,r0);case"textInput":return e=t.data,e===r0&&i0?null:e;default:return null}}function rP(e,t){if($o)return e==="compositionend"||!yp&&J1(e,t)?(e=Z1(),au=gp=pi=null,$o=!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=l0(n)}}function iw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?iw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ow(){for(var e=window,t=wu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wu(e.document)}return t}function wp(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 dP(e){var t=ow(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&iw(n.ownerDocument.documentElement,n)){if(r!==null&&wp(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,a=Math.min(r.start,o);r=r.end===void 0?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=u0(n,a);var l=u0(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.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,Io=null,gh=null,qs=null,mh=!1;function c0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mh||Io==null||Io!==wu(r)||(r=Io,"selectionStart"in r&&wp(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}),qs&&da(qs,r)||(qs=r,r=Eu(gh,"onSelect"),0zo||(e.current=_h[zo],_h[zo]=null,zo--)}function Ze(e,t){zo++,_h[zo]=e.current,e.current=t}var Ei={},Gt=Ri(Ei),pn=Ri(!1),Xi=Ei;function Jo(e,t){var n=e.type.contextTypes;if(!n)return Ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in n)o[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function gn(e){return e=e.childContextTypes,e!=null}function Ru(){et(pn),et(Gt)}function v0(e,t,n){if(Gt.current!==Ei)throw Error(ee(168));Ze(Gt,t),Ze(pn,n)}function pw(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(ee(108,aR(e)||"Unknown",o));return ft({},n,r)}function Pu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,Xi=Gt.current,Ze(Gt,e),Ze(pn,pn.current),!0}function y0(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=pw(e,t,Xi),r.__reactInternalMemoizedMergedChildContext=e,et(pn),et(Gt),Ze(Gt,e)):et(pn),Ze(pn,n)}var Ur=null,ic=!1,xd=!1;function gw(e){Ur===null?Ur=[e]:Ur.push(e)}function kP(e){ic=!0,gw(e)}function Pi(){if(!xd&&Ur!==null){xd=!0;var e=0,t=He;try{var n=Ur;for(He=1;e>=l,o-=l,jr=1<<32-dr(t)+o|n<A?(W=R,R=null):W=R.sibling;var Y=m(_,R,x[A],C);if(Y===null){R===null&&(R=W);break}e&&R&&Y.alternate===null&&t(_,R),v=a(Y,v,A),k===null?T=Y:k.sibling=Y,k=Y,R=W}if(A===x.length)return n(_,R),it&&Ui(_,A),T;if(R===null){for(;AA?(W=R,R=null):W=R.sibling;var te=m(_,R,Y.value,C);if(te===null){R===null&&(R=W);break}e&&R&&te.alternate===null&&t(_,R),v=a(te,v,A),k===null?T=te:k.sibling=te,k=te,R=W}if(Y.done)return n(_,R),it&&Ui(_,A),T;if(R===null){for(;!Y.done;A++,Y=x.next())Y=y(_,Y.value,C),Y!==null&&(v=a(Y,v,A),k===null?T=Y:k.sibling=Y,k=Y);return it&&Ui(_,A),T}for(R=r(_,R);!Y.done;A++,Y=x.next())Y=b(R,_,A,Y.value,C),Y!==null&&(e&&Y.alternate!==null&&R.delete(Y.key===null?A:Y.key),v=a(Y,v,A),k===null?T=Y:k.sibling=Y,k=Y);return e&&R.forEach(function(de){return t(_,de)}),it&&Ui(_,A),T}function N(_,v,x,C){if(typeof x=="object"&&x!==null&&x.type===Do&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ll:e:{for(var T=x.key,k=v;k!==null;){if(k.key===T){if(T=x.type,T===Do){if(k.tag===7){n(_,k.sibling),v=o(k,x.props.children),v.return=_,_=v;break e}}else if(k.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===ci&&x0(T)===k.type){n(_,k.sibling),v=o(k,x.props),v.ref=Ns(_,k,x),v.return=_,_=v;break e}n(_,k);break}else t(_,k);k=k.sibling}x.type===Do?(v=Gi(x.props.children,_.mode,C,x.key),v.return=_,_=v):(C=gu(x.type,x.key,x.props,null,_.mode,C),C.ref=Ns(_,v,x),C.return=_,_=C)}return l(_);case Ao:e:{for(k=x.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(_,v.sibling),v=o(v,x.children||[]),v.return=_,_=v;break e}else{n(_,v);break}else t(_,v);v=v.sibling}v=Pd(x,_.mode,C),v.return=_,_=v}return l(_);case ci:return k=x._init,N(_,v,k(x._payload),C)}if(Vs(x))return P(_,v,x,C);if(Ls(x))return O(_,v,x,C);Bl(_,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(_,v.sibling),v=o(v,x),v.return=_,_=v):(n(_,v),v=Rd(x,_.mode,C),v.return=_,_=v),l(_)):n(_,v)}return N}var ts=ww(!0),Sw=ww(!1),Au=Ri(null),Du=null,jo=null,bp=null;function kp(){bp=jo=Du=null}function Cp(e){var t=Au.current;et(Au),e._currentValue=t}function Ch(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 Qo(e,t){Du=e,bp=jo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(hn=!0),e.firstContext=null)}function Yn(e){var t=e._currentValue;if(bp!==e)if(e={context:e,memoizedValue:t,next:null},jo===null){if(Du===null)throw Error(ee(308));jo=e,Du.dependencies={lanes:0,firstContext:e}}else jo=jo.next=e;return t}var Wi=null;function Ep(e){Wi===null?Wi=[e]:Wi.push(e)}function xw(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ep(t)):(n.next=o.next,o.next=n),t.interleaved=n,Gr(e,r)}function Gr(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 fi=!1;function Tp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _w(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 Hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ze&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Gr(e,n)}return o=r.interleaved,o===null?(t.next=t,Ep(r)):(t.next=o.next,o.next=t),r.interleaved=t,Gr(e,n)}function uu(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,dp(e,n)}}function _0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?o=a=l:a=a.next=l,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,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 $u(e,t,n,r){var o=e.updateQueue;fi=!1;var a=o.firstBaseUpdate,l=o.lastBaseUpdate,c=o.shared.pending;if(c!==null){o.shared.pending=null;var f=c,h=f.next;f.next=null,l===null?a=h:l.next=h,l=f;var p=e.alternate;p!==null&&(p=p.updateQueue,c=p.lastBaseUpdate,c!==l&&(c===null?p.firstBaseUpdate=h:c.next=h,p.lastBaseUpdate=f))}if(a!==null){var y=o.baseState;l=0,p=h=f=null,c=a;do{var m=c.lane,b=c.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:b,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var P=e,O=c;switch(m=t,b=n,O.tag){case 1:if(P=O.payload,typeof P=="function"){y=P.call(b,y,m);break e}y=P;break e;case 3:P.flags=P.flags&-65537|128;case 0:if(P=O.payload,m=typeof P=="function"?P.call(b,y,m):P,m==null)break e;y=ft({},y,m);break e;case 2:fi=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[c]:m.push(c))}else b={eventTime:b,lane:m,tag:c.tag,payload:c.payload,callback:c.callback,next:null},p===null?(h=p=b,f=y):p=p.next=b,l|=m;if(c=c.next,c===null){if(c=o.shared.pending,c===null)break;m=c,c=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(1);if(p===null&&(f=y),o.baseState=f,o.firstBaseUpdate=h,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else a===null&&(o.shared.lanes=0);qi|=l,e.lanes=l,e.memoizedState=y}}function b0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bd.transition;bd.transition={};try{e(!1),t()}finally{He=n,bd.transition=r}}function Fw(){return Xn().memoizedState}function RP(e,t,n){var r=_i(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Uw(e))jw(t,n);else if(n=xw(e,t,n,r),n!==null){var o=tn();hr(n,e,r,o),Bw(n,t,r)}}function PP(e,t,n){var r=_i(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uw(e))jw(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,c=a(l,n);if(o.hasEagerState=!0,o.eagerState=c,pr(c,l)){var f=t.interleaved;f===null?(o.next=o,Ep(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}n=xw(e,t,o,r),n!==null&&(o=tn(),hr(n,e,r,o),Bw(n,t,r))}}function Uw(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function jw(e,t){Js=Nu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dp(e,n)}}var Mu={readContext:Yn,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},OP={readContext:Yn,useCallback:function(e,t){return Sr().memoizedState=[e,t===void 0?null:t],e},useContext:Yn,useEffect:C0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fu(4194308,4,$w.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fu(4194308,4,e,t)},useInsertionEffect:function(e,t){return fu(4,2,e,t)},useMemo:function(e,t){var n=Sr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Sr();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=RP.bind(null,ct,e),[r.memoizedState,e]},useRef:function(e){var t=Sr();return e={current:e},t.memoizedState=e},useState:k0,useDebugValue:Ip,useDeferredValue:function(e){return Sr().memoizedState=e},useTransition:function(){var e=k0(!1),t=e[0];return e=TP.bind(null,e[1]),Sr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ct,o=Sr();if(it){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),At===null)throw Error(ee(349));Zi&30||Ew(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,C0(Rw.bind(null,r,a,e),[e]),r.flags|=2048,Sa(9,Tw.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Sr(),t=At.identifierPrefix;if(it){var n=Br,r=jr;n=(r&~(1<<32-dr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ya++,0")&&(f=f.replace("",e.displayName)),f}while(1<=l&&0<=c);break}}}finally{sd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hs(e):""}function sR(e){switch(e.tag){case 5:return Hs(e.type);case 16:return Hs("Lazy");case 13:return Hs("Suspense");case 19:return Hs("SuspenseList");case 0:case 2:case 15:return e=ad(e.type,!1),e;case 11:return e=ad(e.type.render,!1),e;case 1:return e=ad(e.type,!0),e;default:return""}}function eh(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 Do:return"Fragment";case Ao:return"Portal";case Zd:return"Profiler";case ap:return"StrictMode";case qd:return"Suspense";case Jd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _1:return(e.displayName||"Context")+".Consumer";case x1:return(e._context.displayName||"Context")+".Provider";case lp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case up:return t=e.displayName||null,t!==null?t:eh(e.type)||"Memo";case ci:t=e._payload,e=e._init;try{return eh(e(t))}catch{}}return null}function aR(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 eh(t);case 8:return t===ap?"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 Ci(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lR(e){var t=k1(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,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Al(e){e._valueTracker||(e._valueTracker=lR(e))}function C1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=k1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wu(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 th(e,t){var n=t.checked;return ft({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ci(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 E1(e,t){t=t.checked,t!=null&&sp(e,"checked",t,!1)}function nh(e,t){E1(e,t);var n=Ci(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")?rh(e,t.type,n):t.hasOwnProperty("defaultValue")&&rh(e,t.type,Ci(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vv(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 rh(e,t,n){(t!=="number"||wu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vs=Array.isArray;function Ko(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Dl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ys={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},uR=["Webkit","ms","Moz","O"];Object.keys(Ys).forEach(function(e){uR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ys[t]=Ys[e]})});function O1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}function L1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=O1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var cR=ft({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 sh(e,t){if(t){if(cR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function ah(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 lh=null;function cp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var uh=null,Go=null,Yo=null;function Yv(e){if(e=Pa(e)){if(typeof uh!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=rc(t),uh(e.stateNode,e.type,t))}}function A1(e){Go?Yo?Yo.push(e):Yo=[e]:Go=e}function D1(){if(Go){var e=Go,t=Yo;if(Yo=Go=null,Yv(e),t)for(e=0;e>>=0,e===0?32:31-(xR(e)/_R|0)|0}var $l=64,Il=4194304;function Ks(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 bu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,l=n&268435455;if(l!==0){var c=l&~o;c!==0?r=Ks(c):(a&=l,a!==0&&(r=Ks(a)))}else l=n&~o,l!==0?r=Ks(l):a!==0&&(r=Ks(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,a=t&-t,o>=a||o===16&&(a&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 Ta(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fr(t),e[t]=n}function ER(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=Qs),r0=String.fromCharCode(32),i0=!1;function J1(e,t){switch(e){case"keyup":return eP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ew(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $o=!1;function nP(e,t){switch(e){case"compositionend":return ew(t);case"keypress":return t.which!==32?null:(i0=!0,r0);case"textInput":return e=t.data,e===r0&&i0?null:e;default:return null}}function rP(e,t){if($o)return e==="compositionend"||!yp&&J1(e,t)?(e=Z1(),au=gp=pi=null,$o=!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=l0(n)}}function iw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?iw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ow(){for(var e=window,t=wu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wu(e.document)}return t}function wp(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 dP(e){var t=ow(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&iw(n.ownerDocument.documentElement,n)){if(r!==null&&wp(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,a=Math.min(r.start,o);r=r.end===void 0?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=u0(n,a);var l=u0(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.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,Io=null,gh=null,qs=null,mh=!1;function c0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mh||Io==null||Io!==wu(r)||(r=Io,"selectionStart"in r&&wp(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}),qs&&da(qs,r)||(qs=r,r=Eu(gh,"onSelect"),0zo||(e.current=_h[zo],_h[zo]=null,zo--)}function Ze(e,t){zo++,_h[zo]=e.current,e.current=t}var Ei={},Gt=Ri(Ei),hn=Ri(!1),Qi=Ei;function Jo(e,t){var n=e.type.contextTypes;if(!n)return Ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in n)o[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function pn(e){return e=e.childContextTypes,e!=null}function Ru(){et(hn),et(Gt)}function v0(e,t,n){if(Gt.current!==Ei)throw Error(ee(168));Ze(Gt,t),Ze(hn,n)}function pw(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(ee(108,aR(e)||"Unknown",o));return ft({},n,r)}function Pu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,Qi=Gt.current,Ze(Gt,e),Ze(hn,hn.current),!0}function y0(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=pw(e,t,Qi),r.__reactInternalMemoizedMergedChildContext=e,et(hn),et(Gt),Ze(Gt,e)):et(hn),Ze(hn,n)}var Ur=null,ic=!1,xd=!1;function gw(e){Ur===null?Ur=[e]:Ur.push(e)}function kP(e){ic=!0,gw(e)}function Pi(){if(!xd&&Ur!==null){xd=!0;var e=0,t=We;try{var n=Ur;for(We=1;e>=l,o-=l,jr=1<<32-fr(t)+o|n<A?(V=P,P=null):V=P.sibling;var Q=m(_,P,x[A],C);if(Q===null){P===null&&(P=V);break}e&&P&&Q.alternate===null&&t(_,P),v=a(Q,v,A),E===null?k=Q:E.sibling=Q,E=Q,P=V}if(A===x.length)return n(_,P),it&&ji(_,A),k;if(P===null){for(;AA?(V=P,P=null):V=P.sibling;var te=m(_,P,Q.value,C);if(te===null){P===null&&(P=V);break}e&&P&&te.alternate===null&&t(_,P),v=a(te,v,A),E===null?k=te:E.sibling=te,E=te,P=V}if(Q.done)return n(_,P),it&&ji(_,A),k;if(P===null){for(;!Q.done;A++,Q=x.next())Q=w(_,Q.value,C),Q!==null&&(v=a(Q,v,A),E===null?k=Q:E.sibling=Q,E=Q);return it&&ji(_,A),k}for(P=r(_,P);!Q.done;A++,Q=x.next())Q=b(P,_,A,Q.value,C),Q!==null&&(e&&Q.alternate!==null&&P.delete(Q.key===null?A:Q.key),v=a(Q,v,A),E===null?k=Q:E.sibling=Q,E=Q);return e&&P.forEach(function(he){return t(_,he)}),it&&ji(_,A),k}function N(_,v,x,C){if(typeof x=="object"&&x!==null&&x.type===Do&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ll:e:{for(var k=x.key,E=v;E!==null;){if(E.key===k){if(k=x.type,k===Do){if(E.tag===7){n(_,E.sibling),v=o(E,x.props.children),v.return=_,_=v;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ci&&x0(k)===E.type){n(_,E.sibling),v=o(E,x.props),v.ref=Ns(_,E,x),v.return=_,_=v;break e}n(_,E);break}else t(_,E);E=E.sibling}x.type===Do?(v=Yi(x.props.children,_.mode,C,x.key),v.return=_,_=v):(C=gu(x.type,x.key,x.props,null,_.mode,C),C.ref=Ns(_,v,x),C.return=_,_=C)}return l(_);case Ao:e:{for(E=x.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(_,v.sibling),v=o(v,x.children||[]),v.return=_,_=v;break e}else{n(_,v);break}else t(_,v);v=v.sibling}v=Pd(x,_.mode,C),v.return=_,_=v}return l(_);case ci:return E=x._init,N(_,v,E(x._payload),C)}if(Vs(x))return R(_,v,x,C);if(Ls(x))return O(_,v,x,C);Bl(_,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(_,v.sibling),v=o(v,x),v.return=_,_=v):(n(_,v),v=Rd(x,_.mode,C),v.return=_,_=v),l(_)):n(_,v)}return N}var ts=ww(!0),Sw=ww(!1),Au=Ri(null),Du=null,jo=null,bp=null;function kp(){bp=jo=Du=null}function Cp(e){var t=Au.current;et(Au),e._currentValue=t}function Ch(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 Qo(e,t){Du=e,bp=jo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dn=!0),e.firstContext=null)}function Gn(e){var t=e._currentValue;if(bp!==e)if(e={context:e,memoizedValue:t,next:null},jo===null){if(Du===null)throw Error(ee(308));jo=e,Du.dependencies={lanes:0,firstContext:e}}else jo=jo.next=e;return t}var Hi=null;function Ep(e){Hi===null?Hi=[e]:Hi.push(e)}function xw(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ep(t)):(n.next=o.next,o.next=n),t.interleaved=n,Gr(e,r)}function Gr(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 fi=!1;function Tp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _w(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 Hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ze&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Gr(e,n)}return o=r.interleaved,o===null?(t.next=t,Ep(r)):(t.next=o.next,o.next=t),r.interleaved=t,Gr(e,n)}function uu(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,dp(e,n)}}function _0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?o=a=l:a=a.next=l,n=n.next}while(n!==null);a===null?o=a=t:a=a.next=t}else o=a=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,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 $u(e,t,n,r){var o=e.updateQueue;fi=!1;var a=o.firstBaseUpdate,l=o.lastBaseUpdate,c=o.shared.pending;if(c!==null){o.shared.pending=null;var f=c,h=f.next;f.next=null,l===null?a=h:l.next=h,l=f;var p=e.alternate;p!==null&&(p=p.updateQueue,c=p.lastBaseUpdate,c!==l&&(c===null?p.firstBaseUpdate=h:c.next=h,p.lastBaseUpdate=f))}if(a!==null){var w=o.baseState;l=0,p=h=f=null,c=a;do{var m=c.lane,b=c.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:b,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var R=e,O=c;switch(m=t,b=n,O.tag){case 1:if(R=O.payload,typeof R=="function"){w=R.call(b,w,m);break e}w=R;break e;case 3:R.flags=R.flags&-65537|128;case 0:if(R=O.payload,m=typeof R=="function"?R.call(b,w,m):R,m==null)break e;w=ft({},w,m);break e;case 2:fi=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[c]:m.push(c))}else b={eventTime:b,lane:m,tag:c.tag,payload:c.payload,callback:c.callback,next:null},p===null?(h=p=b,f=w):p=p.next=b,l|=m;if(c=c.next,c===null){if(c=o.shared.pending,c===null)break;m=c,c=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(1);if(p===null&&(f=w),o.baseState=f,o.firstBaseUpdate=h,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else a===null&&(o.shared.lanes=0);Ji|=l,e.lanes=l,e.memoizedState=w}}function b0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bd.transition;bd.transition={};try{e(!1),t()}finally{We=n,bd.transition=r}}function Fw(){return Yn().memoizedState}function RP(e,t,n){var r=_i(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Uw(e))jw(t,n);else if(n=xw(e,t,n,r),n!==null){var o=tn();dr(n,e,r,o),Bw(n,t,r)}}function PP(e,t,n){var r=_i(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uw(e))jw(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,c=a(l,n);if(o.hasEagerState=!0,o.eagerState=c,hr(c,l)){var f=t.interleaved;f===null?(o.next=o,Ep(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}n=xw(e,t,o,r),n!==null&&(o=tn(),dr(n,e,r,o),Bw(n,t,r))}}function Uw(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function jw(e,t){Js=Nu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dp(e,n)}}var Mu={readContext:Gn,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},OP={readContext:Gn,useCallback:function(e,t){return Sr().memoizedState=[e,t===void 0?null:t],e},useContext:Gn,useEffect:C0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fu(4194308,4,$w.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fu(4194308,4,e,t)},useInsertionEffect:function(e,t){return fu(4,2,e,t)},useMemo:function(e,t){var n=Sr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Sr();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=RP.bind(null,ct,e),[r.memoizedState,e]},useRef:function(e){var t=Sr();return e={current:e},t.memoizedState=e},useState:k0,useDebugValue:Ip,useDeferredValue:function(e){return Sr().memoizedState=e},useTransition:function(){var e=k0(!1),t=e[0];return e=TP.bind(null,e[1]),Sr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ct,o=Sr();if(it){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),At===null)throw Error(ee(349));qi&30||Ew(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,C0(Rw.bind(null,r,a,e),[e]),r.flags|=2048,Sa(9,Tw.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Sr(),t=At.identifierPrefix;if(it){var n=Br,r=jr;n=(r&~(1<<32-fr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ya++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[_r]=t,e[ga]=r,qw(e,t,!1,!1),t.stateNode=e;e:{switch(l=ah(n,r),n){case"dialog":Je("cancel",e),Je("close",e),o=r;break;case"iframe":case"object":case"embed":Je("load",e),o=r;break;case"video":case"audio":for(o=0;ois&&(t.flags|=128,r=!0,Ms(a,!1),t.lanes=4194304)}else{if(!r)if(e=Iu(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ms(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!it)return Ht(t),null}else 2*yt()-a.renderingStartTime>is&&n!==1073741824&&(t.flags|=128,r=!0,Ms(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(n=a.last,n!==null?n.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=yt(),t.sibling=null,n=lt.current,Ze(lt,r?n&1|2:n&1),t):(Ht(t),null);case 22:case 23:return jp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Tn&1073741824&&(Ht(t),t.subtreeFlags&6&&(t.flags|=8192)):Ht(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function zP(e,t){switch(xp(t),t.tag){case 1:return gn(t.type)&&Ru(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ns(),et(pn),et(Gt),Op(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pp(t),null;case 13:if(et(lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return et(lt),null;case 4:return ns(),null;case 10:return Cp(t.type._context),null;case 22:case 23:return jp(),null;case 24:return null;default:return null}}var Hl=!1,Kt=!1,FP=typeof WeakSet=="function"?WeakSet:Set,se=null;function Bo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pt(e,t,r)}else n.current=null}function $h(e,t,n){try{n()}catch(r){pt(e,t,r)}}var N0=!1;function UP(e,t){if(vh=ku,e=ow(),wp(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,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var l=0,c=-1,f=-1,h=0,p=0,y=e,m=null;t:for(;;){for(var b;y!==n||o!==0&&y.nodeType!==3||(c=l+o),y!==a||r!==0&&y.nodeType!==3||(f=l+r),y.nodeType===3&&(l+=y.nodeValue.length),(b=y.firstChild)!==null;)m=y,y=b;for(;;){if(y===e)break t;if(m===n&&++h===o&&(c=l),m===a&&++p===r&&(f=l),(b=y.nextSibling)!==null)break;y=m,m=y.parentNode}y=b}n=c===-1||f===-1?null:{start:c,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(yh={focusedElem:e,selectionRange:n},ku=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var P=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(P!==null){var O=P.memoizedProps,N=P.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?O:ur(t.type,O),N);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(C){pt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return P=N0,N0=!1,P}function ea(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 a=o.destroy;o.destroy=void 0,a!==void 0&&$h(t,n,a)}o=o.next}while(o!==r)}}function ac(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 Ih(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 tS(e){var t=e.alternate;t!==null&&(e.alternate=null,tS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_r],delete t[ga],delete t[xh],delete t[_P],delete t[bP])),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 nS(e){return e.tag===5||e.tag===3||e.tag===4}function M0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nS(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 Nh(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=Tu));else if(r!==4&&(e=e.child,e!==null))for(Nh(e,t,n),e=e.sibling;e!==null;)Nh(e,t,n),e=e.sibling}function Mh(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(Mh(e,t,n),e=e.sibling;e!==null;)Mh(e,t,n),e=e.sibling}var Mt=null,cr=!1;function ai(e,t,n){for(n=n.child;n!==null;)rS(e,t,n),n=n.sibling}function rS(e,t,n){if(Cr&&typeof Cr.onCommitFiberUnmount=="function")try{Cr.onCommitFiberUnmount(Ju,n)}catch{}switch(n.tag){case 5:Kt||Bo(n,t);case 6:var r=Mt,o=cr;Mt=null,ai(e,t,n),Mt=r,cr=o,Mt!==null&&(cr?(e=Mt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Mt.removeChild(n.stateNode));break;case 18:Mt!==null&&(cr?(e=Mt,n=n.stateNode,e.nodeType===8?Sd(e.parentNode,n):e.nodeType===1&&Sd(e,n),ca(e)):Sd(Mt,n.stateNode));break;case 4:r=Mt,o=cr,Mt=n.stateNode.containerInfo,cr=!0,ai(e,t,n),Mt=r,cr=o;break;case 0:case 11:case 14:case 15:if(!Kt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var a=o,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&$h(n,t,l),o=o.next}while(o!==r)}ai(e,t,n);break;case 1:if(!Kt&&(Bo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){pt(n,t,c)}ai(e,t,n);break;case 21:ai(e,t,n);break;case 22:n.mode&1?(Kt=(r=Kt)||n.memoizedState!==null,ai(e,t,n),Kt=r):ai(e,t,n);break;default:ai(e,t,n)}}function z0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FP),t.forEach(function(r){var o=XP.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function sr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~a}if(r=o,r=yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*BP(r/1960))-r,10e?16:e,gi===null)var r=!1;else{if(e=gi,gi=null,Uu=0,ze&6)throw Error(ee(331));var o=ze;for(ze|=4,se=e.current;se!==null;){var a=se,l=a.child;if(se.flags&16){var c=a.deletions;if(c!==null){for(var f=0;fyt()-Fp?Ki(e,0):zp|=n),mn(e,t)}function fS(e,t){t===0&&(e.mode&1?(t=Il,Il<<=1,!(Il&130023424)&&(Il=4194304)):t=1);var n=tn();e=Gr(e,t),e!==null&&(Ta(e,t,n),mn(e,n))}function YP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fS(e,n)}function XP(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(ee(314))}r!==null&&r.delete(t),fS(e,n)}var dS;dS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||pn.current)hn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return hn=!1,NP(e,t,n);hn=!!(e.flags&131072)}else hn=!1,it&&t.flags&1048576&&mw(t,Lu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;du(e,t),e=t.pendingProps;var o=Jo(t,Gt.current);Qo(t,n),o=Ap(null,t,r,e,o,n);var a=Dp();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,gn(r)?(a=!0,Pu(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Tp(t),o.updater=sc,t.stateNode=o,o._reactInternals=t,Th(t,r,e,n),t=Oh(null,t,r,!0,a,n)):(t.tag=0,it&&a&&Sp(t),Jt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(du(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=ZP(r),e=ur(r,e),o){case 0:t=Ph(null,t,r,e,n);break e;case 1:t=D0(null,t,r,e,n);break e;case 11:t=L0(null,t,r,e,n);break e;case 14:t=A0(null,t,r,ur(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ur(r,o),Ph(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ur(r,o),D0(e,t,r,o,n);case 3:e:{if(Xw(t),e===null)throw Error(ee(387));r=t.pendingProps,a=t.memoizedState,o=a.element,_w(e,t),$u(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){o=rs(Error(ee(423)),t),t=$0(e,t,r,n,o);break e}else if(r!==o){o=rs(Error(ee(424)),t),t=$0(e,t,r,n,o);break e}else for(Rn=wi(t.stateNode.containerInfo.firstChild),Pn=t,it=!0,fr=null,n=Sw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(es(),r===o){t=Yr(e,t,n);break e}Jt(e,t,r,n)}t=t.child}return t;case 5:return bw(t),e===null&&kh(t),r=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,l=o.children,wh(r,o)?l=null:a!==null&&wh(r,a)&&(t.flags|=32),Yw(e,t),Jt(e,t,l,n),t.child;case 6:return e===null&&kh(t),null;case 13:return Qw(e,t,n);case 4:return Rp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ts(t,null,r,n):Jt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ur(r,o),L0(e,t,r,o,n);case 7:return Jt(e,t,t.pendingProps,n),t.child;case 8:return Jt(e,t,t.pendingProps.children,n),t.child;case 12:return Jt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,l=o.value,Ze(Au,r._currentValue),r._currentValue=l,a!==null)if(pr(a.value,l)){if(a.children===o.children&&!pn.current){t=Yr(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){l=a.child;for(var f=c.firstContext;f!==null;){if(f.context===r){if(a.tag===1){f=Hr(-1,n&-n),f.tag=2;var h=a.updateQueue;if(h!==null){h=h.shared;var p=h.pending;p===null?f.next=f:(f.next=p.next,p.next=f),h.pending=f}}a.lanes|=n,f=a.alternate,f!==null&&(f.lanes|=n),Ch(a.return,n,t),c.lanes|=n;break}f=f.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(ee(341));l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Ch(l,n,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Jt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Qo(t,n),o=Yn(o),r=r(o),t.flags|=1,Jt(e,t,r,n),t.child;case 14:return r=t.type,o=ur(r,t.pendingProps),o=ur(r.type,o),A0(e,t,r,o,n);case 15:return Kw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ur(r,o),du(e,t),t.tag=1,gn(r)?(e=!0,Pu(t)):e=!1,Qo(t,n),Ww(t,r,o),Th(t,r,o,n),Oh(null,t,r,!0,e,n);case 19:return Zw(e,t,n);case 22:return Gw(e,t,n)}throw Error(ee(156,t.tag))};function hS(e,t){return U1(e,t)}function QP(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 Kn(e,t,n,r){return new QP(e,t,n,r)}function Wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ZP(e){if(typeof e=="function")return Wp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lp)return 11;if(e===up)return 14}return 2}function bi(e,t){var n=e.alternate;return n===null?(n=Kn(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 gu(e,t,n,r,o,a){var l=2;if(r=e,typeof e=="function")Wp(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Do:return Gi(n.children,o,a,t);case ap:l=8,o|=8;break;case Zd:return e=Kn(12,n,t,o|2),e.elementType=Zd,e.lanes=a,e;case qd:return e=Kn(13,n,t,o),e.elementType=qd,e.lanes=a,e;case Jd:return e=Kn(19,n,t,o),e.elementType=Jd,e.lanes=a,e;case b1:return uc(n,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x1:l=10;break e;case _1:l=9;break e;case lp:l=11;break e;case up:l=14;break e;case ci:l=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=Kn(l,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Gi(e,t,n,r){return e=Kn(7,e,r,t),e.lanes=n,e}function uc(e,t,n,r){return e=Kn(22,e,r,t),e.elementType=b1,e.lanes=n,e.stateNode={isHidden:!1},e}function Rd(e,t,n){return e=Kn(6,e,null,t),e.lanes=n,e}function Pd(e,t,n){return t=Kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qP(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=ud(0),this.expirationTimes=ud(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ud(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Hp(e,t,n,r,o,a,l,c,f){return e=new qP(e,t,n,c,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Kn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tp(a),e}function JP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vS)}catch(e){console.error(e)}}vS(),v1.exports=An;var La=v1.exports,K0=La;Xd.createRoot=K0.createRoot,Xd.hydrateRoot=K0.hydrateRoot;var yS={exports:{}},Ve={};/** +`+a.stack}return{value:e,source:t,stack:o,digest:null}}function Ed(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Rh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var DP=typeof WeakMap=="function"?WeakMap:Map;function Hw(e,t,n){n=Hr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Fu||(Fu=!0,zh=r),Rh(e,t)},n}function Vw(e,t,n){n=Hr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Rh(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Rh(e,t),typeof r!="function"&&(xi===null?xi=new Set([this]):xi.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function R0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new DP;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=GP.bind(null,e,t,n),t.then(e,e))}function P0(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function O0(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Hr(-1,1),t.tag=2,Si(n,t,1))),n.lanes|=1),e)}var $P=Xr.ReactCurrentOwner,dn=!1;function Jt(e,t,n,r){t.child=e===null?Sw(t,null,n,r):ts(t,e.child,n,r)}function L0(e,t,n,r,o){n=n.render;var a=t.ref;return Qo(t,o),r=Ap(e,t,n,r,a,o),n=Dp(),e!==null&&!dn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Yr(e,t,o)):(it&&n&&Sp(t),t.flags|=1,Jt(e,t,r,o),t.child)}function A0(e,t,n,r,o){if(e===null){var a=n.type;return typeof a=="function"&&!Wp(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Kw(e,t,a,r,o)):(e=gu(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&o)){var l=a.memoizedProps;if(n=n.compare,n=n!==null?n:da,n(l,r)&&e.ref===t.ref)return Yr(e,t,o)}return t.flags|=1,e=bi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Kw(e,t,n,r,o){if(e!==null){var a=e.memoizedProps;if(da(a,r)&&e.ref===t.ref)if(dn=!1,t.pendingProps=r=a,(e.lanes&o)!==0)e.flags&131072&&(dn=!0);else return t.lanes=e.lanes,Yr(e,t,o)}return Ph(e,t,n,r,o)}function Gw(e,t,n){var r=t.pendingProps,o=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Wo,En),En|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(Wo,En),En|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Ze(Wo,En),En|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Ze(Wo,En),En|=r;return Jt(e,t,o,n),t.child}function Yw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ph(e,t,n,r,o){var a=pn(n)?Qi:Gt.current;return a=Jo(t,a),Qo(t,o),n=Ap(e,t,n,r,a,o),r=Dp(),e!==null&&!dn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Yr(e,t,o)):(it&&r&&Sp(t),t.flags|=1,Jt(e,t,n,o),t.child)}function D0(e,t,n,r,o){if(pn(n)){var a=!0;Pu(t)}else a=!1;if(Qo(t,o),t.stateNode===null)du(e,t),Ww(t,n,r),Th(t,n,r,o),r=!0;else if(e===null){var l=t.stateNode,c=t.memoizedProps;l.props=c;var f=l.context,h=n.contextType;typeof h=="object"&&h!==null?h=Gn(h):(h=pn(n)?Qi:Gt.current,h=Jo(t,h));var p=n.getDerivedStateFromProps,w=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";w||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==r||f!==h)&&T0(t,l,r,h),fi=!1;var m=t.memoizedState;l.state=m,$u(t,r,l,o),f=t.memoizedState,c!==r||m!==f||hn.current||fi?(typeof p=="function"&&(Eh(t,n,p,r),f=t.memoizedState),(c=fi||E0(t,n,c,r,m,f,h))?(w||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=f),l.props=r,l.state=f,l.context=h,r=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,_w(e,t),c=t.memoizedProps,h=t.type===t.elementType?c:lr(t.type,c),l.props=h,w=t.pendingProps,m=l.context,f=n.contextType,typeof f=="object"&&f!==null?f=Gn(f):(f=pn(n)?Qi:Gt.current,f=Jo(t,f));var b=n.getDerivedStateFromProps;(p=typeof b=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==w||m!==f)&&T0(t,l,r,f),fi=!1,m=t.memoizedState,l.state=m,$u(t,r,l,o);var R=t.memoizedState;c!==w||m!==R||hn.current||fi?(typeof b=="function"&&(Eh(t,n,b,r),R=t.memoizedState),(h=fi||E0(t,n,h,r,m,R,f)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,R,f),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,R,f)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=R),l.props=r,l.state=R,l.context=f,r=h):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Oh(e,t,n,r,a,o)}function Oh(e,t,n,r,o,a){Yw(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&y0(t,n,!1),Yr(e,t,a);r=t.stateNode,$P.current=t;var c=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=ts(t,e.child,null,a),t.child=ts(t,null,c,a)):Jt(e,t,c,a),t.memoizedState=r.state,o&&y0(t,n,!0),t.child}function Xw(e){var t=e.stateNode;t.pendingContext?v0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&v0(e,t.context,!1),Rp(e,t.containerInfo)}function $0(e,t,n,r,o){return es(),_p(o),t.flags|=256,Jt(e,t,n,r),t.child}var Lh={dehydrated:null,treeContext:null,retryLane:0};function Ah(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qw(e,t,n){var r=t.pendingProps,o=lt.current,a=!1,l=(t.flags&128)!==0,c;if((c=l)||(c=e!==null&&e.memoizedState===null?!1:(o&2)!==0),c?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ze(lt,o&1),e===null)return kh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,a?(r=t.mode,a=t.child,l={mode:"hidden",children:l},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=uc(l,r,0,null),e=Yi(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ah(n),t.memoizedState=Lh,e):Np(t,l));if(o=e.memoizedState,o!==null&&(c=o.dehydrated,c!==null))return IP(e,t,l,r,c,o,n);if(a){a=r.fallback,l=t.mode,o=e.child,c=o.sibling;var f={mode:"hidden",children:r.children};return!(l&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=f,t.deletions=null):(r=bi(o,f),r.subtreeFlags=o.subtreeFlags&14680064),c!==null?a=bi(c,a):(a=Yi(a,l,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,l=e.child.memoizedState,l=l===null?Ah(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=Lh,r}return a=e.child,e=a.sibling,r=bi(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Np(e,t){return t=uc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wl(e,t,n,r){return r!==null&&_p(r),ts(t,e.child,null,n),e=Np(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function IP(e,t,n,r,o,a,l){if(n)return t.flags&256?(t.flags&=-257,r=Ed(Error(ee(422))),Wl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=uc({mode:"visible",children:r.children},o,0,null),a=Yi(a,o,l,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&ts(t,e.child,null,l),t.child.memoizedState=Ah(l),t.memoizedState=Lh,a);if(!(t.mode&1))return Wl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var c=r.dgst;return r=c,a=Error(ee(419)),r=Ed(a,r,void 0),Wl(e,t,l,r)}if(c=(l&e.childLanes)!==0,dn||c){if(r=At,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|l)?0:o,o!==0&&o!==a.retryLane&&(a.retryLane=o,Gr(e,o),dr(r,e,o,-1))}return Bp(),r=Ed(Error(ee(421))),Wl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=YP.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Tn=wi(o.nextSibling),Rn=t,it=!0,cr=null,e!==null&&(Bn[Wn++]=jr,Bn[Wn++]=Br,Bn[Wn++]=Zi,jr=e.id,Br=e.overflow,Zi=t),t=Np(t,r.children),t.flags|=4096,t)}function I0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ch(e.return,t,n)}function Td(e,t,n,r,o){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function Zw(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(Jt(e,t,r.children,n),r=lt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&I0(e,n,t);else if(e.tag===19)I0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ze(lt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Iu(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Td(t,!1,o,n,a);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Iu(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Td(t,!0,n,null,a);break;case"together":Td(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function du(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Yr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ji|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=bi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=bi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function NP(e,t,n){switch(t.tag){case 3:Xw(t),es();break;case 5:bw(t);break;case 1:pn(t.type)&&Pu(t);break;case 4:Rp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ze(Au,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ze(lt,lt.current&1),t.flags|=128,null):n&t.child.childLanes?Qw(e,t,n):(Ze(lt,lt.current&1),e=Yr(e,t,n),e!==null?e.sibling:null);Ze(lt,lt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Zw(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ze(lt,lt.current),r)break;return null;case 22:case 23:return t.lanes=0,Gw(e,t,n)}return Yr(e,t,n)}var qw,Dh,Jw,eS;qw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Dh=function(){};Jw=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Vi(Er.current);var a=null;switch(n){case"input":o=th(e,o),r=th(e,r),a=[];break;case"select":o=ft({},o,{value:void 0}),r=ft({},r,{value:void 0}),a=[];break;case"textarea":o=ih(e,o),r=ih(e,r),a=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Tu)}sh(n,r);var l;n=null;for(h in o)if(!r.hasOwnProperty(h)&&o.hasOwnProperty(h)&&o[h]!=null)if(h==="style"){var c=o[h];for(l in c)c.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else h!=="dangerouslySetInnerHTML"&&h!=="children"&&h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(oa.hasOwnProperty(h)?a||(a=[]):(a=a||[]).push(h,null));for(h in r){var f=r[h];if(c=o!=null?o[h]:void 0,r.hasOwnProperty(h)&&f!==c&&(f!=null||c!=null))if(h==="style")if(c){for(l in c)!c.hasOwnProperty(l)||f&&f.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in f)f.hasOwnProperty(l)&&c[l]!==f[l]&&(n||(n={}),n[l]=f[l])}else n||(a||(a=[]),a.push(h,n)),n=f;else h==="dangerouslySetInnerHTML"?(f=f?f.__html:void 0,c=c?c.__html:void 0,f!=null&&c!==f&&(a=a||[]).push(h,f)):h==="children"?typeof f!="string"&&typeof f!="number"||(a=a||[]).push(h,""+f):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&(oa.hasOwnProperty(h)?(f!=null&&h==="onScroll"&&Je("scroll",e),a||c===f||(a=[])):(a=a||[]).push(h,f))}n&&(a=a||[]).push("style",n);var h=a;(t.updateQueue=h)&&(t.flags|=4)}};eS=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ms(e,t){if(!it)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function MP(e,t,n){var r=t.pendingProps;switch(xp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(t),null;case 1:return pn(t.type)&&Ru(),Ht(t),null;case 3:return r=t.stateNode,ns(),et(hn),et(Gt),Op(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(jl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,cr!==null&&(jh(cr),cr=null))),Dh(e,t),Ht(t),null;case 5:Pp(t);var o=Vi(va.current);if(n=t.type,e!==null&&t.stateNode!=null)Jw(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return Ht(t),null}if(e=Vi(Er.current),jl(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[_r]=t,r[ga]=a,e=(t.mode&1)!==0,n){case"dialog":Je("cancel",r),Je("close",r);break;case"iframe":case"object":case"embed":Je("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[_r]=t,e[ga]=r,qw(e,t,!1,!1),t.stateNode=e;e:{switch(l=ah(n,r),n){case"dialog":Je("cancel",e),Je("close",e),o=r;break;case"iframe":case"object":case"embed":Je("load",e),o=r;break;case"video":case"audio":for(o=0;ois&&(t.flags|=128,r=!0,Ms(a,!1),t.lanes=4194304)}else{if(!r)if(e=Iu(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ms(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!it)return Ht(t),null}else 2*yt()-a.renderingStartTime>is&&n!==1073741824&&(t.flags|=128,r=!0,Ms(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(n=a.last,n!==null?n.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=yt(),t.sibling=null,n=lt.current,Ze(lt,r?n&1|2:n&1),t):(Ht(t),null);case 22:case 23:return jp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?En&1073741824&&(Ht(t),t.subtreeFlags&6&&(t.flags|=8192)):Ht(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function zP(e,t){switch(xp(t),t.tag){case 1:return pn(t.type)&&Ru(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ns(),et(hn),et(Gt),Op(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pp(t),null;case 13:if(et(lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return et(lt),null;case 4:return ns(),null;case 10:return Cp(t.type._context),null;case 22:case 23:return jp(),null;case 24:return null;default:return null}}var Hl=!1,Kt=!1,FP=typeof WeakSet=="function"?WeakSet:Set,se=null;function Bo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pt(e,t,r)}else n.current=null}function $h(e,t,n){try{n()}catch(r){pt(e,t,r)}}var N0=!1;function UP(e,t){if(vh=ku,e=ow(),wp(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,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var l=0,c=-1,f=-1,h=0,p=0,w=e,m=null;t:for(;;){for(var b;w!==n||o!==0&&w.nodeType!==3||(c=l+o),w!==a||r!==0&&w.nodeType!==3||(f=l+r),w.nodeType===3&&(l+=w.nodeValue.length),(b=w.firstChild)!==null;)m=w,w=b;for(;;){if(w===e)break t;if(m===n&&++h===o&&(c=l),m===a&&++p===r&&(f=l),(b=w.nextSibling)!==null)break;w=m,m=w.parentNode}w=b}n=c===-1||f===-1?null:{start:c,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(yh={focusedElem:e,selectionRange:n},ku=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var R=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(R!==null){var O=R.memoizedProps,N=R.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?O:lr(t.type,O),N);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(C){pt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return R=N0,N0=!1,R}function ea(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 a=o.destroy;o.destroy=void 0,a!==void 0&&$h(t,n,a)}o=o.next}while(o!==r)}}function ac(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 Ih(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 tS(e){var t=e.alternate;t!==null&&(e.alternate=null,tS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_r],delete t[ga],delete t[xh],delete t[_P],delete t[bP])),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 nS(e){return e.tag===5||e.tag===3||e.tag===4}function M0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nS(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 Nh(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=Tu));else if(r!==4&&(e=e.child,e!==null))for(Nh(e,t,n),e=e.sibling;e!==null;)Nh(e,t,n),e=e.sibling}function Mh(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(Mh(e,t,n),e=e.sibling;e!==null;)Mh(e,t,n),e=e.sibling}var Mt=null,ur=!1;function ai(e,t,n){for(n=n.child;n!==null;)rS(e,t,n),n=n.sibling}function rS(e,t,n){if(Cr&&typeof Cr.onCommitFiberUnmount=="function")try{Cr.onCommitFiberUnmount(Ju,n)}catch{}switch(n.tag){case 5:Kt||Bo(n,t);case 6:var r=Mt,o=ur;Mt=null,ai(e,t,n),Mt=r,ur=o,Mt!==null&&(ur?(e=Mt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Mt.removeChild(n.stateNode));break;case 18:Mt!==null&&(ur?(e=Mt,n=n.stateNode,e.nodeType===8?Sd(e.parentNode,n):e.nodeType===1&&Sd(e,n),ca(e)):Sd(Mt,n.stateNode));break;case 4:r=Mt,o=ur,Mt=n.stateNode.containerInfo,ur=!0,ai(e,t,n),Mt=r,ur=o;break;case 0:case 11:case 14:case 15:if(!Kt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var a=o,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&$h(n,t,l),o=o.next}while(o!==r)}ai(e,t,n);break;case 1:if(!Kt&&(Bo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){pt(n,t,c)}ai(e,t,n);break;case 21:ai(e,t,n);break;case 22:n.mode&1?(Kt=(r=Kt)||n.memoizedState!==null,ai(e,t,n),Kt=r):ai(e,t,n);break;default:ai(e,t,n)}}function z0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FP),t.forEach(function(r){var o=XP.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function or(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~a}if(r=o,r=yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*BP(r/1960))-r,10e?16:e,gi===null)var r=!1;else{if(e=gi,gi=null,Uu=0,ze&6)throw Error(ee(331));var o=ze;for(ze|=4,se=e.current;se!==null;){var a=se,l=a.child;if(se.flags&16){var c=a.deletions;if(c!==null){for(var f=0;fyt()-Fp?Gi(e,0):zp|=n),gn(e,t)}function fS(e,t){t===0&&(e.mode&1?(t=Il,Il<<=1,!(Il&130023424)&&(Il=4194304)):t=1);var n=tn();e=Gr(e,t),e!==null&&(Ta(e,t,n),gn(e,n))}function YP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fS(e,n)}function XP(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(ee(314))}r!==null&&r.delete(t),fS(e,n)}var dS;dS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||hn.current)dn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dn=!1,NP(e,t,n);dn=!!(e.flags&131072)}else dn=!1,it&&t.flags&1048576&&mw(t,Lu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;du(e,t),e=t.pendingProps;var o=Jo(t,Gt.current);Qo(t,n),o=Ap(null,t,r,e,o,n);var a=Dp();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,pn(r)?(a=!0,Pu(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Tp(t),o.updater=sc,t.stateNode=o,o._reactInternals=t,Th(t,r,e,n),t=Oh(null,t,r,!0,a,n)):(t.tag=0,it&&a&&Sp(t),Jt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(du(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=ZP(r),e=lr(r,e),o){case 0:t=Ph(null,t,r,e,n);break e;case 1:t=D0(null,t,r,e,n);break e;case 11:t=L0(null,t,r,e,n);break e;case 14:t=A0(null,t,r,lr(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),Ph(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),D0(e,t,r,o,n);case 3:e:{if(Xw(t),e===null)throw Error(ee(387));r=t.pendingProps,a=t.memoizedState,o=a.element,_w(e,t),$u(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){o=rs(Error(ee(423)),t),t=$0(e,t,r,n,o);break e}else if(r!==o){o=rs(Error(ee(424)),t),t=$0(e,t,r,n,o);break e}else for(Tn=wi(t.stateNode.containerInfo.firstChild),Rn=t,it=!0,cr=null,n=Sw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(es(),r===o){t=Yr(e,t,n);break e}Jt(e,t,r,n)}t=t.child}return t;case 5:return bw(t),e===null&&kh(t),r=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,l=o.children,wh(r,o)?l=null:a!==null&&wh(r,a)&&(t.flags|=32),Yw(e,t),Jt(e,t,l,n),t.child;case 6:return e===null&&kh(t),null;case 13:return Qw(e,t,n);case 4:return Rp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ts(t,null,r,n):Jt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),L0(e,t,r,o,n);case 7:return Jt(e,t,t.pendingProps,n),t.child;case 8:return Jt(e,t,t.pendingProps.children,n),t.child;case 12:return Jt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,l=o.value,Ze(Au,r._currentValue),r._currentValue=l,a!==null)if(hr(a.value,l)){if(a.children===o.children&&!hn.current){t=Yr(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){l=a.child;for(var f=c.firstContext;f!==null;){if(f.context===r){if(a.tag===1){f=Hr(-1,n&-n),f.tag=2;var h=a.updateQueue;if(h!==null){h=h.shared;var p=h.pending;p===null?f.next=f:(f.next=p.next,p.next=f),h.pending=f}}a.lanes|=n,f=a.alternate,f!==null&&(f.lanes|=n),Ch(a.return,n,t),c.lanes|=n;break}f=f.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(ee(341));l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Ch(l,n,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Jt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Qo(t,n),o=Gn(o),r=r(o),t.flags|=1,Jt(e,t,r,n),t.child;case 14:return r=t.type,o=lr(r,t.pendingProps),o=lr(r.type,o),A0(e,t,r,o,n);case 15:return Kw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),du(e,t),t.tag=1,pn(r)?(e=!0,Pu(t)):e=!1,Qo(t,n),Ww(t,r,o),Th(t,r,o,n),Oh(null,t,r,!0,e,n);case 19:return Zw(e,t,n);case 22:return Gw(e,t,n)}throw Error(ee(156,t.tag))};function hS(e,t){return U1(e,t)}function QP(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 Vn(e,t,n,r){return new QP(e,t,n,r)}function Wp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ZP(e){if(typeof e=="function")return Wp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lp)return 11;if(e===up)return 14}return 2}function bi(e,t){var n=e.alternate;return n===null?(n=Vn(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 gu(e,t,n,r,o,a){var l=2;if(r=e,typeof e=="function")Wp(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Do:return Yi(n.children,o,a,t);case ap:l=8,o|=8;break;case Zd:return e=Vn(12,n,t,o|2),e.elementType=Zd,e.lanes=a,e;case qd:return e=Vn(13,n,t,o),e.elementType=qd,e.lanes=a,e;case Jd:return e=Vn(19,n,t,o),e.elementType=Jd,e.lanes=a,e;case b1:return uc(n,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x1:l=10;break e;case _1:l=9;break e;case lp:l=11;break e;case up:l=14;break e;case ci:l=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=Vn(l,n,t,o),t.elementType=e,t.type=r,t.lanes=a,t}function Yi(e,t,n,r){return e=Vn(7,e,r,t),e.lanes=n,e}function uc(e,t,n,r){return e=Vn(22,e,r,t),e.elementType=b1,e.lanes=n,e.stateNode={isHidden:!1},e}function Rd(e,t,n){return e=Vn(6,e,null,t),e.lanes=n,e}function Pd(e,t,n){return t=Vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qP(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=ud(0),this.expirationTimes=ud(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ud(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Hp(e,t,n,r,o,a,l,c,f){return e=new qP(e,t,n,c,f),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Vn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tp(a),e}function JP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vS)}catch(e){console.error(e)}}vS(),v1.exports=Ln;var La=v1.exports,K0=La;Xd.createRoot=K0.createRoot,Xd.hydrateRoot=K0.hydrateRoot;var yS={exports:{}},He={};/** * @license React * react-is.production.min.js * @@ -45,17 +45,17 @@ Error generating stack: `+a.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Yp=Symbol.for("react.element"),Xp=Symbol.for("react.portal"),pc=Symbol.for("react.fragment"),gc=Symbol.for("react.strict_mode"),mc=Symbol.for("react.profiler"),vc=Symbol.for("react.provider"),yc=Symbol.for("react.context"),iO=Symbol.for("react.server_context"),wc=Symbol.for("react.forward_ref"),Sc=Symbol.for("react.suspense"),xc=Symbol.for("react.suspense_list"),_c=Symbol.for("react.memo"),bc=Symbol.for("react.lazy"),oO=Symbol.for("react.offscreen"),wS;wS=Symbol.for("react.module.reference");function Qn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Yp:switch(e=e.type,e){case pc:case mc:case gc:case Sc:case xc:return e;default:switch(e=e&&e.$$typeof,e){case iO:case yc:case wc:case bc:case _c:case vc:return e;default:return t}}case Xp:return t}}}Ve.ContextConsumer=yc;Ve.ContextProvider=vc;Ve.Element=Yp;Ve.ForwardRef=wc;Ve.Fragment=pc;Ve.Lazy=bc;Ve.Memo=_c;Ve.Portal=Xp;Ve.Profiler=mc;Ve.StrictMode=gc;Ve.Suspense=Sc;Ve.SuspenseList=xc;Ve.isAsyncMode=function(){return!1};Ve.isConcurrentMode=function(){return!1};Ve.isContextConsumer=function(e){return Qn(e)===yc};Ve.isContextProvider=function(e){return Qn(e)===vc};Ve.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yp};Ve.isForwardRef=function(e){return Qn(e)===wc};Ve.isFragment=function(e){return Qn(e)===pc};Ve.isLazy=function(e){return Qn(e)===bc};Ve.isMemo=function(e){return Qn(e)===_c};Ve.isPortal=function(e){return Qn(e)===Xp};Ve.isProfiler=function(e){return Qn(e)===mc};Ve.isStrictMode=function(e){return Qn(e)===gc};Ve.isSuspense=function(e){return Qn(e)===Sc};Ve.isSuspenseList=function(e){return Qn(e)===xc};Ve.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===pc||e===mc||e===gc||e===Sc||e===xc||e===oO||typeof e=="object"&&e!==null&&(e.$$typeof===bc||e.$$typeof===_c||e.$$typeof===vc||e.$$typeof===yc||e.$$typeof===wc||e.$$typeof===wS||e.getModuleId!==void 0)};Ve.typeOf=Qn;yS.exports=Ve;var SS=yS.exports;function sO(e){function t(G,H,J,ie,z){for(var ge=0,q=0,Ne=0,Re=0,xe,_e,nt=0,Ge=0,Pe,ot=Pe=xe=0,Ce=0,st=0,gr=0,Xe=0,dt=J.length,yn=dt-1,wt,be="",Be="",Qr="",qn="",Rt;Cexe)&&(Xe=(be=be.replace(" ",":")).length),0ie&&(ie=(H=H.trim()).charCodeAt(0)),ie){case 38:return H.replace(_,"$1"+G.trim());case 58:return G.trim()+H.replace(_,"$1"+G.trim());default:if(0<1*J&&0q.charCodeAt(8))break;case 115:z=z.replace(q,"-webkit-"+q)+";"+z;break;case 207:case 102:z=z.replace(q,"-webkit-"+(102J.charCodeAt(0)&&(J=J.trim()),K=J,J=[K],0xe)&&(Xe=(be=be.replace(" ",":")).length),0ie&&(ie=(W=W.trim()).charCodeAt(0)),ie){case 38:return W.replace(_,"$1"+G.trim());case 58:return G.trim()+W.replace(_,"$1"+G.trim());default:if(0<1*J&&0q.charCodeAt(8))break;case 115:z=z.replace(q,"-webkit-"+q)+";"+z;break;case 207:case 102:z=z.replace(q,"-webkit-"+(102J.charCodeAt(0)&&(J=J.trim()),K=J,J=[K],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var TO=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,a=o.length,l=a;n>=l;)(l<<=1)<0&&Aa(16,""+n);this.groupSizes=new Uint32Array(l),this.groupSizes.set(o),this.length=l;for(var c=a;c=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],a=this.indexOfGroup(n),l=a+o,c=a;c1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var TO=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,a=o.length,l=a;n>=l;)(l<<=1)<0&&Aa(16,""+n);this.groupSizes=new Uint32Array(l),this.groupSizes.set(o),this.length=l;for(var c=a;c=this.length||this.groupSizes[n]===0)return r;for(var o=this.groupSizes[n],a=this.indexOfGroup(n),l=a+o,c=a;c=ra&&(ra=t+1),mu.set(e,t),Hu.set(t,e)},OO="style["+os+'][data-styled-version="5.3.11"]',LO=new RegExp("^"+os+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),AO=function(e,t,n){for(var r,o=n.split(","),a=0,l=o.length;a=0;h--){var p=f[h];if(p&&p.nodeType===1&&p.hasAttribute(os))return p}}(n),a=o!==void 0?o.nextSibling:null;r.setAttribute(os,"active"),r.setAttribute("data-styled-version","5.3.11");var l=$O();return l&&r.setAttribute("nonce",l),n.insertBefore(r,a),r},IO=function(){function e(n){var r=this.element=CS(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var a=document.styleSheets,l=0,c=a.length;l=0){var o=document.createTextNode(r),a=this.nodes[n];return this.element.insertBefore(o,a||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(y+=m+",")}),a+=""+h+p+'{content:"'+y+`"}/*!sc*/ -`}}}return a}(this)},e}(),FO=/(a)(d)/gi,ey=function(e){return String.fromCharCode(e+(e>25?39:97))};function Wh(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ey(t%52)+n;return(ey(t%52)+n).replace(FO,"$1-$2")}var Ho=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ES=function(e){return Ho(5381,e)};function TS(e){for(var t=0;t>>0);if(!n.hasNameForId(o,c)){var f=r(l,"."+c,void 0,o);n.insertRules(o,c,f)}a.push(c),this.staticRulesId=c}else{for(var h=this.rules.length,p=Ho(this.baseHash,r.hash),y="",m=0;m>>0);if(!n.hasNameForId(o,N)){var _=r(y,"."+N,void 0,o);n.insertRules(o,N,_)}a.push(N)}}return a.join(" ")},e}(),BO=/^\s*\/\/.*$/gm,WO=[":","[",".","#"];function HO(e){var t,n,r,o,a=e===void 0?ki:e,l=a.options,c=l===void 0?ki:l,f=a.plugins,h=f===void 0?Wu:f,p=new sO(c),y=[],m=function(O){function N(_){if(_)try{O(_+"}")}catch{}}return function(_,v,x,C,T,k,R,A,W,Y){switch(_){case 1:if(W===0&&v.charCodeAt(0)===64)return O(v+";"),"";break;case 2:if(A===0)return v+"/*|*/";break;case 3:switch(A){case 102:case 112:return O(x[0]+v),"";default:return v+(Y===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(N)}}}(function(O){y.push(O)}),b=function(O,N,_){return N===0&&WO.indexOf(_[n.length])!==-1||_.match(o)?O:"."+t};function P(O,N,_,v){v===void 0&&(v="&");var x=O.replace(BO,""),C=N&&_?_+" "+N+" { "+x+" }":x;return t=v,n=N,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),p(_||!N?"":N,C)}return p.use([].concat(h,[function(O,N,_){O===2&&_.length&&_[0].lastIndexOf(n)>0&&(_[0]=_[0].replace(r,b))},m,function(O){if(O===-2){var N=y;return y=[],N}}])),P.hash=h.length?h.reduce(function(O,N){return N.name||Aa(15),Ho(O,N.name)},5381).toString():"",P}var RS=Wr.createContext();RS.Consumer;var PS=Wr.createContext(),VO=(PS.Consumer,new Vu),Hh=HO();function OS(){return j.useContext(RS)||VO}function LS(){return j.useContext(PS)||Hh}var AS=function(){function e(t,n){var r=this;this.inject=function(o,a){a===void 0&&(a=Hh);var l=r.name+a.hash;o.hasNameForId(r.id,l)||o.insertRules(r.id,l,a(r.rules,l,"@keyframes"))},this.toString=function(){return Aa(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Hh),this.name+t.hash},e}(),KO=/([A-Z])/,GO=/([A-Z])/g,YO=/^ms-/,XO=function(e){return"-"+e.toLowerCase()};function ty(e){return KO.test(e)?e.replace(GO,XO).replace(YO,"-ms-"):e}var ny=function(e){return e==null||e===!1||e===""};function eo(e,t,n,r){if(Array.isArray(e)){for(var o,a=[],l=0,c=e.length;l1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,ZO=/(^-|-$)/g;function Od(e){return e.replace(QO,"-").replace(ZO,"")}var ig=function(e){return Wh(ES(e)>>>0)};function Yl(e){return typeof e=="string"&&!0}var Vh=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},qO=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function JO(e,t,n){var r=e[n];Vh(t)&&Vh(r)?$S(r,t):e[n]=t}function $S(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(Y[A]=k[A]);return Y}(t,["componentId"]),T=x&&x+"-"+(Yl(v)?v:Od(q0(v)));return IS(v,br({},C,{attrs:m,componentId:T}),n)},Object.defineProperty(P,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=r?$S({},e.defaultProps,v):v}}),Object.defineProperty(P,"toString",{value:function(){return"."+P.styledComponentId}}),o&&kO(P,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),P}var Kh=function(e){return function t(n,r,o){if(o===void 0&&(o=ki),!SS.isValidElementType(r))return Aa(1,String(r));var a=function(){return n(r,o,rg.apply(void 0,arguments))};return a.withConfig=function(l){return t(n,r,br({},o,{},l))},a.attrs=function(l){return t(n,r,br({},o,{attrs:Array.prototype.concat(o.attrs,l).filter(Boolean)}))},a}(IS,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Kh[e]=Kh(e)});var eL=function(){function e(n,r){this.rules=n,this.componentId=r,this.isStatic=TS(n),Vu.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(n,r,o,a){var l=a(eo(this.rules,r,o,a).join(""),""),c=this.componentId+n;o.insertRules(c,c,l)},t.removeStyles=function(n,r){r.clearRules(this.componentId+n)},t.renderStyles=function(n,r,o,a){n>2&&Vu.registerId(this.componentId+n),this.removeStyles(n,o),this.createStyles(n,r,o,a)},e}();function tL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r{console!=null&&console.warn&&(Yi(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},iy={},Gh=(...e)=>{Yi(e[0])&&iy[e[0]]||(Yi(e[0])&&(iy[e[0]]=new Date),rL(...e))},NS=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},oy=(e,t,n)=>{e.loadNamespaces(t,NS(e,n))},sy=(e,t,n,r)=>{Yi(n)&&(n=[n]),n.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,NS(e,r))},iL=(e,t,n={})=>!t.languages||!t.languages.length?(Gh("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,o)=>{var a;if(((a=n.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!o(r.isLanguageChangingTo,e))return!1}}),Yi=e=>typeof e=="string",oL=e=>typeof e=="object"&&e!==null,sL=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,aL={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},lL=e=>aL[e],uL=e=>e.replace(sL,lL);let Yh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:uL};const cL=(e={})=>{Yh={...Yh,...e}},fL=()=>Yh;let MS;const dL=e=>{MS=e},zS=()=>MS,hL={type:"3rdParty",init(e){cL(e.options.react),dL(e)}},pL=j.createContext();class gL{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const mL=(e,t)=>{const n=j.useRef();return j.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current},FS=(e,t,n,r)=>e.getFixedT(t,n,r),vL=(e,t,n,r)=>j.useCallback(FS(e,t,n,r),[e,t,n,r]),ro=(e,t={})=>{var C,T,k,R;const{i18n:n}=t,{i18n:r,defaultNS:o}=j.useContext(pL)||{},a=n||r||zS();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new gL),!a){Gh("You will need to pass in an i18next instance by using initReactI18next");const A=(Y,te)=>Yi(te)?te:oL(te)&&Yi(te.defaultValue)?te.defaultValue:Array.isArray(Y)?Y[Y.length-1]:Y,W=[A,{},!1];return W.t=A,W.i18n={},W.ready=!1,W}(C=a.options.react)!=null&&C.wait&&Gh("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...fL(),...a.options.react,...t},{useSuspense:c,keyPrefix:f}=l;let h=e||o||((T=a.options)==null?void 0:T.defaultNS);h=Yi(h)?[h]:h||["translation"],(R=(k=a.reportNamespaces).addUsedNamespaces)==null||R.call(k,h);const p=(a.isInitialized||a.initializedStoreOnce)&&h.every(A=>iL(A,a,l)),y=vL(a,t.lng||null,l.nsMode==="fallback"?h:h[0],f),m=()=>y,b=()=>FS(a,t.lng||null,l.nsMode==="fallback"?h:h[0],f),[P,O]=j.useState(m);let N=h.join();t.lng&&(N=`${t.lng}${N}`);const _=mL(N),v=j.useRef(!0);j.useEffect(()=>{const{bindI18n:A,bindI18nStore:W}=l;v.current=!0,!p&&!c&&(t.lng?sy(a,t.lng,h,()=>{v.current&&O(b)}):oy(a,h,()=>{v.current&&O(b)})),p&&_&&_!==N&&v.current&&O(b);const Y=()=>{v.current&&O(b)};return A&&(a==null||a.on(A,Y)),W&&(a==null||a.store.on(W,Y)),()=>{v.current=!1,a&&(A==null||A.split(" ").forEach(te=>a.off(te,Y))),W&&a&&W.split(" ").forEach(te=>a.store.off(te,Y))}},[a,N]),j.useEffect(()=>{v.current&&p&&O(m)},[a,f,p]);const x=[P,a,p];if(x.t=P,x.i18n=a,x.ready=p,p||!p&&!c)return x;throw new Promise(A=>{t.lng?sy(a,t.lng,h,()=>A()):oy(a,h,()=>A())})},ay=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),o=Math.floor(e%1*1e3);return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}.${o.toString().padStart(3,"0")}`},yL=ae.div` +`),r=[],o=0,a=n.length;o=0;h--){var p=f[h];if(p&&p.nodeType===1&&p.hasAttribute(os))return p}}(n),a=o!==void 0?o.nextSibling:null;r.setAttribute(os,"active"),r.setAttribute("data-styled-version","5.3.11");var l=$O();return l&&r.setAttribute("nonce",l),n.insertBefore(r,a),r},IO=function(){function e(n){var r=this.element=CS(n);r.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var a=document.styleSheets,l=0,c=a.length;l=0){var o=document.createTextNode(r),a=this.nodes[n];return this.element.insertBefore(o,a||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(w+=m+",")}),a+=""+h+p+'{content:"'+w+`"}/*!sc*/ +`}}}return a}(this)},e}(),FO=/(a)(d)/gi,ey=function(e){return String.fromCharCode(e+(e>25?39:97))};function Wh(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ey(t%52)+n;return(ey(t%52)+n).replace(FO,"$1-$2")}var Ho=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ES=function(e){return Ho(5381,e)};function TS(e){for(var t=0;t>>0);if(!n.hasNameForId(o,c)){var f=r(l,"."+c,void 0,o);n.insertRules(o,c,f)}a.push(c),this.staticRulesId=c}else{for(var h=this.rules.length,p=Ho(this.baseHash,r.hash),w="",m=0;m>>0);if(!n.hasNameForId(o,N)){var _=r(w,"."+N,void 0,o);n.insertRules(o,N,_)}a.push(N)}}return a.join(" ")},e}(),BO=/^\s*\/\/.*$/gm,WO=[":","[",".","#"];function HO(e){var t,n,r,o,a=e===void 0?ki:e,l=a.options,c=l===void 0?ki:l,f=a.plugins,h=f===void 0?Wu:f,p=new sO(c),w=[],m=function(O){function N(_){if(_)try{O(_+"}")}catch{}}return function(_,v,x,C,k,E,P,A,V,Q){switch(_){case 1:if(V===0&&v.charCodeAt(0)===64)return O(v+";"),"";break;case 2:if(A===0)return v+"/*|*/";break;case 3:switch(A){case 102:case 112:return O(x[0]+v),"";default:return v+(Q===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(N)}}}(function(O){w.push(O)}),b=function(O,N,_){return N===0&&WO.indexOf(_[n.length])!==-1||_.match(o)?O:"."+t};function R(O,N,_,v){v===void 0&&(v="&");var x=O.replace(BO,""),C=N&&_?_+" "+N+" { "+x+" }":x;return t=v,n=N,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),p(_||!N?"":N,C)}return p.use([].concat(h,[function(O,N,_){O===2&&_.length&&_[0].lastIndexOf(n)>0&&(_[0]=_[0].replace(r,b))},m,function(O){if(O===-2){var N=w;return w=[],N}}])),R.hash=h.length?h.reduce(function(O,N){return N.name||Aa(15),Ho(O,N.name)},5381).toString():"",R}var RS=Wr.createContext();RS.Consumer;var PS=Wr.createContext(),VO=(PS.Consumer,new Vu),Hh=HO();function OS(){return j.useContext(RS)||VO}function LS(){return j.useContext(PS)||Hh}var AS=function(){function e(t,n){var r=this;this.inject=function(o,a){a===void 0&&(a=Hh);var l=r.name+a.hash;o.hasNameForId(r.id,l)||o.insertRules(r.id,l,a(r.rules,l,"@keyframes"))},this.toString=function(){return Aa(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Hh),this.name+t.hash},e}(),KO=/([A-Z])/,GO=/([A-Z])/g,YO=/^ms-/,XO=function(e){return"-"+e.toLowerCase()};function ty(e){return KO.test(e)?e.replace(GO,XO).replace(YO,"-ms-"):e}var ny=function(e){return e==null||e===!1||e===""};function to(e,t,n,r){if(Array.isArray(e)){for(var o,a=[],l=0,c=e.length;l1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,ZO=/(^-|-$)/g;function Od(e){return e.replace(QO,"-").replace(ZO,"")}var ig=function(e){return Wh(ES(e)>>>0)};function Yl(e){return typeof e=="string"&&!0}var Vh=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},qO=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function JO(e,t,n){var r=e[n];Vh(t)&&Vh(r)?$S(r,t):e[n]=t}function $S(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(Q[A]=E[A]);return Q}(t,["componentId"]),k=x&&x+"-"+(Yl(v)?v:Od(q0(v)));return IS(v,br({},C,{attrs:m,componentId:k}),n)},Object.defineProperty(R,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=r?$S({},e.defaultProps,v):v}}),Object.defineProperty(R,"toString",{value:function(){return"."+R.styledComponentId}}),o&&kO(R,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),R}var Kh=function(e){return function t(n,r,o){if(o===void 0&&(o=ki),!SS.isValidElementType(r))return Aa(1,String(r));var a=function(){return n(r,o,rg.apply(void 0,arguments))};return a.withConfig=function(l){return t(n,r,br({},o,{},l))},a.attrs=function(l){return t(n,r,br({},o,{attrs:Array.prototype.concat(o.attrs,l).filter(Boolean)}))},a}(IS,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Kh[e]=Kh(e)});var eL=function(){function e(n,r){this.rules=n,this.componentId=r,this.isStatic=TS(n),Vu.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(n,r,o,a){var l=a(to(this.rules,r,o,a).join(""),""),c=this.componentId+n;o.insertRules(c,c,l)},t.removeStyles=function(n,r){r.clearRules(this.componentId+n)},t.renderStyles=function(n,r,o,a){n>2&&Vu.registerId(this.componentId+n),this.removeStyles(n,o),this.createStyles(n,r,o,a)},e}();function tL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r{console!=null&&console.warn&&(Xi(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},iy={},Gh=(...e)=>{Xi(e[0])&&iy[e[0]]||(Xi(e[0])&&(iy[e[0]]=new Date),rL(...e))},NS=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},oy=(e,t,n)=>{e.loadNamespaces(t,NS(e,n))},sy=(e,t,n,r)=>{Xi(n)&&(n=[n]),n.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,NS(e,r))},iL=(e,t,n={})=>!t.languages||!t.languages.length?(Gh("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,o)=>{var a;if(((a=n.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!o(r.isLanguageChangingTo,e))return!1}}),Xi=e=>typeof e=="string",oL=e=>typeof e=="object"&&e!==null,sL=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,aL={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},lL=e=>aL[e],uL=e=>e.replace(sL,lL);let Yh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:uL};const cL=(e={})=>{Yh={...Yh,...e}},fL=()=>Yh;let MS;const dL=e=>{MS=e},zS=()=>MS,hL={type:"3rdParty",init(e){cL(e.options.react),dL(e)}},pL=j.createContext();class gL{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const mL=(e,t)=>{const n=j.useRef();return j.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current},FS=(e,t,n,r)=>e.getFixedT(t,n,r),vL=(e,t,n,r)=>j.useCallback(FS(e,t,n,r),[e,t,n,r]),io=(e,t={})=>{var C,k,E,P;const{i18n:n}=t,{i18n:r,defaultNS:o}=j.useContext(pL)||{},a=n||r||zS();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new gL),!a){Gh("You will need to pass in an i18next instance by using initReactI18next");const A=(Q,te)=>Xi(te)?te:oL(te)&&Xi(te.defaultValue)?te.defaultValue:Array.isArray(Q)?Q[Q.length-1]:Q,V=[A,{},!1];return V.t=A,V.i18n={},V.ready=!1,V}(C=a.options.react)!=null&&C.wait&&Gh("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...fL(),...a.options.react,...t},{useSuspense:c,keyPrefix:f}=l;let h=e||o||((k=a.options)==null?void 0:k.defaultNS);h=Xi(h)?[h]:h||["translation"],(P=(E=a.reportNamespaces).addUsedNamespaces)==null||P.call(E,h);const p=(a.isInitialized||a.initializedStoreOnce)&&h.every(A=>iL(A,a,l)),w=vL(a,t.lng||null,l.nsMode==="fallback"?h:h[0],f),m=()=>w,b=()=>FS(a,t.lng||null,l.nsMode==="fallback"?h:h[0],f),[R,O]=j.useState(m);let N=h.join();t.lng&&(N=`${t.lng}${N}`);const _=mL(N),v=j.useRef(!0);j.useEffect(()=>{const{bindI18n:A,bindI18nStore:V}=l;v.current=!0,!p&&!c&&(t.lng?sy(a,t.lng,h,()=>{v.current&&O(b)}):oy(a,h,()=>{v.current&&O(b)})),p&&_&&_!==N&&v.current&&O(b);const Q=()=>{v.current&&O(b)};return A&&(a==null||a.on(A,Q)),V&&(a==null||a.store.on(V,Q)),()=>{v.current=!1,a&&(A==null||A.split(" ").forEach(te=>a.off(te,Q))),V&&a&&V.split(" ").forEach(te=>a.store.off(te,Q))}},[a,N]),j.useEffect(()=>{v.current&&p&&O(m)},[a,f,p]);const x=[R,a,p];if(x.t=R,x.i18n=a,x.ready=p,p||!p&&!c)return x;throw new Promise(A=>{t.lng?sy(a,t.lng,h,()=>A()):oy(a,h,()=>A())})},ay=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),o=Math.floor(e%1*1e3);return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}.${o.toString().padStart(3,"0")}`},yL=ae.div` width: 100%; height: 100%; display: flex; @@ -66,15 +66,15 @@ Error generating stack: `+a.message+` max-height: 100%; object-fit: contain; width: ${e=>e.isEditMode?"auto":"100%"}; -`,SL=j.forwardRef(({src:e,tracks:t,mediaType:n,audioTracks:r,selectedAudioTracks:o,selectedSubtitles:a,advancedEditMode:l},c)=>{const f=j.useRef(null),h=j.useRef(null),p=j.useRef(null),y=j.useRef({}),m=j.useRef(null),b=j.useRef(null),P=j.useRef(null),O=j.useRef(null),N=j.useRef([]),[_,v]=j.useMemo(()=>{if(t.length===0)return["",""];const k=R=>{const W=`WEBVTT +`,SL=j.forwardRef(({src:e,tracks:t,mediaType:n,audioTracks:r,selectedAudioTracks:o,selectedSubtitles:a,advancedEditMode:l},c)=>{const f=j.useRef(null),h=j.useRef(null),p=j.useRef(null),w=j.useRef({}),m=j.useRef(null),b=j.useRef(null),R=j.useRef(null),O=j.useRef(null),N=j.useRef([]),[_,v]=j.useMemo(()=>{if(t.length===0)return["",""];const E=P=>{const V=`WEBVTT -${t.map(te=>({startTime:te.start,duration:te.end-te.start,text:te[R]})).map((te,de)=>` -${de+1} +${t.map(te=>({startTime:te.start,duration:te.end-te.start,text:te[P]})).map((te,he)=>` +${he+1} ${ay(te.startTime)} --> ${ay(te.startTime+te.duration)} ${te.text} `).join(` `)} -`,Y=new Blob([W],{type:"text/vtt"});return URL.createObjectURL(Y)};return[k("text"),k("translated_text")]},[t]);j.useImperativeHandle(c,()=>({get currentTime(){return f.current?f.current.currentTime:0},setCurrentTime(k){f.current&&(f.current.currentTime=k,Object.values(y.current).forEach(R=>{R.currentTime=k}))},play(){if(f.current){const k=f.current.play();k!==void 0&&k.then(()=>{Object.values(y.current).forEach(R=>{const A=R.play();A!==void 0&&A.catch(W=>{console.log("Audio play prevented:",W)})})}).catch(R=>{console.log("Video play prevented:",R)})}},pause(){var k;(k=f.current)==null||k.pause(),Object.values(y.current).forEach(R=>{R.pause()})}})),j.useEffect(()=>{h.current&&(h.current.src=_),p.current&&(p.current.src=v)},[_,v]),j.useEffect(()=>{h.current&&p.current&&(h.current.track.mode=a==="original"?"showing":"hidden",p.current.track.mode=a==="dubbed"?"showing":"hidden")},[a]),j.useEffect(()=>{f.current&&(f.current.src=e)},[e]),j.useEffect(()=>{const k=f.current;k&&(k.onerror=()=>{console.error("Video error:",k.error)})},[]);const x=k=>{O.current||(O.current=new AudioContext),N.current.forEach(R=>{try{R.stop(),R.disconnect()}catch(A){console.error("Error stopping audio source:",A)}}),N.current=[],o.forEach(R=>{const A=r[R];if((A==null?void 0:A.buffer)instanceof AudioBuffer){const W=O.current.createBufferSource();W.buffer=A.buffer,W.connect(O.current.destination),W.start(0,k),N.current.push(W)}})};j.useEffect(()=>(Object.values(y.current).forEach(k=>{k.pause()}),y.current={},Object.entries(r).forEach(([k,R])=>{if(R.url&&!R.buffer){const A=new Audio(R.url);A.preload="auto",A.muted=!o.includes(k),f.current&&(A.currentTime=f.current.currentTime),f.current&&!f.current.paused&&A.play().catch(W=>{console.log("Audio play prevented:",W)}),y.current[k]=A}}),()=>{Object.values(y.current).forEach(k=>{k.pause()}),y.current={}}),[r]),j.useEffect(()=>{Object.entries(y.current).forEach(([k,R])=>{R.muted=!o.includes(k)}),f.current&&!f.current.paused&&x(f.current.currentTime)},[o]),j.useEffect(()=>{const k=f.current;if(!k)return;const R=()=>{Object.values(y.current).forEach(Y=>{Y.play().catch(te=>{console.log("Audio play prevented:",te)})}),x(k.currentTime),k.play()},A=()=>{Object.values(y.current).forEach(Y=>{Y.pause()}),N.current.forEach(Y=>{try{Y.stop(),Y.disconnect()}catch(te){console.error("Error stopping audio source:",te)}}),N.current=[],k.pause()},W=()=>{const Y=k.currentTime;Object.values(y.current).forEach(te=>{te.currentTime=Y}),k.paused||x(Y),k.play()};return k.addEventListener("play",R),k.addEventListener("pause",A),k.addEventListener("seeked",W),()=>{k.removeEventListener("play",R),k.removeEventListener("pause",A),k.removeEventListener("seeked",W),N.current.forEach(Y=>{try{Y.stop(),Y.disconnect()}catch(te){console.error("Error cleaning up audio source:",te)}}),O.current&&(O.current.close(),O.current=null)}},[r,o]),j.useEffect(()=>{const k=f.current;if(!k)return;const R=()=>{T()};return k.addEventListener("timeupdate",R),()=>{k.removeEventListener("timeupdate",R),m.current&&(m.current.close(),m.current=null)}},[t,l]),j.useEffect(()=>{const k=f.current;if(!k)return;const R=()=>{b.current&&(b.current.stop(),b.current.disconnect()),T()};return k.addEventListener("seeked",R),()=>{k.removeEventListener("seeked",R)}},[t,l]);const C=k=>{if(k.buffer)try{if(m.current||(m.current=new AudioContext),b.current)try{b.current.stop(),b.current.disconnect()}catch(te){console.error("Error stopping previous track:",te)}const R=m.current.createBufferSource(),A=m.current.createGain();R.buffer=k.buffer,A.gain.value=Math.pow(10,k.volume_gain_db/20),R.connect(A),A.connect(m.current.destination);const W=Math.max(0,f.current.currentTime-k.start),Y=k.end-k.start;R.start(0,W,Y),b.current=R,P.current=A,setTimeout(()=>{try{R.stop(),R.disconnect()}catch(te){console.error("Error stopping track:",te)}finally{y.current.dubbed&&o.includes("dubbed")&&(y.current.dubbed.muted=!1)}},(Y-W)*1e3)}catch(R){console.error("Error playing track buffer:",R),y.current.dubbed&&o.includes("dubbed")&&(y.current.dubbed.muted=!1)}},T=()=>{if(!f.current)return;const k=f.current.currentTime;try{const R=t.find(W=>k>=W.start&&k<=W.end),A=t.find(W=>W.buffer&&!W.deleted&&k>=W.start-1&&k<=W.end);if(R!=null&&R.deleted)y.current.dubbed&&o.includes("dubbed")&&(y.current.dubbed.muted=!0);else if(A)y.current.dubbed&&o.includes("dubbed")&&(y.current.dubbed.muted=!0),C(A);else if(y.current.dubbed&&o.includes("dubbed")&&(y.current.dubbed.muted=!1),b.current)try{b.current.stop(),b.current.disconnect()}catch(W){console.error("Error stopping track:",W)}}catch(R){console.error("Error checking and playing tracks:",R),y.current.dubbed&&o.includes("dubbed")&&(y.current.dubbed.muted=!1)}};return $.jsx(yL,{children:$.jsxs(wL,{ref:f,controls:!0,preload:"auto",isEditMode:t.length>0,children:[$.jsx("source",{src:e,type:n}),_&&$.jsx("track",{ref:h,kind:"captions",srcLang:"original",label:"Original"}),v&&$.jsx("track",{ref:p,kind:"captions",srcLang:"dubbed",label:"Dubbed"}),"Your browser does not support the video tag."]})})}),xL=ae.div` +`,Q=new Blob([V],{type:"text/vtt"});return URL.createObjectURL(Q)};return[E("text"),E("translated_text")]},[t]);j.useImperativeHandle(c,()=>({get currentTime(){return f.current?f.current.currentTime:0},setCurrentTime(E){f.current&&(f.current.currentTime=E,Object.values(w.current).forEach(P=>{P.currentTime=E}))},play(){if(f.current){const E=f.current.play();E!==void 0&&E.then(()=>{Object.values(w.current).forEach(P=>{const A=P.play();A!==void 0&&A.catch(V=>{console.log("Audio play prevented:",V)})})}).catch(P=>{console.log("Video play prevented:",P)})}},pause(){var E;(E=f.current)==null||E.pause(),Object.values(w.current).forEach(P=>{P.pause()})}})),j.useEffect(()=>{h.current&&(h.current.src=_),p.current&&(p.current.src=v)},[_,v]),j.useEffect(()=>{h.current&&p.current&&(h.current.track.mode=a==="original"?"showing":"hidden",p.current.track.mode=a==="dubbed"?"showing":"hidden")},[a]),j.useEffect(()=>{f.current&&(f.current.src=e)},[e]),j.useEffect(()=>{const E=f.current;E&&(E.onerror=()=>{console.error("Video error:",E.error)})},[]);const x=E=>{O.current||(O.current=new AudioContext),N.current.forEach(P=>{try{P.stop(),P.disconnect()}catch(A){console.error("Error stopping audio source:",A)}}),N.current=[],o.forEach(P=>{const A=r[P];if((A==null?void 0:A.buffer)instanceof AudioBuffer){const V=O.current.createBufferSource();V.buffer=A.buffer,V.connect(O.current.destination),V.start(0,E),N.current.push(V)}})};j.useEffect(()=>(Object.values(w.current).forEach(E=>{E.pause()}),w.current={},Object.entries(r).forEach(([E,P])=>{if(P.url&&!P.buffer){const A=new Audio(P.url);A.preload="auto",A.muted=!o.includes(E),f.current&&(A.currentTime=f.current.currentTime),f.current&&!f.current.paused&&A.play().catch(V=>{console.log("Audio play prevented:",V)}),w.current[E]=A}}),()=>{Object.values(w.current).forEach(E=>{E.pause()}),w.current={}}),[r]),j.useEffect(()=>{Object.entries(w.current).forEach(([E,P])=>{P.muted=!o.includes(E)}),f.current&&!f.current.paused&&x(f.current.currentTime)},[o]),j.useEffect(()=>{const E=f.current;if(!E)return;const P=()=>{Object.values(w.current).forEach(Q=>{Q.play().catch(te=>{console.log("Audio play prevented:",te)})}),x(E.currentTime),E.play()},A=()=>{Object.values(w.current).forEach(Q=>{Q.pause()}),N.current.forEach(Q=>{try{Q.stop(),Q.disconnect()}catch(te){console.error("Error stopping audio source:",te)}}),N.current=[],E.pause()},V=()=>{const Q=E.currentTime;Object.values(w.current).forEach(te=>{te.currentTime=Q}),E.paused||x(Q),E.play()};return E.addEventListener("play",P),E.addEventListener("pause",A),E.addEventListener("seeked",V),()=>{E.removeEventListener("play",P),E.removeEventListener("pause",A),E.removeEventListener("seeked",V),N.current.forEach(Q=>{try{Q.stop(),Q.disconnect()}catch(te){console.error("Error cleaning up audio source:",te)}}),O.current&&(O.current.close(),O.current=null)}},[r,o]),j.useEffect(()=>{const E=f.current;if(!E)return;const P=()=>{k()};return E.addEventListener("timeupdate",P),()=>{E.removeEventListener("timeupdate",P),m.current&&(m.current.close(),m.current=null)}},[t,l]),j.useEffect(()=>{const E=f.current;if(!E)return;const P=()=>{b.current&&(b.current.stop(),b.current.disconnect()),k()};return E.addEventListener("seeked",P),()=>{E.removeEventListener("seeked",P)}},[t,l]);const C=E=>{if(E.buffer)try{if(m.current||(m.current=new AudioContext),b.current)try{b.current.stop(),b.current.disconnect()}catch(te){console.error("Error stopping previous track:",te)}const P=m.current.createBufferSource(),A=m.current.createGain();P.buffer=E.buffer,A.gain.value=Math.pow(10,E.volume_gain_db/20),P.connect(A),A.connect(m.current.destination);const V=Math.max(0,f.current.currentTime-E.start),Q=E.end-E.start;P.start(0,V,Q),b.current=P,R.current=A,setTimeout(()=>{try{P.stop(),P.disconnect()}catch(te){console.error("Error stopping track:",te)}finally{w.current.dubbed&&o.includes("dubbed")&&(w.current.dubbed.muted=!1)}},(Q-V)*1e3)}catch(P){console.error("Error playing track buffer:",P),w.current.dubbed&&o.includes("dubbed")&&(w.current.dubbed.muted=!1)}},k=()=>{if(!f.current)return;const E=f.current.currentTime;try{const P=t.find(V=>E>=V.start&&E<=V.end),A=t.find(V=>V.buffer&&!V.deleted&&E>=V.start-1&&E<=V.end);if(P!=null&&P.deleted)w.current.dubbed&&o.includes("dubbed")&&(w.current.dubbed.muted=!0);else if(A)w.current.dubbed&&o.includes("dubbed")&&(w.current.dubbed.muted=!0),C(A);else if(w.current.dubbed&&o.includes("dubbed")&&(w.current.dubbed.muted=!1),b.current)try{b.current.stop(),b.current.disconnect()}catch(V){console.error("Error stopping track:",V)}}catch(P){console.error("Error checking and playing tracks:",P),w.current.dubbed&&o.includes("dubbed")&&(w.current.dubbed.muted=!1)}};return $.jsx(yL,{children:$.jsxs(wL,{ref:f,controls:!0,preload:"auto",isEditMode:t.length>0,children:[$.jsx("source",{src:e,type:n}),_&&$.jsx("track",{ref:h,kind:"captions",srcLang:"original",label:"Original"}),v&&$.jsx("track",{ref:p,kind:"captions",srcLang:"dubbed",label:"Dubbed"}),"Your browser does not support the video tag."]})})}),xL=ae.div` width: 100%; height: 100%; display: flex; @@ -82,9 +82,9 @@ ${te.text} align-items: center; `,_L=ae.audio` width: 100%; -`,bL=j.forwardRef(({src:e,mediaType:t},n)=>{const r=j.useRef(null);return j.useImperativeHandle(n,()=>({get currentTime(){return r.current?r.current.currentTime:0},setCurrentTime(o){r.current&&(r.current.currentTime=o)},play(){var o;(o=r.current)==null||o.play()},pause(){var o;(o=r.current)==null||o.pause()}})),j.useEffect(()=>{r.current&&(r.current.src=e)},[e]),j.useEffect(()=>{const o=r.current;o&&(o.onerror=()=>{console.error("Audio error:",o.error)})},[]),$.jsx(xL,{children:$.jsxs(_L,{ref:r,controls:!0,children:[$.jsx("source",{src:e,type:t}),"Your browser does not support the audio tag."]})})}),kL=(e,t)=>e.mediaType.startsWith("video")?$.jsx(SL,{...e,ref:t}):$.jsx(bL,{...e,ref:t}),CL=j.forwardRef(kL);function EL(e,t,n){return Math.max(t,Math.min(e,n))}const tt={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function ly(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function uy(e,t,n,r=.15){return r===0?EL(e,t,n):en?+ly(e-n,n-t,r)+n:e}function TL(e,[t,n],[r,o]){const[[a,l],[c,f]]=e;return[uy(t,a,l,r),uy(n,c,f,o)]}function RL(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PL(e){var t=RL(e,"string");return typeof t=="symbol"?t:String(t)}function xt(e,t,n){return t=PL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function ML(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function BS(e){return $c(e)?ML(e)[0]:e}function Xh(e,t){try{const n=t.clientX-e.clientX,r=t.clientY-e.clientY,o=(t.clientX+e.clientX)/2,a=(t.clientY+e.clientY)/2,l=Math.hypot(n,r);return{angle:-(Math.atan2(n,r)*180)/Math.PI,distance:l,origin:[o,a]}}catch{}return null}function zL(e){return NL(e).map(t=>t.identifier)}function dy(e,t){const[n,r]=Array.from(e.touches).filter(o=>t.includes(o.identifier));return Xh(n,r)}function Ad(e){const t=BS(e);return $c(e)?t.identifier:t.pointerId}function ss(e){const t=BS(e);return[t.clientX,t.clientY]}const hy=40,py=800;function WS(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return r===1?(t*=hy,n*=hy):r===2&&(t*=py,n*=py),[t,n]}function FL(e){var t,n;const{scrollX:r,scrollY:o,scrollLeft:a,scrollTop:l}=e.currentTarget;return[(t=r??a)!==null&&t!==void 0?t:0,(n=o??l)!==null&&n!==void 0?n:0]}function UL(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a})}return t}function Ku(e,...t){return typeof e=="function"?e(...t):e}function jL(){}function BL(...e){return e.length===0?jL:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function gy(e,t){return Object.assign({},t,e||{})}const WL=32;class HS{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?Ku(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let a=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,UL(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,a=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const k=n._delta.map(Math.abs);tt.addTo(n._distance,k)}this.axisIntent&&this.axisIntent(t);const[l,c]=n._movement,[f,h]=r.threshold,{_step:p,values:y}=n;if(r.hasCustomTransform?(p[0]===!1&&(p[0]=Math.abs(l)>=f&&y[0]),p[1]===!1&&(p[1]=Math.abs(c)>=h&&y[1])):(p[0]===!1&&(p[0]=Math.abs(l)>=f&&Math.sign(l)*f),p[1]===!1&&(p[1]=Math.abs(c)>=h&&Math.sign(c)*h)),n.intentional=p[0]!==!1||p[1]!==!1,!n.intentional)return;const m=[0,0];if(r.hasCustomTransform){const[k,R]=y;m[0]=p[0]!==!1?k-p[0]:0,m[1]=p[1]!==!1?R-p[1]:0}else m[0]=p[0]!==!1?l-p[0]:0,m[1]=p[1]!==!1?c-p[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(m);const b=n.offset,P=n._active&&!n._blocked||n.active;P&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=Ku(r.bounds,n)),this.setup&&this.setup()),n.movement=m,this.computeOffset()));const[O,N]=n.offset,[[_,v],[x,C]]=n._bounds;n.overflow=[O<_?-1:O>v?1:0,NC?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const T=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=TL(n._bounds,n.offset,T),n.delta=tt.sub(n.offset,b),this.computeMovement(),P&&(!n.last||a>WL)){n.delta=tt.sub(n.offset,b);const k=n.delta.map(Math.abs);tt.addTo(n.distance,k),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&a>0&&(n.velocity=[k[0]/a,k[1]/a],n.timeDelta=a)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(ut(ut(ut({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function HL([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class Da extends HS{constructor(...t){super(...t),xt(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=tt.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=tt.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[jS(t)]:r.axisThreshold;n.axis=HL(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const VL=e=>e,my=.15,VS={enabled(e=!0){return e},eventOptions(e,t,n){return ut(ut({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[my,my];case!1:return[0,0];default:return tt.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return tt.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||VL},threshold(e){return tt.toVector(e,0)}},KL=0,io=ut(ut({},VS),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=KL){return e},bounds(e={}){if(typeof e=="function")return a=>io.bounds(e(a));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),vy={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class GL extends Da{constructor(...t){super(...t),xt(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=io.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=Ad(t),r._pointerActive=!0,this.computeValues(ss(t)),this.computeInitial(),n.preventScrollAxis&&jS(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=Ad(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const a=ss(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=tt.sub(a,n._values),this.computeValues(a)),tt.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=Ad(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[a,l]=n._distance;if(n.tap=a<=r.tapsThreshold&&l<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[c,f]=n._delta,[h,p]=n._movement,[y,m]=r.swipe.velocity,[b,P]=r.swipe.distance,O=r.swipe.duration;if(n.elapsedTimey&&Math.abs(h)>b&&(n.swipe[0]=Math.sign(c)),_>m&&Math.abs(p)>P&&(n.swipe[1]=Math.sign(f))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,YL(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=vy[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,tt.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in vy&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function YL(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const $a=typeof window<"u"&&window.document&&window.document.createElement;function KS(){return $a&&"ontouchstart"in window}function XL(){return KS()||$a&&window.navigator.maxTouchPoints>1}function QL(){return $a&&"onpointerdown"in window}function ZL(){return $a&&"exitPointerLock"in window.document}function qL(){try{return"constructor"in GestureEvent}catch{return!1}}const Vn={isBrowser:$a,gesture:qL(),touch:KS(),touchscreen:XL(),pointer:QL(),pointerLock:ZL()},JL=250,eA=180,tA=.5,nA=50,rA=250,iA=10,yy={mouse:0,touch:0,pen:8},oA=ut(ut({},io),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Vn.pointerLock,Vn.touch&&n?"touch":this.pointerLock?"mouse":Vn.pointer&&!o?"pointer":Vn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?JL:void 0,!(!Vn.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const a=tt.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:e=tA,distance:t=nA,duration:n=rA}={}){return{velocity:this.transform(tt.toVector(e)),distance:this.transform(tt.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return eA;case!1:return 0;default:return e}},axisThreshold(e){return e?ut(ut({},yy),e):yy},keyboardDisplacement(e=iA){return e}});function GS(e){const[t,n]=e.overflow,[r,o]=e._delta,[a,l]=e._direction;(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&o>0&&l<0||n>0&&o<0&&l>0)&&(e._movement[1]=e._movementBound[1])}const sA=30,aA=100;class lA extends HS{constructor(...t){super(...t),xt(this,"ingKey","pinching"),xt(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const t=this.state;t._touchIds=[],t.canceled=!1,t.cancel=this.cancel.bind(this),t.turns=0}computeOffset(){const{type:t,movement:n,lastOffset:r}=this.state;t==="wheel"?this.state.offset=tt.add(n,r):this.state.offset=[(1+n[0])*r[0],n[1]+r[1]]}computeMovement(){const{offset:t,lastOffset:n}=this.state;this.state.movement=[t[0]/n[0],t[1]-n[1]]}axisIntent(){const t=this.state,[n,r]=t._movement;if(!t.axis){const o=Math.abs(n)*sA-Math.abs(r);o<0?t.axis="angle":o>0&&(t.axis="scale")}}restrictToAxis(t){this.config.lockDirection&&(this.state.axis==="scale"?t[1]=0:this.state.axis==="angle"&&(t[0]=0))}cancel(){const t=this.state;t.canceled||setTimeout(()=>{t.canceled=!0,t._active=!1,this.compute(),this.emit()},0)}touchStart(t){this.ctrl.setEventIds(t);const n=this.state,r=this.ctrl.touchIds;if(n._active&&n._touchIds.every(a=>r.has(a))||r.size<2)return;this.start(t),n._touchIds=Array.from(r).slice(0,2);const o=dy(t,n._touchIds);o&&this.pinchStart(t,o)}pointerStart(t){if(t.buttons!=null&&t.buttons%2!==1)return;this.ctrl.setEventIds(t),t.target.setPointerCapture(t.pointerId);const n=this.state,r=n._pointerEvents,o=this.ctrl.pointerIds;if(n._active&&Array.from(r.keys()).every(l=>o.has(l))||(r.size<2&&r.set(t.pointerId,t),n._pointerEvents.size<2))return;this.start(t);const a=Xh(...Array.from(r.values()));a&&this.pinchStart(t,a)}pinchStart(t,n){const r=this.state;r.origin=n.origin,this.computeValues([n.distance,n.angle]),this.computeInitial(),this.compute(t),this.emit()}touchMove(t){if(!this.state._active)return;const n=dy(t,this.state._touchIds);n&&this.pinchMove(t,n)}pointerMove(t){const n=this.state._pointerEvents;if(n.has(t.pointerId)&&n.set(t.pointerId,t),!this.state._active)return;const r=Xh(...Array.from(n.values()));r&&this.pinchMove(t,r)}pinchMove(t,n){const r=this.state,o=r._values[1],a=n.angle-o;let l=0;Math.abs(a)>270&&(l+=Math.sign(a)),this.computeValues([n.distance,n.angle-360*l]),r.origin=n.origin,r.turns=l,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(t),this.emit()}touchEnd(t){this.ctrl.setEventIds(t),this.state._active&&this.state._touchIds.some(n=>!this.ctrl.touchIds.has(n))&&(this.state._active=!1,this.compute(t),this.emit())}pointerEnd(t){const n=this.state;this.ctrl.setEventIds(t);try{t.target.releasePointerCapture(t.pointerId)}catch{}n._pointerEvents.has(t.pointerId)&&n._pointerEvents.delete(t.pointerId),n._active&&n._pointerEvents.size<2&&(n._active=!1,this.compute(t),this.emit())}gestureStart(t){t.cancelable&&t.preventDefault();const n=this.state;n._active||(this.start(t),this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY],this.compute(t),this.emit())}gestureMove(t){if(t.cancelable&&t.preventDefault(),!this.state._active)return;const n=this.state;this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY];const r=n._movement;n._movement=[t.scale-1,t.rotation],n._delta=tt.sub(n._movement,r),this.compute(t),this.emit()}gestureEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}wheel(t){const n=this.config.modifierKey;n&&(Array.isArray(n)?!n.find(r=>t[r]):!t[n])||(this.state._active?this.wheelChange(t):this.wheelStart(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(t){this.start(t),this.wheelChange(t)}wheelChange(t){"uv"in t||t.cancelable&&t.preventDefault();const r=this.state;r._delta=[-WS(t)[1]/aA*r.offset[0],0],tt.addTo(r._movement,r._delta),GS(r),this.state.origin=[t.clientX,t.clientY],this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){const n=this.config.device;n&&(t(n,"start",this[n+"Start"].bind(this)),t(n,"change",this[n+"Move"].bind(this)),t(n,"end",this[n+"End"].bind(this)),t(n,"cancel",this[n+"End"].bind(this)),t("lostPointerCapture","",this[n+"End"].bind(this))),this.config.pinchOnWheel&&t("wheel","",this.wheel.bind(this),{passive:!1})}}const uA=ut(ut({},VS),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Vn.touch&&Vn.gesture)return"gesture";if(Vn.touch&&r)return"touch";if(Vn.touchscreen){if(Vn.pointer)return"pointer";if(Vn.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=l=>{const c=gy(Ku(n,l),{min:-1/0,max:1/0});return[c.min,c.max]},a=l=>{const c=gy(Ku(r,l),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof n!="function"&&typeof r!="function"?[o(),a()]:l=>[o(l),a(l)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",tt.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});class cA extends Da{constructor(...t){super(...t),xt(this,"ingKey","moving")}move(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.state._active?this.moveChange(t):this.moveStart(t),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(t){this.start(t),this.computeValues(ss(t)),this.compute(t),this.computeInitial(),this.emit()}moveChange(t){if(!this.state._active)return;const n=ss(t),r=this.state;r._delta=tt.sub(n,r._values),tt.addTo(r._movement,r._delta),this.computeValues(n),this.compute(t),this.emit()}moveEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}bind(t){t("pointer","change",this.move.bind(this)),t("pointer","leave",this.moveEnd.bind(this))}}const fA=ut(ut({},io),{},{mouseOnly:(e=!0)=>e});class dA extends Da{constructor(...t){super(...t),xt(this,"ingKey","scrolling")}scroll(t){this.state._active||this.start(t),this.scrollChange(t),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(t){t.cancelable&&t.preventDefault();const n=this.state,r=FL(t);n._delta=tt.sub(r,n._values),tt.addTo(n._movement,n._delta),this.computeValues(r),this.compute(t),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("scroll","",this.scroll.bind(this))}}const hA=io;class pA extends Da{constructor(...t){super(...t),xt(this,"ingKey","wheeling")}wheel(t){this.state._active||this.start(t),this.wheelChange(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(t){const n=this.state;n._delta=WS(t),tt.addTo(n._movement,n._delta),GS(n),this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("wheel","",this.wheel.bind(this))}}const gA=io;class mA extends Da{constructor(...t){super(...t),xt(this,"ingKey","hovering")}enter(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.start(t),this.computeValues(ss(t)),this.compute(t),this.emit())}leave(t){if(this.config.mouseOnly&&t.pointerType!=="mouse")return;const n=this.state;if(!n._active)return;n._active=!1;const r=ss(t);n._movement=n._delta=tt.sub(r,n._values),this.computeValues(r),this.compute(t),n.delta=n.movement,this.emit()}bind(t){t("pointer","enter",this.enter.bind(this)),t("pointer","leave",this.leave.bind(this))}}const vA=ut(ut({},io),{},{mouseOnly:(e=!0)=>e}),sg=new Map,Qh=new Map;function yA(e){sg.set(e.key,e.engine),Qh.set(e.key,e.resolver)}const wA={key:"drag",engine:GL,resolver:oA},SA={key:"hover",engine:mA,resolver:vA},xA={key:"move",engine:cA,resolver:fA},_A={key:"pinch",engine:lA,resolver:uA},bA={key:"scroll",engine:dA,resolver:hA},kA={key:"wheel",engine:pA,resolver:gA};function CA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a=0)&&(n[o]=e[o]);return n}function EA(e,t){if(e==null)return{};var n=CA(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const TA={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Vn.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},RA=["target","eventOptions","window","enabled","transform"];function vu(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=vu(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function PA(e,t,n={}){const r=e,{target:o,eventOptions:a,window:l,enabled:c,transform:f}=r,h=EA(r,RA);if(n.shared=vu({target:o,eventOptions:a,window:l,enabled:c,transform:f},TA),t){const p=Qh.get(t);n[t]=vu(ut({shared:n.shared},h),p)}else for(const p in h){const y=Qh.get(p);y&&(n[p]=vu(ut({shared:n.shared},h[p]),y))}return n}class YS{constructor(t,n){xt(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,a){const l=this._listeners,c=IL(n,r),f=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},h=ut(ut({},f),a);t.addEventListener(c,o,h);const p=()=>{t.removeEventListener(c,o,h),l.delete(p)};return l.add(p),p}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class OA{constructor(){xt(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class LA{constructor(t){xt(this,"gestures",new Set),xt(this,"_targetEventStore",new YS(this)),xt(this,"gestureEventStores",{}),xt(this,"gestureTimeoutStores",{}),xt(this,"handlers",{}),xt(this,"config",{}),xt(this,"pointerIds",new Set),xt(this,"touchIds",new Set),xt(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),AA(this,t)}setEventIds(t){if($c(t))return this.touchIds=new Set(zL(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=PA(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const l of this.gestures){const c=this.config[l],f=wy(r,c.eventOptions,!!o);if(c.enabled){const h=sg.get(l);new h(this,t,l).bind(f)}}const a=wy(r,n.eventOptions,!!o);for(const l in this.nativeHandlers)a(l,"",c=>this.nativeHandlers[l](ut(ut({},this.state.shared),{},{event:c,args:t})),void 0,!0)}for(const a in r)r[a]=BL(...r[a]);if(!o)return r;for(const a in r){const{device:l,capture:c,passive:f}=$L(a);this._targetEventStore.add(o,l,"",r[a],{capture:c,passive:f})}}}}function Co(e,t){e.gestures.add(t),e.gestureEventStores[t]=new YS(e,t),e.gestureTimeoutStores[t]=new OA}function AA(e,t){t.drag&&Co(e,"drag"),t.wheel&&Co(e,"wheel"),t.scroll&&Co(e,"scroll"),t.move&&Co(e,"move"),t.pinch&&Co(e,"pinch"),t.hover&&Co(e,"hover")}const wy=(e,t,n)=>(r,o,a,l={},c=!1)=>{var f,h;const p=(f=l.capture)!==null&&f!==void 0?f:t.capture,y=(h=l.passive)!==null&&h!==void 0?h:t.passive;let m=c?r:AL(r,o,p);n&&y&&(m+="Passive"),e[m]=e[m]||[],e[m].push(a)},DA=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function $A(e){const t={},n={},r=new Set;for(let o in e)DA.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}function Eo(e,t,n,r,o,a){if(!e.has(n)||!sg.has(r))return;const l=n+"Start",c=n+"End",f=h=>{let p;return h.first&&l in t&&t[l](h),n in t&&(p=t[n](h)),h.last&&c in t&&t[c](h),p};o[r]=f,a[r]=a[r]||{}}function IA(e,t){const[n,r,o]=$A(e),a={};return Eo(o,n,"onDrag","drag",a,t),Eo(o,n,"onWheel","wheel",a,t),Eo(o,n,"onScroll","scroll",a,t),Eo(o,n,"onPinch","pinch",a,t),Eo(o,n,"onMove","move",a,t),Eo(o,n,"onHover","hover",a,t),{handlers:a,config:t,nativeHandlers:r}}function NA(e,t={},n,r){const o=Wr.useMemo(()=>new LA(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),Wr.useEffect(o.effect.bind(o)),Wr.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function MA(e){return e.forEach(yA),function(n,r){const{handlers:o,nativeHandlers:a,config:l}=IA(n,r||{});return NA(o,l,void 0,a)}}function zA(e,t){return MA([wA,_A,bA,kA,xA,SA])(e,t||{})}var Ic={exports:{}},XS={},QS={exports:{}},FA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",UA=FA,jA=UA;function ZS(){}function qS(){}qS.resetWarningCache=ZS;var BA=function(){function e(r,o,a,l,c,f){if(f!==jA){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:qS,resetWarningCache:ZS};return n.PropTypes=n,n};QS.exports=BA();var JS=QS.exports;function ex(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;rt===n.identifier)||e.changedTouches&&(0,On.findInArray)(e.changedTouches,n=>t===n.identifier)}function cD(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function fD(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +`,bL=j.forwardRef(({src:e,mediaType:t},n)=>{const r=j.useRef(null);return j.useImperativeHandle(n,()=>({get currentTime(){return r.current?r.current.currentTime:0},setCurrentTime(o){r.current&&(r.current.currentTime=o)},play(){var o;(o=r.current)==null||o.play()},pause(){var o;(o=r.current)==null||o.pause()}})),j.useEffect(()=>{r.current&&(r.current.src=e)},[e]),j.useEffect(()=>{const o=r.current;o&&(o.onerror=()=>{console.error("Audio error:",o.error)})},[]),$.jsx(xL,{children:$.jsxs(_L,{ref:r,controls:!0,children:[$.jsx("source",{src:e,type:t}),"Your browser does not support the audio tag."]})})}),kL=(e,t)=>e.mediaType.startsWith("video")?$.jsx(SL,{...e,ref:t}):$.jsx(bL,{...e,ref:t}),CL=j.forwardRef(kL);function EL(e,t,n){return Math.max(t,Math.min(e,n))}const tt={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function ly(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function uy(e,t,n,r=.15){return r===0?EL(e,t,n):en?+ly(e-n,n-t,r)+n:e}function TL(e,[t,n],[r,o]){const[[a,l],[c,f]]=e;return[uy(t,a,l,r),uy(n,c,f,o)]}function RL(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PL(e){var t=RL(e,"string");return typeof t=="symbol"?t:String(t)}function xt(e,t,n){return t=PL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ut(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function ML(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function BS(e){return $c(e)?ML(e)[0]:e}function Xh(e,t){try{const n=t.clientX-e.clientX,r=t.clientY-e.clientY,o=(t.clientX+e.clientX)/2,a=(t.clientY+e.clientY)/2,l=Math.hypot(n,r);return{angle:-(Math.atan2(n,r)*180)/Math.PI,distance:l,origin:[o,a]}}catch{}return null}function zL(e){return NL(e).map(t=>t.identifier)}function dy(e,t){const[n,r]=Array.from(e.touches).filter(o=>t.includes(o.identifier));return Xh(n,r)}function Ad(e){const t=BS(e);return $c(e)?t.identifier:t.pointerId}function ss(e){const t=BS(e);return[t.clientX,t.clientY]}const hy=40,py=800;function WS(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return r===1?(t*=hy,n*=hy):r===2&&(t*=py,n*=py),[t,n]}function FL(e){var t,n;const{scrollX:r,scrollY:o,scrollLeft:a,scrollTop:l}=e.currentTarget;return[(t=r??a)!==null&&t!==void 0?t:0,(n=o??l)!==null&&n!==void 0?n:0]}function UL(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:a})}return t}function Ku(e,...t){return typeof e=="function"?e(...t):e}function jL(){}function BL(...e){return e.length===0?jL:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function gy(e,t){return Object.assign({},t,e||{})}const WL=32;class HS{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?Ku(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let a=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,UL(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,a=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const E=n._delta.map(Math.abs);tt.addTo(n._distance,E)}this.axisIntent&&this.axisIntent(t);const[l,c]=n._movement,[f,h]=r.threshold,{_step:p,values:w}=n;if(r.hasCustomTransform?(p[0]===!1&&(p[0]=Math.abs(l)>=f&&w[0]),p[1]===!1&&(p[1]=Math.abs(c)>=h&&w[1])):(p[0]===!1&&(p[0]=Math.abs(l)>=f&&Math.sign(l)*f),p[1]===!1&&(p[1]=Math.abs(c)>=h&&Math.sign(c)*h)),n.intentional=p[0]!==!1||p[1]!==!1,!n.intentional)return;const m=[0,0];if(r.hasCustomTransform){const[E,P]=w;m[0]=p[0]!==!1?E-p[0]:0,m[1]=p[1]!==!1?P-p[1]:0}else m[0]=p[0]!==!1?l-p[0]:0,m[1]=p[1]!==!1?c-p[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(m);const b=n.offset,R=n._active&&!n._blocked||n.active;R&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=Ku(r.bounds,n)),this.setup&&this.setup()),n.movement=m,this.computeOffset()));const[O,N]=n.offset,[[_,v],[x,C]]=n._bounds;n.overflow=[O<_?-1:O>v?1:0,NC?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const k=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=TL(n._bounds,n.offset,k),n.delta=tt.sub(n.offset,b),this.computeMovement(),R&&(!n.last||a>WL)){n.delta=tt.sub(n.offset,b);const E=n.delta.map(Math.abs);tt.addTo(n.distance,E),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&a>0&&(n.velocity=[E[0]/a,E[1]/a],n.timeDelta=a)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(ut(ut(ut({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function HL([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class Da extends HS{constructor(...t){super(...t),xt(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=tt.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=tt.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[jS(t)]:r.axisThreshold;n.axis=HL(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const VL=e=>e,my=.15,VS={enabled(e=!0){return e},eventOptions(e,t,n){return ut(ut({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[my,my];case!1:return[0,0];default:return tt.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return tt.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||VL},threshold(e){return tt.toVector(e,0)}},KL=0,oo=ut(ut({},VS),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=KL){return e},bounds(e={}){if(typeof e=="function")return a=>oo.bounds(e(a));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),vy={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class GL extends Da{constructor(...t){super(...t),xt(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=oo.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=Ad(t),r._pointerActive=!0,this.computeValues(ss(t)),this.computeInitial(),n.preventScrollAxis&&jS(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=Ad(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const a=ss(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=tt.sub(a,n._values),this.computeValues(a)),tt.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=Ad(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[a,l]=n._distance;if(n.tap=a<=r.tapsThreshold&&l<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[c,f]=n._delta,[h,p]=n._movement,[w,m]=r.swipe.velocity,[b,R]=r.swipe.distance,O=r.swipe.duration;if(n.elapsedTimew&&Math.abs(h)>b&&(n.swipe[0]=Math.sign(c)),_>m&&Math.abs(p)>R&&(n.swipe[1]=Math.sign(f))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,YL(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=vy[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,tt.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in vy&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function YL(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const $a=typeof window<"u"&&window.document&&window.document.createElement;function KS(){return $a&&"ontouchstart"in window}function XL(){return KS()||$a&&window.navigator.maxTouchPoints>1}function QL(){return $a&&"onpointerdown"in window}function ZL(){return $a&&"exitPointerLock"in window.document}function qL(){try{return"constructor"in GestureEvent}catch{return!1}}const Hn={isBrowser:$a,gesture:qL(),touch:KS(),touchscreen:XL(),pointer:QL(),pointerLock:ZL()},JL=250,eA=180,tA=.5,nA=50,rA=250,iA=10,yy={mouse:0,touch:0,pen:8},oA=ut(ut({},oo),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Hn.pointerLock,Hn.touch&&n?"touch":this.pointerLock?"mouse":Hn.pointer&&!o?"pointer":Hn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?JL:void 0,!(!Hn.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const a=tt.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:e=tA,distance:t=nA,duration:n=rA}={}){return{velocity:this.transform(tt.toVector(e)),distance:this.transform(tt.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return eA;case!1:return 0;default:return e}},axisThreshold(e){return e?ut(ut({},yy),e):yy},keyboardDisplacement(e=iA){return e}});function GS(e){const[t,n]=e.overflow,[r,o]=e._delta,[a,l]=e._direction;(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&o>0&&l<0||n>0&&o<0&&l>0)&&(e._movement[1]=e._movementBound[1])}const sA=30,aA=100;class lA extends HS{constructor(...t){super(...t),xt(this,"ingKey","pinching"),xt(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const t=this.state;t._touchIds=[],t.canceled=!1,t.cancel=this.cancel.bind(this),t.turns=0}computeOffset(){const{type:t,movement:n,lastOffset:r}=this.state;t==="wheel"?this.state.offset=tt.add(n,r):this.state.offset=[(1+n[0])*r[0],n[1]+r[1]]}computeMovement(){const{offset:t,lastOffset:n}=this.state;this.state.movement=[t[0]/n[0],t[1]-n[1]]}axisIntent(){const t=this.state,[n,r]=t._movement;if(!t.axis){const o=Math.abs(n)*sA-Math.abs(r);o<0?t.axis="angle":o>0&&(t.axis="scale")}}restrictToAxis(t){this.config.lockDirection&&(this.state.axis==="scale"?t[1]=0:this.state.axis==="angle"&&(t[0]=0))}cancel(){const t=this.state;t.canceled||setTimeout(()=>{t.canceled=!0,t._active=!1,this.compute(),this.emit()},0)}touchStart(t){this.ctrl.setEventIds(t);const n=this.state,r=this.ctrl.touchIds;if(n._active&&n._touchIds.every(a=>r.has(a))||r.size<2)return;this.start(t),n._touchIds=Array.from(r).slice(0,2);const o=dy(t,n._touchIds);o&&this.pinchStart(t,o)}pointerStart(t){if(t.buttons!=null&&t.buttons%2!==1)return;this.ctrl.setEventIds(t),t.target.setPointerCapture(t.pointerId);const n=this.state,r=n._pointerEvents,o=this.ctrl.pointerIds;if(n._active&&Array.from(r.keys()).every(l=>o.has(l))||(r.size<2&&r.set(t.pointerId,t),n._pointerEvents.size<2))return;this.start(t);const a=Xh(...Array.from(r.values()));a&&this.pinchStart(t,a)}pinchStart(t,n){const r=this.state;r.origin=n.origin,this.computeValues([n.distance,n.angle]),this.computeInitial(),this.compute(t),this.emit()}touchMove(t){if(!this.state._active)return;const n=dy(t,this.state._touchIds);n&&this.pinchMove(t,n)}pointerMove(t){const n=this.state._pointerEvents;if(n.has(t.pointerId)&&n.set(t.pointerId,t),!this.state._active)return;const r=Xh(...Array.from(n.values()));r&&this.pinchMove(t,r)}pinchMove(t,n){const r=this.state,o=r._values[1],a=n.angle-o;let l=0;Math.abs(a)>270&&(l+=Math.sign(a)),this.computeValues([n.distance,n.angle-360*l]),r.origin=n.origin,r.turns=l,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(t),this.emit()}touchEnd(t){this.ctrl.setEventIds(t),this.state._active&&this.state._touchIds.some(n=>!this.ctrl.touchIds.has(n))&&(this.state._active=!1,this.compute(t),this.emit())}pointerEnd(t){const n=this.state;this.ctrl.setEventIds(t);try{t.target.releasePointerCapture(t.pointerId)}catch{}n._pointerEvents.has(t.pointerId)&&n._pointerEvents.delete(t.pointerId),n._active&&n._pointerEvents.size<2&&(n._active=!1,this.compute(t),this.emit())}gestureStart(t){t.cancelable&&t.preventDefault();const n=this.state;n._active||(this.start(t),this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY],this.compute(t),this.emit())}gestureMove(t){if(t.cancelable&&t.preventDefault(),!this.state._active)return;const n=this.state;this.computeValues([t.scale,t.rotation]),n.origin=[t.clientX,t.clientY];const r=n._movement;n._movement=[t.scale-1,t.rotation],n._delta=tt.sub(n._movement,r),this.compute(t),this.emit()}gestureEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}wheel(t){const n=this.config.modifierKey;n&&(Array.isArray(n)?!n.find(r=>t[r]):!t[n])||(this.state._active?this.wheelChange(t):this.wheelStart(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(t){this.start(t),this.wheelChange(t)}wheelChange(t){"uv"in t||t.cancelable&&t.preventDefault();const r=this.state;r._delta=[-WS(t)[1]/aA*r.offset[0],0],tt.addTo(r._movement,r._delta),GS(r),this.state.origin=[t.clientX,t.clientY],this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){const n=this.config.device;n&&(t(n,"start",this[n+"Start"].bind(this)),t(n,"change",this[n+"Move"].bind(this)),t(n,"end",this[n+"End"].bind(this)),t(n,"cancel",this[n+"End"].bind(this)),t("lostPointerCapture","",this[n+"End"].bind(this))),this.config.pinchOnWheel&&t("wheel","",this.wheel.bind(this),{passive:!1})}}const uA=ut(ut({},VS),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Hn.touch&&Hn.gesture)return"gesture";if(Hn.touch&&r)return"touch";if(Hn.touchscreen){if(Hn.pointer)return"pointer";if(Hn.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=l=>{const c=gy(Ku(n,l),{min:-1/0,max:1/0});return[c.min,c.max]},a=l=>{const c=gy(Ku(r,l),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof n!="function"&&typeof r!="function"?[o(),a()]:l=>[o(l),a(l)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",tt.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});class cA extends Da{constructor(...t){super(...t),xt(this,"ingKey","moving")}move(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.state._active?this.moveChange(t):this.moveStart(t),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(t){this.start(t),this.computeValues(ss(t)),this.compute(t),this.computeInitial(),this.emit()}moveChange(t){if(!this.state._active)return;const n=ss(t),r=this.state;r._delta=tt.sub(n,r._values),tt.addTo(r._movement,r._delta),this.computeValues(n),this.compute(t),this.emit()}moveEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}bind(t){t("pointer","change",this.move.bind(this)),t("pointer","leave",this.moveEnd.bind(this))}}const fA=ut(ut({},oo),{},{mouseOnly:(e=!0)=>e});class dA extends Da{constructor(...t){super(...t),xt(this,"ingKey","scrolling")}scroll(t){this.state._active||this.start(t),this.scrollChange(t),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(t){t.cancelable&&t.preventDefault();const n=this.state,r=FL(t);n._delta=tt.sub(r,n._values),tt.addTo(n._movement,n._delta),this.computeValues(r),this.compute(t),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("scroll","",this.scroll.bind(this))}}const hA=oo;class pA extends Da{constructor(...t){super(...t),xt(this,"ingKey","wheeling")}wheel(t){this.state._active||this.start(t),this.wheelChange(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(t){const n=this.state;n._delta=WS(t),tt.addTo(n._movement,n._delta),GS(n),this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("wheel","",this.wheel.bind(this))}}const gA=oo;class mA extends Da{constructor(...t){super(...t),xt(this,"ingKey","hovering")}enter(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.start(t),this.computeValues(ss(t)),this.compute(t),this.emit())}leave(t){if(this.config.mouseOnly&&t.pointerType!=="mouse")return;const n=this.state;if(!n._active)return;n._active=!1;const r=ss(t);n._movement=n._delta=tt.sub(r,n._values),this.computeValues(r),this.compute(t),n.delta=n.movement,this.emit()}bind(t){t("pointer","enter",this.enter.bind(this)),t("pointer","leave",this.leave.bind(this))}}const vA=ut(ut({},oo),{},{mouseOnly:(e=!0)=>e}),sg=new Map,Qh=new Map;function yA(e){sg.set(e.key,e.engine),Qh.set(e.key,e.resolver)}const wA={key:"drag",engine:GL,resolver:oA},SA={key:"hover",engine:mA,resolver:vA},xA={key:"move",engine:cA,resolver:fA},_A={key:"pinch",engine:lA,resolver:uA},bA={key:"scroll",engine:dA,resolver:hA},kA={key:"wheel",engine:pA,resolver:gA};function CA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a=0)&&(n[o]=e[o]);return n}function EA(e,t){if(e==null)return{};var n=CA(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const TA={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Hn.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},RA=["target","eventOptions","window","enabled","transform"];function vu(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=vu(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function PA(e,t,n={}){const r=e,{target:o,eventOptions:a,window:l,enabled:c,transform:f}=r,h=EA(r,RA);if(n.shared=vu({target:o,eventOptions:a,window:l,enabled:c,transform:f},TA),t){const p=Qh.get(t);n[t]=vu(ut({shared:n.shared},h),p)}else for(const p in h){const w=Qh.get(p);w&&(n[p]=vu(ut({shared:n.shared},h[p]),w))}return n}class YS{constructor(t,n){xt(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,a){const l=this._listeners,c=IL(n,r),f=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},h=ut(ut({},f),a);t.addEventListener(c,o,h);const p=()=>{t.removeEventListener(c,o,h),l.delete(p)};return l.add(p),p}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class OA{constructor(){xt(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class LA{constructor(t){xt(this,"gestures",new Set),xt(this,"_targetEventStore",new YS(this)),xt(this,"gestureEventStores",{}),xt(this,"gestureTimeoutStores",{}),xt(this,"handlers",{}),xt(this,"config",{}),xt(this,"pointerIds",new Set),xt(this,"touchIds",new Set),xt(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),AA(this,t)}setEventIds(t){if($c(t))return this.touchIds=new Set(zL(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=PA(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const l of this.gestures){const c=this.config[l],f=wy(r,c.eventOptions,!!o);if(c.enabled){const h=sg.get(l);new h(this,t,l).bind(f)}}const a=wy(r,n.eventOptions,!!o);for(const l in this.nativeHandlers)a(l,"",c=>this.nativeHandlers[l](ut(ut({},this.state.shared),{},{event:c,args:t})),void 0,!0)}for(const a in r)r[a]=BL(...r[a]);if(!o)return r;for(const a in r){const{device:l,capture:c,passive:f}=$L(a);this._targetEventStore.add(o,l,"",r[a],{capture:c,passive:f})}}}}function Co(e,t){e.gestures.add(t),e.gestureEventStores[t]=new YS(e,t),e.gestureTimeoutStores[t]=new OA}function AA(e,t){t.drag&&Co(e,"drag"),t.wheel&&Co(e,"wheel"),t.scroll&&Co(e,"scroll"),t.move&&Co(e,"move"),t.pinch&&Co(e,"pinch"),t.hover&&Co(e,"hover")}const wy=(e,t,n)=>(r,o,a,l={},c=!1)=>{var f,h;const p=(f=l.capture)!==null&&f!==void 0?f:t.capture,w=(h=l.passive)!==null&&h!==void 0?h:t.passive;let m=c?r:AL(r,o,p);n&&w&&(m+="Passive"),e[m]=e[m]||[],e[m].push(a)},DA=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function $A(e){const t={},n={},r=new Set;for(let o in e)DA.test(o)?(r.add(RegExp.lastMatch),n[o]=e[o]):t[o]=e[o];return[n,t,r]}function Eo(e,t,n,r,o,a){if(!e.has(n)||!sg.has(r))return;const l=n+"Start",c=n+"End",f=h=>{let p;return h.first&&l in t&&t[l](h),n in t&&(p=t[n](h)),h.last&&c in t&&t[c](h),p};o[r]=f,a[r]=a[r]||{}}function IA(e,t){const[n,r,o]=$A(e),a={};return Eo(o,n,"onDrag","drag",a,t),Eo(o,n,"onWheel","wheel",a,t),Eo(o,n,"onScroll","scroll",a,t),Eo(o,n,"onPinch","pinch",a,t),Eo(o,n,"onMove","move",a,t),Eo(o,n,"onHover","hover",a,t),{handlers:a,config:t,nativeHandlers:r}}function NA(e,t={},n,r){const o=Wr.useMemo(()=>new LA(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),Wr.useEffect(o.effect.bind(o)),Wr.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function MA(e){return e.forEach(yA),function(n,r){const{handlers:o,nativeHandlers:a,config:l}=IA(n,r||{});return NA(o,l,void 0,a)}}function zA(e,t){return MA([wA,_A,bA,kA,xA,SA])(e,t||{})}var Ic={exports:{}},XS={},QS={exports:{}},FA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",UA=FA,jA=UA;function ZS(){}function qS(){}qS.resetWarningCache=ZS;var BA=function(){function e(r,o,a,l,c,f){if(f!==jA){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:qS,resetWarningCache:ZS};return n.PropTypes=n,n};QS.exports=BA();var JS=QS.exports;function ex(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;rt===n.identifier)||e.changedTouches&&(0,Pn.findInArray)(e.changedTouches,n=>t===n.identifier)}function cD(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function fD(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&ox(e.body,"react-draggable-transparent-selection")}function dD(e){if(e)try{if(e.body&&sx(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function ox(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function sx(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.canDragX=gD;Rr.canDragY=mD;Rr.createCoreData=yD;Rr.createDraggableData=wD;Rr.getBoundPosition=hD;Rr.getControlPosition=vD;Rr.snapToGrid=pD;var En=Tr,Vo=gt;function hD(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:SD(r);const o=lg(e);if(typeof r=="string"){const{ownerDocument:a}=o,l=a.defaultView;let c;if(r==="parent"?c=o.parentNode:c=a.querySelector(r),!(c instanceof l.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const f=c,h=l.getComputedStyle(o),p=l.getComputedStyle(f);r={left:-o.offsetLeft+(0,En.int)(p.paddingLeft)+(0,En.int)(h.marginLeft),top:-o.offsetTop+(0,En.int)(p.paddingTop)+(0,En.int)(h.marginTop),right:(0,Vo.innerWidth)(f)-(0,Vo.outerWidth)(o)-o.offsetLeft+(0,En.int)(p.paddingRight)-(0,En.int)(h.marginRight),bottom:(0,Vo.innerHeight)(f)-(0,Vo.outerHeight)(o)-o.offsetTop+(0,En.int)(p.paddingBottom)-(0,En.int)(h.marginBottom)}}return(0,En.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,En.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,En.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,En.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pD(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function gD(e){return e.props.axis==="both"||e.props.axis==="x"}function mD(e){return e.props.axis==="both"||e.props.axis==="y"}function vD(e,t,n){const r=typeof t=="number"?(0,Vo.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=lg(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Vo.offsetXYFromParent)(r||e,a,n.props.scale)}function yD(e,t,n){const r=!(0,En.isNum)(e.lastX),o=lg(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function wD(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function SD(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function lg(e){const t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}var Nc={},Mc={};Object.defineProperty(Mc,"__esModule",{value:!0});Mc.default=xD;function xD(){}Object.defineProperty(Nc,"__esModule",{value:!0});Nc.default=void 0;var $d=bD(j),cn=ug(JS),_D=ug(La),Vt=gt,li=Rr,Id=Tr,Fs=ug(Mc);function ug(e){return e&&e.__esModule?e:{default:e}}function ax(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ax=function(r){return r?n:t})(e)}function bD(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ax(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function qt(e,t,n){return t=kD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kD(e){var t=CD(e,"string");return typeof t=="symbol"?t:String(t)}function CD(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const lr={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ui=lr.mouse,zc=class extends $d.Component{constructor(){super(...arguments),qt(this,"dragging",!1),qt(this,"lastX",NaN),qt(this,"lastY",NaN),qt(this,"touchIdentifier",null),qt(this,"mounted",!1),qt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Vt.getTouchIdentifier)(t);this.touchIdentifier=o;const a=(0,li.getControlPosition)(t,o,this);if(a==null)return;const{x:l,y:c}=a,f=(0,li.createCoreData)(this,l,c);(0,Fs.default)("DraggableCore: handleDragStart: %j",f),(0,Fs.default)("calling",this.props.onStart),!(this.props.onStart(t,f)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Vt.addUserSelectStyles)(r),this.dragging=!0,this.lastX=l,this.lastY=c,(0,Vt.addEvent)(r,ui.move,this.handleDrag),(0,Vt.addEvent)(r,ui.stop,this.handleDragStop))}),qt(this,"handleDrag",t=>{const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let c=r-this.lastX,f=o-this.lastY;if([c,f]=(0,li.snapToGrid)(this.props.grid,c,f),!c&&!f)return;r=this.lastX+c,o=this.lastY+f}const a=(0,li.createCoreData)(this,r,o);if((0,Fs.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const f=document.createEvent("MouseEvents");f.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(f)}return}this.lastX=r,this.lastY=o}),qt(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let f=r-this.lastX||0,h=o-this.lastY||0;[f,h]=(0,li.snapToGrid)(this.props.grid,f,h),r=this.lastX+f,o=this.lastY+h}const a=(0,li.createCoreData)(this,r,o);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const c=this.findDOMNode();c&&this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(c.ownerDocument),(0,Fs.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,c&&((0,Fs.default)("DraggableCore: Removing handlers"),(0,Vt.removeEvent)(c.ownerDocument,ui.move,this.handleDrag),(0,Vt.removeEvent)(c.ownerDocument,ui.stop,this.handleDragStop))}),qt(this,"onMouseDown",t=>(ui=lr.mouse,this.handleDragStart(t))),qt(this,"onMouseUp",t=>(ui=lr.mouse,this.handleDragStop(t))),qt(this,"onTouchStart",t=>(ui=lr.touch,this.handleDragStart(t))),qt(this,"onTouchEnd",t=>(ui=lr.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Vt.addEvent)(t,lr.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Vt.removeEvent)(n,lr.mouse.move,this.handleDrag),(0,Vt.removeEvent)(n,lr.touch.move,this.handleDrag),(0,Vt.removeEvent)(n,lr.mouse.stop,this.handleDragStop),(0,Vt.removeEvent)(n,lr.touch.stop,this.handleDragStop),(0,Vt.removeEvent)(t,lr.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:_D.default.findDOMNode(this)}render(){return $d.cloneElement($d.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Nc.default=zc;qt(zc,"displayName","DraggableCore");qt(zc,"propTypes",{allowAnyClick:cn.default.bool,children:cn.default.node.isRequired,disabled:cn.default.bool,enableUserSelectHack:cn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:cn.default.arrayOf(cn.default.number),handle:cn.default.string,cancel:cn.default.string,nodeRef:cn.default.object,onStart:cn.default.func,onDrag:cn.default.func,onStop:cn.default.func,onMouseDown:cn.default.func,scale:cn.default.number,className:Id.dontSetMe,style:Id.dontSetMe,transform:Id.dontSetMe});qt(zc,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),e.default=void 0;var t=m(j),n=p(JS),r=p(La),o=p(HA),a=gt,l=Rr,c=Tr,f=p(Nc),h=p(Mc);function p(v){return v&&v.__esModule?v:{default:v}}function y(v){if(typeof WeakMap!="function")return null;var x=new WeakMap,C=new WeakMap;return(y=function(T){return T?C:x})(v)}function m(v,x){if(!x&&v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var C=y(x);if(C&&C.has(v))return C.get(v);var T={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var R in v)if(R!=="default"&&Object.prototype.hasOwnProperty.call(v,R)){var A=k?Object.getOwnPropertyDescriptor(v,R):null;A&&(A.get||A.set)?Object.defineProperty(T,R,A):T[R]=v[R]}return T.default=v,C&&C.set(v,T),T}function b(){return b=Object.assign?Object.assign.bind():function(v){for(var x=1;x{if((0,h.default)("Draggable: onDragStart: %j",T),this.props.onStart(C,(0,l.createDraggableData)(this,T))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),P(this,"onDrag",(C,T)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",T);const k=(0,l.createDraggableData)(this,T),R={x:k.x,y:k.y,slackX:0,slackY:0};if(this.props.bounds){const{x:W,y:Y}=R;R.x+=this.state.slackX,R.y+=this.state.slackY;const[te,de]=(0,l.getBoundPosition)(this,R.x,R.y);R.x=te,R.y=de,R.slackX=this.state.slackX+(W-R.x),R.slackY=this.state.slackY+(Y-R.y),k.x=R.x,k.y=R.y,k.deltaX=R.x-this.state.x,k.deltaY=R.y-this.state.y}if(this.props.onDrag(C,k)===!1)return!1;this.setState(R)}),P(this,"onDragStop",(C,T)=>{if(!this.state.dragging||this.props.onStop(C,(0,l.createDraggableData)(this,T))===!1)return!1;(0,h.default)("Draggable: onDragStop: %j",T);const R={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:W,y:Y}=this.props.position;R.x=W,R.y=Y}this.setState(R)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,C;return(x=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:C,children:T,defaultPosition:k,defaultClassName:R,defaultClassNameDragging:A,defaultClassNameDragged:W,position:Y,positionOffset:te,scale:de,...ve}=this.props;let ne={},ue=null;const ce=!!!Y||this.state.dragging,B=Y||k,M={x:(0,l.canDragX)(this)&&ce?this.state.x:B.x,y:(0,l.canDragY)(this)&&ce?this.state.y:B.y};this.state.isElementSVG?ue=(0,a.createSVGTransform)(M,te):ne=(0,a.createCSSTransform)(M,te);const F=(0,o.default)(T.props.className||"",R,{[A]:this.state.dragging,[W]:this.state.dragged});return t.createElement(f.default,b({},ve,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(T),{className:F,style:{...T.props.style,...ne},transform:ue}))}}e.default=_,P(_,"displayName","Draggable"),P(_,"propTypes",{...f.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),P(_,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(XS);const{default:lx,DraggableCore:ED}=XS;Ic.exports=lx;Ic.exports.default=lx;Ic.exports.DraggableCore=ED;var TD=Ic.exports;const RD=Jh(TD);var PD=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),St=globalThis&&globalThis.__assign||function(){return St=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof a>"u"?void 0:Number(a),minHeight:typeof l>"u"?void 0:Number(l)}},ND=function(e){return Array.isArray(e)?e:[e,e]},MD=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Ey="__resizable_base__",zD=function(e){AD(t,e);function t(n){var r,o,a,l,c=e.call(this,n)||this;return c.ratio=1,c.resizable=null,c.parentLeft=0,c.parentTop=0,c.resizableLeft=0,c.resizableRight=0,c.resizableTop=0,c.resizableBottom=0,c.targetLeft=0,c.targetTop=0,c.appendBase=function(){if(!c.resizable||!c.window)return null;var f=c.parentNode;if(!f)return null;var h=c.window.document.createElement("div");return h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.transform="scale(0, 0)",h.style.left="0",h.style.flex="0 0 100%",h.classList?h.classList.add(Ey):h.className+=Ey,f.appendChild(h),h},c.removeBase=function(f){var h=c.parentNode;h&&h.removeChild(f)},c.state={isResizing:!1,width:(o=(r=c.propsSize)===null||r===void 0?void 0:r.width)!==null&&o!==void 0?o:"auto",height:(l=(a=c.propsSize)===null||a===void 0?void 0:a.height)!==null&&l!==void 0?l:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},c.onResizeStart=c.onResizeStart.bind(c),c.onMouseMove=c.onMouseMove.bind(c),c.onMouseUp=c.onMouseUp.bind(c),c}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||DD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,a=this.resizable.offsetHeight,l=this.resizable.style.position;l!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:a,this.resizable.style.position=l}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(c){var f;if(typeof n.state[c]>"u"||n.state[c]==="auto")return"auto";if(n.propsSize&&n.propsSize[c]&&(!((f=n.propsSize[c])===null||f===void 0)&&f.toString().endsWith("%"))){if(n.state[c].toString().endsWith("%"))return n.state[c].toString();var h=n.getParentSize(),p=Number(n.state[c].toString().replace("px","")),y=p/h[c]*100;return y+"%"}return Nd(n.state[c])},a=r&&typeof r.width<"u"&&!this.state.isResizing?Nd(r.width):o("width"),l=r&&typeof r.height<"u"&&!this.state.isResizing?Nd(r.height):o("height");return{width:a,height:l}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var a={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),a},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,a=this.state.direction,l=o&&To("left",a),c=o&&To("top",a),f,h;if(this.props.bounds==="parent"){var p=this.parentNode;p&&(f=l?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),h=c?this.resizableBottom-this.parentTop:p.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=l?this.resizableRight:this.window.innerWidth-this.resizableLeft,h=c?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=l?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),h=c?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n"u"?10:a.width,y=typeof o.width>"u"||o.width<0?n:o.width,m=typeof a.height>"u"?10:a.height,b=typeof o.height>"u"||o.height<0?r:o.height,P=f||0,O=h||0;if(c){var N=(m-P)*this.ratio+O,_=(b-P)*this.ratio+O,v=(p-O)/this.ratio+P,x=(y-O)/this.ratio+P,C=Math.max(p,N),T=Math.min(y,_),k=Math.max(m,v),R=Math.min(b,x);n=Zl(n,C,T),r=Zl(r,k,R)}else n=Zl(n,p,y),r=Zl(r,m,b);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){var n=1/(this.props.scale||1);if(this.props.bounds==="parent"){var r=this.parentNode;if(r){var o=r.getBoundingClientRect();this.parentLeft=o.left*n,this.parentTop=o.top*n}}if(this.props.bounds&&typeof this.props.bounds!="string"){var a=this.props.bounds.getBoundingClientRect();this.targetLeft=a.left*n,this.targetTop=a.top*n}if(this.resizable){var l=this.resizable.getBoundingClientRect(),c=l.left,f=l.top,h=l.right,p=l.bottom;this.resizableLeft=c*n,this.resizableRight=h*n,this.resizableTop=f*n,this.resizableBottom=p*n}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,a=0;if(n.nativeEvent&&$D(n.nativeEvent)?(o=n.nativeEvent.clientX,a=n.nativeEvent.clientY):n.nativeEvent&&ql(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,a=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var l=this.props.onResizeStart(n,r,this.resizable);if(l===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var c,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var h=this.parentNode;if(h){var p=this.window.getComputedStyle(h).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",c=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var y={original:{x:o,y:a,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:c};this.setState(y)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&ql(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,a=o.maxWidth,l=o.maxHeight,c=o.minWidth,f=o.minHeight,h=ql(n)?n.touches[0].clientX:n.clientX,p=ql(n)?n.touches[0].clientY:n.clientY,y=this.state,m=y.direction,b=y.original,P=y.width,O=y.height,N=this.getParentSize(),_=ID(N,this.window.innerWidth,this.window.innerHeight,a,l,c,f);a=_.maxWidth,l=_.maxHeight,c=_.minWidth,f=_.minHeight;var v=this.calculateNewSizeFromDirection(h,p),x=v.newHeight,C=v.newWidth,T=this.calculateNewMaxFromBoundary(a,l);this.props.snap&&this.props.snap.x&&(C=Cy(C,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(x=Cy(x,this.props.snap.y,this.props.snapGap));var k=this.calculateNewSizeFromAspectRatio(C,x,{width:T.maxWidth,height:T.maxHeight},{width:c,height:f});if(C=k.newWidth,x=k.newHeight,this.props.grid){var R=ky(C,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),A=ky(x,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),W=this.props.snapGap||0,Y=W===0||Math.abs(R-C)<=W?R:C,te=W===0||Math.abs(A-x)<=W?A:x;C=Y,x=te}var de={width:C-b.width,height:x-b.height};if(P&&typeof P=="string"){if(P.endsWith("%")){var ve=C/N.width*100;C=ve+"%"}else if(P.endsWith("vw")){var ne=C/this.window.innerWidth*100;C=ne+"vw"}else if(P.endsWith("vh")){var ue=C/this.window.innerHeight*100;C=ue+"vh"}}if(O&&typeof O=="string"){if(O.endsWith("%")){var ve=x/N.height*100;x=ve+"%"}else if(O.endsWith("vw")){var ne=x/this.window.innerWidth*100;x=ne+"vw"}else if(O.endsWith("vh")){var ue=x/this.window.innerHeight*100;x=ue+"vh"}}var he={width:this.createSizeForCssProperty(C,"width"),height:this.createSizeForCssProperty(x,"height")};this.flexDir==="row"?he.flexBasis=he.width:this.flexDir==="column"&&(he.flexBasis=he.height);var ce=this.state.width!==he.width,B=this.state.height!==he.height,M=this.state.flexBasis!==he.flexBasis,F=ce||B||M;F&&La.flushSync(function(){r.setState(he)}),this.props.onResize&&F&&this.props.onResize(n,m,this.resizable,de)}},t.prototype.onMouseUp=function(n){var r,o,a=this.state,l=a.isResizing,c=a.direction,f=a.original;if(!(!l||!this.resizable)){var h={width:this.size.width-f.width,height:this.size.height-f.height};this.props.onResizeStop&&this.props.onResizeStop(n,c,this.resizable,h),this.props.size&&this.setState({width:(r=this.props.size.width)!==null&&r!==void 0?r:"auto",height:(o=this.props.size.height)!==null&&o!==void 0?o:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){var r,o;this.setState({width:(r=n.width)!==null&&r!==void 0?r:"auto",height:(o=n.height)!==null&&o!==void 0?o:"auto"})},t.prototype.renderResizer=function(n){var r=this,o=this.props,a=o.enable,l=o.handleStyles,c=o.handleClasses,f=o.handleWrapperStyle,h=o.handleWrapperClass,p=o.handleComponent;if(!a)return null;var y=n.filter(function(m){return a[m]!==!1}).map(function(m){return a[m]!==!1?j.createElement(LD,{key:m,direction:m,onResizeStart:r.onResizeStart,replaceStyles:l&&l[m],className:c&&c[m]},p&&p[m]?p[m]:null):null});return j.createElement("div",{className:h,style:f},y)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(l,c){return MD.indexOf(c)!==-1||(l[c]=n.props[c]),l},{}),o=xr(xr(xr({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var a=this.props.as||"div";return j.createElement(a,xr({style:o,className:this.props.className},r,{ref:function(l){l&&(n.resizable=l)}}),this.state.isResizing&&j.createElement("div",{style:this.state.backgroundStyle}),this.renderResizer(["topLeft","top","topRight","left"]),this.props.children,this.renderResizer(["right","bottomLeft","bottom","bottomRight"]))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(j.PureComponent);/*! ***************************************************************************** +`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&ox(e.body,"react-draggable-transparent-selection")}function dD(e){if(e)try{if(e.body&&sx(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function ox(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function sx(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.canDragX=gD;Rr.canDragY=mD;Rr.createCoreData=yD;Rr.createDraggableData=wD;Rr.getBoundPosition=hD;Rr.getControlPosition=vD;Rr.snapToGrid=pD;var Cn=Tr,Vo=gt;function hD(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:SD(r);const o=lg(e);if(typeof r=="string"){const{ownerDocument:a}=o,l=a.defaultView;let c;if(r==="parent"?c=o.parentNode:c=a.querySelector(r),!(c instanceof l.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const f=c,h=l.getComputedStyle(o),p=l.getComputedStyle(f);r={left:-o.offsetLeft+(0,Cn.int)(p.paddingLeft)+(0,Cn.int)(h.marginLeft),top:-o.offsetTop+(0,Cn.int)(p.paddingTop)+(0,Cn.int)(h.marginTop),right:(0,Vo.innerWidth)(f)-(0,Vo.outerWidth)(o)-o.offsetLeft+(0,Cn.int)(p.paddingRight)-(0,Cn.int)(h.marginRight),bottom:(0,Vo.innerHeight)(f)-(0,Vo.outerHeight)(o)-o.offsetTop+(0,Cn.int)(p.paddingBottom)-(0,Cn.int)(h.marginBottom)}}return(0,Cn.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Cn.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Cn.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Cn.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pD(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function gD(e){return e.props.axis==="both"||e.props.axis==="x"}function mD(e){return e.props.axis==="both"||e.props.axis==="y"}function vD(e,t,n){const r=typeof t=="number"?(0,Vo.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=lg(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Vo.offsetXYFromParent)(r||e,a,n.props.scale)}function yD(e,t,n){const r=!(0,Cn.isNum)(e.lastX),o=lg(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function wD(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function SD(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function lg(e){const t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}var Nc={},Mc={};Object.defineProperty(Mc,"__esModule",{value:!0});Mc.default=xD;function xD(){}Object.defineProperty(Nc,"__esModule",{value:!0});Nc.default=void 0;var $d=bD(j),un=ug(JS),_D=ug(La),Vt=gt,li=Rr,Id=Tr,Fs=ug(Mc);function ug(e){return e&&e.__esModule?e:{default:e}}function ax(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ax=function(r){return r?n:t})(e)}function bD(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ax(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function qt(e,t,n){return t=kD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kD(e){var t=CD(e,"string");return typeof t=="symbol"?t:String(t)}function CD(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const ar={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ui=ar.mouse,zc=class extends $d.Component{constructor(){super(...arguments),qt(this,"dragging",!1),qt(this,"lastX",NaN),qt(this,"lastY",NaN),qt(this,"touchIdentifier",null),qt(this,"mounted",!1),qt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Vt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Vt.getTouchIdentifier)(t);this.touchIdentifier=o;const a=(0,li.getControlPosition)(t,o,this);if(a==null)return;const{x:l,y:c}=a,f=(0,li.createCoreData)(this,l,c);(0,Fs.default)("DraggableCore: handleDragStart: %j",f),(0,Fs.default)("calling",this.props.onStart),!(this.props.onStart(t,f)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Vt.addUserSelectStyles)(r),this.dragging=!0,this.lastX=l,this.lastY=c,(0,Vt.addEvent)(r,ui.move,this.handleDrag),(0,Vt.addEvent)(r,ui.stop,this.handleDragStop))}),qt(this,"handleDrag",t=>{const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let c=r-this.lastX,f=o-this.lastY;if([c,f]=(0,li.snapToGrid)(this.props.grid,c,f),!c&&!f)return;r=this.lastX+c,o=this.lastY+f}const a=(0,li.createCoreData)(this,r,o);if((0,Fs.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const f=document.createEvent("MouseEvents");f.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(f)}return}this.lastX=r,this.lastY=o}),qt(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,li.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let f=r-this.lastX||0,h=o-this.lastY||0;[f,h]=(0,li.snapToGrid)(this.props.grid,f,h),r=this.lastX+f,o=this.lastY+h}const a=(0,li.createCoreData)(this,r,o);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const c=this.findDOMNode();c&&this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(c.ownerDocument),(0,Fs.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,c&&((0,Fs.default)("DraggableCore: Removing handlers"),(0,Vt.removeEvent)(c.ownerDocument,ui.move,this.handleDrag),(0,Vt.removeEvent)(c.ownerDocument,ui.stop,this.handleDragStop))}),qt(this,"onMouseDown",t=>(ui=ar.mouse,this.handleDragStart(t))),qt(this,"onMouseUp",t=>(ui=ar.mouse,this.handleDragStop(t))),qt(this,"onTouchStart",t=>(ui=ar.touch,this.handleDragStart(t))),qt(this,"onTouchEnd",t=>(ui=ar.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Vt.addEvent)(t,ar.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Vt.removeEvent)(n,ar.mouse.move,this.handleDrag),(0,Vt.removeEvent)(n,ar.touch.move,this.handleDrag),(0,Vt.removeEvent)(n,ar.mouse.stop,this.handleDragStop),(0,Vt.removeEvent)(n,ar.touch.stop,this.handleDragStop),(0,Vt.removeEvent)(t,ar.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Vt.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:_D.default.findDOMNode(this)}render(){return $d.cloneElement($d.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Nc.default=zc;qt(zc,"displayName","DraggableCore");qt(zc,"propTypes",{allowAnyClick:un.default.bool,children:un.default.node.isRequired,disabled:un.default.bool,enableUserSelectHack:un.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:un.default.arrayOf(un.default.number),handle:un.default.string,cancel:un.default.string,nodeRef:un.default.object,onStart:un.default.func,onDrag:un.default.func,onStop:un.default.func,onMouseDown:un.default.func,scale:un.default.number,className:Id.dontSetMe,style:Id.dontSetMe,transform:Id.dontSetMe});qt(zc,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),e.default=void 0;var t=m(j),n=p(JS),r=p(La),o=p(HA),a=gt,l=Rr,c=Tr,f=p(Nc),h=p(Mc);function p(v){return v&&v.__esModule?v:{default:v}}function w(v){if(typeof WeakMap!="function")return null;var x=new WeakMap,C=new WeakMap;return(w=function(k){return k?C:x})(v)}function m(v,x){if(!x&&v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var C=w(x);if(C&&C.has(v))return C.get(v);var k={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in v)if(P!=="default"&&Object.prototype.hasOwnProperty.call(v,P)){var A=E?Object.getOwnPropertyDescriptor(v,P):null;A&&(A.get||A.set)?Object.defineProperty(k,P,A):k[P]=v[P]}return k.default=v,C&&C.set(v,k),k}function b(){return b=Object.assign?Object.assign.bind():function(v){for(var x=1;x{if((0,h.default)("Draggable: onDragStart: %j",k),this.props.onStart(C,(0,l.createDraggableData)(this,k))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),R(this,"onDrag",(C,k)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",k);const E=(0,l.createDraggableData)(this,k),P={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:V,y:Q}=P;P.x+=this.state.slackX,P.y+=this.state.slackY;const[te,he]=(0,l.getBoundPosition)(this,P.x,P.y);P.x=te,P.y=he,P.slackX=this.state.slackX+(V-P.x),P.slackY=this.state.slackY+(Q-P.y),E.x=P.x,E.y=P.y,E.deltaX=P.x-this.state.x,E.deltaY=P.y-this.state.y}if(this.props.onDrag(C,E)===!1)return!1;this.setState(P)}),R(this,"onDragStop",(C,k)=>{if(!this.state.dragging||this.props.onStop(C,(0,l.createDraggableData)(this,k))===!1)return!1;(0,h.default)("Draggable: onDragStop: %j",k);const P={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:V,y:Q}=this.props.position;P.x=V,P.y=Q}this.setState(P)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,C;return(x=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:C,children:k,defaultPosition:E,defaultClassName:P,defaultClassNameDragging:A,defaultClassNameDragged:V,position:Q,positionOffset:te,scale:he,...ve}=this.props;let re={},ue=null;const ce=!!!Q||this.state.dragging,B=Q||E,M={x:(0,l.canDragX)(this)&&ce?this.state.x:B.x,y:(0,l.canDragY)(this)&&ce?this.state.y:B.y};this.state.isElementSVG?ue=(0,a.createSVGTransform)(M,te):re=(0,a.createCSSTransform)(M,te);const F=(0,o.default)(k.props.className||"",P,{[A]:this.state.dragging,[V]:this.state.dragged});return t.createElement(f.default,b({},ve,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(k),{className:F,style:{...k.props.style,...re},transform:ue}))}}e.default=_,R(_,"displayName","Draggable"),R(_,"propTypes",{...f.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),R(_,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(XS);const{default:lx,DraggableCore:ED}=XS;Ic.exports=lx;Ic.exports.default=lx;Ic.exports.DraggableCore=ED;var TD=Ic.exports;const RD=Jh(TD);var PD=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),St=globalThis&&globalThis.__assign||function(){return St=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof a>"u"?void 0:Number(a),minHeight:typeof l>"u"?void 0:Number(l)}},ND=function(e){return Array.isArray(e)?e:[e,e]},MD=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Ey="__resizable_base__",zD=function(e){AD(t,e);function t(n){var r,o,a,l,c=e.call(this,n)||this;return c.ratio=1,c.resizable=null,c.parentLeft=0,c.parentTop=0,c.resizableLeft=0,c.resizableRight=0,c.resizableTop=0,c.resizableBottom=0,c.targetLeft=0,c.targetTop=0,c.appendBase=function(){if(!c.resizable||!c.window)return null;var f=c.parentNode;if(!f)return null;var h=c.window.document.createElement("div");return h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.transform="scale(0, 0)",h.style.left="0",h.style.flex="0 0 100%",h.classList?h.classList.add(Ey):h.className+=Ey,f.appendChild(h),h},c.removeBase=function(f){var h=c.parentNode;h&&h.removeChild(f)},c.state={isResizing:!1,width:(o=(r=c.propsSize)===null||r===void 0?void 0:r.width)!==null&&o!==void 0?o:"auto",height:(l=(a=c.propsSize)===null||a===void 0?void 0:a.height)!==null&&l!==void 0?l:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},c.onResizeStart=c.onResizeStart.bind(c),c.onMouseMove=c.onMouseMove.bind(c),c.onMouseUp=c.onMouseUp.bind(c),c}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||DD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,a=this.resizable.offsetHeight,l=this.resizable.style.position;l!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:a,this.resizable.style.position=l}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(c){var f;if(typeof n.state[c]>"u"||n.state[c]==="auto")return"auto";if(n.propsSize&&n.propsSize[c]&&(!((f=n.propsSize[c])===null||f===void 0)&&f.toString().endsWith("%"))){if(n.state[c].toString().endsWith("%"))return n.state[c].toString();var h=n.getParentSize(),p=Number(n.state[c].toString().replace("px","")),w=p/h[c]*100;return w+"%"}return Nd(n.state[c])},a=r&&typeof r.width<"u"&&!this.state.isResizing?Nd(r.width):o("width"),l=r&&typeof r.height<"u"&&!this.state.isResizing?Nd(r.height):o("height");return{width:a,height:l}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var a={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),a},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,a=this.state.direction,l=o&&To("left",a),c=o&&To("top",a),f,h;if(this.props.bounds==="parent"){var p=this.parentNode;p&&(f=l?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),h=c?this.resizableBottom-this.parentTop:p.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=l?this.resizableRight:this.window.innerWidth-this.resizableLeft,h=c?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=l?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),h=c?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n"u"?10:a.width,w=typeof o.width>"u"||o.width<0?n:o.width,m=typeof a.height>"u"?10:a.height,b=typeof o.height>"u"||o.height<0?r:o.height,R=f||0,O=h||0;if(c){var N=(m-R)*this.ratio+O,_=(b-R)*this.ratio+O,v=(p-O)/this.ratio+R,x=(w-O)/this.ratio+R,C=Math.max(p,N),k=Math.min(w,_),E=Math.max(m,v),P=Math.min(b,x);n=Zl(n,C,k),r=Zl(r,E,P)}else n=Zl(n,p,w),r=Zl(r,m,b);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){var n=1/(this.props.scale||1);if(this.props.bounds==="parent"){var r=this.parentNode;if(r){var o=r.getBoundingClientRect();this.parentLeft=o.left*n,this.parentTop=o.top*n}}if(this.props.bounds&&typeof this.props.bounds!="string"){var a=this.props.bounds.getBoundingClientRect();this.targetLeft=a.left*n,this.targetTop=a.top*n}if(this.resizable){var l=this.resizable.getBoundingClientRect(),c=l.left,f=l.top,h=l.right,p=l.bottom;this.resizableLeft=c*n,this.resizableRight=h*n,this.resizableTop=f*n,this.resizableBottom=p*n}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,a=0;if(n.nativeEvent&&$D(n.nativeEvent)?(o=n.nativeEvent.clientX,a=n.nativeEvent.clientY):n.nativeEvent&&ql(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,a=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var l=this.props.onResizeStart(n,r,this.resizable);if(l===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var c,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var h=this.parentNode;if(h){var p=this.window.getComputedStyle(h).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",c=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var w={original:{x:o,y:a,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:c};this.setState(w)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&ql(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,a=o.maxWidth,l=o.maxHeight,c=o.minWidth,f=o.minHeight,h=ql(n)?n.touches[0].clientX:n.clientX,p=ql(n)?n.touches[0].clientY:n.clientY,w=this.state,m=w.direction,b=w.original,R=w.width,O=w.height,N=this.getParentSize(),_=ID(N,this.window.innerWidth,this.window.innerHeight,a,l,c,f);a=_.maxWidth,l=_.maxHeight,c=_.minWidth,f=_.minHeight;var v=this.calculateNewSizeFromDirection(h,p),x=v.newHeight,C=v.newWidth,k=this.calculateNewMaxFromBoundary(a,l);this.props.snap&&this.props.snap.x&&(C=Cy(C,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(x=Cy(x,this.props.snap.y,this.props.snapGap));var E=this.calculateNewSizeFromAspectRatio(C,x,{width:k.maxWidth,height:k.maxHeight},{width:c,height:f});if(C=E.newWidth,x=E.newHeight,this.props.grid){var P=ky(C,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),A=ky(x,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),V=this.props.snapGap||0,Q=V===0||Math.abs(P-C)<=V?P:C,te=V===0||Math.abs(A-x)<=V?A:x;C=Q,x=te}var he={width:C-b.width,height:x-b.height};if(R&&typeof R=="string"){if(R.endsWith("%")){var ve=C/N.width*100;C=ve+"%"}else if(R.endsWith("vw")){var re=C/this.window.innerWidth*100;C=re+"vw"}else if(R.endsWith("vh")){var ue=C/this.window.innerHeight*100;C=ue+"vh"}}if(O&&typeof O=="string"){if(O.endsWith("%")){var ve=x/N.height*100;x=ve+"%"}else if(O.endsWith("vw")){var re=x/this.window.innerWidth*100;x=re+"vw"}else if(O.endsWith("vh")){var ue=x/this.window.innerHeight*100;x=ue+"vh"}}var de={width:this.createSizeForCssProperty(C,"width"),height:this.createSizeForCssProperty(x,"height")};this.flexDir==="row"?de.flexBasis=de.width:this.flexDir==="column"&&(de.flexBasis=de.height);var ce=this.state.width!==de.width,B=this.state.height!==de.height,M=this.state.flexBasis!==de.flexBasis,F=ce||B||M;F&&La.flushSync(function(){r.setState(de)}),this.props.onResize&&F&&this.props.onResize(n,m,this.resizable,he)}},t.prototype.onMouseUp=function(n){var r,o,a=this.state,l=a.isResizing,c=a.direction,f=a.original;if(!(!l||!this.resizable)){var h={width:this.size.width-f.width,height:this.size.height-f.height};this.props.onResizeStop&&this.props.onResizeStop(n,c,this.resizable,h),this.props.size&&this.setState({width:(r=this.props.size.width)!==null&&r!==void 0?r:"auto",height:(o=this.props.size.height)!==null&&o!==void 0?o:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:xr(xr({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){var r,o;this.setState({width:(r=n.width)!==null&&r!==void 0?r:"auto",height:(o=n.height)!==null&&o!==void 0?o:"auto"})},t.prototype.renderResizer=function(n){var r=this,o=this.props,a=o.enable,l=o.handleStyles,c=o.handleClasses,f=o.handleWrapperStyle,h=o.handleWrapperClass,p=o.handleComponent;if(!a)return null;var w=n.filter(function(m){return a[m]!==!1}).map(function(m){return a[m]!==!1?j.createElement(LD,{key:m,direction:m,onResizeStart:r.onResizeStart,replaceStyles:l&&l[m],className:c&&c[m]},p&&p[m]?p[m]:null):null});return j.createElement("div",{className:h,style:f},w)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(l,c){return MD.indexOf(c)!==-1||(l[c]=n.props[c]),l},{}),o=xr(xr(xr({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var a=this.props.as||"div";return j.createElement(a,xr({style:o,className:this.props.className},r,{ref:function(l){l&&(n.resizable=l)}}),this.state.isResizing&&j.createElement("div",{style:this.state.backgroundStyle}),this.renderResizer(["topLeft","top","topRight","left"]),this.props.children,this.renderResizer(["right","bottomLeft","bottom","bottomRight"]))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(j.PureComponent);/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the @@ -97,15 +97,15 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. -***************************************************************************** */var Zh=function(e,t){return Zh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Zh(e,t)};function FD(e,t){Zh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,r=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:n,maxHeight:r}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/r;case"body":return document.body.offsetHeight/r;default:return n.offsetHeight}},t.prototype.getOffsetWidth=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/r;case"body":return document.body.offsetWidth/r;default:return n.offsetWidth}},t.prototype.onDragStart=function(n,r){this.props.onDragStart&&this.props.onDragStart(n,r);var o=this.getDraggablePosition();if(this.originalPosition=o,!!this.props.bounds){var a=this.getParent(),l=this.props.scale,c;if(this.props.bounds==="parent")c=a;else if(this.props.bounds==="body"){var f=a.getBoundingClientRect(),h=f.left,p=f.top,y=document.body.getBoundingClientRect(),m=-(h-a.offsetLeft*l-y.left)/l,b=-(p-a.offsetTop*l-y.top)/l,P=(document.body.offsetWidth-this.resizable.size.width*l)/l+m,O=(document.body.offsetHeight-this.resizable.size.height*l)/l+b;return this.setState({bounds:{top:b,right:P,bottom:O,left:m}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var N=a.getBoundingClientRect(),_=N.left,v=N.top,x=-(_-a.offsetLeft*l)/l,C=-(v-a.offsetTop*l)/l,P=(window.innerWidth-this.resizable.size.width*l)/l+x,O=(window.innerHeight-this.resizable.size.height*l)/l+C;return this.setState({bounds:{top:C,right:P,bottom:O,left:x}})}else typeof this.props.bounds=="string"?c=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(c=this.props.bounds);if(!(!(c instanceof HTMLElement)||!(a instanceof HTMLElement))){var T=c.getBoundingClientRect(),k=T.left,R=T.top,A=a.getBoundingClientRect(),W=A.left,Y=A.top,te=(k-W)/l,de=R-Y;if(this.resizable){this.updateOffsetFromParent();var ve=this.offsetFromParent;this.setState({bounds:{top:de-ve.top,right:te+(c.offsetWidth-this.resizable.size.width)-ve.left/l,bottom:de+(c.offsetHeight-this.resizable.size.height)-ve.top,left:te-ve.left/l}})}}}},t.prototype.onDrag=function(n,r){if(this.props.onDrag){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(n,Ct(Ct({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDrag(n,Ct(Ct({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(n,Ct(Ct({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onDragStop=function(n,r){if(this.props.onDragStop){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(n,Ct(Ct({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDragStop(n,Ct(Ct({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(n,Ct(Ct({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onResizeStart=function(n,r,o){n.stopPropagation(),this.setState({resizing:!0});var a=this.props.scale,l=this.offsetFromParent,c=this.getDraggablePosition();if(this.resizingPosition={x:c.x+l.left,y:c.y+l.top},this.originalPosition=c,this.props.bounds){var f=this.getParent(),h=void 0;this.props.bounds==="parent"?h=f:this.props.bounds==="body"?h=document.body:this.props.bounds==="window"?h=window:typeof this.props.bounds=="string"?h=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(h=this.props.bounds);var p=this.getSelfElement();if(p instanceof Element&&(h instanceof HTMLElement||h===window)&&f instanceof HTMLElement){var y=this.getMaxSizesFromProps(),m=y.maxWidth,b=y.maxHeight,P=this.getParentSize();if(m&&typeof m=="string")if(m.endsWith("%")){var O=Number(m.replace("%",""))/100;m=P.width*O}else m.endsWith("px")&&(m=Number(m.replace("px","")));if(b&&typeof b=="string")if(b.endsWith("%")){var O=Number(b.replace("%",""))/100;b=P.height*O}else b.endsWith("px")&&(b=Number(b.replace("px","")));var N=p.getBoundingClientRect(),_=N.left,v=N.top,x=this.props.bounds==="window"?{left:0,top:0}:h.getBoundingClientRect(),C=x.left,T=x.top,k=this.getOffsetWidth(h),R=this.getOffsetHeight(h),A=r.toLowerCase().endsWith("left"),W=r.toLowerCase().endsWith("right"),Y=r.startsWith("top"),te=r.startsWith("bottom");if((A||Y)&&this.resizable){var de=(_-C)/a+this.resizable.size.width;this.setState({maxWidth:de>Number(m)?m:de})}if(W||this.props.lockAspectRatio&&!A&&!Y){var de=k+(C-_)/a;this.setState({maxWidth:de>Number(m)?m:de})}if((Y||A)&&this.resizable){var de=(v-T)/a+this.resizable.size.height;this.setState({maxHeight:de>Number(b)?b:de})}if(te||this.props.lockAspectRatio&&!Y&&!A){var de=R+(T-v)/a;this.setState({maxHeight:de>Number(b)?b:de})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(n,r,o)},t.prototype.onResize=function(n,r,o,a){var l=this,c={x:this.originalPosition.x,y:this.originalPosition.y},f=-a.width,h=-a.height,p=["top","left","topLeft","bottomLeft","topRight"];p.includes(r)&&(r==="bottomLeft"?c.x+=f:(r==="topRight"||(c.x+=f),c.y+=h));var y=this.draggable.state;(c.x!==y.x||c.y!==y.y)&&La.flushSync(function(){l.draggable.setState(c)}),this.updateOffsetFromParent();var m=this.offsetFromParent,b=this.getDraggablePosition().x+m.left,P=this.getDraggablePosition().y+m.top;this.resizingPosition={x:b,y:P},this.props.onResize&&this.props.onResize(n,r,o,a,{x:b,y:P})},t.prototype.onResizeStop=function(n,r,o,a){this.setState({resizing:!1});var l=this.getMaxSizesFromProps(),c=l.maxWidth,f=l.maxHeight;this.setState({maxWidth:c,maxHeight:f}),this.props.onResizeStop&&this.props.onResizeStop(n,r,o,a,this.resizingPosition)},t.prototype.updateSize=function(n){this.resizable&&this.resizable.updateSize({width:n.width,height:n.height})},t.prototype.updatePosition=function(n){this.draggable.setState(n)},t.prototype.updateOffsetFromParent=function(){var n=this.props.scale,r=this.getParent(),o=this.getSelfElement();if(!r||o===null)return{top:0,left:0};var a=r.getBoundingClientRect(),l=a.left,c=a.top,f=o.getBoundingClientRect(),h=this.getDraggablePosition(),p=r.scrollLeft,y=r.scrollTop;this.offsetFromParent={left:f.left-l+p-h.x*n,top:f.top-c+y-h.y*n}},t.prototype.render=function(){var n=this,r=this.props,o=r.disableDragging,a=r.style,l=r.dragHandleClassName,c=r.position,f=r.onMouseDown,h=r.onMouseUp,p=r.dragAxis,y=r.dragGrid,m=r.bounds,b=r.enableUserSelectHack,P=r.cancel,O=r.children;r.onResizeStart,r.onResize,r.onResizeStop,r.onDragStart,r.onDrag,r.onDragStop;var N=r.resizeHandleStyles,_=r.resizeHandleClasses,v=r.resizeHandleComponent,x=r.enableResizing,C=r.resizeGrid,T=r.resizeHandleWrapperClass,k=r.resizeHandleWrapperStyle,R=r.scale,A=r.allowAnyClick,W=UD(r,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick"]),Y=this.props.default?Ct({},this.props.default):void 0;delete W.default;var te=o||l?{cursor:"auto"}:{cursor:"move"},de=Ct(Ct(Ct({},jD),te),a),ve=this.offsetFromParent,ne=ve.left,ue=ve.top,he;c&&(he={x:c.x-ne,y:c.y-ue});var ce=this.state.resizing?void 0:he,B=this.state.resizing?"both":p;return j.createElement(RD,{ref:function(M){M&&(n.draggable=M)},handle:l?".".concat(l):void 0,defaultPosition:Y,onMouseDown:f,onMouseUp:h,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:B,disabled:o,grid:y,bounds:m?this.state.bounds:void 0,position:ce,enableUserSelectHack:b,cancel:P,scale:R,allowAnyClick:A,nodeRef:this.resizableElement},j.createElement(zD,Ct({},W,{ref:function(M){M&&(n.resizable=M,n.resizableElement.current=M.resizable)},defaultSize:Y,size:this.props.size,enable:typeof x=="boolean"?BD(x):x,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:de,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:C,handleWrapperClass:T,handleWrapperStyle:k,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:N,handleClasses:_,handleComponent:v,scale:this.props.scale}),O))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(j.PureComponent);const Se={white:"#ffffff",black:"#000000",primary:"#BA2626",primaryLight:"#f08080",secondary:"#8A0000",secondaryLight:"#ff6b6b",tertiary:"#DD0003",tertiaryLight:"#ff9999",quaternary:"#ff8000",quaternaryLight:"#ffb36b",desactivat:"#c6c6c6",desactivatLight:"#e5e5e5",background:"#f8f8f8",secondaryBackground:"#ffffff",border:"#c7c5c5",accent:"#3d3df7",accentLight:"#6a6af8",text:"#333333",timeline:"#ffe8cc"},vn={fontFamily:"Open Sans,Helvetica,Arial,sans-serif",fontSize:{small:"12px",medium:"14px",large:"16px"}},Lt=ae.button` +***************************************************************************** */var Zh=function(e,t){return Zh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Zh(e,t)};function FD(e,t){Zh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,r=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:n,maxHeight:r}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/r;case"body":return document.body.offsetHeight/r;default:return n.offsetHeight}},t.prototype.getOffsetWidth=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/r;case"body":return document.body.offsetWidth/r;default:return n.offsetWidth}},t.prototype.onDragStart=function(n,r){this.props.onDragStart&&this.props.onDragStart(n,r);var o=this.getDraggablePosition();if(this.originalPosition=o,!!this.props.bounds){var a=this.getParent(),l=this.props.scale,c;if(this.props.bounds==="parent")c=a;else if(this.props.bounds==="body"){var f=a.getBoundingClientRect(),h=f.left,p=f.top,w=document.body.getBoundingClientRect(),m=-(h-a.offsetLeft*l-w.left)/l,b=-(p-a.offsetTop*l-w.top)/l,R=(document.body.offsetWidth-this.resizable.size.width*l)/l+m,O=(document.body.offsetHeight-this.resizable.size.height*l)/l+b;return this.setState({bounds:{top:b,right:R,bottom:O,left:m}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var N=a.getBoundingClientRect(),_=N.left,v=N.top,x=-(_-a.offsetLeft*l)/l,C=-(v-a.offsetTop*l)/l,R=(window.innerWidth-this.resizable.size.width*l)/l+x,O=(window.innerHeight-this.resizable.size.height*l)/l+C;return this.setState({bounds:{top:C,right:R,bottom:O,left:x}})}else typeof this.props.bounds=="string"?c=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(c=this.props.bounds);if(!(!(c instanceof HTMLElement)||!(a instanceof HTMLElement))){var k=c.getBoundingClientRect(),E=k.left,P=k.top,A=a.getBoundingClientRect(),V=A.left,Q=A.top,te=(E-V)/l,he=P-Q;if(this.resizable){this.updateOffsetFromParent();var ve=this.offsetFromParent;this.setState({bounds:{top:he-ve.top,right:te+(c.offsetWidth-this.resizable.size.width)-ve.left/l,bottom:he+(c.offsetHeight-this.resizable.size.height)-ve.top,left:te-ve.left/l}})}}}},t.prototype.onDrag=function(n,r){if(this.props.onDrag){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(n,Ct(Ct({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDrag(n,Ct(Ct({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(n,Ct(Ct({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onDragStop=function(n,r){if(this.props.onDragStop){var o=this.offsetFromParent,a=o.left,l=o.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(n,Ct(Ct({},r),{x:r.x+a,y:r.y+l}));if(this.props.dragAxis==="x")return this.props.onDragStop(n,Ct(Ct({},r),{x:r.x+a,y:this.originalPosition.y+l,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(n,Ct(Ct({},r),{x:this.originalPosition.x+a,y:r.y+l,deltaX:0}))}},t.prototype.onResizeStart=function(n,r,o){n.stopPropagation(),this.setState({resizing:!0});var a=this.props.scale,l=this.offsetFromParent,c=this.getDraggablePosition();if(this.resizingPosition={x:c.x+l.left,y:c.y+l.top},this.originalPosition=c,this.props.bounds){var f=this.getParent(),h=void 0;this.props.bounds==="parent"?h=f:this.props.bounds==="body"?h=document.body:this.props.bounds==="window"?h=window:typeof this.props.bounds=="string"?h=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(h=this.props.bounds);var p=this.getSelfElement();if(p instanceof Element&&(h instanceof HTMLElement||h===window)&&f instanceof HTMLElement){var w=this.getMaxSizesFromProps(),m=w.maxWidth,b=w.maxHeight,R=this.getParentSize();if(m&&typeof m=="string")if(m.endsWith("%")){var O=Number(m.replace("%",""))/100;m=R.width*O}else m.endsWith("px")&&(m=Number(m.replace("px","")));if(b&&typeof b=="string")if(b.endsWith("%")){var O=Number(b.replace("%",""))/100;b=R.height*O}else b.endsWith("px")&&(b=Number(b.replace("px","")));var N=p.getBoundingClientRect(),_=N.left,v=N.top,x=this.props.bounds==="window"?{left:0,top:0}:h.getBoundingClientRect(),C=x.left,k=x.top,E=this.getOffsetWidth(h),P=this.getOffsetHeight(h),A=r.toLowerCase().endsWith("left"),V=r.toLowerCase().endsWith("right"),Q=r.startsWith("top"),te=r.startsWith("bottom");if((A||Q)&&this.resizable){var he=(_-C)/a+this.resizable.size.width;this.setState({maxWidth:he>Number(m)?m:he})}if(V||this.props.lockAspectRatio&&!A&&!Q){var he=E+(C-_)/a;this.setState({maxWidth:he>Number(m)?m:he})}if((Q||A)&&this.resizable){var he=(v-k)/a+this.resizable.size.height;this.setState({maxHeight:he>Number(b)?b:he})}if(te||this.props.lockAspectRatio&&!Q&&!A){var he=P+(k-v)/a;this.setState({maxHeight:he>Number(b)?b:he})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(n,r,o)},t.prototype.onResize=function(n,r,o,a){var l=this,c={x:this.originalPosition.x,y:this.originalPosition.y},f=-a.width,h=-a.height,p=["top","left","topLeft","bottomLeft","topRight"];p.includes(r)&&(r==="bottomLeft"?c.x+=f:(r==="topRight"||(c.x+=f),c.y+=h));var w=this.draggable.state;(c.x!==w.x||c.y!==w.y)&&La.flushSync(function(){l.draggable.setState(c)}),this.updateOffsetFromParent();var m=this.offsetFromParent,b=this.getDraggablePosition().x+m.left,R=this.getDraggablePosition().y+m.top;this.resizingPosition={x:b,y:R},this.props.onResize&&this.props.onResize(n,r,o,a,{x:b,y:R})},t.prototype.onResizeStop=function(n,r,o,a){this.setState({resizing:!1});var l=this.getMaxSizesFromProps(),c=l.maxWidth,f=l.maxHeight;this.setState({maxWidth:c,maxHeight:f}),this.props.onResizeStop&&this.props.onResizeStop(n,r,o,a,this.resizingPosition)},t.prototype.updateSize=function(n){this.resizable&&this.resizable.updateSize({width:n.width,height:n.height})},t.prototype.updatePosition=function(n){this.draggable.setState(n)},t.prototype.updateOffsetFromParent=function(){var n=this.props.scale,r=this.getParent(),o=this.getSelfElement();if(!r||o===null)return{top:0,left:0};var a=r.getBoundingClientRect(),l=a.left,c=a.top,f=o.getBoundingClientRect(),h=this.getDraggablePosition(),p=r.scrollLeft,w=r.scrollTop;this.offsetFromParent={left:f.left-l+p-h.x*n,top:f.top-c+w-h.y*n}},t.prototype.render=function(){var n=this,r=this.props,o=r.disableDragging,a=r.style,l=r.dragHandleClassName,c=r.position,f=r.onMouseDown,h=r.onMouseUp,p=r.dragAxis,w=r.dragGrid,m=r.bounds,b=r.enableUserSelectHack,R=r.cancel,O=r.children;r.onResizeStart,r.onResize,r.onResizeStop,r.onDragStart,r.onDrag,r.onDragStop;var N=r.resizeHandleStyles,_=r.resizeHandleClasses,v=r.resizeHandleComponent,x=r.enableResizing,C=r.resizeGrid,k=r.resizeHandleWrapperClass,E=r.resizeHandleWrapperStyle,P=r.scale,A=r.allowAnyClick,V=UD(r,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick"]),Q=this.props.default?Ct({},this.props.default):void 0;delete V.default;var te=o||l?{cursor:"auto"}:{cursor:"move"},he=Ct(Ct(Ct({},jD),te),a),ve=this.offsetFromParent,re=ve.left,ue=ve.top,de;c&&(de={x:c.x-re,y:c.y-ue});var ce=this.state.resizing?void 0:de,B=this.state.resizing?"both":p;return j.createElement(RD,{ref:function(M){M&&(n.draggable=M)},handle:l?".".concat(l):void 0,defaultPosition:Q,onMouseDown:f,onMouseUp:h,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:B,disabled:o,grid:w,bounds:m?this.state.bounds:void 0,position:ce,enableUserSelectHack:b,cancel:R,scale:P,allowAnyClick:A,nodeRef:this.resizableElement},j.createElement(zD,Ct({},V,{ref:function(M){M&&(n.resizable=M,n.resizableElement.current=M.resizable)},defaultSize:Q,size:this.props.size,enable:typeof x=="boolean"?BD(x):x,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:he,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:C,handleWrapperClass:k,handleWrapperStyle:E,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:N,handleClasses:_,handleComponent:v,scale:this.props.scale}),O))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(j.PureComponent);const Se={white:"#ffffff",black:"#000000",primary:"#BA2626",primaryLight:"#f08080",secondary:"#8A0000",secondaryLight:"#ff6b6b",tertiary:"#DD0003",tertiaryLight:"#ff9999",quaternary:"#ff8000",quaternaryLight:"#ffb36b",desactivat:"#c6c6c6",desactivatLight:"#e5e5e5",background:"#f8f8f8",secondaryBackground:"#ffffff",border:"#c7c5c5",accent:"#3d3df7",accentLight:"#6a6af8",text:"#333333",timeline:"#ffe8cc"},mn={fontFamily:"Open Sans,Helvetica,Arial,sans-serif",fontSize:{small:"12px",medium:"14px",large:"16px"}},Lt=ae.button` background-color: ${Se.primary}; color: ${Se.white}; border: none; padding: 10px 20px; - font-size: ${vn.fontSize.medium}; + font-size: ${mn.fontSize.medium}; cursor: pointer; border-radius: 5px; - font-family: ${vn.fontFamily}; + font-family: ${mn.fontFamily}; transition: background-color 0.3s; &:hover { @@ -123,27 +123,27 @@ and limitations under the License. border: 1px solid ${Se.border}; border-radius: 5px; box-sizing: border-box; - font-family: ${vn.fontFamily}; - font-size: ${vn.fontSize.medium}; + font-family: ${mn.fontFamily}; + font-size: ${mn.fontSize.medium}; color: ${Se.text}; background-color: ${Se.white}; `,HD=ae.select` width: 100%; padding: 10px; margin-bottom: 10px; - font-size: ${vn.fontSize.medium}; + font-size: ${mn.fontSize.medium}; border: 1px solid ${Se.border}; border-radius: 5px; background-color: ${Se.white}; - font-family: ${vn.fontFamily}; + font-family: ${mn.fontFamily}; color: ${Se.text}; `,Md=ae.textarea` width: 100%; height: 100px; margin-bottom: 10px; padding: 5px; - font-family: ${vn.fontFamily}; - font-size: ${vn.fontSize.medium}; + font-family: ${mn.fontFamily}; + font-size: ${mn.fontSize.medium}; border: 1px solid ${Se.border}; border-radius: 5px; box-sizing: border-box; @@ -182,8 +182,8 @@ and limitations under the License. height: 30px; display: flex; align-items: center; - font-size: ${vn.fontSize.medium}; -`,e$=({track:e,onChange:t,zoomLevel:n,onEdit:r,isDubbingService:o,showSpeakerColors:a})=>{const[l,c]=j.useState(!1),f=j.useRef(null),h=(C,T)=>{f.current={x:C,y:T}},p=(C,T)=>{if(f.current){const k=Math.abs(C-f.current.x),R=Math.abs(T-f.current.y);k<5&&R<5&&!l&&r(e)}f.current=null},y=C=>{h(C.clientX,C.clientY)},m=C=>{p(C.clientX,C.clientY)},b=C=>{const T=C.touches[0];h(T.clientX,T.clientY)},P=C=>{const T=C.changedTouches[0];p(T.clientX,T.clientY)},O=()=>{c(!0)},N=(C,T)=>{const k=Math.max(0,T.x/n),R={...e,start:k,end:k+(e.end-e.start)};console.log("Track dragged:",R),t(R,!0),c(!1)},_=(C,T,k,R,A)=>{let W=e.start,Y=e.end;T.includes("left")&&(W=Math.max(0,A.x/n)),T.includes("right")&&(Y=Math.max(W+.1,(A.x+k.offsetWidth)/n));const te={...e,start:W,end:Y};console.log("Track resized:",te),t(te,!1)},v=zt.getSpeakerById(e.speaker_id),x=a&&v?v.color:Se.quaternaryLight;return $.jsx(WD,{position:{x:e.start*n,y:0},size:{width:(e.end-e.start)*n,height:30},onDragStart:O,onDragStop:N,onResize:_,dragAxis:"x",bounds:"parent",enableResizing:{left:!0,right:!0},minWidth:10,children:$.jsx(JD,{backgroundColor:x,onMouseDown:y,onMouseUp:m,onTouchStart:b,onTouchEnd:P,children:o?e.translated_text:e.text})})},t$=ae.div` + font-size: ${mn.fontSize.medium}; +`,e$=({track:e,onChange:t,zoomLevel:n,onEdit:r,isDubbingService:o,showSpeakerColors:a})=>{const[l,c]=j.useState(!1),f=j.useRef(null),h=(C,k)=>{f.current={x:C,y:k}},p=(C,k)=>{if(f.current){const E=Math.abs(C-f.current.x),P=Math.abs(k-f.current.y);E<5&&P<5&&!l&&r(e)}f.current=null},w=C=>{h(C.clientX,C.clientY)},m=C=>{p(C.clientX,C.clientY)},b=C=>{const k=C.touches[0];h(k.clientX,k.clientY)},R=C=>{const k=C.changedTouches[0];p(k.clientX,k.clientY)},O=()=>{c(!0)},N=(C,k)=>{const E=Math.max(0,k.x/n),P={...e,start:E,end:E+(e.end-e.start)};console.log("Track dragged:",P),t(P,!0),c(!1)},_=(C,k,E,P,A)=>{let V=e.start,Q=e.end;k.includes("left")&&(V=Math.max(0,A.x/n)),k.includes("right")&&(Q=Math.max(V+.1,(A.x+E.offsetWidth)/n));const te={...e,start:V,end:Q};console.log("Track resized:",te),t(te,!1)},v=zt.getSpeakerById(e.speaker_id),x=a&&v?v.color:Se.quaternaryLight;return $.jsx(WD,{position:{x:e.start*n,y:0},size:{width:(e.end-e.start)*n,height:30},onDragStart:O,onDragStop:N,onResize:_,dragAxis:"x",bounds:"parent",enableResizing:{left:!0,right:!0},minWidth:10,children:$.jsx(JD,{backgroundColor:x,onMouseDown:w,onMouseUp:m,onTouchStart:b,onTouchEnd:R,children:o?e.translated_text:e.text})})},t$=ae.div` background-color: ${Se.background}; display: flex; flex-direction: column; @@ -223,7 +223,7 @@ and limitations under the License. `,a$=ae.div` position: absolute; bottom: 0; - font-size: ${vn.fontSize.small}; + font-size: ${mn.fontSize.small}; color: ${Se.text}; transform: translateX(-50%); `,l$=ae.div` @@ -245,24 +245,24 @@ and limitations under the License. border-radius: 50%; `,u$=ae(s$)` cursor: pointer; -`,Py=10,Oy=1,Ly=100,c$=({tracks:e,setTracks:t,currentTime:n,onTimeChange:r,onEditTrack:o,isDubbingService:a,onTrackChange:l,showSpeakerColors:c})=>{const{t:f}=ro(),[h,p]=j.useState(Py),y=j.useRef(null),m=(k,R,A)=>{l(k,R,A)},b=()=>p(k=>Math.min(k*1.5,Ly)),P=()=>p(k=>Math.max(k/1.5,Oy)),O=()=>p(Py),N=j.useCallback((k,R)=>{p(A=>{const W=Math.min(Math.max(A*(1+k*.01),Oy),Ly);if(y.current){const Y=y.current,te=Y.scrollLeft,de=Y.scrollWidth,ve=de/A*W,ne=(te+R)*(ve/de)-R;requestAnimationFrame(()=>{Y.scrollLeft=ne})}return W})},[]),_=j.useCallback(k=>{const R=k.currentTarget.getBoundingClientRect(),W=(k.clientX-R.left)/h;r(W)},[h,r]),v=zA({onPinch:({delta:[k],origin:[R],event:A})=>{var Y;A.preventDefault();const W=R-(((Y=y.current)==null?void 0:Y.getBoundingClientRect().left)||0);N(k,W)},onWheel:({delta:[,k],event:R})=>{var A;if(R.ctrlKey||R.metaKey){R.preventDefault();const W=(A=y.current)==null?void 0:A.getBoundingClientRect(),Y=R.clientX-((W==null?void 0:W.left)||0);N(-k,Y)}}},{eventOptions:{passive:!1}})(y);j.useEffect(()=>{const k=y.current;return k&&k.addEventListener("wheel",v.onWheel,{passive:!1}),()=>{k&&k.removeEventListener("wheel",v.onWheel)}},[v]);const x=Math.max(...e.map(k=>k.end),n),C=Math.max(x*h,100),T=()=>{const k=[];for(let R=0;R<=x;R+=5)k.push($.jsx(a$,{style:{left:`${R*h}px`},children:f$(R)},R));return k};return $.jsxs(t$,{children:[$.jsx(n$,{ref:y,children:$.jsxs(r$,{id:"track-timeline",style:{width:`${C}px`},children:[$.jsx(u$,{style:{width:`${C}px`},onClick:_,children:T()}),$.jsx(i$,{style:{left:`${n*h}px`}}),e.filter(k=>!k.deleted).map((k,R)=>$.jsx(o$,{children:$.jsx(e$,{track:k,onChange:(A,W)=>m(R,A,W),zoomLevel:h,onEdit:o,isDubbingService:a,showSpeakerColors:c})},k.id))]})}),$.jsxs(l$,{children:[$.jsx(Ud,{onClick:P,title:f("zoomOut"),children:$.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"})]})}),$.jsx(Ud,{onClick:b,title:f("zoomIn"),children:$.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"9",y1:"6",x2:"9",y2:"12",stroke:"currentColor",strokeWidth:"2"})]})}),$.jsx(Ud,{onClick:O,title:f("resetZoom"),children:$.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),$.jsx("path",{d:"M9 6v3h3",stroke:"currentColor",strokeWidth:"2",fill:"none"})]})})]})]})},f$=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var Gu={exports:{}};/** +`,Py=10,Oy=1,Ly=100,c$=({tracks:e,currentTime:t,onTimeChange:n,onEditTrack:r,isDubbingService:o,onTrackChange:a,showSpeakerColors:l})=>{const{t:c}=io(),[f,h]=j.useState(Py),p=j.useRef(null),w=(k,E,P)=>{a(k,E,P)},m=()=>h(k=>Math.min(k*1.5,Ly)),b=()=>h(k=>Math.max(k/1.5,Oy)),R=()=>h(Py),O=j.useCallback((k,E)=>{h(P=>{const A=Math.min(Math.max(P*(1+k*.01),Oy),Ly);if(p.current){const V=p.current,Q=V.scrollLeft,te=V.scrollWidth,he=te/P*A,ve=(Q+E)*(he/te)-E;requestAnimationFrame(()=>{V.scrollLeft=ve})}return A})},[]),N=j.useCallback(k=>{const E=k.currentTarget.getBoundingClientRect(),A=(k.clientX-E.left)/f;n(A)},[f,n]),_=zA({onPinch:({delta:[k],origin:[E],event:P})=>{var V;P.preventDefault();const A=E-(((V=p.current)==null?void 0:V.getBoundingClientRect().left)||0);O(k,A)},onWheel:({delta:[,k],event:E})=>{var P;if(E.ctrlKey||E.metaKey){E.preventDefault();const A=(P=p.current)==null?void 0:P.getBoundingClientRect(),V=E.clientX-((A==null?void 0:A.left)||0);O(-k,V)}}},{eventOptions:{passive:!1}})(p);j.useEffect(()=>{const k=p.current;return k&&k.addEventListener("wheel",_.onWheel,{passive:!1}),()=>{k&&k.removeEventListener("wheel",_.onWheel)}},[_]);const v=Math.max(...e.map(k=>k.end),t),x=Math.max(v*f,100),C=()=>{const k=[];for(let E=0;E<=v;E+=5)k.push($.jsx(a$,{style:{left:`${E*f}px`},children:f$(E)},E));return k};return $.jsxs(t$,{children:[$.jsx(n$,{ref:p,children:$.jsxs(r$,{id:"track-timeline",style:{width:`${x}px`},children:[$.jsx(u$,{style:{width:`${x}px`},onClick:N,children:C()}),$.jsx(i$,{style:{left:`${t*f}px`}}),e.filter(k=>!k.deleted).map((k,E)=>$.jsx(o$,{children:$.jsx(e$,{track:k,onChange:(P,A)=>w(E,P,A),zoomLevel:f,onEdit:r,isDubbingService:o,showSpeakerColors:l})},k.id))]})}),$.jsxs(l$,{children:[$.jsx(Ud,{onClick:b,title:c("zoomOut"),children:$.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"})]})}),$.jsx(Ud,{onClick:m,title:c("zoomIn"),children:$.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"6",y1:"9",x2:"12",y2:"9",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"9",y1:"6",x2:"9",y2:"12",stroke:"currentColor",strokeWidth:"2"})]})}),$.jsx(Ud,{onClick:R,title:c("resetZoom"),children:$.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),$.jsx("line",{x1:"14",y1:"14",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2"}),$.jsx("path",{d:"M9 6v3h3",stroke:"currentColor",strokeWidth:"2",fill:"none"})]})})]})]})},f$=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var Gu={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */Gu.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",y=1,m=2,b=4,P=1,O=2,N=1,_=2,v=4,x=8,C=16,T=32,k=64,R=128,A=256,W=512,Y=30,te="...",de=800,ve=16,ne=1,ue=2,he=3,ce=1/0,B=9007199254740991,M=17976931348623157e292,F=0/0,K=4294967295,G=K-1,H=K>>>1,J=[["ary",R],["bind",N],["bindKey",_],["curry",x],["curryRight",C],["flip",W],["partial",T],["partialRight",k],["rearg",A]],ie="[object Arguments]",z="[object Array]",ge="[object AsyncFunction]",q="[object Boolean]",Ne="[object Date]",Re="[object DOMException]",xe="[object Error]",_e="[object Function]",nt="[object GeneratorFunction]",Ge="[object Map]",Pe="[object Number]",ot="[object Null]",Ce="[object Object]",st="[object Promise]",gr="[object Proxy]",Xe="[object RegExp]",dt="[object Set]",yn="[object String]",wt="[object Symbol]",be="[object Undefined]",Be="[object WeakMap]",Qr="[object WeakSet]",qn="[object ArrayBuffer]",Rt="[object DataView]",Oi="[object Float32Array]",so="[object Float64Array]",cs="[object Int8Array]",ao="[object Int16Array]",Jn="[object Int32Array]",fs="[object Uint8Array]",lo="[object Uint8ClampedArray]",ds="[object Uint16Array]",hs="[object Uint32Array]",Uc=/\b__p \+= '';/g,Ia=/\b(__p \+=) '' \+/g,jc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Na=/&(?:amp|lt|gt|quot|#39);/g,Zr=/[&<>"']/g,Ma=RegExp(Na.source),Bc=RegExp(Zr.source),Wc=/<%-([\s\S]+?)%>/g,Hc=/<%([\s\S]+?)%>/g,za=/<%=([\s\S]+?)%>/g,Vc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kc=/^\w*$/,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pe=/[\\^$.*+?()[\]{}|]/g,Te=RegExp(pe.source),Ue=/^\s+/,on=/\s/,er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ps=/\{\n\/\* \[wrapped with (.+)\] \*/,wn=/,? & /,tr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pr=/[()=,{}\[\]\/\s]/,Fa=/\\(\\)?/g,Ua=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ja=/\w*$/,wx=/^[-+]0x[0-9a-f]+$/i,Sx=/^0b[01]+$/i,xx=/^\[object .+?Constructor\]$/,_x=/^0o[0-7]+$/i,bx=/^(?:0|[1-9]\d*)$/,kx=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ba=/($^)/,Cx=/['\n\r\u2028\u2029\\]/g,Wa="\\ud800-\\udfff",Ex="\\u0300-\\u036f",Tx="\\ufe20-\\ufe2f",Rx="\\u20d0-\\u20ff",hg=Ex+Tx+Rx,pg="\\u2700-\\u27bf",gg="a-z\\xdf-\\xf6\\xf8-\\xff",Px="\\xac\\xb1\\xd7\\xf7",Ox="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lx="\\u2000-\\u206f",Ax=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mg="A-Z\\xc0-\\xd6\\xd8-\\xde",vg="\\ufe0e\\ufe0f",yg=Px+Ox+Lx+Ax,Gc="['’]",Dx="["+Wa+"]",wg="["+yg+"]",Ha="["+hg+"]",Sg="\\d+",$x="["+pg+"]",xg="["+gg+"]",_g="[^"+Wa+yg+Sg+pg+gg+mg+"]",Yc="\\ud83c[\\udffb-\\udfff]",Ix="(?:"+Ha+"|"+Yc+")",bg="[^"+Wa+"]",Xc="(?:\\ud83c[\\udde6-\\uddff]){2}",Qc="[\\ud800-\\udbff][\\udc00-\\udfff]",uo="["+mg+"]",kg="\\u200d",Cg="(?:"+xg+"|"+_g+")",Nx="(?:"+uo+"|"+_g+")",Eg="(?:"+Gc+"(?:d|ll|m|re|s|t|ve))?",Tg="(?:"+Gc+"(?:D|LL|M|RE|S|T|VE))?",Rg=Ix+"?",Pg="["+vg+"]?",Mx="(?:"+kg+"(?:"+[bg,Xc,Qc].join("|")+")"+Pg+Rg+")*",zx="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fx="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Og=Pg+Rg+Mx,Ux="(?:"+[$x,Xc,Qc].join("|")+")"+Og,jx="(?:"+[bg+Ha+"?",Ha,Xc,Qc,Dx].join("|")+")",Bx=RegExp(Gc,"g"),Wx=RegExp(Ha,"g"),Zc=RegExp(Yc+"(?="+Yc+")|"+jx+Og,"g"),Hx=RegExp([uo+"?"+xg+"+"+Eg+"(?="+[wg,uo,"$"].join("|")+")",Nx+"+"+Tg+"(?="+[wg,uo+Cg,"$"].join("|")+")",uo+"?"+Cg+"+"+Eg,uo+"+"+Tg,Fx,zx,Sg,Ux].join("|"),"g"),Vx=RegExp("["+kg+Wa+hg+vg+"]"),Kx=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gx=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yx=-1,qe={};qe[Oi]=qe[so]=qe[cs]=qe[ao]=qe[Jn]=qe[fs]=qe[lo]=qe[ds]=qe[hs]=!0,qe[ie]=qe[z]=qe[qn]=qe[q]=qe[Rt]=qe[Ne]=qe[xe]=qe[_e]=qe[Ge]=qe[Pe]=qe[Ce]=qe[Xe]=qe[dt]=qe[yn]=qe[Be]=!1;var Qe={};Qe[ie]=Qe[z]=Qe[qn]=Qe[Rt]=Qe[q]=Qe[Ne]=Qe[Oi]=Qe[so]=Qe[cs]=Qe[ao]=Qe[Jn]=Qe[Ge]=Qe[Pe]=Qe[Ce]=Qe[Xe]=Qe[dt]=Qe[yn]=Qe[wt]=Qe[fs]=Qe[lo]=Qe[ds]=Qe[hs]=!0,Qe[xe]=Qe[_e]=Qe[Be]=!1;var Xx={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Qx={"&":"&","<":"<",">":">",'"':""","'":"'"},Zx={"&":"&","<":"<",">":">",""":'"',"'":"'"},qx={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Jx=parseFloat,e_=parseInt,Lg=typeof Os=="object"&&Os&&Os.Object===Object&&Os,t_=typeof self=="object"&&self&&self.Object===Object&&self,$t=Lg||t_||Function("return this")(),qc=t&&!t.nodeType&&t,Li=qc&&!0&&e&&!e.nodeType&&e,Ag=Li&&Li.exports===qc,Jc=Ag&&Lg.process,In=function(){try{var D=Li&&Li.require&&Li.require("util").types;return D||Jc&&Jc.binding&&Jc.binding("util")}catch{}}(),Dg=In&&In.isArrayBuffer,$g=In&&In.isDate,Ig=In&&In.isMap,Ng=In&&In.isRegExp,Mg=In&&In.isSet,zg=In&&In.isTypedArray;function Sn(D,V,U){switch(U.length){case 0:return D.call(V);case 1:return D.call(V,U[0]);case 2:return D.call(V,U[0],U[1]);case 3:return D.call(V,U[0],U[1],U[2])}return D.apply(V,U)}function n_(D,V,U,oe){for(var ke=-1,Fe=D==null?0:D.length;++ke-1}function ef(D,V,U){for(var oe=-1,ke=D==null?0:D.length;++oe-1;);return U}function Kg(D,V){for(var U=D.length;U--&&co(V,D[U],0)>-1;);return U}function f_(D,V){for(var U=D.length,oe=0;U--;)D[U]===V&&++oe;return oe}var d_=of(Xx),h_=of(Qx);function p_(D){return"\\"+qx[D]}function g_(D,V){return D==null?n:D[V]}function fo(D){return Vx.test(D)}function m_(D){return Kx.test(D)}function v_(D){for(var V,U=[];!(V=D.next()).done;)U.push(V.value);return U}function uf(D){var V=-1,U=Array(D.size);return D.forEach(function(oe,ke){U[++V]=[ke,oe]}),U}function Gg(D,V){return function(U){return D(V(U))}}function ei(D,V){for(var U=-1,oe=D.length,ke=0,Fe=[];++U-1}function ib(i,s){var u=this.__data__,d=ll(u,i);return d<0?(++this.size,u.push([i,s])):u[d][1]=s,this}Or.prototype.clear=eb,Or.prototype.delete=tb,Or.prototype.get=nb,Or.prototype.has=rb,Or.prototype.set=ib;function Lr(i){var s=-1,u=i==null?0:i.length;for(this.clear();++s=s?i:s)),i}function Fn(i,s,u,d,g,S){var E,L=s&y,I=s&m,X=s&b;if(u&&(E=g?u(i,d,g,S):u(i)),E!==n)return E;if(!at(i))return i;var Q=Ee(i);if(Q){if(E=lk(i),!L)return sn(i,E)}else{var Z=Bt(i),re=Z==_e||Z==nt;if(si(i))return Pm(i,L);if(Z==Ce||Z==ie||re&&!g){if(E=I||re?{}:Ym(i),!L)return I?Zb(i,Sb(E,i)):Qb(i,om(E,i))}else{if(!Qe[Z])return g?i:{};E=uk(i,Z,L)}}S||(S=new rr);var fe=S.get(i);if(fe)return fe;S.set(i,E),bv(i)?i.forEach(function(we){E.add(Fn(we,s,u,we,i,S))}):xv(i)&&i.forEach(function(we,De){E.set(De,Fn(we,s,u,De,i,S))});var ye=X?I?If:$f:I?ln:Pt,Le=Q?n:ye(i);return Nn(Le||i,function(we,De){Le&&(De=we,we=i[De]),xs(E,De,Fn(we,s,u,De,i,S))}),E}function xb(i){var s=Pt(i);return function(u){return sm(u,i,s)}}function sm(i,s,u){var d=u.length;if(i==null)return!d;for(i=Ye(i);d--;){var g=u[d],S=s[g],E=i[g];if(E===n&&!(g in i)||!S(E))return!1}return!0}function am(i,s,u){if(typeof i!="function")throw new Mn(l);return Rs(function(){i.apply(n,u)},s)}function _s(i,s,u,d){var g=-1,S=Va,E=!0,L=i.length,I=[],X=s.length;if(!L)return I;u&&(s=rt(s,xn(u))),d?(S=ef,E=!1):s.length>=o&&(S=gs,E=!1,s=new $i(s));e:for(;++gg?0:g+u),d=d===n||d>g?g:Oe(d),d<0&&(d+=g),d=u>d?0:Cv(d);u0&&u(L)?s>1?It(L,s-1,u,d,g):Jr(g,L):d||(g[g.length]=L)}return g}var mf=Im(),cm=Im(!0);function mr(i,s){return i&&mf(i,s,Pt)}function vf(i,s){return i&&cm(i,s,Pt)}function cl(i,s){return qr(s,function(u){return Nr(i[u])})}function Ni(i,s){s=ii(s,i);for(var u=0,d=s.length;i!=null&&us}function kb(i,s){return i!=null&&We.call(i,s)}function Cb(i,s){return i!=null&&s in Ye(i)}function Eb(i,s,u){return i>=jt(s,u)&&i=120&&Q.length>=120)?new $i(E&&Q):n}Q=i[0];var Z=-1,re=L[0];e:for(;++Z-1;)L!==i&&tl.call(L,I,1),tl.call(i,I,1);return i}function xm(i,s){for(var u=i?s.length:0,d=u-1;u--;){var g=s[u];if(u==d||g!==S){var S=g;Ir(g)?tl.call(i,g,1):Tf(i,g)}}return i}function kf(i,s){return i+il(tm()*(s-i+1))}function Fb(i,s,u,d){for(var g=-1,S=kt(rl((s-i)/(u||1)),0),E=U(S);S--;)E[d?S:++g]=i,i+=u;return E}function Cf(i,s){var u="";if(!i||s<1||s>B)return u;do s%2&&(u+=i),s=il(s/2),s&&(i+=i);while(s);return u}function Ae(i,s){return Bf(Zm(i,s,un),i+"")}function Ub(i){return im(bo(i))}function jb(i,s){var u=bo(i);return xl(u,Ii(s,0,u.length))}function Cs(i,s,u,d){if(!at(i))return i;s=ii(s,i);for(var g=-1,S=s.length,E=S-1,L=i;L!=null&&++gg?0:g+s),u=u>g?g:u,u<0&&(u+=g),g=s>u?0:u-s>>>0,s>>>=0;for(var S=U(g);++d>>1,E=i[S];E!==null&&!bn(E)&&(u?E<=s:E=o){var X=s?null:tk(i);if(X)return Ga(X);E=!1,g=gs,I=new $i}else I=s?[]:L;e:for(;++d=d?i:Un(i,s,u)}var Rm=A_||function(i){return $t.clearTimeout(i)};function Pm(i,s){if(s)return i.slice();var u=i.length,d=Qg?Qg(u):new i.constructor(u);return i.copy(d),d}function Lf(i){var s=new i.constructor(i.byteLength);return new Ja(s).set(new Ja(i)),s}function Kb(i,s){var u=s?Lf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.byteLength)}function Gb(i){var s=new i.constructor(i.source,ja.exec(i));return s.lastIndex=i.lastIndex,s}function Yb(i){return Ss?Ye(Ss.call(i)):{}}function Om(i,s){var u=s?Lf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.length)}function Lm(i,s){if(i!==s){var u=i!==n,d=i===null,g=i===i,S=bn(i),E=s!==n,L=s===null,I=s===s,X=bn(s);if(!L&&!X&&!S&&i>s||S&&E&&I&&!L&&!X||d&&E&&I||!u&&I||!g)return 1;if(!d&&!S&&!X&&i=L)return I;var X=u[d];return I*(X=="desc"?-1:1)}}return i.index-s.index}function Am(i,s,u,d){for(var g=-1,S=i.length,E=u.length,L=-1,I=s.length,X=kt(S-E,0),Q=U(I+X),Z=!d;++L1?u[g-1]:n,E=g>2?u[2]:n;for(S=i.length>3&&typeof S=="function"?(g--,S):n,E&&Qt(u[0],u[1],E)&&(S=g<3?n:S,g=1),s=Ye(s);++d-1?g[S?s[E]:E]:n}}function zm(i){return $r(function(s){var u=s.length,d=u,g=zn.prototype.thru;for(i&&s.reverse();d--;){var S=s[d];if(typeof S!="function")throw new Mn(l);if(g&&!E&&wl(S)=="wrapper")var E=new zn([],!0)}for(d=E?d:u;++d1&&Me.reverse(),Q&&IL))return!1;var X=S.get(i),Q=S.get(s);if(X&&Q)return X==s&&Q==i;var Z=-1,re=!0,fe=u&O?new $i:n;for(S.set(i,s),S.set(s,i);++Z1?"& ":"")+s[d],s=s.join(u>2?", ":" "),i.replace(er,`{ + */Gu.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",w=1,m=2,b=4,R=1,O=2,N=1,_=2,v=4,x=8,C=16,k=32,E=64,P=128,A=256,V=512,Q=30,te="...",he=800,ve=16,re=1,ue=2,de=3,ce=1/0,B=9007199254740991,M=17976931348623157e292,F=0/0,K=4294967295,G=K-1,W=K>>>1,J=[["ary",P],["bind",N],["bindKey",_],["curry",x],["curryRight",C],["flip",V],["partial",k],["partialRight",E],["rearg",A]],ie="[object Arguments]",z="[object Array]",ge="[object AsyncFunction]",q="[object Boolean]",Ne="[object Date]",Te="[object DOMException]",xe="[object Error]",_e="[object Function]",nt="[object GeneratorFunction]",Ke="[object Map]",Re="[object Number]",ot="[object Null]",Ce="[object Object]",st="[object Promise]",pr="[object Proxy]",Xe="[object RegExp]",dt="[object Set]",vn="[object String]",wt="[object Symbol]",be="[object Undefined]",je="[object WeakMap]",Qr="[object WeakSet]",Zn="[object ArrayBuffer]",Rt="[object DataView]",Oi="[object Float32Array]",ao="[object Float64Array]",cs="[object Int8Array]",lo="[object Int16Array]",gr="[object Int32Array]",fs="[object Uint8Array]",Li="[object Uint8ClampedArray]",ds="[object Uint16Array]",hs="[object Uint32Array]",Uc=/\b__p \+= '';/g,Ia=/\b(__p \+=) '' \+/g,jc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Na=/&(?:amp|lt|gt|quot|#39);/g,Zr=/[&<>"']/g,Ma=RegExp(Na.source),Bc=RegExp(Zr.source),Wc=/<%-([\s\S]+?)%>/g,Hc=/<%([\s\S]+?)%>/g,za=/<%=([\s\S]+?)%>/g,Vc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kc=/^\w*$/,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pe=/[\\^$.*+?()[\]{}|]/g,Oe=RegExp(pe.source),Ge=/^\s+/,qn=/\s/,Jn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ps=/\{\n\/\* \[wrapped with (.+)\] \*/,yn=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pr=/[()=,{}\[\]\/\s]/,Fa=/\\(\\)?/g,Ua=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ja=/\w*$/,wx=/^[-+]0x[0-9a-f]+$/i,Sx=/^0b[01]+$/i,xx=/^\[object .+?Constructor\]$/,_x=/^0o[0-7]+$/i,bx=/^(?:0|[1-9]\d*)$/,kx=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ba=/($^)/,Cx=/['\n\r\u2028\u2029\\]/g,Wa="\\ud800-\\udfff",Ex="\\u0300-\\u036f",Tx="\\ufe20-\\ufe2f",Rx="\\u20d0-\\u20ff",hg=Ex+Tx+Rx,pg="\\u2700-\\u27bf",gg="a-z\\xdf-\\xf6\\xf8-\\xff",Px="\\xac\\xb1\\xd7\\xf7",Ox="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lx="\\u2000-\\u206f",Ax=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mg="A-Z\\xc0-\\xd6\\xd8-\\xde",vg="\\ufe0e\\ufe0f",yg=Px+Ox+Lx+Ax,Gc="['’]",Dx="["+Wa+"]",wg="["+yg+"]",Ha="["+hg+"]",Sg="\\d+",$x="["+pg+"]",xg="["+gg+"]",_g="[^"+Wa+yg+Sg+pg+gg+mg+"]",Yc="\\ud83c[\\udffb-\\udfff]",Ix="(?:"+Ha+"|"+Yc+")",bg="[^"+Wa+"]",Xc="(?:\\ud83c[\\udde6-\\uddff]){2}",Qc="[\\ud800-\\udbff][\\udc00-\\udfff]",uo="["+mg+"]",kg="\\u200d",Cg="(?:"+xg+"|"+_g+")",Nx="(?:"+uo+"|"+_g+")",Eg="(?:"+Gc+"(?:d|ll|m|re|s|t|ve))?",Tg="(?:"+Gc+"(?:D|LL|M|RE|S|T|VE))?",Rg=Ix+"?",Pg="["+vg+"]?",Mx="(?:"+kg+"(?:"+[bg,Xc,Qc].join("|")+")"+Pg+Rg+")*",zx="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fx="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Og=Pg+Rg+Mx,Ux="(?:"+[$x,Xc,Qc].join("|")+")"+Og,jx="(?:"+[bg+Ha+"?",Ha,Xc,Qc,Dx].join("|")+")",Bx=RegExp(Gc,"g"),Wx=RegExp(Ha,"g"),Zc=RegExp(Yc+"(?="+Yc+")|"+jx+Og,"g"),Hx=RegExp([uo+"?"+xg+"+"+Eg+"(?="+[wg,uo,"$"].join("|")+")",Nx+"+"+Tg+"(?="+[wg,uo+Cg,"$"].join("|")+")",uo+"?"+Cg+"+"+Eg,uo+"+"+Tg,Fx,zx,Sg,Ux].join("|"),"g"),Vx=RegExp("["+kg+Wa+hg+vg+"]"),Kx=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gx=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yx=-1,qe={};qe[Oi]=qe[ao]=qe[cs]=qe[lo]=qe[gr]=qe[fs]=qe[Li]=qe[ds]=qe[hs]=!0,qe[ie]=qe[z]=qe[Zn]=qe[q]=qe[Rt]=qe[Ne]=qe[xe]=qe[_e]=qe[Ke]=qe[Re]=qe[Ce]=qe[Xe]=qe[dt]=qe[vn]=qe[je]=!1;var Qe={};Qe[ie]=Qe[z]=Qe[Zn]=Qe[Rt]=Qe[q]=Qe[Ne]=Qe[Oi]=Qe[ao]=Qe[cs]=Qe[lo]=Qe[gr]=Qe[Ke]=Qe[Re]=Qe[Ce]=Qe[Xe]=Qe[dt]=Qe[vn]=Qe[wt]=Qe[fs]=Qe[Li]=Qe[ds]=Qe[hs]=!0,Qe[xe]=Qe[_e]=Qe[je]=!1;var Xx={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Qx={"&":"&","<":"<",">":">",'"':""","'":"'"},Zx={"&":"&","<":"<",">":">",""":'"',"'":"'"},qx={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Jx=parseFloat,e_=parseInt,Lg=typeof Os=="object"&&Os&&Os.Object===Object&&Os,t_=typeof self=="object"&&self&&self.Object===Object&&self,$t=Lg||t_||Function("return this")(),qc=t&&!t.nodeType&&t,Ai=qc&&!0&&e&&!e.nodeType&&e,Ag=Ai&&Ai.exports===qc,Jc=Ag&&Lg.process,$n=function(){try{var D=Ai&&Ai.require&&Ai.require("util").types;return D||Jc&&Jc.binding&&Jc.binding("util")}catch{}}(),Dg=$n&&$n.isArrayBuffer,$g=$n&&$n.isDate,Ig=$n&&$n.isMap,Ng=$n&&$n.isRegExp,Mg=$n&&$n.isSet,zg=$n&&$n.isTypedArray;function wn(D,H,U){switch(U.length){case 0:return D.call(H);case 1:return D.call(H,U[0]);case 2:return D.call(H,U[0],U[1]);case 3:return D.call(H,U[0],U[1],U[2])}return D.apply(H,U)}function n_(D,H,U,oe){for(var ke=-1,Fe=D==null?0:D.length;++ke-1}function ef(D,H,U){for(var oe=-1,ke=D==null?0:D.length;++oe-1;);return U}function Kg(D,H){for(var U=D.length;U--&&co(H,D[U],0)>-1;);return U}function f_(D,H){for(var U=D.length,oe=0;U--;)D[U]===H&&++oe;return oe}var d_=of(Xx),h_=of(Qx);function p_(D){return"\\"+qx[D]}function g_(D,H){return D==null?n:D[H]}function fo(D){return Vx.test(D)}function m_(D){return Kx.test(D)}function v_(D){for(var H,U=[];!(H=D.next()).done;)U.push(H.value);return U}function uf(D){var H=-1,U=Array(D.size);return D.forEach(function(oe,ke){U[++H]=[ke,oe]}),U}function Gg(D,H){return function(U){return D(H(U))}}function ei(D,H){for(var U=-1,oe=D.length,ke=0,Fe=[];++U-1}function ib(i,s){var u=this.__data__,d=ll(u,i);return d<0?(++this.size,u.push([i,s])):u[d][1]=s,this}Or.prototype.clear=eb,Or.prototype.delete=tb,Or.prototype.get=nb,Or.prototype.has=rb,Or.prototype.set=ib;function Lr(i){var s=-1,u=i==null?0:i.length;for(this.clear();++s=s?i:s)),i}function zn(i,s,u,d,g,S){var T,L=s&w,I=s&m,Y=s&b;if(u&&(T=g?u(i,d,g,S):u(i)),T!==n)return T;if(!at(i))return i;var X=Ee(i);if(X){if(T=lk(i),!L)return on(i,T)}else{var Z=Bt(i),ne=Z==_e||Z==nt;if(si(i))return Pm(i,L);if(Z==Ce||Z==ie||ne&&!g){if(T=I||ne?{}:Ym(i),!L)return I?Zb(i,Sb(T,i)):Qb(i,om(T,i))}else{if(!Qe[Z])return g?i:{};T=uk(i,Z,L)}}S||(S=new nr);var fe=S.get(i);if(fe)return fe;S.set(i,T),bv(i)?i.forEach(function(we){T.add(zn(we,s,u,we,i,S))}):xv(i)&&i.forEach(function(we,De){T.set(De,zn(we,s,u,De,i,S))});var ye=Y?I?If:$f:I?an:Pt,Le=X?n:ye(i);return In(Le||i,function(we,De){Le&&(De=we,we=i[De]),xs(T,De,zn(we,s,u,De,i,S))}),T}function xb(i){var s=Pt(i);return function(u){return sm(u,i,s)}}function sm(i,s,u){var d=u.length;if(i==null)return!d;for(i=Ye(i);d--;){var g=u[d],S=s[g],T=i[g];if(T===n&&!(g in i)||!S(T))return!1}return!0}function am(i,s,u){if(typeof i!="function")throw new Nn(l);return Rs(function(){i.apply(n,u)},s)}function _s(i,s,u,d){var g=-1,S=Va,T=!0,L=i.length,I=[],Y=s.length;if(!L)return I;u&&(s=rt(s,Sn(u))),d?(S=ef,T=!1):s.length>=o&&(S=gs,T=!1,s=new Ii(s));e:for(;++gg?0:g+u),d=d===n||d>g?g:Pe(d),d<0&&(d+=g),d=u>d?0:Cv(d);u0&&u(L)?s>1?It(L,s-1,u,d,g):Jr(g,L):d||(g[g.length]=L)}return g}var mf=Im(),cm=Im(!0);function mr(i,s){return i&&mf(i,s,Pt)}function vf(i,s){return i&&cm(i,s,Pt)}function cl(i,s){return qr(s,function(u){return Nr(i[u])})}function Mi(i,s){s=ii(s,i);for(var u=0,d=s.length;i!=null&&us}function kb(i,s){return i!=null&&Be.call(i,s)}function Cb(i,s){return i!=null&&s in Ye(i)}function Eb(i,s,u){return i>=jt(s,u)&&i=120&&X.length>=120)?new Ii(T&&X):n}X=i[0];var Z=-1,ne=L[0];e:for(;++Z-1;)L!==i&&tl.call(L,I,1),tl.call(i,I,1);return i}function xm(i,s){for(var u=i?s.length:0,d=u-1;u--;){var g=s[u];if(u==d||g!==S){var S=g;Ir(g)?tl.call(i,g,1):Tf(i,g)}}return i}function kf(i,s){return i+il(tm()*(s-i+1))}function Fb(i,s,u,d){for(var g=-1,S=kt(rl((s-i)/(u||1)),0),T=U(S);S--;)T[d?S:++g]=i,i+=u;return T}function Cf(i,s){var u="";if(!i||s<1||s>B)return u;do s%2&&(u+=i),s=il(s/2),s&&(i+=i);while(s);return u}function Ae(i,s){return Bf(Zm(i,s,ln),i+"")}function Ub(i){return im(bo(i))}function jb(i,s){var u=bo(i);return xl(u,Ni(s,0,u.length))}function Cs(i,s,u,d){if(!at(i))return i;s=ii(s,i);for(var g=-1,S=s.length,T=S-1,L=i;L!=null&&++gg?0:g+s),u=u>g?g:u,u<0&&(u+=g),g=s>u?0:u-s>>>0,s>>>=0;for(var S=U(g);++d>>1,T=i[S];T!==null&&!_n(T)&&(u?T<=s:T=o){var Y=s?null:tk(i);if(Y)return Ga(Y);T=!1,g=gs,I=new Ii}else I=s?[]:L;e:for(;++d=d?i:Fn(i,s,u)}var Rm=A_||function(i){return $t.clearTimeout(i)};function Pm(i,s){if(s)return i.slice();var u=i.length,d=Qg?Qg(u):new i.constructor(u);return i.copy(d),d}function Lf(i){var s=new i.constructor(i.byteLength);return new Ja(s).set(new Ja(i)),s}function Kb(i,s){var u=s?Lf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.byteLength)}function Gb(i){var s=new i.constructor(i.source,ja.exec(i));return s.lastIndex=i.lastIndex,s}function Yb(i){return Ss?Ye(Ss.call(i)):{}}function Om(i,s){var u=s?Lf(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.length)}function Lm(i,s){if(i!==s){var u=i!==n,d=i===null,g=i===i,S=_n(i),T=s!==n,L=s===null,I=s===s,Y=_n(s);if(!L&&!Y&&!S&&i>s||S&&T&&I&&!L&&!Y||d&&T&&I||!u&&I||!g)return 1;if(!d&&!S&&!Y&&i=L)return I;var Y=u[d];return I*(Y=="desc"?-1:1)}}return i.index-s.index}function Am(i,s,u,d){for(var g=-1,S=i.length,T=u.length,L=-1,I=s.length,Y=kt(S-T,0),X=U(I+Y),Z=!d;++L1?u[g-1]:n,T=g>2?u[2]:n;for(S=i.length>3&&typeof S=="function"?(g--,S):n,T&&Qt(u[0],u[1],T)&&(S=g<3?n:S,g=1),s=Ye(s);++d-1?g[S?s[T]:T]:n}}function zm(i){return $r(function(s){var u=s.length,d=u,g=Mn.prototype.thru;for(i&&s.reverse();d--;){var S=s[d];if(typeof S!="function")throw new Nn(l);if(g&&!T&&wl(S)=="wrapper")var T=new Mn([],!0)}for(d=T?d:u;++d1&&Me.reverse(),X&&IL))return!1;var Y=S.get(i),X=S.get(s);if(Y&&X)return Y==s&&X==i;var Z=-1,ne=!0,fe=u&O?new Ii:n;for(S.set(i,s),S.set(s,i);++Z1?"& ":"")+s[d],s=s.join(u>2?", ":" "),i.replace(Jn,`{ /* [wrapped with `+s+`] */ -`)}function fk(i){return Ee(i)||Fi(i)||!!(Jg&&i&&i[Jg])}function Ir(i,s){var u=typeof i;return s=s??B,!!s&&(u=="number"||u!="symbol"&&bx.test(i))&&i>-1&&i%1==0&&i0){if(++s>=de)return arguments[0]}else s=0;return i.apply(n,arguments)}}function xl(i,s){var u=-1,d=i.length,g=d-1;for(s=s===n?d:s;++u1?i[s-1]:n;return u=typeof u=="function"?(i.pop(),u):n,uv(i,u)});function cv(i){var s=w(i);return s.__chain__=!0,s}function _C(i,s){return s(i),i}function _l(i,s){return s(i)}var bC=$r(function(i){var s=i.length,u=s?i[0]:0,d=this.__wrapped__,g=function(S){return gf(S,i)};return s>1||this.__actions__.length||!(d instanceof Ie)||!Ir(u)?this.thru(g):(d=d.slice(u,+u+(s?1:0)),d.__actions__.push({func:_l,args:[g],thisArg:n}),new zn(d,this.__chain__).thru(function(S){return s&&!S.length&&S.push(n),S}))});function kC(){return cv(this)}function CC(){return new zn(this.value(),this.__chain__)}function EC(){this.__values__===n&&(this.__values__=kv(this.value()));var i=this.__index__>=this.__values__.length,s=i?n:this.__values__[this.__index__++];return{done:i,value:s}}function TC(){return this}function RC(i){for(var s,u=this;u instanceof al;){var d=rv(u);d.__index__=0,d.__values__=n,s?g.__wrapped__=d:s=d;var g=d;u=u.__wrapped__}return g.__wrapped__=i,s}function PC(){var i=this.__wrapped__;if(i instanceof Ie){var s=i;return this.__actions__.length&&(s=new Ie(this)),s=s.reverse(),s.__actions__.push({func:_l,args:[Wf],thisArg:n}),new zn(s,this.__chain__)}return this.thru(Wf)}function OC(){return Em(this.__wrapped__,this.__actions__)}var LC=pl(function(i,s,u){We.call(i,u)?++i[u]:Ar(i,u,1)});function AC(i,s,u){var d=Ee(i)?Fg:_b;return u&&Qt(i,s,u)&&(s=n),d(i,me(s,3))}function DC(i,s){var u=Ee(i)?qr:um;return u(i,me(s,3))}var $C=Mm(iv),IC=Mm(ov);function NC(i,s){return It(bl(i,s),1)}function MC(i,s){return It(bl(i,s),ce)}function zC(i,s,u){return u=u===n?1:Oe(u),It(bl(i,s),u)}function fv(i,s){var u=Ee(i)?Nn:ni;return u(i,me(s,3))}function dv(i,s){var u=Ee(i)?r_:lm;return u(i,me(s,3))}var FC=pl(function(i,s,u){We.call(i,u)?i[u].push(s):Ar(i,u,[s])});function UC(i,s,u,d){i=an(i)?i:bo(i),u=u&&!d?Oe(u):0;var g=i.length;return u<0&&(u=kt(g+u,0)),Rl(i)?u<=g&&i.indexOf(s,u)>-1:!!g&&co(i,s,u)>-1}var jC=Ae(function(i,s,u){var d=-1,g=typeof s=="function",S=an(i)?U(i.length):[];return ni(i,function(E){S[++d]=g?Sn(s,E,u):bs(E,s,u)}),S}),BC=pl(function(i,s,u){Ar(i,u,s)});function bl(i,s){var u=Ee(i)?rt:gm;return u(i,me(s,3))}function WC(i,s,u,d){return i==null?[]:(Ee(s)||(s=s==null?[]:[s]),u=d?n:u,Ee(u)||(u=u==null?[]:[u]),wm(i,s,u))}var HC=pl(function(i,s,u){i[u?0:1].push(s)},function(){return[[],[]]});function VC(i,s,u){var d=Ee(i)?tf:Wg,g=arguments.length<3;return d(i,me(s,4),u,g,ni)}function KC(i,s,u){var d=Ee(i)?i_:Wg,g=arguments.length<3;return d(i,me(s,4),u,g,lm)}function GC(i,s){var u=Ee(i)?qr:um;return u(i,El(me(s,3)))}function YC(i){var s=Ee(i)?im:Ub;return s(i)}function XC(i,s,u){(u?Qt(i,s,u):s===n)?s=1:s=Oe(s);var d=Ee(i)?vb:jb;return d(i,s)}function QC(i){var s=Ee(i)?yb:Wb;return s(i)}function ZC(i){if(i==null)return 0;if(an(i))return Rl(i)?ho(i):i.length;var s=Bt(i);return s==Ge||s==dt?i.size:xf(i).length}function qC(i,s,u){var d=Ee(i)?nf:Hb;return u&&Qt(i,s,u)&&(s=n),d(i,me(s,3))}var JC=Ae(function(i,s){if(i==null)return[];var u=s.length;return u>1&&Qt(i,s[0],s[1])?s=[]:u>2&&Qt(s[0],s[1],s[2])&&(s=[s[0]]),wm(i,It(s,1),[])}),kl=D_||function(){return $t.Date.now()};function eE(i,s){if(typeof s!="function")throw new Mn(l);return i=Oe(i),function(){if(--i<1)return s.apply(this,arguments)}}function hv(i,s,u){return s=u?n:s,s=i&&s==null?i.length:s,Dr(i,R,n,n,n,n,s)}function pv(i,s){var u;if(typeof s!="function")throw new Mn(l);return i=Oe(i),function(){return--i>0&&(u=s.apply(this,arguments)),i<=1&&(s=n),u}}var Vf=Ae(function(i,s,u){var d=N;if(u.length){var g=ei(u,xo(Vf));d|=T}return Dr(i,d,s,u,g)}),gv=Ae(function(i,s,u){var d=N|_;if(u.length){var g=ei(u,xo(gv));d|=T}return Dr(s,d,i,u,g)});function mv(i,s,u){s=u?n:s;var d=Dr(i,x,n,n,n,n,n,s);return d.placeholder=mv.placeholder,d}function vv(i,s,u){s=u?n:s;var d=Dr(i,C,n,n,n,n,n,s);return d.placeholder=vv.placeholder,d}function yv(i,s,u){var d,g,S,E,L,I,X=0,Q=!1,Z=!1,re=!0;if(typeof i!="function")throw new Mn(l);s=Bn(s)||0,at(u)&&(Q=!!u.leading,Z="maxWait"in u,S=Z?kt(Bn(u.maxWait)||0,s):S,re="trailing"in u?!!u.trailing:re);function fe(vt){var or=d,zr=g;return d=g=n,X=vt,E=i.apply(zr,or),E}function ye(vt){return X=vt,L=Rs(De,s),Q?fe(vt):E}function Le(vt){var or=vt-I,zr=vt-X,Mv=s-or;return Z?jt(Mv,S-zr):Mv}function we(vt){var or=vt-I,zr=vt-X;return I===n||or>=s||or<0||Z&&zr>=S}function De(){var vt=kl();if(we(vt))return Me(vt);L=Rs(De,Le(vt))}function Me(vt){return L=n,re&&d?fe(vt):(d=g=n,E)}function kn(){L!==n&&Rm(L),X=0,d=I=g=L=n}function Zt(){return L===n?E:Me(kl())}function Cn(){var vt=kl(),or=we(vt);if(d=arguments,g=this,I=vt,or){if(L===n)return ye(I);if(Z)return Rm(L),L=Rs(De,s),fe(I)}return L===n&&(L=Rs(De,s)),E}return Cn.cancel=kn,Cn.flush=Zt,Cn}var tE=Ae(function(i,s){return am(i,1,s)}),nE=Ae(function(i,s,u){return am(i,Bn(s)||0,u)});function rE(i){return Dr(i,W)}function Cl(i,s){if(typeof i!="function"||s!=null&&typeof s!="function")throw new Mn(l);var u=function(){var d=arguments,g=s?s.apply(this,d):d[0],S=u.cache;if(S.has(g))return S.get(g);var E=i.apply(this,d);return u.cache=S.set(g,E)||S,E};return u.cache=new(Cl.Cache||Lr),u}Cl.Cache=Lr;function El(i){if(typeof i!="function")throw new Mn(l);return function(){var s=arguments;switch(s.length){case 0:return!i.call(this);case 1:return!i.call(this,s[0]);case 2:return!i.call(this,s[0],s[1]);case 3:return!i.call(this,s[0],s[1],s[2])}return!i.apply(this,s)}}function iE(i){return pv(2,i)}var oE=Vb(function(i,s){s=s.length==1&&Ee(s[0])?rt(s[0],xn(me())):rt(It(s,1),xn(me()));var u=s.length;return Ae(function(d){for(var g=-1,S=jt(d.length,u);++g=s}),Fi=dm(function(){return arguments}())?dm:function(i){return ht(i)&&We.call(i,"callee")&&!qg.call(i,"callee")},Ee=U.isArray,SE=Dg?xn(Dg):Rb;function an(i){return i!=null&&Tl(i.length)&&!Nr(i)}function mt(i){return ht(i)&&an(i)}function xE(i){return i===!0||i===!1||ht(i)&&Xt(i)==q}var si=I_||rd,_E=$g?xn($g):Pb;function bE(i){return ht(i)&&i.nodeType===1&&!Ps(i)}function kE(i){if(i==null)return!0;if(an(i)&&(Ee(i)||typeof i=="string"||typeof i.splice=="function"||si(i)||_o(i)||Fi(i)))return!i.length;var s=Bt(i);if(s==Ge||s==dt)return!i.size;if(Ts(i))return!xf(i).length;for(var u in i)if(We.call(i,u))return!1;return!0}function CE(i,s){return ks(i,s)}function EE(i,s,u){u=typeof u=="function"?u:n;var d=u?u(i,s):n;return d===n?ks(i,s,n,u):!!d}function Gf(i){if(!ht(i))return!1;var s=Xt(i);return s==xe||s==Re||typeof i.message=="string"&&typeof i.name=="string"&&!Ps(i)}function TE(i){return typeof i=="number"&&em(i)}function Nr(i){if(!at(i))return!1;var s=Xt(i);return s==_e||s==nt||s==ge||s==gr}function Sv(i){return typeof i=="number"&&i==Oe(i)}function Tl(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=B}function at(i){var s=typeof i;return i!=null&&(s=="object"||s=="function")}function ht(i){return i!=null&&typeof i=="object"}var xv=Ig?xn(Ig):Lb;function RE(i,s){return i===s||Sf(i,s,Mf(s))}function PE(i,s,u){return u=typeof u=="function"?u:n,Sf(i,s,Mf(s),u)}function OE(i){return _v(i)&&i!=+i}function LE(i){if(pk(i))throw new ke(a);return hm(i)}function AE(i){return i===null}function DE(i){return i==null}function _v(i){return typeof i=="number"||ht(i)&&Xt(i)==Pe}function Ps(i){if(!ht(i)||Xt(i)!=Ce)return!1;var s=el(i);if(s===null)return!0;var u=We.call(s,"constructor")&&s.constructor;return typeof u=="function"&&u instanceof u&&Qa.call(u)==P_}var Yf=Ng?xn(Ng):Ab;function $E(i){return Sv(i)&&i>=-B&&i<=B}var bv=Mg?xn(Mg):Db;function Rl(i){return typeof i=="string"||!Ee(i)&&ht(i)&&Xt(i)==yn}function bn(i){return typeof i=="symbol"||ht(i)&&Xt(i)==wt}var _o=zg?xn(zg):$b;function IE(i){return i===n}function NE(i){return ht(i)&&Bt(i)==Be}function ME(i){return ht(i)&&Xt(i)==Qr}var zE=yl(_f),FE=yl(function(i,s){return i<=s});function kv(i){if(!i)return[];if(an(i))return Rl(i)?nr(i):sn(i);if(ms&&i[ms])return v_(i[ms]());var s=Bt(i),u=s==Ge?uf:s==dt?Ga:bo;return u(i)}function Mr(i){if(!i)return i===0?i:0;if(i=Bn(i),i===ce||i===-ce){var s=i<0?-1:1;return s*M}return i===i?i:0}function Oe(i){var s=Mr(i),u=s%1;return s===s?u?s-u:s:0}function Cv(i){return i?Ii(Oe(i),0,K):0}function Bn(i){if(typeof i=="number")return i;if(bn(i))return F;if(at(i)){var s=typeof i.valueOf=="function"?i.valueOf():i;i=at(s)?s+"":s}if(typeof i!="string")return i===0?i:+i;i=Hg(i);var u=Sx.test(i);return u||_x.test(i)?e_(i.slice(2),u?2:8):wx.test(i)?F:+i}function Ev(i){return vr(i,ln(i))}function UE(i){return i?Ii(Oe(i),-B,B):i===0?i:0}function je(i){return i==null?"":_n(i)}var jE=wo(function(i,s){if(Ts(s)||an(s)){vr(s,Pt(s),i);return}for(var u in s)We.call(s,u)&&xs(i,u,s[u])}),Tv=wo(function(i,s){vr(s,ln(s),i)}),Pl=wo(function(i,s,u,d){vr(s,ln(s),i,d)}),BE=wo(function(i,s,u,d){vr(s,Pt(s),i,d)}),WE=$r(gf);function HE(i,s){var u=yo(i);return s==null?u:om(u,s)}var VE=Ae(function(i,s){i=Ye(i);var u=-1,d=s.length,g=d>2?s[2]:n;for(g&&Qt(s[0],s[1],g)&&(d=1);++u1),S}),vr(i,If(i),u),d&&(u=Fn(u,y|m|b,nk));for(var g=s.length;g--;)Tf(u,s[g]);return u});function u2(i,s){return Pv(i,El(me(s)))}var c2=$r(function(i,s){return i==null?{}:Mb(i,s)});function Pv(i,s){if(i==null)return{};var u=rt(If(i),function(d){return[d]});return s=me(s),Sm(i,u,function(d,g){return s(d,g[0])})}function f2(i,s,u){s=ii(s,i);var d=-1,g=s.length;for(g||(g=1,i=n);++ds){var d=i;i=s,s=d}if(u||i%1||s%1){var g=tm();return jt(i+g*(s-i+Jx("1e-"+((g+"").length-1))),s)}return kf(i,s)}var _2=So(function(i,s,u){return s=s.toLowerCase(),i+(u?Av(s):s)});function Av(i){return Zf(je(i).toLowerCase())}function Dv(i){return i=je(i),i&&i.replace(kx,d_).replace(Wx,"")}function b2(i,s,u){i=je(i),s=_n(s);var d=i.length;u=u===n?d:Ii(Oe(u),0,d);var g=u;return u-=s.length,u>=0&&i.slice(u,g)==s}function k2(i){return i=je(i),i&&Bc.test(i)?i.replace(Zr,h_):i}function C2(i){return i=je(i),i&&Te.test(i)?i.replace(pe,"\\$&"):i}var E2=So(function(i,s,u){return i+(u?"-":"")+s.toLowerCase()}),T2=So(function(i,s,u){return i+(u?" ":"")+s.toLowerCase()}),R2=Nm("toLowerCase");function P2(i,s,u){i=je(i),s=Oe(s);var d=s?ho(i):0;if(!s||d>=s)return i;var g=(s-d)/2;return vl(il(g),u)+i+vl(rl(g),u)}function O2(i,s,u){i=je(i),s=Oe(s);var d=s?ho(i):0;return s&&d>>0,u?(i=je(i),i&&(typeof s=="string"||s!=null&&!Yf(s))&&(s=_n(s),!s&&fo(i))?oi(nr(i),0,u):i.split(s,u)):[]}var M2=So(function(i,s,u){return i+(u?" ":"")+Zf(s)});function z2(i,s,u){return i=je(i),u=u==null?0:Ii(Oe(u),0,i.length),s=_n(s),i.slice(u,u+s.length)==s}function F2(i,s,u){var d=w.templateSettings;u&&Qt(i,s,u)&&(s=n),i=je(i),s=Pl({},s,d,Wm);var g=Pl({},s.imports,d.imports,Wm),S=Pt(g),E=lf(g,S),L,I,X=0,Q=s.interpolate||Ba,Z="__p += '",re=cf((s.escape||Ba).source+"|"+Q.source+"|"+(Q===za?Ua:Ba).source+"|"+(s.evaluate||Ba).source+"|$","g"),fe="//# sourceURL="+(We.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yx+"]")+` -`;i.replace(re,function(we,De,Me,kn,Zt,Cn){return Me||(Me=kn),Z+=i.slice(X,Cn).replace(Cx,p_),De&&(L=!0,Z+=`' + +`)}function fk(i){return Ee(i)||Ui(i)||!!(Jg&&i&&i[Jg])}function Ir(i,s){var u=typeof i;return s=s??B,!!s&&(u=="number"||u!="symbol"&&bx.test(i))&&i>-1&&i%1==0&&i0){if(++s>=he)return arguments[0]}else s=0;return i.apply(n,arguments)}}function xl(i,s){var u=-1,d=i.length,g=d-1;for(s=s===n?d:s;++u1?i[s-1]:n;return u=typeof u=="function"?(i.pop(),u):n,uv(i,u)});function cv(i){var s=y(i);return s.__chain__=!0,s}function _C(i,s){return s(i),i}function _l(i,s){return s(i)}var bC=$r(function(i){var s=i.length,u=s?i[0]:0,d=this.__wrapped__,g=function(S){return gf(S,i)};return s>1||this.__actions__.length||!(d instanceof Ie)||!Ir(u)?this.thru(g):(d=d.slice(u,+u+(s?1:0)),d.__actions__.push({func:_l,args:[g],thisArg:n}),new Mn(d,this.__chain__).thru(function(S){return s&&!S.length&&S.push(n),S}))});function kC(){return cv(this)}function CC(){return new Mn(this.value(),this.__chain__)}function EC(){this.__values__===n&&(this.__values__=kv(this.value()));var i=this.__index__>=this.__values__.length,s=i?n:this.__values__[this.__index__++];return{done:i,value:s}}function TC(){return this}function RC(i){for(var s,u=this;u instanceof al;){var d=rv(u);d.__index__=0,d.__values__=n,s?g.__wrapped__=d:s=d;var g=d;u=u.__wrapped__}return g.__wrapped__=i,s}function PC(){var i=this.__wrapped__;if(i instanceof Ie){var s=i;return this.__actions__.length&&(s=new Ie(this)),s=s.reverse(),s.__actions__.push({func:_l,args:[Wf],thisArg:n}),new Mn(s,this.__chain__)}return this.thru(Wf)}function OC(){return Em(this.__wrapped__,this.__actions__)}var LC=pl(function(i,s,u){Be.call(i,u)?++i[u]:Ar(i,u,1)});function AC(i,s,u){var d=Ee(i)?Fg:_b;return u&&Qt(i,s,u)&&(s=n),d(i,me(s,3))}function DC(i,s){var u=Ee(i)?qr:um;return u(i,me(s,3))}var $C=Mm(iv),IC=Mm(ov);function NC(i,s){return It(bl(i,s),1)}function MC(i,s){return It(bl(i,s),ce)}function zC(i,s,u){return u=u===n?1:Pe(u),It(bl(i,s),u)}function fv(i,s){var u=Ee(i)?In:ni;return u(i,me(s,3))}function dv(i,s){var u=Ee(i)?r_:lm;return u(i,me(s,3))}var FC=pl(function(i,s,u){Be.call(i,u)?i[u].push(s):Ar(i,u,[s])});function UC(i,s,u,d){i=sn(i)?i:bo(i),u=u&&!d?Pe(u):0;var g=i.length;return u<0&&(u=kt(g+u,0)),Rl(i)?u<=g&&i.indexOf(s,u)>-1:!!g&&co(i,s,u)>-1}var jC=Ae(function(i,s,u){var d=-1,g=typeof s=="function",S=sn(i)?U(i.length):[];return ni(i,function(T){S[++d]=g?wn(s,T,u):bs(T,s,u)}),S}),BC=pl(function(i,s,u){Ar(i,u,s)});function bl(i,s){var u=Ee(i)?rt:gm;return u(i,me(s,3))}function WC(i,s,u,d){return i==null?[]:(Ee(s)||(s=s==null?[]:[s]),u=d?n:u,Ee(u)||(u=u==null?[]:[u]),wm(i,s,u))}var HC=pl(function(i,s,u){i[u?0:1].push(s)},function(){return[[],[]]});function VC(i,s,u){var d=Ee(i)?tf:Wg,g=arguments.length<3;return d(i,me(s,4),u,g,ni)}function KC(i,s,u){var d=Ee(i)?i_:Wg,g=arguments.length<3;return d(i,me(s,4),u,g,lm)}function GC(i,s){var u=Ee(i)?qr:um;return u(i,El(me(s,3)))}function YC(i){var s=Ee(i)?im:Ub;return s(i)}function XC(i,s,u){(u?Qt(i,s,u):s===n)?s=1:s=Pe(s);var d=Ee(i)?vb:jb;return d(i,s)}function QC(i){var s=Ee(i)?yb:Wb;return s(i)}function ZC(i){if(i==null)return 0;if(sn(i))return Rl(i)?ho(i):i.length;var s=Bt(i);return s==Ke||s==dt?i.size:xf(i).length}function qC(i,s,u){var d=Ee(i)?nf:Hb;return u&&Qt(i,s,u)&&(s=n),d(i,me(s,3))}var JC=Ae(function(i,s){if(i==null)return[];var u=s.length;return u>1&&Qt(i,s[0],s[1])?s=[]:u>2&&Qt(s[0],s[1],s[2])&&(s=[s[0]]),wm(i,It(s,1),[])}),kl=D_||function(){return $t.Date.now()};function eE(i,s){if(typeof s!="function")throw new Nn(l);return i=Pe(i),function(){if(--i<1)return s.apply(this,arguments)}}function hv(i,s,u){return s=u?n:s,s=i&&s==null?i.length:s,Dr(i,P,n,n,n,n,s)}function pv(i,s){var u;if(typeof s!="function")throw new Nn(l);return i=Pe(i),function(){return--i>0&&(u=s.apply(this,arguments)),i<=1&&(s=n),u}}var Vf=Ae(function(i,s,u){var d=N;if(u.length){var g=ei(u,xo(Vf));d|=k}return Dr(i,d,s,u,g)}),gv=Ae(function(i,s,u){var d=N|_;if(u.length){var g=ei(u,xo(gv));d|=k}return Dr(s,d,i,u,g)});function mv(i,s,u){s=u?n:s;var d=Dr(i,x,n,n,n,n,n,s);return d.placeholder=mv.placeholder,d}function vv(i,s,u){s=u?n:s;var d=Dr(i,C,n,n,n,n,n,s);return d.placeholder=vv.placeholder,d}function yv(i,s,u){var d,g,S,T,L,I,Y=0,X=!1,Z=!1,ne=!0;if(typeof i!="function")throw new Nn(l);s=jn(s)||0,at(u)&&(X=!!u.leading,Z="maxWait"in u,S=Z?kt(jn(u.maxWait)||0,s):S,ne="trailing"in u?!!u.trailing:ne);function fe(vt){var ir=d,zr=g;return d=g=n,Y=vt,T=i.apply(zr,ir),T}function ye(vt){return Y=vt,L=Rs(De,s),X?fe(vt):T}function Le(vt){var ir=vt-I,zr=vt-Y,Mv=s-ir;return Z?jt(Mv,S-zr):Mv}function we(vt){var ir=vt-I,zr=vt-Y;return I===n||ir>=s||ir<0||Z&&zr>=S}function De(){var vt=kl();if(we(vt))return Me(vt);L=Rs(De,Le(vt))}function Me(vt){return L=n,ne&&d?fe(vt):(d=g=n,T)}function bn(){L!==n&&Rm(L),Y=0,d=I=g=L=n}function Zt(){return L===n?T:Me(kl())}function kn(){var vt=kl(),ir=we(vt);if(d=arguments,g=this,I=vt,ir){if(L===n)return ye(I);if(Z)return Rm(L),L=Rs(De,s),fe(I)}return L===n&&(L=Rs(De,s)),T}return kn.cancel=bn,kn.flush=Zt,kn}var tE=Ae(function(i,s){return am(i,1,s)}),nE=Ae(function(i,s,u){return am(i,jn(s)||0,u)});function rE(i){return Dr(i,V)}function Cl(i,s){if(typeof i!="function"||s!=null&&typeof s!="function")throw new Nn(l);var u=function(){var d=arguments,g=s?s.apply(this,d):d[0],S=u.cache;if(S.has(g))return S.get(g);var T=i.apply(this,d);return u.cache=S.set(g,T)||S,T};return u.cache=new(Cl.Cache||Lr),u}Cl.Cache=Lr;function El(i){if(typeof i!="function")throw new Nn(l);return function(){var s=arguments;switch(s.length){case 0:return!i.call(this);case 1:return!i.call(this,s[0]);case 2:return!i.call(this,s[0],s[1]);case 3:return!i.call(this,s[0],s[1],s[2])}return!i.apply(this,s)}}function iE(i){return pv(2,i)}var oE=Vb(function(i,s){s=s.length==1&&Ee(s[0])?rt(s[0],Sn(me())):rt(It(s,1),Sn(me()));var u=s.length;return Ae(function(d){for(var g=-1,S=jt(d.length,u);++g=s}),Ui=dm(function(){return arguments}())?dm:function(i){return ht(i)&&Be.call(i,"callee")&&!qg.call(i,"callee")},Ee=U.isArray,SE=Dg?Sn(Dg):Rb;function sn(i){return i!=null&&Tl(i.length)&&!Nr(i)}function mt(i){return ht(i)&&sn(i)}function xE(i){return i===!0||i===!1||ht(i)&&Xt(i)==q}var si=I_||rd,_E=$g?Sn($g):Pb;function bE(i){return ht(i)&&i.nodeType===1&&!Ps(i)}function kE(i){if(i==null)return!0;if(sn(i)&&(Ee(i)||typeof i=="string"||typeof i.splice=="function"||si(i)||_o(i)||Ui(i)))return!i.length;var s=Bt(i);if(s==Ke||s==dt)return!i.size;if(Ts(i))return!xf(i).length;for(var u in i)if(Be.call(i,u))return!1;return!0}function CE(i,s){return ks(i,s)}function EE(i,s,u){u=typeof u=="function"?u:n;var d=u?u(i,s):n;return d===n?ks(i,s,n,u):!!d}function Gf(i){if(!ht(i))return!1;var s=Xt(i);return s==xe||s==Te||typeof i.message=="string"&&typeof i.name=="string"&&!Ps(i)}function TE(i){return typeof i=="number"&&em(i)}function Nr(i){if(!at(i))return!1;var s=Xt(i);return s==_e||s==nt||s==ge||s==pr}function Sv(i){return typeof i=="number"&&i==Pe(i)}function Tl(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=B}function at(i){var s=typeof i;return i!=null&&(s=="object"||s=="function")}function ht(i){return i!=null&&typeof i=="object"}var xv=Ig?Sn(Ig):Lb;function RE(i,s){return i===s||Sf(i,s,Mf(s))}function PE(i,s,u){return u=typeof u=="function"?u:n,Sf(i,s,Mf(s),u)}function OE(i){return _v(i)&&i!=+i}function LE(i){if(pk(i))throw new ke(a);return hm(i)}function AE(i){return i===null}function DE(i){return i==null}function _v(i){return typeof i=="number"||ht(i)&&Xt(i)==Re}function Ps(i){if(!ht(i)||Xt(i)!=Ce)return!1;var s=el(i);if(s===null)return!0;var u=Be.call(s,"constructor")&&s.constructor;return typeof u=="function"&&u instanceof u&&Qa.call(u)==P_}var Yf=Ng?Sn(Ng):Ab;function $E(i){return Sv(i)&&i>=-B&&i<=B}var bv=Mg?Sn(Mg):Db;function Rl(i){return typeof i=="string"||!Ee(i)&&ht(i)&&Xt(i)==vn}function _n(i){return typeof i=="symbol"||ht(i)&&Xt(i)==wt}var _o=zg?Sn(zg):$b;function IE(i){return i===n}function NE(i){return ht(i)&&Bt(i)==je}function ME(i){return ht(i)&&Xt(i)==Qr}var zE=yl(_f),FE=yl(function(i,s){return i<=s});function kv(i){if(!i)return[];if(sn(i))return Rl(i)?tr(i):on(i);if(ms&&i[ms])return v_(i[ms]());var s=Bt(i),u=s==Ke?uf:s==dt?Ga:bo;return u(i)}function Mr(i){if(!i)return i===0?i:0;if(i=jn(i),i===ce||i===-ce){var s=i<0?-1:1;return s*M}return i===i?i:0}function Pe(i){var s=Mr(i),u=s%1;return s===s?u?s-u:s:0}function Cv(i){return i?Ni(Pe(i),0,K):0}function jn(i){if(typeof i=="number")return i;if(_n(i))return F;if(at(i)){var s=typeof i.valueOf=="function"?i.valueOf():i;i=at(s)?s+"":s}if(typeof i!="string")return i===0?i:+i;i=Hg(i);var u=Sx.test(i);return u||_x.test(i)?e_(i.slice(2),u?2:8):wx.test(i)?F:+i}function Ev(i){return vr(i,an(i))}function UE(i){return i?Ni(Pe(i),-B,B):i===0?i:0}function Ue(i){return i==null?"":xn(i)}var jE=wo(function(i,s){if(Ts(s)||sn(s)){vr(s,Pt(s),i);return}for(var u in s)Be.call(s,u)&&xs(i,u,s[u])}),Tv=wo(function(i,s){vr(s,an(s),i)}),Pl=wo(function(i,s,u,d){vr(s,an(s),i,d)}),BE=wo(function(i,s,u,d){vr(s,Pt(s),i,d)}),WE=$r(gf);function HE(i,s){var u=yo(i);return s==null?u:om(u,s)}var VE=Ae(function(i,s){i=Ye(i);var u=-1,d=s.length,g=d>2?s[2]:n;for(g&&Qt(s[0],s[1],g)&&(d=1);++u1),S}),vr(i,If(i),u),d&&(u=zn(u,w|m|b,nk));for(var g=s.length;g--;)Tf(u,s[g]);return u});function u2(i,s){return Pv(i,El(me(s)))}var c2=$r(function(i,s){return i==null?{}:Mb(i,s)});function Pv(i,s){if(i==null)return{};var u=rt(If(i),function(d){return[d]});return s=me(s),Sm(i,u,function(d,g){return s(d,g[0])})}function f2(i,s,u){s=ii(s,i);var d=-1,g=s.length;for(g||(g=1,i=n);++ds){var d=i;i=s,s=d}if(u||i%1||s%1){var g=tm();return jt(i+g*(s-i+Jx("1e-"+((g+"").length-1))),s)}return kf(i,s)}var _2=So(function(i,s,u){return s=s.toLowerCase(),i+(u?Av(s):s)});function Av(i){return Zf(Ue(i).toLowerCase())}function Dv(i){return i=Ue(i),i&&i.replace(kx,d_).replace(Wx,"")}function b2(i,s,u){i=Ue(i),s=xn(s);var d=i.length;u=u===n?d:Ni(Pe(u),0,d);var g=u;return u-=s.length,u>=0&&i.slice(u,g)==s}function k2(i){return i=Ue(i),i&&Bc.test(i)?i.replace(Zr,h_):i}function C2(i){return i=Ue(i),i&&Oe.test(i)?i.replace(pe,"\\$&"):i}var E2=So(function(i,s,u){return i+(u?"-":"")+s.toLowerCase()}),T2=So(function(i,s,u){return i+(u?" ":"")+s.toLowerCase()}),R2=Nm("toLowerCase");function P2(i,s,u){i=Ue(i),s=Pe(s);var d=s?ho(i):0;if(!s||d>=s)return i;var g=(s-d)/2;return vl(il(g),u)+i+vl(rl(g),u)}function O2(i,s,u){i=Ue(i),s=Pe(s);var d=s?ho(i):0;return s&&d>>0,u?(i=Ue(i),i&&(typeof s=="string"||s!=null&&!Yf(s))&&(s=xn(s),!s&&fo(i))?oi(tr(i),0,u):i.split(s,u)):[]}var M2=So(function(i,s,u){return i+(u?" ":"")+Zf(s)});function z2(i,s,u){return i=Ue(i),u=u==null?0:Ni(Pe(u),0,i.length),s=xn(s),i.slice(u,u+s.length)==s}function F2(i,s,u){var d=y.templateSettings;u&&Qt(i,s,u)&&(s=n),i=Ue(i),s=Pl({},s,d,Wm);var g=Pl({},s.imports,d.imports,Wm),S=Pt(g),T=lf(g,S),L,I,Y=0,X=s.interpolate||Ba,Z="__p += '",ne=cf((s.escape||Ba).source+"|"+X.source+"|"+(X===za?Ua:Ba).source+"|"+(s.evaluate||Ba).source+"|$","g"),fe="//# sourceURL="+(Be.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yx+"]")+` +`;i.replace(ne,function(we,De,Me,bn,Zt,kn){return Me||(Me=bn),Z+=i.slice(Y,kn).replace(Cx,p_),De&&(L=!0,Z+=`' + __e(`+De+`) + '`),Zt&&(I=!0,Z+=`'; `+Zt+`; __p += '`),Me&&(Z+=`' + ((__t = (`+Me+`)) == null ? '' : __t) + -'`),X=Cn+we.length,we}),Z+=`'; -`;var ye=We.call(s,"variable")&&s.variable;if(!ye)Z=`with (obj) { +'`),Y=kn+we.length,we}),Z+=`'; +`;var ye=Be.call(s,"variable")&&s.variable;if(!ye)Z=`with (obj) { `+Z+` } `;else if(Pr.test(ye))throw new ke(c);Z=(I?Z.replace(Uc,""):Z).replace(Ia,"$1").replace(jc,"$1;"),Z="function("+(ye||"obj")+`) { @@ -271,7 +271,7 @@ __p += '`),Me&&(Z+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Z+`return __p -}`;var Le=Iv(function(){return Fe(S,fe+"return "+Z).apply(n,E)});if(Le.source=Z,Gf(Le))throw Le;return Le}function U2(i){return je(i).toLowerCase()}function j2(i){return je(i).toUpperCase()}function B2(i,s,u){if(i=je(i),i&&(u||s===n))return Hg(i);if(!i||!(s=_n(s)))return i;var d=nr(i),g=nr(s),S=Vg(d,g),E=Kg(d,g)+1;return oi(d,S,E).join("")}function W2(i,s,u){if(i=je(i),i&&(u||s===n))return i.slice(0,Yg(i)+1);if(!i||!(s=_n(s)))return i;var d=nr(i),g=Kg(d,nr(s))+1;return oi(d,0,g).join("")}function H2(i,s,u){if(i=je(i),i&&(u||s===n))return i.replace(Ue,"");if(!i||!(s=_n(s)))return i;var d=nr(i),g=Vg(d,nr(s));return oi(d,g).join("")}function V2(i,s){var u=Y,d=te;if(at(s)){var g="separator"in s?s.separator:g;u="length"in s?Oe(s.length):u,d="omission"in s?_n(s.omission):d}i=je(i);var S=i.length;if(fo(i)){var E=nr(i);S=E.length}if(u>=S)return i;var L=u-ho(d);if(L<1)return d;var I=E?oi(E,0,L).join(""):i.slice(0,L);if(g===n)return I+d;if(E&&(L+=I.length-L),Yf(g)){if(i.slice(L).search(g)){var X,Q=I;for(g.global||(g=cf(g.source,je(ja.exec(g))+"g")),g.lastIndex=0;X=g.exec(Q);)var Z=X.index;I=I.slice(0,Z===n?L:Z)}}else if(i.indexOf(_n(g),L)!=L){var re=I.lastIndexOf(g);re>-1&&(I=I.slice(0,re))}return I+d}function K2(i){return i=je(i),i&&Ma.test(i)?i.replace(Na,x_):i}var G2=So(function(i,s,u){return i+(u?" ":"")+s.toUpperCase()}),Zf=Nm("toUpperCase");function $v(i,s,u){return i=je(i),s=u?n:s,s===n?m_(i)?k_(i):a_(i):i.match(s)||[]}var Iv=Ae(function(i,s){try{return Sn(i,n,s)}catch(u){return Gf(u)?u:new ke(u)}}),Y2=$r(function(i,s){return Nn(s,function(u){u=yr(u),Ar(i,u,Vf(i[u],i))}),i});function X2(i){var s=i==null?0:i.length,u=me();return i=s?rt(i,function(d){if(typeof d[1]!="function")throw new Mn(l);return[u(d[0]),d[1]]}):[],Ae(function(d){for(var g=-1;++gB)return[];var u=K,d=jt(i,K);s=me(s),i-=K;for(var g=af(d,s);++u0||s<0)?new Ie(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),s!==n&&(s=Oe(s),u=s<0?u.dropRight(-s):u.take(s-i)),u)},Ie.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ie.prototype.toArray=function(){return this.take(K)},mr(Ie.prototype,function(i,s){var u=/^(?:filter|find|map|reject)|While$/.test(s),d=/^(?:head|last)$/.test(s),g=w[d?"take"+(s=="last"?"Right":""):s],S=d||/^find/.test(s);g&&(w.prototype[s]=function(){var E=this.__wrapped__,L=d?[1]:arguments,I=E instanceof Ie,X=L[0],Q=I||Ee(E),Z=function(De){var Me=g.apply(w,Jr([De],L));return d&&re?Me[0]:Me};Q&&u&&typeof X=="function"&&X.length!=1&&(I=Q=!1);var re=this.__chain__,fe=!!this.__actions__.length,ye=S&&!re,Le=I&&!fe;if(!S&&Q){E=Le?E:new Ie(this);var we=i.apply(E,L);return we.__actions__.push({func:_l,args:[Z],thisArg:n}),new zn(we,re)}return ye&&Le?i.apply(this,L):(we=this.thru(Z),ye?d?we.value()[0]:we.value():we)})}),Nn(["pop","push","shift","sort","splice","unshift"],function(i){var s=Ya[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);w.prototype[i]=function(){var g=arguments;if(d&&!this.__chain__){var S=this.value();return s.apply(Ee(S)?S:[],g)}return this[u](function(E){return s.apply(Ee(E)?E:[],g)})}}),mr(Ie.prototype,function(i,s){var u=w[s];if(u){var d=u.name+"";We.call(vo,d)||(vo[d]=[]),vo[d].push({name:s,func:u})}}),vo[gl(n,_).name]=[{name:"wrapper",func:n}],Ie.prototype.clone=K_,Ie.prototype.reverse=G_,Ie.prototype.value=Y_,w.prototype.at=bC,w.prototype.chain=kC,w.prototype.commit=CC,w.prototype.next=EC,w.prototype.plant=RC,w.prototype.reverse=PC,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=OC,w.prototype.first=w.prototype.head,ms&&(w.prototype[ms]=TC),w},po=C_();Li?((Li.exports=po)._=po,qc._=po):$t._=po}).call(Os)})(Gu,Gu.exports);var d$=Gu.exports;const h$=ae.div` +}`;var Le=Iv(function(){return Fe(S,fe+"return "+Z).apply(n,T)});if(Le.source=Z,Gf(Le))throw Le;return Le}function U2(i){return Ue(i).toLowerCase()}function j2(i){return Ue(i).toUpperCase()}function B2(i,s,u){if(i=Ue(i),i&&(u||s===n))return Hg(i);if(!i||!(s=xn(s)))return i;var d=tr(i),g=tr(s),S=Vg(d,g),T=Kg(d,g)+1;return oi(d,S,T).join("")}function W2(i,s,u){if(i=Ue(i),i&&(u||s===n))return i.slice(0,Yg(i)+1);if(!i||!(s=xn(s)))return i;var d=tr(i),g=Kg(d,tr(s))+1;return oi(d,0,g).join("")}function H2(i,s,u){if(i=Ue(i),i&&(u||s===n))return i.replace(Ge,"");if(!i||!(s=xn(s)))return i;var d=tr(i),g=Vg(d,tr(s));return oi(d,g).join("")}function V2(i,s){var u=Q,d=te;if(at(s)){var g="separator"in s?s.separator:g;u="length"in s?Pe(s.length):u,d="omission"in s?xn(s.omission):d}i=Ue(i);var S=i.length;if(fo(i)){var T=tr(i);S=T.length}if(u>=S)return i;var L=u-ho(d);if(L<1)return d;var I=T?oi(T,0,L).join(""):i.slice(0,L);if(g===n)return I+d;if(T&&(L+=I.length-L),Yf(g)){if(i.slice(L).search(g)){var Y,X=I;for(g.global||(g=cf(g.source,Ue(ja.exec(g))+"g")),g.lastIndex=0;Y=g.exec(X);)var Z=Y.index;I=I.slice(0,Z===n?L:Z)}}else if(i.indexOf(xn(g),L)!=L){var ne=I.lastIndexOf(g);ne>-1&&(I=I.slice(0,ne))}return I+d}function K2(i){return i=Ue(i),i&&Ma.test(i)?i.replace(Na,x_):i}var G2=So(function(i,s,u){return i+(u?" ":"")+s.toUpperCase()}),Zf=Nm("toUpperCase");function $v(i,s,u){return i=Ue(i),s=u?n:s,s===n?m_(i)?k_(i):a_(i):i.match(s)||[]}var Iv=Ae(function(i,s){try{return wn(i,n,s)}catch(u){return Gf(u)?u:new ke(u)}}),Y2=$r(function(i,s){return In(s,function(u){u=yr(u),Ar(i,u,Vf(i[u],i))}),i});function X2(i){var s=i==null?0:i.length,u=me();return i=s?rt(i,function(d){if(typeof d[1]!="function")throw new Nn(l);return[u(d[0]),d[1]]}):[],Ae(function(d){for(var g=-1;++gB)return[];var u=K,d=jt(i,K);s=me(s),i-=K;for(var g=af(d,s);++u0||s<0)?new Ie(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),s!==n&&(s=Pe(s),u=s<0?u.dropRight(-s):u.take(s-i)),u)},Ie.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ie.prototype.toArray=function(){return this.take(K)},mr(Ie.prototype,function(i,s){var u=/^(?:filter|find|map|reject)|While$/.test(s),d=/^(?:head|last)$/.test(s),g=y[d?"take"+(s=="last"?"Right":""):s],S=d||/^find/.test(s);g&&(y.prototype[s]=function(){var T=this.__wrapped__,L=d?[1]:arguments,I=T instanceof Ie,Y=L[0],X=I||Ee(T),Z=function(De){var Me=g.apply(y,Jr([De],L));return d&&ne?Me[0]:Me};X&&u&&typeof Y=="function"&&Y.length!=1&&(I=X=!1);var ne=this.__chain__,fe=!!this.__actions__.length,ye=S&&!ne,Le=I&&!fe;if(!S&&X){T=Le?T:new Ie(this);var we=i.apply(T,L);return we.__actions__.push({func:_l,args:[Z],thisArg:n}),new Mn(we,ne)}return ye&&Le?i.apply(this,L):(we=this.thru(Z),ye?d?we.value()[0]:we.value():we)})}),In(["pop","push","shift","sort","splice","unshift"],function(i){var s=Ya[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",d=/^(?:pop|shift)$/.test(i);y.prototype[i]=function(){var g=arguments;if(d&&!this.__chain__){var S=this.value();return s.apply(Ee(S)?S:[],g)}return this[u](function(T){return s.apply(Ee(T)?T:[],g)})}}),mr(Ie.prototype,function(i,s){var u=y[s];if(u){var d=u.name+"";Be.call(vo,d)||(vo[d]=[]),vo[d].push({name:s,func:u})}}),vo[gl(n,_).name]=[{name:"wrapper",func:n}],Ie.prototype.clone=K_,Ie.prototype.reverse=G_,Ie.prototype.value=Y_,y.prototype.at=bC,y.prototype.chain=kC,y.prototype.commit=CC,y.prototype.next=EC,y.prototype.plant=RC,y.prototype.reverse=PC,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=OC,y.prototype.first=y.prototype.head,ms&&(y.prototype[ms]=TC),y},po=C_();Ai?((Ai.exports=po)._=po,qc._=po):$t._=po}).call(Os)})(Gu,Gu.exports);var d$=Gu.exports;const h$=ae.div` background-color: ${Se.background}; padding-right: 10px; overflow-y: auto; @@ -292,7 +292,7 @@ function print() { __p += __j.call(arguments, '') } } `,g$=ae.span` width: 100px; - font-size: ${vn.fontSize.small}; + font-size: ${mn.fontSize.small}; cursor: pointer; flex-shrink: 0; display: flex; @@ -312,11 +312,11 @@ function print() { __p += __j.call(arguments, '') } flex-grow: 1; border: none; background: transparent; - font-size: ${vn.fontSize.medium}; + font-size: ${mn.fontSize.medium}; resize: none; overflow: hidden; padding: 5px; - font-family: ${vn.fontFamily}; + font-family: ${mn.fontFamily}; line-height: 1.5; min-height: 1.5em; color: ${Se.text}; @@ -335,13 +335,13 @@ function print() { __p += __j.call(arguments, '') } &:hover { background-color: ${Se.desactivatLight}; } -`,y$=({tracks:e,onTrackChange:t,onTimeChange:n,onEditTrack:r,onDeleteTrack:o,isDubbingService:a,showSpeakerColors:l})=>{const{t:c}=ro(),f=m=>{n(m)},h=m=>{m.style.height="auto",m.style.height=`${Math.max(m.scrollHeight,m.clientHeight)}px`},p=j.useMemo(()=>d$.debounce((m,b)=>{t(m,b,!0)},1e3),[t]),y=j.useCallback((m,b)=>{const P=e.find(N=>N.id===m);if(!P)return;const O={...P};a?(O.translated_text=b.target.value,O.needsResynthesis=O.translated_text!==P.translated_text):O.text=b.target.value,t(m,O,!1),h(b.target),p(m,O)},[e,a,t,p]);return j.useEffect(()=>{document.querySelectorAll(".track-textarea").forEach(h)},[e]),j.useEffect(()=>()=>{p.cancel()},[p]),$.jsx(h$,{children:e.filter(m=>!m.deleted).map((m,b)=>{var P;return $.jsxs(p$,{speakerColor:l?(P=zt.getSpeakerById(m.speaker_id))==null?void 0:P.color:void 0,children:[$.jsx(g$,{onClick:()=>f(m.start),children:w$(m.start)}),$.jsxs(m$,{children:[$.jsx(v$,{className:"track-textarea",value:a?m.translated_text:m.text,onChange:O=>y(m.id,O),onFocus:O=>h(O.target),readOnly:a}),$.jsx(Ay,{onClick:()=>r(m),title:c("edit"),children:$.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:$.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z",fill:"currentColor"})})}),$.jsx(Ay,{onClick:()=>o(m.id),title:c("delete"),children:$.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:$.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z",fill:"currentColor"})})})]})]},m.id)})})},w$=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var S$={exports:{}};(function(e){var t=function(n){var r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(M,F,K){M[F]=K.value},l,c=typeof Symbol=="function"?Symbol:{},f=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function y(M,F,K){return Object.defineProperty(M,F,{value:K,enumerable:!0,configurable:!0,writable:!0}),M[F]}try{y({},"")}catch{y=function(F,K,G){return F[K]=G}}function m(M,F,K,G){var H=F&&F.prototype instanceof x?F:x,J=Object.create(H.prototype),ie=new he(G||[]);return a(J,"_invoke",{value:de(M,K,ie)}),J}n.wrap=m;function b(M,F,K){try{return{type:"normal",arg:M.call(F,K)}}catch(G){return{type:"throw",arg:G}}}var P="suspendedStart",O="suspendedYield",N="executing",_="completed",v={};function x(){}function C(){}function T(){}var k={};y(k,f,function(){return this});var R=Object.getPrototypeOf,A=R&&R(R(ce([])));A&&A!==r&&o.call(A,f)&&(k=A);var W=T.prototype=x.prototype=Object.create(k);C.prototype=T,a(W,"constructor",{value:T,configurable:!0}),a(T,"constructor",{value:C,configurable:!0}),C.displayName=y(T,p,"GeneratorFunction");function Y(M){["next","throw","return"].forEach(function(F){y(M,F,function(K){return this._invoke(F,K)})})}n.isGeneratorFunction=function(M){var F=typeof M=="function"&&M.constructor;return F?F===C||(F.displayName||F.name)==="GeneratorFunction":!1},n.mark=function(M){return Object.setPrototypeOf?Object.setPrototypeOf(M,T):(M.__proto__=T,y(M,p,"GeneratorFunction")),M.prototype=Object.create(W),M},n.awrap=function(M){return{__await:M}};function te(M,F){function K(J,ie,z,ge){var q=b(M[J],M,ie);if(q.type==="throw")ge(q.arg);else{var Ne=q.arg,Re=Ne.value;return Re&&typeof Re=="object"&&o.call(Re,"__await")?F.resolve(Re.__await).then(function(xe){K("next",xe,z,ge)},function(xe){K("throw",xe,z,ge)}):F.resolve(Re).then(function(xe){Ne.value=xe,z(Ne)},function(xe){return K("throw",xe,z,ge)})}}var G;function H(J,ie){function z(){return new F(function(ge,q){K(J,ie,ge,q)})}return G=G?G.then(z,z):z()}a(this,"_invoke",{value:H})}Y(te.prototype),y(te.prototype,h,function(){return this}),n.AsyncIterator=te,n.async=function(M,F,K,G,H){H===void 0&&(H=Promise);var J=new te(m(M,F,K,G),H);return n.isGeneratorFunction(F)?J:J.next().then(function(ie){return ie.done?ie.value:J.next()})};function de(M,F,K){var G=P;return function(J,ie){if(G===N)throw new Error("Generator is already running");if(G===_){if(J==="throw")throw ie;return B()}for(K.method=J,K.arg=ie;;){var z=K.delegate;if(z){var ge=ve(z,K);if(ge){if(ge===v)continue;return ge}}if(K.method==="next")K.sent=K._sent=K.arg;else if(K.method==="throw"){if(G===P)throw G=_,K.arg;K.dispatchException(K.arg)}else K.method==="return"&&K.abrupt("return",K.arg);G=N;var q=b(M,F,K);if(q.type==="normal"){if(G=K.done?_:O,q.arg===v)continue;return{value:q.arg,done:K.done}}else q.type==="throw"&&(G=_,K.method="throw",K.arg=q.arg)}}}function ve(M,F){var K=F.method,G=M.iterator[K];if(G===l)return F.delegate=null,K==="throw"&&M.iterator.return&&(F.method="return",F.arg=l,ve(M,F),F.method==="throw")||K!=="return"&&(F.method="throw",F.arg=new TypeError("The iterator does not provide a '"+K+"' method")),v;var H=b(G,M.iterator,F.arg);if(H.type==="throw")return F.method="throw",F.arg=H.arg,F.delegate=null,v;var J=H.arg;if(!J)return F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,v;if(J.done)F[M.resultName]=J.value,F.next=M.nextLoc,F.method!=="return"&&(F.method="next",F.arg=l);else return J;return F.delegate=null,v}Y(W),y(W,p,"Generator"),y(W,f,function(){return this}),y(W,"toString",function(){return"[object Generator]"});function ne(M){var F={tryLoc:M[0]};1 in M&&(F.catchLoc=M[1]),2 in M&&(F.finallyLoc=M[2],F.afterLoc=M[3]),this.tryEntries.push(F)}function ue(M){var F=M.completion||{};F.type="normal",delete F.arg,M.completion=F}function he(M){this.tryEntries=[{tryLoc:"root"}],M.forEach(ne,this),this.reset(!0)}n.keys=function(M){var F=Object(M),K=[];for(var G in F)K.push(G);return K.reverse(),function H(){for(;K.length;){var J=K.pop();if(J in F)return H.value=J,H.done=!1,H}return H.done=!0,H}};function ce(M){if(M){var F=M[f];if(F)return F.call(M);if(typeof M.next=="function")return M;if(!isNaN(M.length)){var K=-1,G=function H(){for(;++K=0;--G){var H=this.tryEntries[G],J=H.completion;if(H.tryLoc==="root")return K("end");if(H.tryLoc<=this.prev){var ie=o.call(H,"catchLoc"),z=o.call(H,"finallyLoc");if(ie&&z){if(this.prev=0;--K){var G=this.tryEntries[K];if(G.tryLoc<=this.prev&&o.call(G,"finallyLoc")&&this.prev=0;--F){var K=this.tryEntries[F];if(K.finallyLoc===M)return this.complete(K.completion,K.afterLoc),ue(K),v}},catch:function(M){for(var F=this.tryEntries.length-1;F>=0;--F){var K=this.tryEntries[F];if(K.tryLoc===M){var G=K.completion;if(G.type==="throw"){var H=G.arg;ue(K)}return H}}throw new Error("illegal catch attempt")},delegateYield:function(M,F,K){return this.delegate={iterator:ce(M),resultName:F,nextLoc:K},this.method==="next"&&(this.arg=l),v}},n}(e.exports);try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}})(S$);var x$={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}},_$=(e,t)=>{const n=e._malloc(t.length*Uint32Array.BYTES_PER_ELEMENT);return t.forEach((r,o)=>{const a=e.lengthBytesUTF8(r)+1,l=e._malloc(a);e.stringToUTF8(r,l,a),e.setValue(n+Uint32Array.BYTES_PER_ELEMENT*o,l,"i32")}),[t.length,n]};const b$="@ffmpeg/ffmpeg",k$="0.11.6",C$="FFmpeg WebAssembly version",E$="src/index.js",T$="src/index.d.ts",R$={example:"examples"},P$={start:"node scripts/server.js","start:worker":"node scripts/worker-server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js","build:worker":"rimraf dist && webpack --config scripts/webpack.config.worker.prod.js",prepublishOnly:"npm run build",lint:"eslint src",wait:"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node node_modules/mocha/bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},O$={"./src/node/index.js":"./src/browser/index.js"},L$={type:"git",url:"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},A$=["ffmpeg","WebAssembly","video"],D$="Jerome Wu ",$$="MIT",I$={url:"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},N$={node:">=12.16.1"},M$="https://github.com/ffmpegwasm/ffmpeg.wasm#readme",z$={"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},F$={"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.11.0","@types/emscripten":"^1.39.4","babel-eslint":"^10.1.0","babel-loader":"^8.1.0",chai:"^4.2.0",cors:"^2.8.5",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1",express:"^4.17.1",mocha:"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0",webpack:"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"},ux={name:b$,version:k$,description:C$,main:E$,types:T$,directories:R$,scripts:P$,browser:O$,repository:L$,keywords:A$,author:D$,license:$$,bugs:I$,engines:N$,homepage:M$,dependencies:z$,devDependencies:F$},U$=(typeof process<"u",`https://unpkg.com/@ffmpeg/core@${ux.devDependencies["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`),j$={corePath:U$};let fg=!1,cx=()=>{};const B$=e=>{fg=e},W$=e=>{cx=e},H$=(e,t)=>{cx({type:e,message:t}),fg&&console.log(`[${e}] ${t}`)};var Vi={logging:fg,setLogging:B$,setCustomLogger:W$,log:H$};const V$=e=>` +`,y$=({tracks:e,onTrackChange:t,onTimeChange:n,onEditTrack:r,onDeleteTrack:o,isDubbingService:a,showSpeakerColors:l})=>{const{t:c}=io(),f=m=>{n(m)},h=m=>{m.style.height="auto",m.style.height=`${Math.max(m.scrollHeight,m.clientHeight)}px`},p=j.useMemo(()=>d$.debounce((m,b)=>{t(m,b,!0)},1e3),[t]),w=j.useCallback((m,b)=>{const R=e.find(N=>N.id===m);if(!R)return;const O={...R};a?(O.translated_text=b.target.value,O.needsResynthesis=O.translated_text!==R.translated_text):O.text=b.target.value,t(m,O,!1),h(b.target),p(m,O)},[e,a,t,p]);return j.useEffect(()=>{document.querySelectorAll(".track-textarea").forEach(h)},[e]),j.useEffect(()=>()=>{p.cancel()},[p]),$.jsx(h$,{children:e.filter(m=>!m.deleted).map((m,b)=>{var R;return $.jsxs(p$,{speakerColor:l?(R=zt.getSpeakerById(m.speaker_id))==null?void 0:R.color:void 0,children:[$.jsx(g$,{onClick:()=>f(m.start),children:w$(m.start)}),$.jsxs(m$,{children:[$.jsx(v$,{className:"track-textarea",value:a?m.translated_text:m.text,onChange:O=>w(m.id,O),onFocus:O=>h(O.target),readOnly:a}),$.jsx(Ay,{onClick:()=>r(m),title:c("edit"),children:$.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:$.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z",fill:"currentColor"})})}),$.jsx(Ay,{onClick:()=>o(m.id),title:c("delete"),children:$.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:$.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z",fill:"currentColor"})})})]})]},m.id)})})},w$=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`};var S$={exports:{}};(function(e){var t=function(n){var r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(M,F,K){M[F]=K.value},l,c=typeof Symbol=="function"?Symbol:{},f=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function w(M,F,K){return Object.defineProperty(M,F,{value:K,enumerable:!0,configurable:!0,writable:!0}),M[F]}try{w({},"")}catch{w=function(F,K,G){return F[K]=G}}function m(M,F,K,G){var W=F&&F.prototype instanceof x?F:x,J=Object.create(W.prototype),ie=new de(G||[]);return a(J,"_invoke",{value:he(M,K,ie)}),J}n.wrap=m;function b(M,F,K){try{return{type:"normal",arg:M.call(F,K)}}catch(G){return{type:"throw",arg:G}}}var R="suspendedStart",O="suspendedYield",N="executing",_="completed",v={};function x(){}function C(){}function k(){}var E={};w(E,f,function(){return this});var P=Object.getPrototypeOf,A=P&&P(P(ce([])));A&&A!==r&&o.call(A,f)&&(E=A);var V=k.prototype=x.prototype=Object.create(E);C.prototype=k,a(V,"constructor",{value:k,configurable:!0}),a(k,"constructor",{value:C,configurable:!0}),C.displayName=w(k,p,"GeneratorFunction");function Q(M){["next","throw","return"].forEach(function(F){w(M,F,function(K){return this._invoke(F,K)})})}n.isGeneratorFunction=function(M){var F=typeof M=="function"&&M.constructor;return F?F===C||(F.displayName||F.name)==="GeneratorFunction":!1},n.mark=function(M){return Object.setPrototypeOf?Object.setPrototypeOf(M,k):(M.__proto__=k,w(M,p,"GeneratorFunction")),M.prototype=Object.create(V),M},n.awrap=function(M){return{__await:M}};function te(M,F){function K(J,ie,z,ge){var q=b(M[J],M,ie);if(q.type==="throw")ge(q.arg);else{var Ne=q.arg,Te=Ne.value;return Te&&typeof Te=="object"&&o.call(Te,"__await")?F.resolve(Te.__await).then(function(xe){K("next",xe,z,ge)},function(xe){K("throw",xe,z,ge)}):F.resolve(Te).then(function(xe){Ne.value=xe,z(Ne)},function(xe){return K("throw",xe,z,ge)})}}var G;function W(J,ie){function z(){return new F(function(ge,q){K(J,ie,ge,q)})}return G=G?G.then(z,z):z()}a(this,"_invoke",{value:W})}Q(te.prototype),w(te.prototype,h,function(){return this}),n.AsyncIterator=te,n.async=function(M,F,K,G,W){W===void 0&&(W=Promise);var J=new te(m(M,F,K,G),W);return n.isGeneratorFunction(F)?J:J.next().then(function(ie){return ie.done?ie.value:J.next()})};function he(M,F,K){var G=R;return function(J,ie){if(G===N)throw new Error("Generator is already running");if(G===_){if(J==="throw")throw ie;return B()}for(K.method=J,K.arg=ie;;){var z=K.delegate;if(z){var ge=ve(z,K);if(ge){if(ge===v)continue;return ge}}if(K.method==="next")K.sent=K._sent=K.arg;else if(K.method==="throw"){if(G===R)throw G=_,K.arg;K.dispatchException(K.arg)}else K.method==="return"&&K.abrupt("return",K.arg);G=N;var q=b(M,F,K);if(q.type==="normal"){if(G=K.done?_:O,q.arg===v)continue;return{value:q.arg,done:K.done}}else q.type==="throw"&&(G=_,K.method="throw",K.arg=q.arg)}}}function ve(M,F){var K=F.method,G=M.iterator[K];if(G===l)return F.delegate=null,K==="throw"&&M.iterator.return&&(F.method="return",F.arg=l,ve(M,F),F.method==="throw")||K!=="return"&&(F.method="throw",F.arg=new TypeError("The iterator does not provide a '"+K+"' method")),v;var W=b(G,M.iterator,F.arg);if(W.type==="throw")return F.method="throw",F.arg=W.arg,F.delegate=null,v;var J=W.arg;if(!J)return F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,v;if(J.done)F[M.resultName]=J.value,F.next=M.nextLoc,F.method!=="return"&&(F.method="next",F.arg=l);else return J;return F.delegate=null,v}Q(V),w(V,p,"Generator"),w(V,f,function(){return this}),w(V,"toString",function(){return"[object Generator]"});function re(M){var F={tryLoc:M[0]};1 in M&&(F.catchLoc=M[1]),2 in M&&(F.finallyLoc=M[2],F.afterLoc=M[3]),this.tryEntries.push(F)}function ue(M){var F=M.completion||{};F.type="normal",delete F.arg,M.completion=F}function de(M){this.tryEntries=[{tryLoc:"root"}],M.forEach(re,this),this.reset(!0)}n.keys=function(M){var F=Object(M),K=[];for(var G in F)K.push(G);return K.reverse(),function W(){for(;K.length;){var J=K.pop();if(J in F)return W.value=J,W.done=!1,W}return W.done=!0,W}};function ce(M){if(M){var F=M[f];if(F)return F.call(M);if(typeof M.next=="function")return M;if(!isNaN(M.length)){var K=-1,G=function W(){for(;++K=0;--G){var W=this.tryEntries[G],J=W.completion;if(W.tryLoc==="root")return K("end");if(W.tryLoc<=this.prev){var ie=o.call(W,"catchLoc"),z=o.call(W,"finallyLoc");if(ie&&z){if(this.prev=0;--K){var G=this.tryEntries[K];if(G.tryLoc<=this.prev&&o.call(G,"finallyLoc")&&this.prev=0;--F){var K=this.tryEntries[F];if(K.finallyLoc===M)return this.complete(K.completion,K.afterLoc),ue(K),v}},catch:function(M){for(var F=this.tryEntries.length-1;F>=0;--F){var K=this.tryEntries[F];if(K.tryLoc===M){var G=K.completion;if(G.type==="throw"){var W=G.arg;ue(K)}return W}}throw new Error("illegal catch attempt")},delegateYield:function(M,F,K){return this.delegate={iterator:ce(M),resultName:F,nextLoc:K},this.method==="next"&&(this.arg=l),v}},n}(e.exports);try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}})(S$);var x$={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}},_$=(e,t)=>{const n=e._malloc(t.length*Uint32Array.BYTES_PER_ELEMENT);return t.forEach((r,o)=>{const a=e.lengthBytesUTF8(r)+1,l=e._malloc(a);e.stringToUTF8(r,l,a),e.setValue(n+Uint32Array.BYTES_PER_ELEMENT*o,l,"i32")}),[t.length,n]};const b$="@ffmpeg/ffmpeg",k$="0.11.6",C$="FFmpeg WebAssembly version",E$="src/index.js",T$="src/index.d.ts",R$={example:"examples"},P$={start:"node scripts/server.js","start:worker":"node scripts/worker-server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js","build:worker":"rimraf dist && webpack --config scripts/webpack.config.worker.prod.js",prepublishOnly:"npm run build",lint:"eslint src",wait:"rimraf dist && wait-on http://localhost:3000/dist/ffmpeg.dev.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:ffmpeg test:node:all","test:node":"node node_modules/mocha/bin/_mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js","test:browser":"mocha-headless-chrome -a allow-file-access-from-files -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:ffmpeg":"npm run test:browser -- -f ./tests/ffmpeg.test.html"},O$={"./src/node/index.js":"./src/browser/index.js"},L$={type:"git",url:"git+https://github.com/ffmpegwasm/ffmpeg.wasm.git"},A$=["ffmpeg","WebAssembly","video"],D$="Jerome Wu ",$$="MIT",I$={url:"https://github.com/ffmpegwasm/ffmpeg.wasm/issues"},N$={node:">=12.16.1"},M$="https://github.com/ffmpegwasm/ffmpeg.wasm#readme",z$={"is-url":"^1.2.4","node-fetch":"^2.6.1","regenerator-runtime":"^0.13.7","resolve-url":"^0.2.1"},F$={"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@ffmpeg/core":"^0.11.0","@types/emscripten":"^1.39.4","babel-eslint":"^10.1.0","babel-loader":"^8.1.0",chai:"^4.2.0",cors:"^2.8.5",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.22.1",express:"^4.17.1",mocha:"^8.2.1","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5","wait-on":"^5.3.0",webpack:"^5.3.2","webpack-cli":"^4.1.0","webpack-dev-middleware":"^4.0.0"},ux={name:b$,version:k$,description:C$,main:E$,types:T$,directories:R$,scripts:P$,browser:O$,repository:L$,keywords:A$,author:D$,license:$$,bugs:I$,engines:N$,homepage:M$,dependencies:z$,devDependencies:F$},U$=(typeof process<"u",`https://unpkg.com/@ffmpeg/core@${ux.devDependencies["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`),j$={corePath:U$};let fg=!1,cx=()=>{};const B$=e=>{fg=e},W$=e=>{cx=e},H$=(e,t)=>{cx({type:e,message:t}),fg&&console.log(`[${e}] ${t}`)};var Ki={logging:fg,setLogging:B$,setCustomLogger:W$,log:H$};const V$=e=>` createFFmpegCore is not defined. ffmpeg.wasm is unable to find createFFmpegCore after loading ffmpeg-core.js from ${e}. Use another URL when calling createFFmpeg(): const ffmpeg = createFFmpeg({ corePath: 'http://localhost:3000/ffmpeg-core.js', }); -`;var Dy={CREATE_FFMPEG_CORE_IS_NOT_DEFINED:V$};const Ro=async(e,t)=>{Vi.log("info",`fetch ${e}`);const n=await(await fetch(e)).arrayBuffer();Vi.log("info",`${e} file size = ${n.byteLength} bytes`);const r=new Blob([n],{type:t}),o=URL.createObjectURL(r);return Vi.log("info",`${e} blob URL = ${o}`),o},K$=async({corePath:e,workerPath:t,wasmPath:n})=>{if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){if(typeof e!="string")throw Error("corePath should be a string!");const c=new URL(e,import.meta.url).href,f=await Ro(c,"application/javascript"),h=await Ro(n!==void 0?n:c.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),p=await Ro(t!==void 0?t:c.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(y=>{if(globalThis.importScripts(f),typeof createFFmpegCore>"u")throw Error(Dy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(c));Vi.log("info","ffmpeg-core.js script loaded"),y({createFFmpegCore,corePath:f,wasmPath:h,workerPath:p})}):(Vi.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:f,wasmPath:h,workerPath:p}))}if(typeof e!="string")throw Error("corePath should be a string!");const r=new URL(e,import.meta.url).href,o=await Ro(r,"application/javascript"),a=await Ro(n!==void 0?n:r.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),l=await Ro(t!==void 0?t:r.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(c=>{const f=document.createElement("script"),h=()=>{if(f.removeEventListener("load",h),typeof createFFmpegCore>"u")throw Error(Dy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(r));Vi.log("info","ffmpeg-core.js script loaded"),c({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l})};f.src=o,f.type="text/javascript",f.addEventListener("load",h),document.getElementsByTagName("head")[0].appendChild(f)}):(Vi.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l}))},G$=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=({target:{error:{code:o}}})=>{n(Error(`File could not be read! Code=${o}`))},r.readAsArrayBuffer(e)}),Y$=async e=>{let t=e;return typeof e>"u"?new Uint8Array:(typeof e=="string"?/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e)?t=atob(e.split(",")[1]).split("").map(n=>n.charCodeAt(0)):t=await(await fetch(new URL(e,import.meta.url).href)).arrayBuffer():(e instanceof File||e instanceof Blob)&&(t=await G$(e)),new Uint8Array(t))},X$=Object.freeze(Object.defineProperty({__proto__:null,defaultOptions:j$,fetchFile:Y$,getCreateFFmpegCore:K$},Symbol.toStringTag,{value:"Module"})),fx=o1(X$),{defaultArgs:Q$,baseOptions:Z$}=x$,q$=_$,{defaultOptions:J$,getCreateFFmpegCore:eI}=fx,{version:tI}=ux,jd=Error("ffmpeg.wasm is not ready, make sure you have completed load().");var nI=(e={})=>{const{log:t,logger:n,progress:r,...o}={...Z$,...J$,...e};let a=null,l=null,c=null,f=null,h=!1,p=()=>{},y=t,m=r,b=0,P=0,O=!1,N=0;const _=ne=>{ne==="FFMPEG_END"&&c!==null&&(c(),c=null,f=null,h=!1)},v=(ne,ue)=>{p({type:ne,message:ue}),y&&console.log(`[${ne}] ${ue}`)},x=ne=>{const[ue,he,ce]=ne.split(":");return parseFloat(ue)*60*60+parseFloat(he)*60+parseFloat(ce)},C=(ne,ue)=>{if(typeof ne=="string")if(ne.startsWith(" Duration")){const he=ne.split(", ")[0].split(": ")[1],ce=x(he);ue({duration:ce,ratio:N}),(b===0||b>ce)&&(b=ce,O=!0)}else if(O&&ne.startsWith(" Stream")){const he=ne.match(/([\d.]+) fps/);if(he){const ce=parseFloat(he[1]);P=b*ce}else P=0;O=!1}else if(ne.startsWith("frame")||ne.startsWith("size")){const he=ne.split("time=")[1].split(" ")[0],ce=x(he),B=ne.match(/frame=\s*(\d+)/);if(P&&B){const M=parseFloat(B[1]);N=Math.min(M/P,1)}else N=ce/b;ue({ratio:N,time:ce})}else ne.startsWith("video:")&&(ue({ratio:1}),b=0)},T=({type:ne,message:ue})=>{v(ne,ue),C(ue,m),_(ue)},k=async()=>{if(v("info","load ffmpeg-core"),a===null){v("info","loading ffmpeg-core");const{createFFmpegCore:ne,corePath:ue,workerPath:he,wasmPath:ce}=await eI(o);a=await ne({mainScriptUrlOrBlob:ue,printErr:B=>T({type:"fferr",message:B}),print:B=>T({type:"ffout",message:B}),locateFile:(B,M)=>{if(typeof window<"u"||typeof WorkerGlobalScope<"u"){if(typeof ce<"u"&&B.endsWith("ffmpeg-core.wasm"))return ce;if(typeof he<"u"&&B.endsWith("ffmpeg-core.worker.js"))return he}return M+B}}),l=a.cwrap(o.mainName||"proxy_main","number",["number","number"]),v("info","ffmpeg-core loaded")}else throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.")},R=()=>a!==null,A=(...ne)=>{if(v("info",`run ffmpeg command: ${ne.join(" ")}`),a===null)throw jd;if(h)throw Error("ffmpeg.wasm can only run one command at a time");return h=!0,new Promise((ue,he)=>{const ce=[...Q$,...ne].filter(B=>B.length!==0);c=ue,f=he,l(...q$(a,ce))})},W=(ne,...ue)=>{if(v("info",`run FS.${ne} ${ue.map(he=>typeof he=="string"?he:`<${he.length} bytes binary file>`).join(" ")}`),a===null)throw jd;{let he=null;try{he=a.FS[ne](...ue)}catch{throw Error(ne==="readdir"?`ffmpeg.FS('readdir', '${ue[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`:ne==="readFile"?`ffmpeg.FS('readFile', '${ue[0]}') error. Check if the path exists`:"Oops, something went wrong in FS operation.")}return he}},Y=()=>{if(a===null)throw jd;f&&f("ffmpeg has exited"),h=!1;try{a.exit(1)}catch(ne){v(ne.message),f&&f(ne)}finally{a=null,l=null,c=null,f=null}},te=ne=>{m=ne},de=ne=>{p=ne},ve=ne=>{y=ne};return v("info",`use ffmpeg.wasm v${tI}`),{setProgress:te,setLogger:de,setLogging:ve,load:k,isLoaded:R,run:A,exit:Y,FS:W}};const rI=nI,{fetchFile:iI}=fx;var dg={createFFmpeg:rI,fetchFile:iI};const Bd=async(e,t)=>{const n=e.sampleRate;return e.createBuffer(1,Math.ceil(n*t),n)},oI=(e,t)=>{const n=t.reduce((a,l)=>a+l.length,0),r=e.createBuffer(1,n,e.sampleRate);let o=0;for(const a of t)r.copyToChannel(a.getChannelData(0),0,o),o+=a.length;return r},sI=e=>{const t=e.getChannelData(0);return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},aI=async(e,t)=>{const n=e.sampleRate,r=e.numberOfChannels,o=Math.floor(e.length/t),a=new OfflineAudioContext(r,o,n),l=a.createBufferSource();return l.buffer=e,l.playbackRate.value=t,l.connect(a.destination),l.start(),await a.startRendering()};function lI(e){const t=e.numberOfChannels,n=e.sampleRate,r=1,o=16,a=o/8,l=t*a,f=e.getChannelData(0).length,h=new ArrayBuffer(44+f*l),p=new DataView(h);tu(p,0,"RIFF"),p.setUint32(4,36+f*l,!0),tu(p,8,"WAVE"),tu(p,12,"fmt "),p.setUint32(16,16,!0),p.setUint16(20,r,!0),p.setUint16(22,t,!0),p.setUint32(24,n,!0),p.setUint32(28,n*l,!0),p.setUint16(32,l,!0),p.setUint16(34,o,!0),tu(p,36,"data"),p.setUint32(40,f*l,!0);const y=44;for(let m=0;m{fn.isLoaded()||await fn.load(),fn.FS("writeFile",e.name,await dg.fetchFile(e)),await fn.run("-i",e.name,"-map","0:s:0","subtitles.srt");try{const t=fn.FS("readFile","subtitles.srt"),n=new TextDecoder().decode(t);return fI(n)}catch(t){return console.error("Error extracting tracks:",t),[]}},cI=async(e,t,n,r)=>{fn.isLoaded()||await fn.load();const o="input.mp4",a="output.mp4";if(fn.FS("writeFile",o,await dg.fetchFile(e)),r.includes("original")){const h=$y(t,!1);fn.FS("writeFile","original_subtitles.srt",h)}if(r.includes("dubbed")){const h=$y(t,!0);fn.FS("writeFile","dubbed_subtitles.srt",h)}const l=["-i",o];r.includes("original")&&l.push("-i","original_subtitles.srt"),r.includes("dubbed")&&l.push("-i","dubbed_subtitles.srt");for(let h=0;h{l.push("-map",`${p+1+r.length}:a`,"-c:a","aac")});let c=0;r.includes("original")&&(l.push("-map",`${1+c}`,"-c:s","mov_text"),l.push("-metadata:s:s:0","language=es"),c++),r.includes("dubbed")&&(l.push("-map",`${1+c}`,"-c:s","mov_text"),l.push("-metadata:s:s:1","language=ca")),n.forEach((h,p)=>{l.push(`-metadata:s:a:${p}`,`title=${h.label}`)}),l.push(a),await fn.run(...l);const f=fn.FS("readFile",a);return new Blob([f.buffer],{type:"video/mp4"})},fI=e=>{const t=[],n=e.trim().split(` +`;var Dy={CREATE_FFMPEG_CORE_IS_NOT_DEFINED:V$};const Ro=async(e,t)=>{Ki.log("info",`fetch ${e}`);const n=await(await fetch(e)).arrayBuffer();Ki.log("info",`${e} file size = ${n.byteLength} bytes`);const r=new Blob([n],{type:t}),o=URL.createObjectURL(r);return Ki.log("info",`${e} blob URL = ${o}`),o},K$=async({corePath:e,workerPath:t,wasmPath:n})=>{if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){if(typeof e!="string")throw Error("corePath should be a string!");const c=new URL(e,import.meta.url).href,f=await Ro(c,"application/javascript"),h=await Ro(n!==void 0?n:c.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),p=await Ro(t!==void 0?t:c.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(w=>{if(globalThis.importScripts(f),typeof createFFmpegCore>"u")throw Error(Dy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(c));Ki.log("info","ffmpeg-core.js script loaded"),w({createFFmpegCore,corePath:f,wasmPath:h,workerPath:p})}):(Ki.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:f,wasmPath:h,workerPath:p}))}if(typeof e!="string")throw Error("corePath should be a string!");const r=new URL(e,import.meta.url).href,o=await Ro(r,"application/javascript"),a=await Ro(n!==void 0?n:r.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),l=await Ro(t!==void 0?t:r.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return typeof createFFmpegCore>"u"?new Promise(c=>{const f=document.createElement("script"),h=()=>{if(f.removeEventListener("load",h),typeof createFFmpegCore>"u")throw Error(Dy.CREATE_FFMPEG_CORE_IS_NOT_DEFINED(r));Ki.log("info","ffmpeg-core.js script loaded"),c({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l})};f.src=o,f.type="text/javascript",f.addEventListener("load",h),document.getElementsByTagName("head")[0].appendChild(f)}):(Ki.log("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore,corePath:o,wasmPath:a,workerPath:l}))},G$=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=({target:{error:{code:o}}})=>{n(Error(`File could not be read! Code=${o}`))},r.readAsArrayBuffer(e)}),Y$=async e=>{let t=e;return typeof e>"u"?new Uint8Array:(typeof e=="string"?/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e)?t=atob(e.split(",")[1]).split("").map(n=>n.charCodeAt(0)):t=await(await fetch(new URL(e,import.meta.url).href)).arrayBuffer():(e instanceof File||e instanceof Blob)&&(t=await G$(e)),new Uint8Array(t))},X$=Object.freeze(Object.defineProperty({__proto__:null,defaultOptions:j$,fetchFile:Y$,getCreateFFmpegCore:K$},Symbol.toStringTag,{value:"Module"})),fx=o1(X$),{defaultArgs:Q$,baseOptions:Z$}=x$,q$=_$,{defaultOptions:J$,getCreateFFmpegCore:eI}=fx,{version:tI}=ux,jd=Error("ffmpeg.wasm is not ready, make sure you have completed load().");var nI=(e={})=>{const{log:t,logger:n,progress:r,...o}={...Z$,...J$,...e};let a=null,l=null,c=null,f=null,h=!1,p=()=>{},w=t,m=r,b=0,R=0,O=!1,N=0;const _=re=>{re==="FFMPEG_END"&&c!==null&&(c(),c=null,f=null,h=!1)},v=(re,ue)=>{p({type:re,message:ue}),w&&console.log(`[${re}] ${ue}`)},x=re=>{const[ue,de,ce]=re.split(":");return parseFloat(ue)*60*60+parseFloat(de)*60+parseFloat(ce)},C=(re,ue)=>{if(typeof re=="string")if(re.startsWith(" Duration")){const de=re.split(", ")[0].split(": ")[1],ce=x(de);ue({duration:ce,ratio:N}),(b===0||b>ce)&&(b=ce,O=!0)}else if(O&&re.startsWith(" Stream")){const de=re.match(/([\d.]+) fps/);if(de){const ce=parseFloat(de[1]);R=b*ce}else R=0;O=!1}else if(re.startsWith("frame")||re.startsWith("size")){const de=re.split("time=")[1].split(" ")[0],ce=x(de),B=re.match(/frame=\s*(\d+)/);if(R&&B){const M=parseFloat(B[1]);N=Math.min(M/R,1)}else N=ce/b;ue({ratio:N,time:ce})}else re.startsWith("video:")&&(ue({ratio:1}),b=0)},k=({type:re,message:ue})=>{v(re,ue),C(ue,m),_(ue)},E=async()=>{if(v("info","load ffmpeg-core"),a===null){v("info","loading ffmpeg-core");const{createFFmpegCore:re,corePath:ue,workerPath:de,wasmPath:ce}=await eI(o);a=await re({mainScriptUrlOrBlob:ue,printErr:B=>k({type:"fferr",message:B}),print:B=>k({type:"ffout",message:B}),locateFile:(B,M)=>{if(typeof window<"u"||typeof WorkerGlobalScope<"u"){if(typeof ce<"u"&&B.endsWith("ffmpeg-core.wasm"))return ce;if(typeof de<"u"&&B.endsWith("ffmpeg-core.worker.js"))return de}return M+B}}),l=a.cwrap(o.mainName||"proxy_main","number",["number","number"]),v("info","ffmpeg-core loaded")}else throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.")},P=()=>a!==null,A=(...re)=>{if(v("info",`run ffmpeg command: ${re.join(" ")}`),a===null)throw jd;if(h)throw Error("ffmpeg.wasm can only run one command at a time");return h=!0,new Promise((ue,de)=>{const ce=[...Q$,...re].filter(B=>B.length!==0);c=ue,f=de,l(...q$(a,ce))})},V=(re,...ue)=>{if(v("info",`run FS.${re} ${ue.map(de=>typeof de=="string"?de:`<${de.length} bytes binary file>`).join(" ")}`),a===null)throw jd;{let de=null;try{de=a.FS[re](...ue)}catch{throw Error(re==="readdir"?`ffmpeg.FS('readdir', '${ue[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`:re==="readFile"?`ffmpeg.FS('readFile', '${ue[0]}') error. Check if the path exists`:"Oops, something went wrong in FS operation.")}return de}},Q=()=>{if(a===null)throw jd;f&&f("ffmpeg has exited"),h=!1;try{a.exit(1)}catch(re){v(re.message),f&&f(re)}finally{a=null,l=null,c=null,f=null}},te=re=>{m=re},he=re=>{p=re},ve=re=>{w=re};return v("info",`use ffmpeg.wasm v${tI}`),{setProgress:te,setLogger:he,setLogging:ve,load:E,isLoaded:P,run:A,exit:Q,FS:V}};const rI=nI,{fetchFile:iI}=fx;var dg={createFFmpeg:rI,fetchFile:iI};const Bd=async(e,t)=>{const n=e.sampleRate;return e.createBuffer(1,Math.ceil(n*t),n)},oI=(e,t)=>{const n=t.reduce((a,l)=>a+l.length,0),r=e.createBuffer(1,n,e.sampleRate);let o=0;for(const a of t)r.copyToChannel(a.getChannelData(0),0,o),o+=a.length;return r},sI=e=>{const t=e.getChannelData(0);return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},aI=async(e,t)=>{const n=e.sampleRate,r=e.numberOfChannels,o=Math.floor(e.length/t),a=new OfflineAudioContext(r,o,n),l=a.createBufferSource();return l.buffer=e,l.playbackRate.value=t,l.connect(a.destination),l.start(),await a.startRendering()};function lI(e){const t=e.numberOfChannels,n=e.sampleRate,r=1,o=16,a=o/8,l=t*a,f=e.getChannelData(0).length,h=new ArrayBuffer(44+f*l),p=new DataView(h);tu(p,0,"RIFF"),p.setUint32(4,36+f*l,!0),tu(p,8,"WAVE"),tu(p,12,"fmt "),p.setUint32(16,16,!0),p.setUint16(20,r,!0),p.setUint16(22,t,!0),p.setUint32(24,n,!0),p.setUint32(28,n*l,!0),p.setUint16(32,l,!0),p.setUint16(34,o,!0),tu(p,36,"data"),p.setUint32(40,f*l,!0);const w=44;for(let m=0;m{cn.isLoaded()||await cn.load(),cn.FS("writeFile",e.name,await dg.fetchFile(e)),await cn.run("-i",e.name,"-map","0:s:0","subtitles.srt");try{const t=cn.FS("readFile","subtitles.srt"),n=new TextDecoder().decode(t);return fI(n)}catch(t){return console.error("Error extracting tracks:",t),[]}},cI=async(e,t,n,r)=>{cn.isLoaded()||await cn.load();const o="input.mp4",a="output.mp4";if(cn.FS("writeFile",o,await dg.fetchFile(e)),r.includes("original")){const h=$y(t,!1);cn.FS("writeFile","original_subtitles.srt",h)}if(r.includes("dubbed")){const h=$y(t,!0);cn.FS("writeFile","dubbed_subtitles.srt",h)}const l=["-i",o];r.includes("original")&&l.push("-i","original_subtitles.srt"),r.includes("dubbed")&&l.push("-i","dubbed_subtitles.srt");for(let h=0;h{l.push("-map",`${p+1+r.length}:a`,"-c:a","aac")});let c=0;r.includes("original")&&(l.push("-map",`${1+c}`,"-c:s","mov_text"),l.push("-metadata:s:s:0","language=es"),c++),r.includes("dubbed")&&(l.push("-map",`${1+c}`,"-c:s","mov_text"),l.push("-metadata:s:s:1","language=ca")),n.forEach((h,p)=>{l.push(`-metadata:s:a:${p}`,`title=${h.label}`)}),l.push(a),await cn.run(...l);const f=cn.FS("readFile",a);return new Blob([f.buffer],{type:"video/mp4"})},fI=e=>{const t=[],n=e.trim().split(` `);let r=0;return n.forEach(o=>{const a=o.split(` `);if(a.length>=3){const l=a[1].split(" --> "),c=Iy(l[0]),f=Iy(l[1]),h=a.slice(2).join(` @@ -361,7 +361,7 @@ ${l}`}).join(` display: flex; justify-content: flex-end; gap: 10px; -`,gI=({track:e,onSave:t,onClose:n,onDelete:r,ModalOverlay:o,isDubbingService:a})=>{const{t:l}=ro(),[c,f]=j.useState(""),[h,p]=j.useState(""),[y,m]=j.useState(0),[b,P]=j.useState(0),[O,N]=j.useState(1),[_,v]=j.useState(""),[x,C]=j.useState([]);j.useEffect(()=>{e&&(f(e.text),p(e.translated_text||""),m(e.start),P(e.end),N(e.speed||1),v(e.speaker_id||"")),C(zt.getSpeakers())},[e]);const T=()=>{if(e){const A=zt.getSpeakerById(_),W=zt.getSpeakerById(e.speaker_id),Y={...e,text:c,translated_text:h,start:y,end:b,speed:O,speaker_id:_,needsResynthesis:h!==e.translated_text||A.voice!==W.voice},te=y!==e.start||O!==e.speed||Y.needsResynthesis;t(Y,te)}n()},k=j.useCallback(A=>{A.target===A.currentTarget&&n()},[n]);if(!e)return null;const R=()=>{e&&r(e.id),n()};return $.jsx(o,{onClick:k,children:$.jsxs(VD,{children:[a&&$.jsxs($.Fragment,{children:[$.jsx(en,{children:l("originalText")}),$.jsx(Md,{value:c,onChange:A=>f(A.target.value),readOnly:!0}),$.jsx(en,{children:l("translatedText")}),$.jsx(Md,{value:h,onChange:A=>p(A.target.value)})]}),!a&&$.jsxs($.Fragment,{children:[$.jsx(en,{children:l("text")}),$.jsx(Md,{value:c,onChange:A=>f(A.target.value)})]}),$.jsx(en,{children:l("startTime")}),$.jsx(yu,{type:"number",value:y,onChange:A=>m(Number(A.target.value)),step:"0.1"}),$.jsx(en,{children:l("endTime")}),$.jsx(yu,{type:"number",value:b,onChange:A=>P(Number(A.target.value)),step:"0.1"}),$.jsx(en,{children:l("speed")}),$.jsx(yu,{type:"number",value:O,onChange:A=>N(Number(A.target.value)),step:"0.1",min:"1",max:"2"}),$.jsx(en,{children:l("speaker")}),$.jsxs(HD,{value:_,onChange:A=>v(A.target.value),children:[$.jsx("option",{value:"",children:l("selectSpeaker")}),x.map(A=>$.jsxs("option",{value:A.id,children:[A.name," (",A.voice.label,")"]},A.id))]}),$.jsxs(dI,{children:[$.jsx(hI,{onClick:R,children:l("deleteTrack")}),$.jsxs(pI,{children:[$.jsx(Lt,{onClick:n,children:l("cancel")}),$.jsx(Lt,{onClick:T,children:l("save")})]})]})]})})},mI={"audio/mpeg":"mp3","audio/wav":"wav","application/ogg":"ogg","audio/flac":"flac","video/x-msvideo":"avi","video/mp4":"mp4","video/x-matroska":"mkv","video/quicktime":"mov","video/mts":"mts"},vI=e=>{if(!e)return"input";const t=e.match(/filename="?([^;]+)"?/i);return t?t[1].replace(/['"]/g,""):"input"},dx="https://api.softcatala.org/transcribe-service/v1",hx=e=>`${dx}/get_file/?uuid=${e}&ext=bin`,yI=async e=>{const t=await fetch(hx(e),{method:"HEAD"});if(!t.ok)throw new Error("Failed to load video");const n=t.headers.get("content-type")||"video/mp4",r=t.headers.get("content-disposition");let o=vI(r);return o==="input"&&(o=`input.${mI[n]||"mp4"}`),{contentType:n,filename:o}},wI=async e=>{const t=await fetch(`${dx}/get_file/?uuid=${e}&ext=json`);if(!t.ok)throw new Error("Failed to load tracks");return t.json()},SI=e=>e.segments.map(t=>({id:t.id,start:t.start,end:t.end,speaker_id:t.speaker||"",path:"",text:t.text.trim(),for_dubbing:!1,ssml_gender:"",translated_text:"",assigned_voice:"",pitch:0,speed:1,volume_gain_db:0})),nu={getMediaUrl:hx,loadTracksFromUUID:wI,parseTracksFromJSON:SI,getMediaMetadata:yI},Zn="https://api.softcatala.org/dubbing-service/v1",xI=async e=>{const t=await fetch(`${Zn}/uuid_exists/?uuid=${e}`);if(!t.ok)throw new Error("UUID does not exist");return t.json()},_I=e=>`${Zn}/get_file/?uuid=${e}&ext=dub`,bI=e=>`${Zn}/get_chunk/?uuid=${e}&chunk_name=original_video.mp4`,kI=async e=>{const t=await fetch(`${Zn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/vocals.mp3`);if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},CI=async e=>{const t=await fetch(`${Zn}/get_chunk/?uuid=${e}&chunk_name=dubbed_vocals.mp3`);if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},EI=async e=>{const t=await fetch(`${Zn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/no_vocals.mp3`);if(!t.ok)throw new Error("Failed to load background audio");return t.arrayBuffer()},TI=async e=>{const t=await fetch(`${Zn}/get_utterances?uuid=${e}`);if(!t.ok)throw new Error("Failed to load dubbing data");return t.json()},RI=e=>{const t=[];for(const n of e)zt.setSpeaker({id:n.speaker_id,name:`${zS().t("speaker")} ${n.speaker_id.slice(-2)}`,voice:ba.getVoice(n.assigned_voice)}),t.push({id:n.id,start:n.start||0,end:n.end||0,speaker_id:n.speaker_id,path:n.path||"",text:n.text||"",for_dubbing:n.for_dubbing||!1,ssml_gender:n.gender||"",translated_text:n.translated_text||"",pitch:n.pitch||0,speed:n.speed||1,volume_gain_db:n.volume_gain_db||0,dubbed_path:n.dubbed_path,chunk_size:0,needsResynthesis:!1});return t},PI=async(e,t)=>{const n=await fetch(`${Zn}/get_dubbed_utterance/?uuid=${e}&id=${t}`);if(!n.ok)throw new Error(`Failed to load dubbed utterance: ${t}`);return n.arrayBuffer()},OI=e=>`${Zn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/no_vocals.mp3`,LI=e=>`${Zn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/vocals.mp3`,AI=e=>`${Zn}/get_chunk/?uuid=${e}&chunk_name=dubbed_vocals.mp3`,DI=async(e,t)=>{const n=t.filter(o=>!o.deleted).map(o=>{var a,l;return{id:o.id,start:o.start,end:o.end,speaker_id:o.speaker_id,path:o.path,text:o.text,for_dubbing:o.for_dubbing,gender:o.ssml_gender,translated_text:o.translated_text,assigned_voice:((l=(a=zt.getSpeakerById(o.speaker_id))==null?void 0:a.voice)==null?void 0:l.id)||"",pitch:o.pitch,speed:o.speed,volume_gain_db:o.volume_gain_db,dubbed_path:o.dubbed_path}});if(!(await fetch(`${Zn}/regenerate_video`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:e,utterance_update:n})})).ok)throw new Error("Failed to regenerate video")},ar={loadOriginalVocalsFromUUID:kI,loadBackgroundAudioFromUUID:EI,loadDubbedVocalsFromUUID:CI,loadTracksFromUUID:TI,parseTracksFromJSON:RI,uuidExists:xI,getMediaUrl:_I,getSilentVideoUrl:bI,loadDubbedUtterance:PI,getBackgroundAudioUrl:OI,getOriginalVocalsUrl:LI,getDubbedVocalsUrl:AI,regenerateVideo:DI};class $I{constructor(){this.providers=new Map,this.registerProvider(ba.getProviderName(),ba)}registerProvider(t,n){this.providers.set(t,n)}async speak(t,n){const r=this.providers.get(n.provider);if(!r)throw new Error(`Provider ${n.provider} not found`);return r.speak(t,n)}async voices(){const t=[];for(const[n,r]of this.providers){const o=await r.voices();t.push(...o)}return t}}const px=new $I;class II{constructor(){this.audioContext=new(window.AudioContext||window.webkitAudioContext)}async recreateConstructedAudio(t,n){console.log("Recreating constructed audio in AudioService...");const r=t.filter(c=>c.dubbed_path&&c.for_dubbing&&!c.deleted).sort((c,f)=>c.start-f.start);if(r.length===0)throw new Error("No dubbed tracks found");const o=[];let a=0;if(r[0].start>0){const c=await Bd(this.audioContext,r[0].start);o.push(c),a=r[0].start}for(const c of r){if(c.start>a){const p=c.start-a,y=await Bd(this.audioContext,p);o.push(y),a=c.start}const f=c.dubbed_path.split("/").pop()||"";let h=n[f];if(!(!h&&!c.needsResynthesis)){if(c.needsResynthesis)try{h=await this.resynthesizeTrack(c),n[f]=h,c.needsResynthesis=!1}catch(p){console.error(`Failed to resynthesize track ${c.id}:`,p);continue}if(h){let p;try{p=await this.audioContext.decodeAudioData(h.slice(0))}catch(m){console.error(`Failed to decode audio data for track ${c.id}:`,m);continue}const y=await aI(p,c.speed||1);o.push(y),a=c.start+y.duration}}}const l=t[t.length-1].end;if(a{for(let p=0;p{const{t:l}=io(),[c,f]=j.useState(""),[h,p]=j.useState(""),[w,m]=j.useState(0),[b,R]=j.useState(0),[O,N]=j.useState(1),[_,v]=j.useState(""),[x,C]=j.useState([]);j.useEffect(()=>{e&&(f(e.text),p(e.translated_text||""),m(e.start),R(e.end),N(e.speed||1),v(e.speaker_id||"")),C(zt.getSpeakers())},[e]);const k=()=>{if(e){const A=zt.getSpeakerById(_),V=zt.getSpeakerById(e.speaker_id),Q={...e,text:c,translated_text:h,start:w,end:b,speed:O,speaker_id:_,needsResynthesis:h!==e.translated_text||A.voice!==V.voice},te=w!==e.start||O!==e.speed||Q.needsResynthesis;t(Q,te)}n()},E=j.useCallback(A=>{A.target===A.currentTarget&&n()},[n]);if(!e)return null;const P=()=>{e&&r(e.id),n()};return $.jsx(o,{onClick:E,children:$.jsxs(VD,{children:[a&&$.jsxs($.Fragment,{children:[$.jsx(en,{children:l("originalText")}),$.jsx(Md,{value:c,onChange:A=>f(A.target.value),readOnly:!0}),$.jsx(en,{children:l("translatedText")}),$.jsx(Md,{value:h,onChange:A=>p(A.target.value)})]}),!a&&$.jsxs($.Fragment,{children:[$.jsx(en,{children:l("text")}),$.jsx(Md,{value:c,onChange:A=>f(A.target.value)})]}),$.jsx(en,{children:l("startTime")}),$.jsx(yu,{type:"number",value:w,onChange:A=>m(Number(A.target.value)),step:"0.1"}),$.jsx(en,{children:l("endTime")}),$.jsx(yu,{type:"number",value:b,onChange:A=>R(Number(A.target.value)),step:"0.1"}),$.jsx(en,{children:l("speed")}),$.jsx(yu,{type:"number",value:O,onChange:A=>N(Number(A.target.value)),step:"0.1",min:"1",max:"2"}),$.jsx(en,{children:l("speaker")}),$.jsxs(HD,{value:_,onChange:A=>v(A.target.value),children:[$.jsx("option",{value:"",children:l("selectSpeaker")}),x.map(A=>$.jsxs("option",{value:A.id,children:[A.name," (",A.voice.label,")"]},A.id))]}),$.jsxs(dI,{children:[$.jsx(hI,{onClick:P,children:l("deleteTrack")}),$.jsxs(pI,{children:[$.jsx(Lt,{onClick:n,children:l("cancel")}),$.jsx(Lt,{onClick:k,children:l("save")})]})]})]})})},mI={"audio/mpeg":"mp3","audio/wav":"wav","application/ogg":"ogg","audio/flac":"flac","video/x-msvideo":"avi","video/mp4":"mp4","video/x-matroska":"mkv","video/quicktime":"mov","video/mts":"mts"},vI=e=>{if(!e)return"input";const t=e.match(/filename="?([^;]+)"?/i);return t?t[1].replace(/['"]/g,""):"input"},dx="https://api.softcatala.org/transcribe-service/v1",hx=e=>`${dx}/get_file/?uuid=${e}&ext=bin`,yI=async e=>{const t=await fetch(hx(e),{method:"HEAD"});if(!t.ok)throw new Error("Failed to load video");const n=t.headers.get("content-type")||"video/mp4",r=t.headers.get("content-disposition");let o=vI(r);return o==="input"&&(o=`input.${mI[n]||"mp4"}`),{contentType:n,filename:o}},wI=async e=>{const t=await fetch(`${dx}/get_file/?uuid=${e}&ext=json`);if(!t.ok)throw new Error("Failed to load tracks");return t.json()},SI=e=>e.segments.map(t=>({id:t.id,start:t.start,end:t.end,speaker_id:t.speaker||"",path:"",text:t.text.trim(),for_dubbing:!1,ssml_gender:"",translated_text:"",assigned_voice:"",pitch:0,speed:1,volume_gain_db:0})),nu={getMediaUrl:hx,loadTracksFromUUID:wI,parseTracksFromJSON:SI,getMediaMetadata:yI},Qn="https://api.softcatala.org/dubbing-service/v1",xI=async e=>{const t=await fetch(`${Qn}/uuid_exists/?uuid=${e}`);if(!t.ok)throw new Error("UUID does not exist");return t.json()},_I=e=>`${Qn}/get_file/?uuid=${e}&ext=dub`,bI=e=>`${Qn}/get_chunk/?uuid=${e}&chunk_name=original_video.mp4`,kI=async e=>{const t=await fetch(`${Qn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/vocals.mp3`);if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},CI=async e=>{const t=await fetch(`${Qn}/get_chunk/?uuid=${e}&chunk_name=dubbed_vocals.mp3`);if(!t.ok)throw new Error("Failed to load original audio");return t.arrayBuffer()},EI=async e=>{const t=await fetch(`${Qn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/no_vocals.mp3`);if(!t.ok)throw new Error("Failed to load background audio");return t.arrayBuffer()},TI=async e=>{const t=await fetch(`${Qn}/get_utterances?uuid=${e}`);if(!t.ok)throw new Error("Failed to load dubbing data");return t.json()},RI=e=>{const t=[];for(const n of e)zt.setSpeaker({id:n.speaker_id,name:`${zS().t("speaker")} ${n.speaker_id.slice(-2)}`,voice:ba.getVoice(n.assigned_voice)}),t.push({id:n.id,start:n.start||0,end:n.end||0,speaker_id:n.speaker_id,path:n.path||"",text:n.text||"",original_text:n.text||"",for_dubbing:n.for_dubbing||!1,ssml_gender:n.gender||"",translated_text:n.translated_text||"",original_translated_text:n.translated_text||"",pitch:n.pitch||0,speed:n.speed||1,volume_gain_db:n.volume_gain_db||0,dubbed_path:n.dubbed_path,chunk_size:0,needsResynthesis:!1});return t},PI=async(e,t)=>{const n=await fetch(`${Qn}/get_dubbed_utterance/?uuid=${e}&id=${t}`);if(!n.ok)throw new Error(`Failed to load dubbed utterance: ${t}`);return n.arrayBuffer()},OI=e=>`${Qn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/no_vocals.mp3`,LI=e=>`${Qn}/get_chunk/?uuid=${e}&chunk_name=htdemucs/original_audio/vocals.mp3`,AI=e=>`${Qn}/get_chunk/?uuid=${e}&chunk_name=dubbed_vocals.mp3`,DI=async(e,t)=>{var o,a;const n=[];for(const l of t)!l.updated&&!l.deleted||n.push({id:l.id,start:l.start,end:l.end,speaker_id:l.speaker_id,path:l.path,text:l.text,for_dubbing:l.for_dubbing,gender:l.ssml_gender,translated_text:l.translated_text||"",assigned_voice:((a=(o=zt.getSpeakerById(l.speaker_id))==null?void 0:o.voice)==null?void 0:a.id)||"",pitch:l.pitch,speed:l.speed,volume_gain_db:l.volume_gain_db,dubbed_path:l.dubbed_path,operation:l.deleted?"delete":"update"});if(!(await fetch(`${Qn}/regenerate_video`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:e,utterance_update:n})})).ok)throw new Error("Failed to regenerate video")},sr={loadOriginalVocalsFromUUID:kI,loadBackgroundAudioFromUUID:EI,loadDubbedVocalsFromUUID:CI,loadTracksFromUUID:TI,parseTracksFromJSON:RI,uuidExists:xI,getMediaUrl:_I,getSilentVideoUrl:bI,loadDubbedUtterance:PI,getBackgroundAudioUrl:OI,getOriginalVocalsUrl:LI,getDubbedVocalsUrl:AI,regenerateVideo:DI};class $I{constructor(){this.providers=new Map,this.registerProvider(ba.getProviderName(),ba)}registerProvider(t,n){this.providers.set(t,n)}async speak(t,n){const r=this.providers.get(n.provider);if(!r)throw new Error(`Provider ${n.provider} not found`);return r.speak(t,n)}async voices(){const t=[];for(const[n,r]of this.providers){const o=await r.voices();t.push(...o)}return t}}const px=new $I;class II{constructor(){this.audioContext=new(window.AudioContext||window.webkitAudioContext)}async recreateConstructedAudio(t,n){console.log("Recreating constructed audio in AudioService...");const r=t.filter(c=>c.dubbed_path&&c.for_dubbing&&!c.deleted).sort((c,f)=>c.start-f.start);if(r.length===0)throw new Error("No dubbed tracks found");const o=[];let a=0;if(r[0].start>0){const c=await Bd(this.audioContext,r[0].start);o.push(c),a=r[0].start}for(const c of r){if(c.start>a){const p=c.start-a,w=await Bd(this.audioContext,p);o.push(w),a=c.start}const f=c.dubbed_path.split("/").pop()||"";let h=n[f];if(!(!h&&!c.needsResynthesis)){if(c.needsResynthesis)try{h=await this.resynthesizeTrack(c),n[f]=h,c.needsResynthesis=!1}catch(p){console.error(`Failed to resynthesize track ${c.id}:`,p);continue}if(h){let p;try{p=await this.audioContext.decodeAudioData(h.slice(0))}catch(m){console.error(`Failed to decode audio data for track ${c.id}:`,m);continue}const w=await aI(p,c.speed||1);o.push(w),a=c.start+w.duration}}}const l=t[t.length-1].end;if(a{for(let p=0;p{const{t:p}=ro(),[y,m]=j.useState(""),[b,P]=j.useState(zt.getSpeakers()),[O,N]=j.useState([]);j.useEffect(()=>{(async()=>{const k=await px.voices();N(k)})()},[]);const _=(T,k)=>{zt.updateSpeaker(T,{name:k}),P([...zt.getSpeakers()])},v=(T,k)=>{zt.updateSpeaker(T,{color:k}),P([...zt.getSpeakers()])},x=async(T,k)=>{const R=O.find(A=>A.id===k);R&&(await c(T,R),P([...zt.getSpeakers()]))},C=()=>{y.trim()&&O.length>0&&(zt.addSpeaker(y.trim(),O[0]),P([...zt.getSpeakers()]),m(""))};return $.jsxs(NI,{children:[$.jsx("h3",{children:p("audioTracks")}),Object.entries(e).filter(([T])=>T!=="background").map(([T,k],R)=>$.jsxs(Po,{children:[$.jsx(Wd,{type:"checkbox",id:`audio-track-${R}`,checked:t.includes(T),onChange:()=>n(T)}),$.jsx(en,{htmlFor:`audio-track-${R}`,children:k.label})]},T)),$.jsx("h3",{children:p("subtitles")}),$.jsxs(MI,{children:[$.jsxs(Po,{children:[$.jsx(Hd,{type:"radio",id:"subtitles-none",name:"subtitles",value:"none",checked:r==="none",onChange:()=>o("none")}),$.jsx(en,{htmlFor:"subtitles-none",children:p("noSubtitles")})]}),$.jsxs(Po,{children:[$.jsx(Hd,{type:"radio",id:"subtitles-original",name:"subtitles",value:"original",checked:r==="original",onChange:()=>o("original")}),$.jsx(en,{htmlFor:"subtitles-original",children:p("originalSubtitles")})]}),$.jsxs(Po,{children:[$.jsx(Hd,{type:"radio",id:"subtitles-dubbed",name:"subtitles",value:"dubbed",checked:r==="dubbed",onChange:()=>o("dubbed")}),$.jsx(en,{htmlFor:"subtitles-dubbed",children:p("dubbedSubtitles")})]})]}),$.jsx("h3",{children:p("speakers")}),$.jsxs(Po,{children:[$.jsx(Wd,{type:"checkbox",id:"show-speaker-colors",checked:a,onChange:T=>l(T.target.checked)}),$.jsx(en,{htmlFor:"show-speaker-colors",children:p("showSpeakerColors")})]}),$.jsx(zI,{children:b.map(T=>$.jsxs(My,{children:[$.jsx(UI,{color:T.color,onClick:()=>{document.getElementById(`color-${T.id}`).click()}}),$.jsx(zy,{value:T.name,onChange:k=>_(T.id,k.target.value)}),$.jsx(BI,{value:T.voice.id,onChange:k=>x(T.id,k.target.value),children:O.map(k=>$.jsx("option",{value:k.id,children:k.label},k.id))}),$.jsx(jI,{id:`color-${T.id}`,type:"color",value:T.color,onChange:k=>v(T.id,k.target.value),hidden:!0})]},T.id))}),$.jsxs(My,{children:[$.jsx(zy,{value:y,onChange:T=>m(T.target.value),placeholder:p("newSpeakerName")}),$.jsx(FI,{onClick:C,children:"+"})]}),$.jsx("h3",{children:p("advanced")}),$.jsxs(Po,{children:[$.jsx(Wd,{type:"checkbox",id:"timeline-visible",checked:f,onChange:T=>h(T.target.checked)}),$.jsx(en,{htmlFor:"timeline-visible",children:p("enableTimeline")})]})]})},HI=ae.div` +`,WI=({audioTracks:e,selectedTracks:t,onAudioTrackToggle:n,selectedSubtitles:r,onSubtitlesChange:o,showSpeakerColors:a,onShowSpeakerColorsChange:l,onSpeakerVoiceChange:c,timelineVisible:f,onTimelineVisibleChange:h})=>{const{t:p}=io(),[w,m]=j.useState(""),[b,R]=j.useState(zt.getSpeakers()),[O,N]=j.useState([]);j.useEffect(()=>{(async()=>{const E=await px.voices();N(E)})()},[]);const _=(k,E)=>{zt.updateSpeaker(k,{name:E}),R([...zt.getSpeakers()])},v=(k,E)=>{zt.updateSpeaker(k,{color:E}),R([...zt.getSpeakers()])},x=async(k,E)=>{const P=O.find(A=>A.id===E);P&&(await c(k,P),R([...zt.getSpeakers()]))},C=()=>{w.trim()&&O.length>0&&(zt.addSpeaker(w.trim(),O[0]),R([...zt.getSpeakers()]),m(""))};return $.jsxs(NI,{children:[$.jsx("h3",{children:p("audioTracks")}),Object.entries(e).filter(([k])=>k!=="background").map(([k,E],P)=>$.jsxs(Po,{children:[$.jsx(Wd,{type:"checkbox",id:`audio-track-${P}`,checked:t.includes(k),onChange:()=>n(k)}),$.jsx(en,{htmlFor:`audio-track-${P}`,children:E.label})]},k)),$.jsx("h3",{children:p("subtitles")}),$.jsxs(MI,{children:[$.jsxs(Po,{children:[$.jsx(Hd,{type:"radio",id:"subtitles-none",name:"subtitles",value:"none",checked:r==="none",onChange:()=>o("none")}),$.jsx(en,{htmlFor:"subtitles-none",children:p("noSubtitles")})]}),$.jsxs(Po,{children:[$.jsx(Hd,{type:"radio",id:"subtitles-original",name:"subtitles",value:"original",checked:r==="original",onChange:()=>o("original")}),$.jsx(en,{htmlFor:"subtitles-original",children:p("originalSubtitles")})]}),$.jsxs(Po,{children:[$.jsx(Hd,{type:"radio",id:"subtitles-dubbed",name:"subtitles",value:"dubbed",checked:r==="dubbed",onChange:()=>o("dubbed")}),$.jsx(en,{htmlFor:"subtitles-dubbed",children:p("dubbedSubtitles")})]})]}),$.jsx("h3",{children:p("speakers")}),$.jsxs(Po,{children:[$.jsx(Wd,{type:"checkbox",id:"show-speaker-colors",checked:a,onChange:k=>l(k.target.checked)}),$.jsx(en,{htmlFor:"show-speaker-colors",children:p("showSpeakerColors")})]}),$.jsx(zI,{children:b.map(k=>$.jsxs(My,{children:[$.jsx(UI,{color:k.color,onClick:()=>{document.getElementById(`color-${k.id}`).click()}}),$.jsx(zy,{value:k.name,onChange:E=>_(k.id,E.target.value)}),$.jsx(BI,{value:k.voice.id,onChange:E=>x(k.id,E.target.value),children:O.map(E=>$.jsx("option",{value:E.id,children:E.label},E.id))}),$.jsx(jI,{id:`color-${k.id}`,type:"color",value:k.color,onChange:E=>v(k.id,E.target.value),hidden:!0})]},k.id))}),$.jsxs(My,{children:[$.jsx(zy,{value:w,onChange:k=>m(k.target.value),placeholder:p("newSpeakerName")}),$.jsx(FI,{onClick:C,children:"+"})]}),$.jsx("h3",{children:p("advanced")}),$.jsxs(Po,{children:[$.jsx(Wd,{type:"checkbox",id:"timeline-visible",checked:f,onChange:k=>h(k.target.checked)}),$.jsx(en,{htmlFor:"timeline-visible",children:p("enableTimeline")})]})]})},HI=ae.div` background-color: ${Se.background}; padding: 20px; border-radius: 5px; @@ -427,7 +427,7 @@ ${l}`}).join(` display: flex; justify-content: flex-end; gap: 10px; -`,GI=({audioTracks:e,subtitles:t,onClose:n,onDownload:r,isRebuilding:o})=>{const{t:a}=ro(),[l,c]=j.useState([]),[f,h]=j.useState([]),p=b=>{c(P=>P.includes(b)?P.filter(O=>O!==b):[...P,b])},y=b=>{h(P=>P.includes(b)?P.filter(O=>O!==b):[...P,b])},m=()=>{r(l,f),n()};return $.jsx(cg,{children:$.jsxs(HI,{children:[$.jsx(VI,{children:a("selectTracksForDownload")}),$.jsxs(Fy,{children:[$.jsx("h3",{children:a("audioTracks")}),Object.entries(e).filter(([b,P])=>b!=="background").map(([b,P],O)=>$.jsxs(Uy,{children:[$.jsx(jy,{type:"checkbox",checked:l.includes(b),onChange:()=>p(b),disabled:o}),$.jsx(en,{htmlFor:b,children:P.label})]},O))]}),$.jsxs(Fy,{children:[$.jsx("h3",{children:a("subtitles")}),t.map(b=>$.jsxs(Uy,{children:[$.jsx(jy,{type:"checkbox",checked:f.includes(b),onChange:()=>y(b),disabled:o}),$.jsx(en,{htmlFor:b,children:a(`${b}Subtitles`)})]},b))]}),$.jsxs(KI,{children:[$.jsx(Lt,{onClick:n,disabled:o,children:a("cancel")}),$.jsx(Lt,{onClick:m,disabled:o,children:a("downloadResult")})]})]})})},YI=nL` +`,GI=({audioTracks:e,subtitles:t,onClose:n,onDownload:r,isRebuilding:o})=>{const{t:a}=io(),[l,c]=j.useState([]),[f,h]=j.useState([]),p=b=>{c(R=>R.includes(b)?R.filter(O=>O!==b):[...R,b])},w=b=>{h(R=>R.includes(b)?R.filter(O=>O!==b):[...R,b])},m=()=>{r(l,f),n()};return $.jsx(cg,{children:$.jsxs(HI,{children:[$.jsx(VI,{children:a("selectTracksForDownload")}),$.jsxs(Fy,{children:[$.jsx("h3",{children:a("audioTracks")}),Object.entries(e).filter(([b,R])=>b!=="background").map(([b,R],O)=>$.jsxs(Uy,{children:[$.jsx(jy,{type:"checkbox",checked:l.includes(b),onChange:()=>p(b),disabled:o}),$.jsx(en,{htmlFor:b,children:R.label})]},O))]}),$.jsxs(Fy,{children:[$.jsx("h3",{children:a("subtitles")}),t.map(b=>$.jsxs(Uy,{children:[$.jsx(jy,{type:"checkbox",checked:f.includes(b),onChange:()=>w(b),disabled:o}),$.jsx(en,{htmlFor:b,children:a(`${b}Subtitles`)})]},b))]}),$.jsxs(KI,{children:[$.jsx(Lt,{onClick:n,disabled:o,children:a("cancel")}),$.jsx(Lt,{onClick:m,disabled:o,children:a("downloadResult")})]})]})})},YI=nL` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `,XI=ae.div` @@ -466,11 +466,11 @@ ${l}`}).join(` `,tN=ae.p` margin: 0 0 20px 0; line-height: 1.5; -`,nN=({onClose:e,onRegenerate:t})=>{const{t:n}=ro(),[r,o]=j.useState(!1),[a,l]=j.useState(!1),c=async()=>{o(!0);try{await t(),l(!0)}catch(f){console.error("Error regenerating video:",f)}};return $.jsx(cg,{children:$.jsxs(JI,{children:[$.jsx(tN,{children:n(a?"regenerateRequestSent":"regenerateDescription")}),$.jsx(eN,{children:a?$.jsx(Lt,{onClick:e,children:n("close")}):$.jsxs($.Fragment,{children:[$.jsx(Lt,{onClick:e,children:n("cancel")}),$.jsx(Lt,{onClick:c,disabled:r,children:n(r?"regenerating":"regenerate")})]})})]})})},rN=tL` +`,nN=({onClose:e,onRegenerate:t})=>{const{t:n}=io(),[r,o]=j.useState(!1),[a,l]=j.useState(!1),c=async()=>{o(!0);try{await t(),l(!0)}catch(f){console.error("Error regenerating video:",f)}};return $.jsx(cg,{children:$.jsxs(JI,{children:[$.jsx(tN,{children:n(a?"regenerateRequestSent":"regenerateDescription")}),$.jsx(eN,{children:a?$.jsx(Lt,{onClick:e,children:n("close")}):$.jsxs($.Fragment,{children:[$.jsx(Lt,{onClick:e,children:n("cancel")}),$.jsx(Lt,{onClick:c,disabled:r,children:n(r?"regenerating":"regenerate")})]})})]})})},rN=tL` body { margin: 0; padding: 0; - font-family: ${vn.fontFamily}; + font-family: ${mn.fontFamily}; background-color: ${Se.secondaryBackground}; color: ${Se.black}; } @@ -546,4 +546,4 @@ ${l}`}).join(` flex-direction: column; align-items: center; gap: 10px; -`;function dN(){const{t:e,i18n:t}=ro(),[n,r]=j.useState(null),[o,a]=j.useState([]),[l,c]=j.useState(""),[f,h]=j.useState(0),[p,y]=j.useState(!1),[m,b]=j.useState("list"),[P,O]=j.useState(""),[N,_]=j.useState(""),v=j.useRef(null),[x,C]=j.useState(null),[T,k]=j.useState(!1),[R,A]=j.useState(null),[W,Y]=j.useState(null),[te,de]=j.useState(null),[ve,ne]=j.useState("dubbing"),[ue,he]=j.useState(!1),[ce,B]=j.useState({}),[M,F]=j.useState({}),[K,G]=j.useState(["background","dubbed"]),[H,J]=j.useState("none"),[ie,z]=j.useState(!0),[ge,q]=j.useState(!1),[Ne,Re]=j.useState(!1),[xe,_e]=j.useState("dubbing"),[nt,Ge]=j.useState(0),[Pe,ot]=j.useState(null),[Ce,st]=j.useState(!1),[gr,Xe]=j.useState(null),[dt,yn]=j.useState(!1),[wt,be]=j.useState(!1),[Be,Qr]=j.useState(!1);j.useEffect(()=>{const le=new URLSearchParams(window.location.search),pe=le.get("uuid"),Te=le.get("service");Te?_e(Te):ne(xe||"dubbing"),console.log("Initial useEffect - UUID param:",pe,"Service param:",Te,"App mode:",xe),pe&&(A(pe),so(null,pe))},[xe]);const qn=()=>{r(null),c(""),a([]),h(0),y(!1),O(""),_(""),v.current&&v.current.setCurrentTime(0),l&&URL.revokeObjectURL(l)},Rt=le=>{v.current&&v.current.setCurrentTime(le)},Oi=j.useCallback(le=>{le.code==="Space"&&le.target===document.body&&(le.preventDefault(),v.current&&(p?(v.current.pause(),y(!1)):(v.current.play(),y(!0))))},[p]);j.useEffect(()=>(document.addEventListener("keydown",Oi),()=>{document.removeEventListener("keydown",Oi)}),[Oi,p]),j.useEffect(()=>{const pe=setInterval(()=>{v.current&&h(v.current.currentTime)},100);return()=>clearInterval(pe)},[]);const so=j.useCallback(async(le,pe)=>{if(console.log("handleFileOrUUIDSelect called with UUID:",pe),l&&URL.revokeObjectURL(l),a([]),de(null),he(!0),pe){r(null);try{if(console.log("Starting API calls for UUID:",pe),ve==="dubbing")await ar.uuidExists(pe),c(ar.getMediaUrl(pe)),O("video/mp4");else if(ve==="transcription"){const[Te,Ue]=await Promise.all([nu.getMediaMetadata(pe),nu.loadTracksFromUUID(pe)]);c(nu.getMediaUrl(pe)),O(Te.contentType),_(Te.filename),a(nu.parseTracksFromJSON(Ue))}}catch(Te){console.error("Error loading media or tracks from UUID:",Te),de("errorLoadingUUID")}}else if(le){r(le),O(le.type),_(le.name);try{const Te=URL.createObjectURL(le);c(Te);const Ue=await uI(le);a(Ue)}catch(Te){console.error("Error processing media file:",Te),a([])}}he(!1)},[ve]),cs=j.useCallback(async(le,pe)=>{const Te=pe.filter(wn=>wn.dubbed_path&&wn.for_dubbing),Ue=Te.length;let on=0;const er={};for(const wn of Te){const tr=wn.dubbed_path.split("/").pop();if(tr)try{const Pr=await ar.loadDubbedUtterance(le,wn.id);er[tr]=Pr,on++,Ge(on/Ue*100)}catch(Pr){console.error(`Failed to load chunk: ${tr}`,Pr)}}F(er);const ps=await Us.recreateConstructedAudio(pe,er);B(wn=>({...wn,dubbed:{...wn.dubbed,buffer:ps}}))},[]),ao=le=>{C(le)},Jn=j.useCallback(async le=>{if(console.log("serviceParam",ve,"advancedEditMode",T),ve==="dubbing")try{if(ot(e("reconstructingAudio")),T){console.log("Recreating constructed audio...");const pe=await Us.recreateConstructedAudio(le,M);console.log("Audio reconstruction complete. Updating audio tracks..."),B(Te=>({...Te,dubbed:{...Te.dubbed,label:e("dubbedVocals"),buffer:pe}}))}else{for(const pe of le)if(pe.needsResynthesis){const Te=await Us.resynthesizeTrack(pe);pe.buffer=await Us.decodeAudioData(Te),pe.needsResynthesis=!1}a(le)}}catch(pe){console.error("Error recreating constructed audio:",pe)}finally{ot(null)}},[ve,M,e,T]),fs=j.useCallback(async(le,pe)=>{console.log("handleSaveTrack called with updatedTrack:",le,"needsReconstruction:",pe),x&&(a(Te=>{const Ue=Te.map(on=>on.id===x.id?le:on);return pe&&Jn(Ue),Ue}),C(null))},[x,Jn]),lo=j.useCallback((le,pe,Te=!1)=>{console.log(`Track ${le} changed:`,pe),a(Ue=>{const on=Ue.map(er=>er.id===le?pe:er);return Te&&(console.log("Track changed, calling recreateConstructedAudio..."),Jn(on)),on})},[Jn]),ds=le=>{le.target.files&&le.target.files.length>0&&Y(le.target.files[0])},hs=()=>{W&&so(W,null)},Uc=le=>{G(pe=>pe.includes(le)?pe.filter(Te=>Te!==le):[...pe,le])},Ia=j.useCallback(le=>{a(pe=>{const Te=pe.map(Ue=>Ue.id===le?{...Ue,deleted:!0}:Ue);return console.log("advancedEditMode",T),T&&Jn(Te),Te})},[T]),jc=le=>{J(le)},Na=le=>{z(le)},Zr=ve==="dubbing",Ma=()=>{q(!0)},Bc=()=>{q(!1)},Wc=async(le,pe)=>{if(l&&o.length>0)try{Re(!0);let Te=n||l;const Ue=ce.background,on=[],er=Ue.buffer;for(const Pr of le){const Fa=ce[Pr];if(Fa){const Ua=Fa.buffer;if(Ua&&er){const ja=await Us.mixAudioBuffers(er,Ua);on.push({buffer:ja,label:Pr})}}else throw new Error(`Audio track ${Pr} not found`)}console.log("selectedAudioBuffers",on);const ps=await cI(Te,o,on,pe),wn=URL.createObjectURL(ps),tr=document.createElement("a");tr.href=wn,tr.download=`output_${N}`,document.body.appendChild(tr),tr.click(),document.body.removeChild(tr),URL.revokeObjectURL(wn)}catch(Te){console.error("Error downloading result:",Te)}finally{Re(!1),q(!1)}},Hc=j.useCallback(async(le,pe)=>{ot(e("reconstructingAudio"));try{await zt.updateSpeaker(le,{voice:pe});const Te=o.map(Ue=>Ue.speaker_id===le?{...Ue,needsResynthesis:!0}:Ue);a(Te),await Jn(Te)}catch(Te){console.error("Error updating speaker voice:",Te)}finally{ot(null)}},[o,Jn]);j.useEffect(()=>{const le="ca";t.changeLanguage(le)},[t]);const za=async()=>{st(!1),Xe(e("loadingMedia"));try{if(R){const le=await ar.loadTracksFromUUID(R),pe=ar.parseTracksFromJSON(le);a(pe),c(ar.getSilentVideoUrl(R)),B({background:{url:ar.getBackgroundAudioUrl(R),label:e("backgroundAudio")},original:{url:ar.getOriginalVocalsUrl(R),label:e("originalVocals")},dubbed:{url:ar.getDubbedVocalsUrl(R),label:e("dubbedVocals")}}),pe.length<100&&(k(!0),cs(R,pe)),st(!0)}}catch(le){console.error("Error loading edit mode:",le),de("errorLoadingUUID")}finally{Xe(null),yn(!0)}},Vc=()=>{const pe=new URLSearchParams(window.location.search).get("uuid");if(pe){const Te=ar.getMediaUrl(pe),Ue=document.createElement("a");Ue.href=Te,Ue.download="dubbed_video.mp4",document.body.appendChild(Ue),Ue.click(),document.body.removeChild(Ue)}},Kc=async()=>{if(R)try{await ar.regenerateVideo(R,o)}catch(le){console.error("Error regenerating video:",le)}};return $.jsxs($.Fragment,{children:[$.jsx(rN,{}),$.jsxs(iN,{children:[$.jsxs(oN,{children:[gr&&$.jsx(Vd,{children:gr}),nt>0&&nt<100&&$.jsxs(Vd,{children:[e("loadingChunks"),": ",nt.toFixed(0),"%"]}),Pe&&$.jsx(Vd,{children:Pe}),$.jsxs(sN,{children:[l&&$.jsxs($.Fragment,{children:[!R&&$.jsx(Lt,{onClick:qn,children:e("closeMedia")}),Zr&&$.jsxs($.Fragment,{children:[!dt&&$.jsx(Lt,{onClick:za,children:e("edit")}),dt?T?$.jsx(Lt,{onClick:Ma,disabled:!Ce,children:e("downloadResult")}):$.jsx(Lt,{onClick:()=>Qr(!0),disabled:!Ce,children:e("regenerate")}):$.jsx(Lt,{onClick:Vc,children:e("downloadResult")})]}),!Zr&&$.jsx(Lt,{onClick:Ma,children:e("downloadResult")})]}),!1]})]}),$.jsx(uN,{children:ue?$.jsx(By,{children:e("loading")}):l?$.jsxs($.Fragment,{children:[$.jsx(lN,{isEditMode:dt,children:$.jsx(CL,{src:l,tracks:dt?o:[],ref:v,mediaType:P,audioTracks:ce,selectedAudioTracks:K,selectedSubtitles:H,advancedEditMode:T})}),dt&&$.jsx(cN,{children:o.length>0&&$.jsxs($.Fragment,{children:[$.jsxs(aN,{children:[wt&&$.jsx(Kd,{active:m==="timeline",onClick:()=>b("timeline"),children:e("timeline")}),$.jsx(Kd,{active:m==="list",onClick:()=>b("list"),children:e("list")}),$.jsx(Kd,{active:m==="options",onClick:()=>b("options"),children:e("options")})]}),m==="timeline"&&wt?$.jsx(c$,{tracks:o,setTracks:a,currentTime:f,onTimeChange:Rt,onEditTrack:ao,isDubbingService:Zr,onTrackChange:lo,showSpeakerColors:ie}):m==="list"?$.jsx(y$,{tracks:o,onTrackChange:lo,onTimeChange:Rt,onEditTrack:ao,onDeleteTrack:Ia,isDubbingService:Zr,showSpeakerColors:ie}):$.jsx(WI,{audioTracks:ce,selectedTracks:K,onAudioTrackToggle:Uc,selectedSubtitles:H,onSubtitlesChange:jc,showSpeakerColors:ie,onShowSpeakerColorsChange:Na,tracks:o,onTracksChange:a,onSpeakerVoiceChange:Hc,timelineVisible:wt,onTimelineVisibleChange:le=>{be(le),!le&&m==="timeline"&&b("list")}})]})})]}):te?$.jsx(By,{children:e(te)}):(!xe||xe==="file")&&!R?$.jsxs(fN,{children:[$.jsx(yu,{type:"file",onChange:ds}),$.jsx(Lt,{onClick:hs,disabled:!W,children:e("openFile")})]}):null})]}),$.jsx(gI,{track:x,onSave:fs,onClose:()=>C(null),onDelete:Ia,ModalOverlay:cg,isDubbingService:Zr}),ge&&$.jsx(GI,{audioTracks:ce,subtitles:["original","dubbed"],onClose:Bc,onDownload:Wc,isRebuilding:Ne}),Ne&&$.jsx(qI,{message:e("rebuildingMedia")}),Be&&$.jsx(nN,{onClose:()=>Qr(!1),onRegenerate:Kc})]})}const hN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Yu{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||hN,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{let[c,f]=l;for(let h=0;h{let[c,f]=l;for(let h=0;h{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},Wy=e=>e==null?"":""+e,pN=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},gN=/###/g,Hy=e=>e&&e.indexOf("###")>-1?e.replace(gN,"."):e,Vy=e=>!e||typeof e=="string",ia=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let o=0;for(;o{const{obj:r,k:o}=ia(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let a=t[t.length-1],l=t.slice(0,t.length-1),c=ia(e,l,Object);for(;c.obj===void 0&&l.length;)a=`${l[l.length-1]}.${a}`,l=l.slice(0,l.length-1),c=ia(e,l,Object),c&&c.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=n},mN=(e,t,n,r)=>{const{obj:o,k:a}=ia(e,t,Object);o[a]=o[a]||[],o[a].push(n)},Xu=(e,t)=>{const{obj:n,k:r}=ia(e,t);if(n)return n[r]},vN=(e,t,n)=>{const r=Xu(e,n);return r!==void 0?r:Xu(t,n)},gx=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):gx(e[r],t[r],n):e[r]=t[r]);return e},Oo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var yN={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const wN=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>yN[t]):e;class SN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const xN=[" ",",","?","!",";"],_N=new SN(20),bN=(e,t,n)=>{t=t||"",n=n||"";const r=xN.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=_N.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let a=!o.test(e);if(!a){const l=e.indexOf(n);l>0&&!o.test(e.substring(0,l))&&(a=!0)}return a},qh=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let a=0;a-1&&fe&&e.replace("_","-");class Gy extends Fc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&a?c.push(...r.split(a)):c.push(r)));const f=Xu(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||typeof r!="string"?f:qh(this.data&&this.data[t]&&this.data[t][n],r,a)}addResource(t,n,r,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),o=n,n=c[1]),this.addNamespaces(n),Ky(this.data,c,o),a.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(typeof r[a]=="string"||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),o=r,r=n,n=c[1]),this.addNamespaces(n);let f=Xu(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?gx(f,r,a):f={...f,...r},Ky(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var mx={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(a=>{this.processors[a]&&(t=this.processors[a].process(t,n,r,o))}),t}};const Yy={};class Zu extends Fc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),pN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=kr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!bN(t,r,o);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:a};const h=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(h[0])>-1)&&(a=h.shift()),t=h.join(o)}return typeof a=="string"&&(a=[a]),{key:t,namespaces:a}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],n),f=c[c.length-1],h=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&h.toLowerCase()==="cimode"){if(p){const C=n.nsSeparator||this.options.nsSeparator;return o?{res:`${f}${C}${l}`,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:`${f}${C}${l}`}return o?{res:l,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:l}const y=this.resolve(t,n);let m=y&&y.res;const b=y&&y.usedKey||l,P=y&&y.exactUsedKey||l,O=Object.prototype.toString.apply(m),N=["[object Number]","[object Function]","[object RegExp]"],_=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&N.indexOf(O)<0&&!(typeof _=="string"&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,m,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=C,y.usedParams=this.getUsedParamsDetails(n),y):C}if(a){const C=Array.isArray(m),T=C?[]:{},k=C?P:b;for(const R in m)if(Object.prototype.hasOwnProperty.call(m,R)){const A=`${k}${a}${R}`;T[R]=this.translate(A,{...n,joinArrays:!1,ns:c}),T[R]===A&&(T[R]=m[R])}m=T}}else if(v&&typeof _=="string"&&Array.isArray(m))m=m.join(_),m&&(m=this.extendTranslation(m,t,n,r));else{let C=!1,T=!1;const k=n.count!==void 0&&typeof n.count!="string",R=Zu.hasDefaultValue(n),A=k?this.pluralResolver.getSuffix(h,n.count,n):"",W=n.ordinal&&k?this.pluralResolver.getSuffix(h,n.count,{ordinal:!1}):"",Y=k&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),te=Y&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${W}`]||n.defaultValue;!this.isValidLookup(m)&&R&&(C=!0,m=te),this.isValidLookup(m)||(T=!0,m=l);const ve=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:m,ne=R&&te!==m&&this.options.updateMissing;if(T||C||ne){if(this.logger.log(ne?"updateKey":"missingKey",h,f,l,ne?te:m),a){const B=this.resolve(l,{...n,keySeparator:!1});B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ue=[];const he=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&he&&he[0])for(let B=0;B{const K=R&&F!==m?F:ve;this.options.missingKeyHandler?this.options.missingKeyHandler(B,f,M,K,ne,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(B,f,M,K,ne,n),this.emit("missingKey",B,f,M,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?ue.forEach(B=>{const M=this.pluralResolver.getSuffixes(B,n);Y&&n[`defaultValue${this.options.pluralSeparator}zero`]&&M.indexOf(`${this.options.pluralSeparator}zero`)<0&&M.push(`${this.options.pluralSeparator}zero`),M.forEach(F=>{ce([B],l+F,n[`defaultValue${F}`]||te)})}):ce(ue,l,te))}m=this.extendTranslation(m,t,n,y,r),T&&m===l&&this.options.appendNamespaceToMissingKey&&(m=`${f}:${l}`),(T||C)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}:${l}`:l,C?m:void 0):m=this.options.parseMissingKeyHandler(m))}return o?(y.res=m,y.usedParams=this.getUsedParamsDetails(n),y):m}extendTranslation(t,n,r,o,a){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const h=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(h){const m=t.match(this.interpolator.nestingRegexp);p=m&&m.length}let y=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||o.usedLng,r),h){const m=t.match(this.interpolator.nestingRegexp),b=m&&m.length;p1&&arguments[1]!==void 0?arguments[1]:{},r,o,a,l,c;return typeof t=="string"&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const h=this.extractFromKey(f,n),p=h.key;o=p;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const m=n.count!==void 0&&typeof n.count!="string",b=m&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),P=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",O=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);y.forEach(N=>{this.isValidLookup(r)||(c=N,!Yy[`${O[0]}-${N}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(Yy[`${O[0]}-${N}`]=!0,this.logger.warn(`key "${o}" for languages "${O.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),O.forEach(_=>{if(this.isValidLookup(r))return;l=_;const v=[p];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,p,_,N,n);else{let C;m&&(C=this.pluralResolver.getSuffix(_,n.count,n));const T=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(v.push(p+C),n.ordinal&&C.indexOf(k)===0&&v.push(p+C.replace(k,this.options.pluralSeparator)),b&&v.push(p+T)),P){const R=`${p}${this.options.contextSeparator}${n.context}`;v.push(R),m&&(v.push(R+C),n.ordinal&&C.indexOf(k)===0&&v.push(R+C.replace(k,this.options.pluralSeparator)),b&&v.push(R+T))}}let x;for(;x=v.pop();)this.isValidLookup(r)||(a=x,r=this.getResource(_,N,x,n))}))})}),{res:r,usedKey:o,exactUsedKey:a,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const a of n)delete o[a]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Gd=e=>e.charAt(0).toUpperCase()+e.slice(1);class Xy{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=kr.create("languageUtils")}getScriptPartFromCode(t){if(t=Qu(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Qu(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let o=Intl.getCanonicalLocales(t)[0];if(o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o)return o}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Gd(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Gd(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Gd(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=l=>{l&&(this.isSupportedCode(l)?o.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),r.forEach(l=>{o.indexOf(l)<0&&a(this.formatLanguageCode(l))}),o}}let kN=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],CN={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const EN=["v1","v2","v3"],TN=["v4"],Qy={zero:0,one:1,two:2,few:3,many:4,other:5},RN=()=>{const e={};return kN.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:CN[t.fc]}})}),e};class PN{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=kr.create("pluralResolver"),(!this.options.compatibilityJSON||TN.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=RN(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Qu(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const l=new Intl.PluralRules(r,{type:o});return this.pluralRulesCache[a]=l,l}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,a)=>Qy[o]-Qy[a]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const a=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!EN.includes(this.options.compatibilityJSON)}}const Zy=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=vN(e,t,n);return!a&&o&&typeof n=="string"&&(a=qh(e,n,r),a===void 0&&(a=qh(t,n,r))),a},Yd=e=>e.replace(/\$/g,"$$$$");class ON{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=kr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:a,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:h,unescapeSuffix:p,unescapePrefix:y,nestingPrefix:m,nestingPrefixEscaped:b,nestingSuffix:P,nestingSuffixEscaped:O,nestingOptionsSeparator:N,maxReplaces:_,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:wN,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?Oo(a):l||"{{",this.suffix=c?Oo(c):f||"}}",this.formatSeparator=h||",",this.unescapePrefix=p?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=m?Oo(m):b||Oo("$t("),this.nestingSuffix=P?Oo(P):O||Oo(")"),this.nestingOptionsSeparator=N||",",this.maxReplaces=_||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let a,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=b=>{if(b.indexOf(this.formatSeparator)<0){const _=Zy(n,f,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,r,{...o,...n,interpolationkey:b}):_}const P=b.split(this.formatSeparator),O=P.shift().trim(),N=P.join(this.formatSeparator).trim();return this.format(Zy(n,f,O,this.options.keySeparator,this.options.ignoreJSONStructure),N,r,{...o,...n,interpolationkey:O})};this.resetRegExp();const p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,y=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>Yd(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?Yd(this.escape(b)):Yd(b)}].forEach(b=>{for(c=0;a=b.regex.exec(t);){const P=a[1].trim();if(l=h(P),l===void 0)if(typeof p=="function"){const N=p(t,a,o);l=typeof N=="string"?N:""}else if(o&&Object.prototype.hasOwnProperty.call(o,P))l="";else if(y){l=a[0];continue}else this.logger.warn(`missed to pass in variable ${P} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=Wy(l));const O=b.safeValue(l);if(t=t.replace(a[0],O),y?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=a[0].length):b.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,l;const c=(f,h)=>{const p=this.nestingOptionsSeparator;if(f.indexOf(p)<0)return f;const y=f.split(new RegExp(`${p}[ ]*{`));let m=`{${y[1]}`;f=y[0],m=this.interpolate(m,l);const b=m.match(/'/g),P=m.match(/"/g);(b&&b.length%2===0&&!P||P.length%2!==0)&&(m=m.replace(/'/g,'"'));try{l=JSON.parse(m),h&&(l={...h,...l})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,O),`${f}${p}${m}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;o=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;let h=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const p=o[1].split(this.formatSeparator).map(y=>y.trim());o[1]=p.shift(),f=p,h=!0}if(a=n(c.call(this,o[1].trim(),l),l),a&&o[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=Wy(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),a=""),h&&(a=f.reduce((p,y)=>this.format(p,y,r.lng,{...r,interpolationkey:o[1].trim()}),a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}const LN=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),h=f.join(":").trim().replace(/^'+|'+$/g,""),p=c.trim();n[p]||(n[p]=h),h==="false"&&(n[p]=!1),h==="true"&&(n[p]=!0),isNaN(h)||(n[p]=parseInt(h,10))}})}return{formatName:t,formatOptions:n}},Lo=e=>{const t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const l=r+JSON.stringify(a);let c=t[l];return c||(c=e(Qu(r),o),t[l]=c),c(n)}};class AN{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=kr.create("formatter"),this.options=t,this.formats={number:Lo((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:Lo((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:Lo((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:Lo((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:Lo((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Lo(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(c=>c.indexOf(")")>-1)){const c=a.findIndex(f=>f.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce((c,f)=>{const{formatName:h,formatOptions:p}=LN(f);if(this.formats[h]){let y=c;try{const m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},b=m.locale||m.lng||o.locale||o.lng||r;y=this.formats[h](c,b,{...p,...o,...m})}catch(m){this.logger.warn(m)}return y}else this.logger.warn(`there was no format function for ${h}`);return c},t)}}const DN=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class $N extends Fc{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=kr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const a={},l={},c={},f={};return t.forEach(h=>{let p=!0;n.forEach(y=>{const m=`${h}|${y}`;!r.reload&&this.store.hasResourceBundle(h,y)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?l[m]===void 0&&(l[m]=!0):(this.state[m]=1,p=!1,l[m]===void 0&&(l[m]=!0),a[m]===void 0&&(a[m]=!0),f[y]===void 0&&(f[y]=!0)))}),p||(c[h]=!0)}),(Object.keys(a).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const o=t.split("|"),a=o[0],l=o[1];n&&this.emit("failedLoading",a,l,n),!n&&r&&this.store.addResourceBundle(a,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{mN(f.loaded,[a],l),DN(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(h=>{c[h]||(c[h]={});const p=f.loaded[h];p.length&&p.forEach(y=>{c[h][y]===void 0&&(c[h][y]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:a,callback:l});return}this.readingCalls++;const c=(h,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&p&&o{this.read.call(this,t,n,r,o+1,a*2,l)},a);return}l(h,p)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const h=f(t,n);h&&typeof h.then=="function"?h.then(p=>c(null,p)).catch(c):c(null,h)}catch(h){c(h)}return}return f(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${a} for language ${o}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const f={...l,isUpdate:a},h=this.backend.create.bind(this.backend);if(h.length<6)try{let p;h.length===5?p=h(t,n,r,o,f):p=h(t,n,r,o),p&&typeof p.then=="function"?p.then(y=>c(null,y)).catch(c):c(null,p)}catch(p){c(p)}else h(t,n,r,o,c,f)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const qy=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Jy=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),ru=()=>{},IN=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ka extends Fc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Jy(t),this.services={},this.logger=kr,this.modules={external:[]},IN(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=qy();this.options={...o,...this.options,...Jy(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?kr.init(a(this.modules.logger),this.options):kr.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:typeof Intl<"u"&&(p=AN);const y=new Xy(this.options);this.store=new Gy(this.options.resources,this.options);const m=this.services;m.logger=kr,m.resourceStore=this.store,m.languageUtils=y,m.pluralResolver=new PN(y,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=a(p),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new ON(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new $N(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(b){for(var P=arguments.length,O=new Array(P>1?P-1:0),N=1;N1?P-1:0),N=1;N{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,r||(r=ru),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=function(){return t.store[p](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=function(){return t.store[p](...arguments),t}});const f=js(),h=()=>{const p=(y,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(m),r(y,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),f}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ru;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(h=>{h!=="cimode"&&a.indexOf(h)<0&&a.push(h)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),this.options.preload&&this.options.preload.forEach(c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=js();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=ru),this.services.backendConnector.reload(t,n,a=>{o.resolve(),r(a)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&mx.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=js();this.emit("languageChanging",t);const a=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,h)=>{h?(a(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(f,function(){return r.t(...arguments)})},c=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const h=typeof f=="string"?f:this.services.languageUtils.getBestMatchFromCodes(f);h&&(this.language||a(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(h)),this.loadResources(h,p=>{l(p,h)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),o}getFixedT(t,n,r){var o=this;const a=function(l,c){let f;if(typeof c!="object"){for(var h=arguments.length,p=new Array(h>2?h-2:0),y=2;y`${f.keyPrefix}${m}${P}`):b=f.keyPrefix?`${f.keyPrefix}${m}${l}`:l,o.t(b,f)};return typeof t=="string"?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const h=this.services.backendConnector.state[`${c}|${f}`];return h===-1||h===0||h===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!o||l(a,t)))}loadNamespaces(t,n){const r=js();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=js();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],a=t.filter(l=>o.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return a.length?(this.options.preload=o.concat(a),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new Xy(qy());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ka(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ru;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new ka(o);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(c=>{a[c]=this[c]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Gy(this.store.data,o),a.services.resourceStore=a.store),a.translator=new Zu(a.services,o),a.translator.on("*",function(c){for(var f=arguments.length,h=new Array(f>1?f-1:0),p=1;p0){var c=o.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+="; Max-Age=".concat(Math.floor(c))}if(o.domain){if(!t1.test(o.domain))throw new TypeError("option domain is invalid");l+="; Domain=".concat(o.domain)}if(o.path){if(!t1.test(o.path))throw new TypeError("option path is invalid");l+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(l+="; HttpOnly"),o.secure&&(l+="; Secure"),o.sameSite){var f=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(f){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l},n1={create:function(t,n,r,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),o&&(a.domain=o),document.cookie=WN(t,encodeURIComponent(n),a)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),a=o.split("&"),l=0;l0){var f=a[l].substring(0,c);f===t.lookupQuerystring&&(n=a[l].substring(c+1))}}}return n}},Bs=null,r1=function(){if(Bs!==null)return Bs;try{Bs=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Bs=!1}return Bs},KN={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&r1()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&r1()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Ws=null,i1=function(){if(Ws!==null)return Ws;try{Ws=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Ws=!1}return Ws},GN={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&i1()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&i1()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},YN={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},XN={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},QN={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},ZN={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function qN(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var yx=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};NN(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return FN(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=BN(r,this.options||{},qN()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(a){return a.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(HN),this.addDetector(VN),this.addDetector(KN),this.addDetector(GN),this.addDetector(YN),this.addDetector(XN),this.addDetector(QN),this.addDetector(ZN)}},{key:"addDetector",value:function(n){return this.detectors[n.name]=n,this}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(a){if(r.detectors[a]){var l=r.detectors[a].lookup(r.options);l&&typeof l=="string"&&(l=[l]),l&&(o=o.concat(l))}}),o=o.map(function(a){return r.options.convertDetectedLanguage(a)}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(a){o.detectors[a]&&o.detectors[a].cacheUserLanguage(n,o.options)}))}}]),e}();yx.type="languageDetector";const JN="Timeline",e3="List",t3="Download",n3="Zoom Out",r3="Zoom In",i3="Reset Zoom",o3="Close File",s3="Open file",a3="Select a file or enter UUID",l3="Enter UUID",u3="Submit",c3="Save",f3="Cancel",d3="Error loading video, maybe it doesn't exist",h3="Original Text",p3="Translated Text",g3="Start Time",m3="End Time",v3="Text",y3="Speed",w3="Options",S3="Audio Tracks",x3="Delete",_3="Subtitles",b3="No Subtitles",k3="Original Subtitles",C3="Dubbed Subtitles",E3="Speakers",T3="New speaker name",R3="Speaker",P3="Select a speaker",O3="Show speaker colors",L3="Select tracks for download",A3="Rebuilding media, please wait...",D3="Loading...",$3="Loading files, please wait...",I3="Reconstructing audio, please wait...",N3="Original Vocals",M3="Dubbed Vocals",z3="Background Audio",F3="Missing UUID",U3="Loading media, please wait...",j3="Edit",B3="Advanced",W3="Enable Timeline",H3="Regenerate",V3="Regenerating...",K3="Once you have made all the necessary edits you can send us back the modifications so we can regenrate the video. You will receive an email once the video is ready.",G3="Your request has been sent successfully. You will receive an email once the video is ready.",Y3="Close",X3={timeline:JN,list:e3,downloadResult:t3,zoomOut:n3,zoomIn:r3,resetZoom:i3,closeMedia:o3,openFile:s3,selectFileOrUUID:a3,enterUUID:l3,submit:u3,save:c3,cancel:f3,errorLoadingUUID:d3,originalText:h3,translatedText:p3,startTime:g3,endTime:m3,text:v3,speed:y3,options:w3,audioTracks:S3,deleteTrack:x3,subtitles:_3,noSubtitles:b3,originalSubtitles:k3,dubbedSubtitles:C3,speakers:E3,newSpeakerName:T3,speaker:R3,selectSpeaker:P3,showSpeakerColors:O3,selectTracksForDownload:L3,rebuildingMedia:A3,loading:D3,loadingChunks:$3,reconstructingAudio:I3,originalVocals:N3,dubbedVocals:M3,backgroundAudio:z3,missingUUID:F3,loadingMedia:U3,edit:j3,advanced:B3,enableTimeline:W3,delete:"Delete",regenerate:H3,regenerating:V3,regenerateDescription:K3,regenerateRequestSent:G3,close:Y3},Q3="Línea de Tiempo",Z3="Lista",q3="Descargar",J3="Alejar",eM="Acercar",tM="Restablecer Zoom",nM="Cerrar Archivo",rM="Abrir archivo",iM="Selecciona un archivo o introduce UUID",oM="Introduce UUID",sM="Enviar",aM="Guardar",lM="Cancelar",uM="Error cargando el video, es posible que ya no exista",cM="Texto Original",fM="Texto Traducido",dM="Tiempo Inicial",hM="Tiempo Final",pM="Texto",gM="Velocidad",mM="Opciones",vM="Pistas de Audio",yM="Eliminar",wM="Subtítulos",SM="Sin Subtítulos",xM="Subtítulos Originales",_M="Subtítulos Doblados",bM="Hablantes",kM="Nombre del nuevo hablante",CM="Hablante",EM="Selecciona un hablante",TM="Mostrar colores de hablantes",RM="Selecciona las pistas para descargar",PM="Reconstruyendo el video, por favor, espera...",OM="Cargando...",LM="Cargando archivos, por favor, espera...",AM="Reconstruyendo audio, por favor, espera...",DM="Voces Originales",$M="Voces Dobladas",IM="Audio de Fondo",NM="Falta UUID",MM="Cargando vídeo, por favor, espera...",zM="Edita",FM="Avançat",UM="Mostrar Línea de Tiempo",jM="Regenera",BM="Regenerant...",WM="Después de haber hecho todas las modificaciones necesarias, puedes enviarnos las modificaciones para regenerar el vídeo. Recibirás un correo electrónico cuando el vídeo esté listo.",HM="La petición ha sido enviada con éxito. Recibirás un correo electrónico cuando el vídeo esté listo.",VM="Cerrar",KM={timeline:Q3,list:Z3,downloadResult:q3,zoomOut:J3,zoomIn:eM,resetZoom:tM,closeMedia:nM,openFile:rM,selectFileOrUUID:iM,enterUUID:oM,submit:sM,save:aM,cancel:lM,errorLoadingUUID:uM,originalText:cM,translatedText:fM,startTime:dM,endTime:hM,text:pM,speed:gM,options:mM,audioTracks:vM,deleteTrack:yM,subtitles:wM,noSubtitles:SM,originalSubtitles:xM,dubbedSubtitles:_M,speakers:bM,newSpeakerName:kM,speaker:CM,selectSpeaker:EM,showSpeakerColors:TM,selectTracksForDownload:RM,rebuildingMedia:PM,loading:OM,loadingChunks:LM,reconstructingAudio:AM,originalVocals:DM,dubbedVocals:$M,backgroundAudio:IM,missingUUID:NM,loadingMedia:MM,edit:zM,advanced:FM,enableTimeline:UM,delete:"Eliminar",regenerate:jM,regenerating:BM,regenerateDescription:WM,regenerateRequestSent:HM,close:VM},GM="Línia de temps",YM="Llista",XM="Descarrega",QM="Allunya",ZM="Apropa",qM="Restablir Zoom",JM="Tanca Arxiu",ez="Obre Arxiu",tz="Selecciona un arxiu o introdueix UUID",nz="Introdueix UUID",rz="Envia",iz="Desa",oz="Cancel·la",sz="Error carregant el vídeo, potser ja no existeix",az="Text original",lz="Text traduït",uz="Temps inicial",cz="Temps final",fz="Text",dz="Velocitat",hz="Opcions",pz="Pistes d'àudio",gz="Elimina",mz="Subtítols",vz="Sense subtítols",yz="Subtítols originals",wz="Subtítols doblats",Sz="Parlants",xz="Nom del nou parlant",_z="Parlant",bz="Selecciona un parlant",kz="Mostrar colors de parlants",Cz="Selecciona les pistes per descarregar",Ez="Reconstruint el vídeo, si us plau, espereu...",Tz="Carregant...",Rz="Carregant fitxers, si us plau, espereu...",Pz="Reconstruint àudio, si us plau, espereu...",Oz="Veus originals",Lz="Veus doblades",Az="Àudio de Fons",Dz="Error carregant el vídeo, manca l'UUID",$z="Carregant vídeo, si us plau, espereu...",Iz="Edita",Nz="Avançat",Mz="Mostrar Línia de Temps",zz="Regenera",Fz="Regenerant...",Uz="Després d'haver fet totes les modificacions necessàries, pots enviar-nos les modificacions per regenerar el vídeo. Rebràs un correu electrònic quan el vídeo estigui llest.",jz="La teva petició ha estat enviada amb èxit. Rebràs un correu electrònic quan el vídeo estigui llest.",Bz="Tanca",Wz={timeline:GM,list:YM,downloadResult:XM,zoomOut:QM,zoomIn:ZM,resetZoom:qM,closeMedia:JM,openFile:ez,selectFileOrUUID:tz,enterUUID:nz,submit:rz,save:iz,cancel:oz,errorLoadingUUID:sz,originalText:az,translatedText:lz,startTime:uz,endTime:cz,text:fz,speed:dz,options:hz,audioTracks:pz,deleteTrack:gz,subtitles:mz,noSubtitles:vz,originalSubtitles:yz,dubbedSubtitles:wz,speakers:Sz,newSpeakerName:xz,speaker:_z,selectSpeaker:bz,showSpeakerColors:kz,selectTracksForDownload:Cz,rebuildingMedia:Ez,loading:Tz,loadingChunks:Rz,reconstructingAudio:Pz,originalVocals:Oz,dubbedVocals:Lz,backgroundAudio:Az,missingUUID:Dz,loadingMedia:$z,edit:Iz,advanced:Nz,enableTimeline:Mz,delete:"Eliminar",regenerate:zz,regenerating:Fz,regenerateDescription:Uz,regenerateRequestSent:jz,close:Bz};Yt.use(yx).use(hL).init({resources:{en:{translation:X3},es:{translation:KM},ca:{translation:Wz}},fallbackLng:"en",detection:{order:["navigator"]},interpolation:{escapeValue:!1}});Xd.createRoot(document.getElementById("root")).render($.jsx(Wr.StrictMode,{children:$.jsx(dN,{})})); +`;function dN(){const{t:e,i18n:t}=io(),[n,r]=j.useState(null),[o,a]=j.useState([]),[l,c]=j.useState(""),[f,h]=j.useState(0),[p,w]=j.useState(!1),[m,b]=j.useState("list"),[R,O]=j.useState(""),[N,_]=j.useState(""),v=j.useRef(null),[x,C]=j.useState(null),[k,E]=j.useState(!1),[P,A]=j.useState(null),[V,Q]=j.useState(null),[te,he]=j.useState(null),[ve,re]=j.useState("dubbing"),[ue,de]=j.useState(!1),[ce,B]=j.useState({}),[M,F]=j.useState({}),[K,G]=j.useState(["background","dubbed"]),[W,J]=j.useState("none"),[ie,z]=j.useState(!0),[ge,q]=j.useState(!1),[Ne,Te]=j.useState(!1),[xe,_e]=j.useState("dubbing"),[nt,Ke]=j.useState(0),[Re,ot]=j.useState(null),[Ce,st]=j.useState(!1),[pr,Xe]=j.useState(null),[dt,vn]=j.useState(!1),[wt,be]=j.useState(!1),[je,Qr]=j.useState(!1);j.useEffect(()=>{const le=new URLSearchParams(window.location.search),pe=le.get("uuid"),Oe=le.get("service");Oe?_e(Oe):re(xe||"dubbing"),console.log("Initial useEffect - UUID param:",pe,"Service param:",Oe,"App mode:",xe),pe&&(A(pe),ao(null,pe))},[xe]);const Zn=()=>{r(null),c(""),a([]),h(0),w(!1),O(""),_(""),v.current&&v.current.setCurrentTime(0),l&&URL.revokeObjectURL(l)},Rt=le=>{v.current&&v.current.setCurrentTime(le)},Oi=j.useCallback(le=>{le.code==="Space"&&le.target===document.body&&(le.preventDefault(),v.current&&(p?(v.current.pause(),w(!1)):(v.current.play(),w(!0))))},[p]);j.useEffect(()=>(document.addEventListener("keydown",Oi),()=>{document.removeEventListener("keydown",Oi)}),[Oi,p]),j.useEffect(()=>{const pe=setInterval(()=>{v.current&&h(v.current.currentTime)},100);return()=>clearInterval(pe)},[]);const ao=j.useCallback(async(le,pe)=>{if(console.log("handleFileOrUUIDSelect called with UUID:",pe),l&&URL.revokeObjectURL(l),a([]),he(null),de(!0),pe){r(null);try{if(console.log("Starting API calls for UUID:",pe),ve==="dubbing")await sr.uuidExists(pe),c(sr.getMediaUrl(pe)),O("video/mp4");else if(ve==="transcription"){const[Oe,Ge]=await Promise.all([nu.getMediaMetadata(pe),nu.loadTracksFromUUID(pe)]);c(nu.getMediaUrl(pe)),O(Oe.contentType),_(Oe.filename),a(nu.parseTracksFromJSON(Ge))}}catch(Oe){console.error("Error loading media or tracks from UUID:",Oe),he("errorLoadingUUID")}}else if(le){r(le),O(le.type),_(le.name);try{const Oe=URL.createObjectURL(le);c(Oe);const Ge=await uI(le);a(Ge)}catch(Oe){console.error("Error processing media file:",Oe),a([])}}de(!1)},[ve]),cs=j.useCallback(async(le,pe)=>{const Oe=pe.filter(yn=>yn.dubbed_path&&yn.for_dubbing),Ge=Oe.length;let qn=0;const Jn={};for(const yn of Oe){const er=yn.dubbed_path.split("/").pop();if(er)try{const Pr=await sr.loadDubbedUtterance(le,yn.id);Jn[er]=Pr,qn++,Ke(qn/Ge*100)}catch(Pr){console.error(`Failed to load chunk: ${er}`,Pr)}}F(Jn);const ps=await Us.recreateConstructedAudio(pe,Jn);B(yn=>({...yn,dubbed:{...yn.dubbed,buffer:ps}}))},[]),lo=le=>{C(le)},gr=j.useCallback(async le=>{if(console.log("serviceParam",ve,"advancedEditMode",k),ve==="dubbing")try{if(ot(e("reconstructingAudio")),k){console.log("Recreating constructed audio...");const pe=await Us.recreateConstructedAudio(le,M);console.log("Audio reconstruction complete. Updating audio tracks..."),B(Oe=>({...Oe,dubbed:{...Oe.dubbed,label:e("dubbedVocals"),buffer:pe}}))}else{for(const pe of le)if(pe.needsResynthesis){const Oe=await Us.resynthesizeTrack(pe);pe.buffer=await Us.decodeAudioData(Oe),pe.needsResynthesis=!1}a(le)}}catch(pe){console.error("Error recreating constructed audio:",pe)}finally{ot(null)}},[ve,M,e,k]),fs=j.useCallback(async(le,pe)=>{x&&(Li(x.id,le,pe),C(null))},[x,gr]),Li=j.useCallback((le,pe,Oe=!1)=>{console.log(`Track ${le} changed:`,pe),a(Ge=>{const qn=Ge.map(Jn=>Jn.id===le?{...pe,updated:!0}:Jn);return Oe&&(console.log("Track changed, calling recreateConstructedAudio..."),gr(qn)),qn})},[gr]),ds=le=>{le.target.files&&le.target.files.length>0&&Q(le.target.files[0])},hs=()=>{V&&ao(V,null)},Uc=le=>{G(pe=>pe.includes(le)?pe.filter(Oe=>Oe!==le):[...pe,le])},Ia=j.useCallback(le=>{a(pe=>{const Oe=pe.map(Ge=>Ge.id===le?{...Ge,deleted:!0}:Ge);return k&&gr(Oe),Oe})},[k]),jc=le=>{J(le)},Na=le=>{z(le)},Zr=ve==="dubbing",Ma=()=>{q(!0)},Bc=()=>{q(!1)},Wc=async(le,pe)=>{if(l&&o.length>0)try{Te(!0);let Oe=n||l;const Ge=ce.background,qn=[],Jn=Ge.buffer;for(const Pr of le){const Fa=ce[Pr];if(Fa){const Ua=Fa.buffer;if(Ua&&Jn){const ja=await Us.mixAudioBuffers(Jn,Ua);qn.push({buffer:ja,label:Pr})}}else throw new Error(`Audio track ${Pr} not found`)}console.log("selectedAudioBuffers",qn);const ps=await cI(Oe,o,qn,pe),yn=URL.createObjectURL(ps),er=document.createElement("a");er.href=yn,er.download=`output_${N}`,document.body.appendChild(er),er.click(),document.body.removeChild(er),URL.revokeObjectURL(yn)}catch(Oe){console.error("Error downloading result:",Oe)}finally{Te(!1),q(!1)}},Hc=j.useCallback(async(le,pe)=>{ot(e("reconstructingAudio"));try{await zt.updateSpeaker(le,{voice:pe});const Oe=o.map(Ge=>Ge.speaker_id===le?{...Ge,needsResynthesis:!0,updated:!0}:Ge);a(Oe),await gr(Oe)}catch(Oe){console.error("Error updating speaker voice:",Oe)}finally{ot(null)}},[o,gr]);j.useEffect(()=>{const le="ca";t.changeLanguage(le)},[t]);const za=async()=>{st(!1),Xe(e("loadingMedia"));try{if(P){const le=await sr.loadTracksFromUUID(P),pe=sr.parseTracksFromJSON(le);a(pe),c(sr.getSilentVideoUrl(P)),B({background:{url:sr.getBackgroundAudioUrl(P),label:e("backgroundAudio")},original:{url:sr.getOriginalVocalsUrl(P),label:e("originalVocals")},dubbed:{url:sr.getDubbedVocalsUrl(P),label:e("dubbedVocals")}}),pe.length<100&&(E(!0),cs(P,pe)),st(!0)}}catch(le){console.error("Error loading edit mode:",le),he("errorLoadingUUID")}finally{Xe(null),vn(!0)}},Vc=()=>{const pe=new URLSearchParams(window.location.search).get("uuid");if(pe){const Oe=sr.getMediaUrl(pe),Ge=document.createElement("a");Ge.href=Oe,Ge.download="dubbed_video.mp4",document.body.appendChild(Ge),Ge.click(),document.body.removeChild(Ge)}},Kc=async()=>{if(P)try{await sr.regenerateVideo(P,o)}catch(le){console.error("Error regenerating video:",le)}};return $.jsxs($.Fragment,{children:[$.jsx(rN,{}),$.jsxs(iN,{children:[$.jsxs(oN,{children:[pr&&$.jsx(Vd,{children:pr}),nt>0&&nt<100&&$.jsxs(Vd,{children:[e("loadingChunks"),": ",nt.toFixed(0),"%"]}),Re&&$.jsx(Vd,{children:Re}),$.jsxs(sN,{children:[l&&$.jsxs($.Fragment,{children:[!P&&$.jsx(Lt,{onClick:Zn,children:e("closeMedia")}),Zr&&$.jsxs($.Fragment,{children:[!dt&&$.jsx(Lt,{onClick:za,children:e("edit")}),dt?k?$.jsx(Lt,{onClick:Ma,disabled:!Ce,children:e("downloadResult")}):$.jsx(Lt,{onClick:()=>Qr(!0),disabled:!Ce,children:e("regenerate")}):$.jsx(Lt,{onClick:Vc,children:e("downloadResult")})]}),!Zr&&$.jsx(Lt,{onClick:Ma,children:e("downloadResult")})]}),!1]})]}),$.jsx(uN,{children:ue?$.jsx(By,{children:e("loading")}):l?$.jsxs($.Fragment,{children:[$.jsx(lN,{isEditMode:dt,children:$.jsx(CL,{src:l,tracks:dt?o:[],ref:v,mediaType:R,audioTracks:ce,selectedAudioTracks:K,selectedSubtitles:W,advancedEditMode:k})}),dt&&$.jsx(cN,{children:o.length>0&&$.jsxs($.Fragment,{children:[$.jsxs(aN,{children:[wt&&$.jsx(Kd,{active:m==="timeline",onClick:()=>b("timeline"),children:e("timeline")}),$.jsx(Kd,{active:m==="list",onClick:()=>b("list"),children:e("list")}),$.jsx(Kd,{active:m==="options",onClick:()=>b("options"),children:e("options")})]}),m==="timeline"&&wt?$.jsx(c$,{tracks:o,currentTime:f,onTimeChange:Rt,onEditTrack:lo,isDubbingService:Zr,onTrackChange:Li,showSpeakerColors:ie}):m==="list"?$.jsx(y$,{tracks:o,onTrackChange:Li,onTimeChange:Rt,onEditTrack:lo,onDeleteTrack:Ia,isDubbingService:Zr,showSpeakerColors:ie}):$.jsx(WI,{audioTracks:ce,selectedTracks:K,onAudioTrackToggle:Uc,selectedSubtitles:W,onSubtitlesChange:jc,showSpeakerColors:ie,onShowSpeakerColorsChange:Na,tracks:o,onSpeakerVoiceChange:Hc,timelineVisible:wt,onTimelineVisibleChange:le=>{be(le),!le&&m==="timeline"&&b("list")}})]})})]}):te?$.jsx(By,{children:e(te)}):(!xe||xe==="file")&&!P?$.jsxs(fN,{children:[$.jsx(yu,{type:"file",onChange:ds}),$.jsx(Lt,{onClick:hs,disabled:!V,children:e("openFile")})]}):null})]}),$.jsx(gI,{track:x,onSave:fs,onClose:()=>C(null),onDelete:Ia,ModalOverlay:cg,isDubbingService:Zr}),ge&&$.jsx(GI,{audioTracks:ce,subtitles:["original","dubbed"],onClose:Bc,onDownload:Wc,isRebuilding:Ne}),Ne&&$.jsx(qI,{message:e("rebuildingMedia")}),je&&$.jsx(nN,{onClose:()=>Qr(!1),onRegenerate:Kc})]})}const hN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Yu{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||hN,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{let[c,f]=l;for(let h=0;h{let[c,f]=l;for(let h=0;h{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},Wy=e=>e==null?"":""+e,pN=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},gN=/###/g,Hy=e=>e&&e.indexOf("###")>-1?e.replace(gN,"."):e,Vy=e=>!e||typeof e=="string",ia=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let o=0;for(;o{const{obj:r,k:o}=ia(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let a=t[t.length-1],l=t.slice(0,t.length-1),c=ia(e,l,Object);for(;c.obj===void 0&&l.length;)a=`${l[l.length-1]}.${a}`,l=l.slice(0,l.length-1),c=ia(e,l,Object),c&&c.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=n},mN=(e,t,n,r)=>{const{obj:o,k:a}=ia(e,t,Object);o[a]=o[a]||[],o[a].push(n)},Xu=(e,t)=>{const{obj:n,k:r}=ia(e,t);if(n)return n[r]},vN=(e,t,n)=>{const r=Xu(e,n);return r!==void 0?r:Xu(t,n)},gx=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):gx(e[r],t[r],n):e[r]=t[r]);return e},Oo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var yN={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const wN=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>yN[t]):e;class SN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const xN=[" ",",","?","!",";"],_N=new SN(20),bN=(e,t,n)=>{t=t||"",n=n||"";const r=xN.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=_N.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let a=!o.test(e);if(!a){const l=e.indexOf(n);l>0&&!o.test(e.substring(0,l))&&(a=!0)}return a},qh=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let a=0;a-1&&fe&&e.replace("_","-");class Gy extends Fc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&a?c.push(...r.split(a)):c.push(r)));const f=Xu(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||typeof r!="string"?f:qh(this.data&&this.data[t]&&this.data[t][n],r,a)}addResource(t,n,r,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),o=n,n=c[1]),this.addNamespaces(n),Ky(this.data,c,o),a.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(typeof r[a]=="string"||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),o=r,r=n,n=c[1]),this.addNamespaces(n);let f=Xu(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?gx(f,r,a):f={...f,...r},Ky(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var mx={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(a=>{this.processors[a]&&(t=this.processors[a].process(t,n,r,o))}),t}};const Yy={};class Zu extends Fc{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),pN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=kr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!bN(t,r,o);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:a};const h=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(h[0])>-1)&&(a=h.shift()),t=h.join(o)}return typeof a=="string"&&(a=[a]),{key:t,namespaces:a}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],n),f=c[c.length-1],h=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&h.toLowerCase()==="cimode"){if(p){const C=n.nsSeparator||this.options.nsSeparator;return o?{res:`${f}${C}${l}`,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:`${f}${C}${l}`}return o?{res:l,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:f,usedParams:this.getUsedParamsDetails(n)}:l}const w=this.resolve(t,n);let m=w&&w.res;const b=w&&w.usedKey||l,R=w&&w.exactUsedKey||l,O=Object.prototype.toString.apply(m),N=["[object Number]","[object Function]","[object RegExp]"],_=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&N.indexOf(O)<0&&!(typeof _=="string"&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,m,{...n,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(w.res=C,w.usedParams=this.getUsedParamsDetails(n),w):C}if(a){const C=Array.isArray(m),k=C?[]:{},E=C?R:b;for(const P in m)if(Object.prototype.hasOwnProperty.call(m,P)){const A=`${E}${a}${P}`;k[P]=this.translate(A,{...n,joinArrays:!1,ns:c}),k[P]===A&&(k[P]=m[P])}m=k}}else if(v&&typeof _=="string"&&Array.isArray(m))m=m.join(_),m&&(m=this.extendTranslation(m,t,n,r));else{let C=!1,k=!1;const E=n.count!==void 0&&typeof n.count!="string",P=Zu.hasDefaultValue(n),A=E?this.pluralResolver.getSuffix(h,n.count,n):"",V=n.ordinal&&E?this.pluralResolver.getSuffix(h,n.count,{ordinal:!1}):"",Q=E&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),te=Q&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${V}`]||n.defaultValue;!this.isValidLookup(m)&&P&&(C=!0,m=te),this.isValidLookup(m)||(k=!0,m=l);const ve=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&k?void 0:m,re=P&&te!==m&&this.options.updateMissing;if(k||C||re){if(this.logger.log(re?"updateKey":"missingKey",h,f,l,re?te:m),a){const B=this.resolve(l,{...n,keySeparator:!1});B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ue=[];const de=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&de&&de[0])for(let B=0;B{const K=P&&F!==m?F:ve;this.options.missingKeyHandler?this.options.missingKeyHandler(B,f,M,K,re,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(B,f,M,K,re,n),this.emit("missingKey",B,f,M,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?ue.forEach(B=>{const M=this.pluralResolver.getSuffixes(B,n);Q&&n[`defaultValue${this.options.pluralSeparator}zero`]&&M.indexOf(`${this.options.pluralSeparator}zero`)<0&&M.push(`${this.options.pluralSeparator}zero`),M.forEach(F=>{ce([B],l+F,n[`defaultValue${F}`]||te)})}):ce(ue,l,te))}m=this.extendTranslation(m,t,n,w,r),k&&m===l&&this.options.appendNamespaceToMissingKey&&(m=`${f}:${l}`),(k||C)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}:${l}`:l,C?m:void 0):m=this.options.parseMissingKeyHandler(m))}return o?(w.res=m,w.usedParams=this.getUsedParamsDetails(n),w):m}extendTranslation(t,n,r,o,a){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const h=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(h){const m=t.match(this.interpolator.nestingRegexp);p=m&&m.length}let w=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(w={...this.options.interpolation.defaultVariables,...w}),t=this.interpolator.interpolate(t,w,r.lng||this.language||o.usedLng,r),h){const m=t.match(this.interpolator.nestingRegexp),b=m&&m.length;p1&&arguments[1]!==void 0?arguments[1]:{},r,o,a,l,c;return typeof t=="string"&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const h=this.extractFromKey(f,n),p=h.key;o=p;let w=h.namespaces;this.options.fallbackNS&&(w=w.concat(this.options.fallbackNS));const m=n.count!==void 0&&typeof n.count!="string",b=m&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),R=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",O=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);w.forEach(N=>{this.isValidLookup(r)||(c=N,!Yy[`${O[0]}-${N}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(Yy[`${O[0]}-${N}`]=!0,this.logger.warn(`key "${o}" for languages "${O.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),O.forEach(_=>{if(this.isValidLookup(r))return;l=_;const v=[p];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,p,_,N,n);else{let C;m&&(C=this.pluralResolver.getSuffix(_,n.count,n));const k=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(v.push(p+C),n.ordinal&&C.indexOf(E)===0&&v.push(p+C.replace(E,this.options.pluralSeparator)),b&&v.push(p+k)),R){const P=`${p}${this.options.contextSeparator}${n.context}`;v.push(P),m&&(v.push(P+C),n.ordinal&&C.indexOf(E)===0&&v.push(P+C.replace(E,this.options.pluralSeparator)),b&&v.push(P+k))}}let x;for(;x=v.pop();)this.isValidLookup(r)||(a=x,r=this.getResource(_,N,x,n))}))})}),{res:r,usedKey:o,exactUsedKey:a,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const a of n)delete o[a]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Gd=e=>e.charAt(0).toUpperCase()+e.slice(1);class Xy{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=kr.create("languageUtils")}getScriptPartFromCode(t){if(t=Qu(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Qu(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let o=Intl.getCanonicalLocales(t)[0];if(o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o)return o}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Gd(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Gd(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Gd(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=l=>{l&&(this.isSupportedCode(l)?o.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),r.forEach(l=>{o.indexOf(l)<0&&a(this.formatLanguageCode(l))}),o}}let kN=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],CN={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const EN=["v1","v2","v3"],TN=["v4"],Qy={zero:0,one:1,two:2,few:3,many:4,other:5},RN=()=>{const e={};return kN.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:CN[t.fc]}})}),e};class PN{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=kr.create("pluralResolver"),(!this.options.compatibilityJSON||TN.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=RN(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Qu(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const l=new Intl.PluralRules(r,{type:o});return this.pluralRulesCache[a]=l,l}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,a)=>Qy[o]-Qy[a]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const a=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!EN.includes(this.options.compatibilityJSON)}}const Zy=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=vN(e,t,n);return!a&&o&&typeof n=="string"&&(a=qh(e,n,r),a===void 0&&(a=qh(t,n,r))),a},Yd=e=>e.replace(/\$/g,"$$$$");class ON{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=kr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:a,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:h,unescapeSuffix:p,unescapePrefix:w,nestingPrefix:m,nestingPrefixEscaped:b,nestingSuffix:R,nestingSuffixEscaped:O,nestingOptionsSeparator:N,maxReplaces:_,alwaysFormat:v}=t.interpolation;this.escape=n!==void 0?n:wN,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?Oo(a):l||"{{",this.suffix=c?Oo(c):f||"}}",this.formatSeparator=h||",",this.unescapePrefix=p?"":w||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=m?Oo(m):b||Oo("$t("),this.nestingSuffix=R?Oo(R):O||Oo(")"),this.nestingOptionsSeparator=N||",",this.maxReplaces=_||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,o){let a,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=b=>{if(b.indexOf(this.formatSeparator)<0){const _=Zy(n,f,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,r,{...o,...n,interpolationkey:b}):_}const R=b.split(this.formatSeparator),O=R.shift().trim(),N=R.join(this.formatSeparator).trim();return this.format(Zy(n,f,O,this.options.keySeparator,this.options.ignoreJSONStructure),N,r,{...o,...n,interpolationkey:O})};this.resetRegExp();const p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,w=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>Yd(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?Yd(this.escape(b)):Yd(b)}].forEach(b=>{for(c=0;a=b.regex.exec(t);){const R=a[1].trim();if(l=h(R),l===void 0)if(typeof p=="function"){const N=p(t,a,o);l=typeof N=="string"?N:""}else if(o&&Object.prototype.hasOwnProperty.call(o,R))l="";else if(w){l=a[0];continue}else this.logger.warn(`missed to pass in variable ${R} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=Wy(l));const O=b.safeValue(l);if(t=t.replace(a[0],O),w?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=a[0].length):b.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,l;const c=(f,h)=>{const p=this.nestingOptionsSeparator;if(f.indexOf(p)<0)return f;const w=f.split(new RegExp(`${p}[ ]*{`));let m=`{${w[1]}`;f=w[0],m=this.interpolate(m,l);const b=m.match(/'/g),R=m.match(/"/g);(b&&b.length%2===0&&!R||R.length%2!==0)&&(m=m.replace(/'/g,'"'));try{l=JSON.parse(m),h&&(l={...h,...l})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,O),`${f}${p}${m}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;o=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;let h=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const p=o[1].split(this.formatSeparator).map(w=>w.trim());o[1]=p.shift(),f=p,h=!0}if(a=n(c.call(this,o[1].trim(),l),l),a&&o[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=Wy(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),a=""),h&&(a=f.reduce((p,w)=>this.format(p,w,r.lng,{...r,interpolationkey:o[1].trim()}),a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}const LN=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),h=f.join(":").trim().replace(/^'+|'+$/g,""),p=c.trim();n[p]||(n[p]=h),h==="false"&&(n[p]=!1),h==="true"&&(n[p]=!0),isNaN(h)||(n[p]=parseInt(h,10))}})}return{formatName:t,formatOptions:n}},Lo=e=>{const t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const l=r+JSON.stringify(a);let c=t[l];return c||(c=e(Qu(r),o),t[l]=c),c(n)}};class AN{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=kr.create("formatter"),this.options=t,this.formats={number:Lo((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return a=>o.format(a)}),currency:Lo((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>o.format(a)}),datetime:Lo((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return a=>o.format(a)}),relativetime:Lo((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return a=>o.format(a,r.range||"day")}),list:Lo((n,r)=>{const o=new Intl.ListFormat(n,{...r});return a=>o.format(a)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Lo(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(c=>c.indexOf(")")>-1)){const c=a.findIndex(f=>f.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce((c,f)=>{const{formatName:h,formatOptions:p}=LN(f);if(this.formats[h]){let w=c;try{const m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},b=m.locale||m.lng||o.locale||o.lng||r;w=this.formats[h](c,b,{...p,...o,...m})}catch(m){this.logger.warn(m)}return w}else this.logger.warn(`there was no format function for ${h}`);return c},t)}}const DN=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class $N extends Fc{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=kr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const a={},l={},c={},f={};return t.forEach(h=>{let p=!0;n.forEach(w=>{const m=`${h}|${w}`;!r.reload&&this.store.hasResourceBundle(h,w)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?l[m]===void 0&&(l[m]=!0):(this.state[m]=1,p=!1,l[m]===void 0&&(l[m]=!0),a[m]===void 0&&(a[m]=!0),f[w]===void 0&&(f[w]=!0)))}),p||(c[h]=!0)}),(Object.keys(a).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const o=t.split("|"),a=o[0],l=o[1];n&&this.emit("failedLoading",a,l,n),!n&&r&&this.store.addResourceBundle(a,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{mN(f.loaded,[a],l),DN(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(h=>{c[h]||(c[h]={});const p=f.loaded[h];p.length&&p.forEach(w=>{c[h][w]===void 0&&(c[h][w]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:a,callback:l});return}this.readingCalls++;const c=(h,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const w=this.waitingReads.shift();this.read(w.lng,w.ns,w.fcName,w.tried,w.wait,w.callback)}if(h&&p&&o{this.read.call(this,t,n,r,o+1,a*2,l)},a);return}l(h,p)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const h=f(t,n);h&&typeof h.then=="function"?h.then(p=>c(null,p)).catch(c):c(null,h)}catch(h){c(h)}return}return f(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${a} for language ${o}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,o,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const f={...l,isUpdate:a},h=this.backend.create.bind(this.backend);if(h.length<6)try{let p;h.length===5?p=h(t,n,r,o,f):p=h(t,n,r,o),p&&typeof p.then=="function"?p.then(w=>c(null,w)).catch(c):c(null,p)}catch(p){c(p)}else h(t,n,r,o,c,f)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const qy=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Jy=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),ru=()=>{},IN=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ka extends Fc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Jy(t),this.services={},this.logger=kr,this.modules={external:[]},IN(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=qy();this.options={...o,...this.options,...Jy(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?kr.init(a(this.modules.logger),this.options):kr.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:typeof Intl<"u"&&(p=AN);const w=new Xy(this.options);this.store=new Gy(this.options.resources,this.options);const m=this.services;m.logger=kr,m.resourceStore=this.store,m.languageUtils=w,m.pluralResolver=new PN(w,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=a(p),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new ON(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new $N(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(b){for(var R=arguments.length,O=new Array(R>1?R-1:0),N=1;N1?R-1:0),N=1;N{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,r||(r=ru),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=function(){return t.store[p](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=function(){return t.store[p](...arguments),t}});const f=js(),h=()=>{const p=(w,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(m),r(w,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),f}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ru;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(h=>{h!=="cimode"&&a.indexOf(h)<0&&a.push(h)})};o?l(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),this.options.preload&&this.options.preload.forEach(c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const o=js();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=ru),this.services.backendConnector.reload(t,n,a=>{o.resolve(),r(a)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&mx.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=js();this.emit("languageChanging",t);const a=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},l=(f,h)=>{h?(a(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(f,function(){return r.t(...arguments)})},c=f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const h=typeof f=="string"?f:this.services.languageUtils.getBestMatchFromCodes(f);h&&(this.language||a(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(h)),this.loadResources(h,p=>{l(p,h)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),o}getFixedT(t,n,r){var o=this;const a=function(l,c){let f;if(typeof c!="object"){for(var h=arguments.length,p=new Array(h>2?h-2:0),w=2;w`${f.keyPrefix}${m}${R}`):b=f.keyPrefix?`${f.keyPrefix}${m}${l}`:l,o.t(b,f)};return typeof t=="string"?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const h=this.services.backendConnector.state[`${c}|${f}`];return h===-1||h===0||h===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!o||l(a,t)))}loadNamespaces(t,n){const r=js();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=js();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],a=t.filter(l=>o.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return a.length?(this.options.preload=o.concat(a),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new Xy(qy());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ka(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ru;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new ka(o);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(c=>{a[c]=this[c]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Gy(this.store.data,o),a.services.resourceStore=a.store),a.translator=new Zu(a.services,o),a.translator.on("*",function(c){for(var f=arguments.length,h=new Array(f>1?f-1:0),p=1;p0){var c=o.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+="; Max-Age=".concat(Math.floor(c))}if(o.domain){if(!t1.test(o.domain))throw new TypeError("option domain is invalid");l+="; Domain=".concat(o.domain)}if(o.path){if(!t1.test(o.path))throw new TypeError("option path is invalid");l+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(l+="; HttpOnly"),o.secure&&(l+="; Secure"),o.sameSite){var f=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(f){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l},n1={create:function(t,n,r,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),o&&(a.domain=o),document.cookie=WN(t,encodeURIComponent(n),a)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),a=o.split("&"),l=0;l0){var f=a[l].substring(0,c);f===t.lookupQuerystring&&(n=a[l].substring(c+1))}}}return n}},Bs=null,r1=function(){if(Bs!==null)return Bs;try{Bs=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Bs=!1}return Bs},KN={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&r1()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&r1()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Ws=null,i1=function(){if(Ws!==null)return Ws;try{Ws=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Ws=!1}return Ws},GN={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&i1()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&i1()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},YN={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},XN={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},QN={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},ZN={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function qN(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var yx=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};NN(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return FN(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n||{languageUtils:{}},this.options=BN(r,this.options||{},qN()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(a){return a.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(HN),this.addDetector(VN),this.addDetector(KN),this.addDetector(GN),this.addDetector(YN),this.addDetector(XN),this.addDetector(QN),this.addDetector(ZN)}},{key:"addDetector",value:function(n){return this.detectors[n.name]=n,this}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(a){if(r.detectors[a]){var l=r.detectors[a].lookup(r.options);l&&typeof l=="string"&&(l=[l]),l&&(o=o.concat(l))}}),o=o.map(function(a){return r.options.convertDetectedLanguage(a)}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(a){o.detectors[a]&&o.detectors[a].cacheUserLanguage(n,o.options)}))}}]),e}();yx.type="languageDetector";const JN="Timeline",e3="List",t3="Download",n3="Zoom Out",r3="Zoom In",i3="Reset Zoom",o3="Close File",s3="Open file",a3="Select a file or enter UUID",l3="Enter UUID",u3="Submit",c3="Save",f3="Cancel",d3="Error loading video, maybe it doesn't exist",h3="Original Text",p3="Translated Text",g3="Start Time",m3="End Time",v3="Text",y3="Speed",w3="Options",S3="Audio Tracks",x3="Delete",_3="Subtitles",b3="No Subtitles",k3="Original Subtitles",C3="Dubbed Subtitles",E3="Speakers",T3="New speaker name",R3="Speaker",P3="Select a speaker",O3="Show speaker colors",L3="Select tracks for download",A3="Rebuilding media, please wait...",D3="Loading...",$3="Loading files, please wait...",I3="Reconstructing audio, please wait...",N3="Original Vocals",M3="Dubbed Vocals",z3="Background Audio",F3="Missing UUID",U3="Loading media, please wait...",j3="Edit",B3="Advanced",W3="Enable Timeline",H3="Regenerate",V3="Regenerating...",K3="Once you have made all the necessary edits you can send us back the modifications so we can regenrate the video. You will receive an email once the video is ready.",G3="Your request has been sent successfully. You will receive an email once the video is ready.",Y3="Close",X3={timeline:JN,list:e3,downloadResult:t3,zoomOut:n3,zoomIn:r3,resetZoom:i3,closeMedia:o3,openFile:s3,selectFileOrUUID:a3,enterUUID:l3,submit:u3,save:c3,cancel:f3,errorLoadingUUID:d3,originalText:h3,translatedText:p3,startTime:g3,endTime:m3,text:v3,speed:y3,options:w3,audioTracks:S3,deleteTrack:x3,subtitles:_3,noSubtitles:b3,originalSubtitles:k3,dubbedSubtitles:C3,speakers:E3,newSpeakerName:T3,speaker:R3,selectSpeaker:P3,showSpeakerColors:O3,selectTracksForDownload:L3,rebuildingMedia:A3,loading:D3,loadingChunks:$3,reconstructingAudio:I3,originalVocals:N3,dubbedVocals:M3,backgroundAudio:z3,missingUUID:F3,loadingMedia:U3,edit:j3,advanced:B3,enableTimeline:W3,delete:"Delete",regenerate:H3,regenerating:V3,regenerateDescription:K3,regenerateRequestSent:G3,close:Y3},Q3="Línea de Tiempo",Z3="Lista",q3="Descargar",J3="Alejar",eM="Acercar",tM="Restablecer Zoom",nM="Cerrar Archivo",rM="Abrir archivo",iM="Selecciona un archivo o introduce UUID",oM="Introduce UUID",sM="Enviar",aM="Guardar",lM="Cancelar",uM="Error cargando el video, es posible que ya no exista",cM="Texto Original",fM="Texto Traducido",dM="Tiempo Inicial",hM="Tiempo Final",pM="Texto",gM="Velocidad",mM="Opciones",vM="Pistas de Audio",yM="Eliminar",wM="Subtítulos",SM="Sin Subtítulos",xM="Subtítulos Originales",_M="Subtítulos Doblados",bM="Hablantes",kM="Nombre del nuevo hablante",CM="Hablante",EM="Selecciona un hablante",TM="Mostrar colores de hablantes",RM="Selecciona las pistas para descargar",PM="Reconstruyendo el video, por favor, espera...",OM="Cargando...",LM="Cargando archivos, por favor, espera...",AM="Reconstruyendo audio, por favor, espera...",DM="Voces Originales",$M="Voces Dobladas",IM="Audio de Fondo",NM="Falta UUID",MM="Cargando vídeo, por favor, espera...",zM="Edita",FM="Avançat",UM="Mostrar Línea de Tiempo",jM="Regenera",BM="Regenerant...",WM="Después de haber hecho todas las modificaciones necesarias, puedes enviarnos las modificaciones para regenerar el vídeo. Recibirás un correo electrónico cuando el vídeo esté listo.",HM="La petición ha sido enviada con éxito. Recibirás un correo electrónico cuando el vídeo esté listo.",VM="Cerrar",KM={timeline:Q3,list:Z3,downloadResult:q3,zoomOut:J3,zoomIn:eM,resetZoom:tM,closeMedia:nM,openFile:rM,selectFileOrUUID:iM,enterUUID:oM,submit:sM,save:aM,cancel:lM,errorLoadingUUID:uM,originalText:cM,translatedText:fM,startTime:dM,endTime:hM,text:pM,speed:gM,options:mM,audioTracks:vM,deleteTrack:yM,subtitles:wM,noSubtitles:SM,originalSubtitles:xM,dubbedSubtitles:_M,speakers:bM,newSpeakerName:kM,speaker:CM,selectSpeaker:EM,showSpeakerColors:TM,selectTracksForDownload:RM,rebuildingMedia:PM,loading:OM,loadingChunks:LM,reconstructingAudio:AM,originalVocals:DM,dubbedVocals:$M,backgroundAudio:IM,missingUUID:NM,loadingMedia:MM,edit:zM,advanced:FM,enableTimeline:UM,delete:"Eliminar",regenerate:jM,regenerating:BM,regenerateDescription:WM,regenerateRequestSent:HM,close:VM},GM="Línia de temps",YM="Llista",XM="Descarrega",QM="Allunya",ZM="Apropa",qM="Restablir Zoom",JM="Tanca Arxiu",ez="Obre Arxiu",tz="Selecciona un arxiu o introdueix UUID",nz="Introdueix UUID",rz="Envia",iz="Desa",oz="Cancel·la",sz="Error carregant el vídeo, potser ja no existeix",az="Text original",lz="Text traduït",uz="Temps inicial",cz="Temps final",fz="Text",dz="Velocitat",hz="Opcions",pz="Pistes d'àudio",gz="Elimina",mz="Subtítols",vz="Sense subtítols",yz="Subtítols originals",wz="Subtítols doblats",Sz="Parlants",xz="Nom del nou parlant",_z="Parlant",bz="Selecciona un parlant",kz="Mostrar colors de parlants",Cz="Selecciona les pistes per descarregar",Ez="Reconstruint el vídeo, si us plau, espereu...",Tz="Carregant...",Rz="Carregant fitxers, si us plau, espereu...",Pz="Reconstruint àudio, si us plau, espereu...",Oz="Veus originals",Lz="Veus doblades",Az="Àudio de Fons",Dz="Error carregant el vídeo, manca l'UUID",$z="Carregant vídeo, si us plau, espereu...",Iz="Edita",Nz="Avançat",Mz="Mostrar Línia de Temps",zz="Regenera",Fz="Regenerant...",Uz="Després d'haver fet totes les modificacions necessàries, pots enviar-nos les modificacions per regenerar el vídeo. Rebràs un correu electrònic quan el vídeo estigui llest.",jz="La teva petició ha estat enviada amb èxit. Rebràs un correu electrònic quan el vídeo estigui llest.",Bz="Tanca",Wz={timeline:GM,list:YM,downloadResult:XM,zoomOut:QM,zoomIn:ZM,resetZoom:qM,closeMedia:JM,openFile:ez,selectFileOrUUID:tz,enterUUID:nz,submit:rz,save:iz,cancel:oz,errorLoadingUUID:sz,originalText:az,translatedText:lz,startTime:uz,endTime:cz,text:fz,speed:dz,options:hz,audioTracks:pz,deleteTrack:gz,subtitles:mz,noSubtitles:vz,originalSubtitles:yz,dubbedSubtitles:wz,speakers:Sz,newSpeakerName:xz,speaker:_z,selectSpeaker:bz,showSpeakerColors:kz,selectTracksForDownload:Cz,rebuildingMedia:Ez,loading:Tz,loadingChunks:Rz,reconstructingAudio:Pz,originalVocals:Oz,dubbedVocals:Lz,backgroundAudio:Az,missingUUID:Dz,loadingMedia:$z,edit:Iz,advanced:Nz,enableTimeline:Mz,delete:"Eliminar",regenerate:zz,regenerating:Fz,regenerateDescription:Uz,regenerateRequestSent:jz,close:Bz};Yt.use(yx).use(hL).init({resources:{en:{translation:X3},es:{translation:KM},ca:{translation:Wz}},fallbackLng:"en",detection:{order:["navigator"]},interpolation:{escapeValue:!1}});Xd.createRoot(document.getElementById("root")).render($.jsx(Wr.StrictMode,{children:$.jsx(dN,{})})); diff --git a/style.css b/style.css index 47c1059..17878f7 100644 --- a/style.css +++ b/style.css @@ -1,7 +1,7 @@ /* Theme Name: Softcatala Theme URI: https://www.softcatala.org -Version: 1.2.14 +Version: 1.2.15 Author: Softcatalà Author URI: https://www.softcatala.org/ Description: Softcatala WordPress Theme