hyperframes 0.6.86 → 0.6.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,140 +0,0 @@
1
- var aT=Object.defineProperty;var lT=(t,e,n)=>e in t?aT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var E5=(t,e,n)=>lT(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function sT(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ip={exports:{}},Tc={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var T5;function oT(){if(T5)return Tc;T5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,l){var s=null;if(l!==void 0&&(s=""+l),i.key!==void 0&&(s=""+i.key),"key"in i){l={};for(var c in i)c!=="key"&&(l[c]=i[c])}else l=i;return i=l.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:l}}return Tc.Fragment=e,Tc.jsx=n,Tc.jsxs=n,Tc}var $5;function cT(){return $5||($5=1,ip.exports=oT()),ip.exports}var m=cT(),ap={exports:{}},Ie={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var j5;function uT(){if(j5)return Ie;j5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),x=Symbol.iterator;function y(P){return P===null||typeof P!="object"?null:(P=x&&P[x]||P["@@iterator"],typeof P=="function"?P:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,A={};function k(P,Z,L){this.props=P,this.context=Z,this.refs=A,this.updater=L||v}k.prototype.isReactComponent={},k.prototype.setState=function(P,Z){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,Z,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function M(){}M.prototype=k.prototype;function E(P,Z,L){this.props=P,this.context=Z,this.refs=A,this.updater=L||v}var $=E.prototype=new M;$.constructor=E,w($,k.prototype),$.isPureReactComponent=!0;var C=Array.isArray;function j(){}var T={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function R(P,Z,L){var B=L.ref;return{$$typeof:t,type:P,key:Z,ref:B!==void 0?B:null,props:L}}function D(P,Z){return R(P.type,Z,P.props)}function V(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function z(P){var Z={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(L){return Z[L]})}var I=/\/+/g;function U(P,Z){return typeof P=="object"&&P!==null&&P.key!=null?z(""+P.key):Z.toString(36)}function K(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(j,j):(P.status="pending",P.then(function(Z){P.status==="pending"&&(P.status="fulfilled",P.value=Z)},function(Z){P.status==="pending"&&(P.status="rejected",P.reason=Z)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function H(P,Z,L,B,J){var te=typeof P;(te==="undefined"||te==="boolean")&&(P=null);var Y=!1;if(P===null)Y=!0;else switch(te){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(P.$$typeof){case t:case e:Y=!0;break;case g:return Y=P._init,H(Y(P._payload),Z,L,B,J)}}if(Y)return J=J(P),Y=B===""?"."+U(P,0):B,C(J)?(L="",Y!=null&&(L=Y.replace(I,"$&/")+"/"),H(J,Z,L,"",function(ue){return ue})):J!=null&&(V(J)&&(J=D(J,L+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace(I,"$&/")+"/")+Y)),Z.push(J)),1;Y=0;var re=B===""?".":B+":";if(C(P))for(var ae=0;ae<P.length;ae++)B=P[ae],te=re+U(B,ae),Y+=H(B,Z,L,te,J);else if(ae=y(P),typeof ae=="function")for(P=ae.call(P),ae=0;!(B=P.next()).done;)B=B.value,te=re+U(B,ae++),Y+=H(B,Z,L,te,J);else if(te==="object"){if(typeof P.then=="function")return H(K(P),Z,L,B,J);throw Z=String(P),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return Y}function q(P,Z,L){if(P==null)return P;var B=[],J=0;return H(P,B,"","",function(te){return Z.call(L,te,J++)}),B}function X(P){if(P._status===-1){var Z=P._result;Z=Z(),Z.then(function(L){(P._status===0||P._status===-1)&&(P._status=1,P._result=L)},function(L){(P._status===0||P._status===-1)&&(P._status=2,P._result=L)}),P._status===-1&&(P._status=0,P._result=Z)}if(P._status===1)return P._result.default;throw P._result}var G=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},F={map:q,forEach:function(P,Z,L){q(P,function(){Z.apply(this,arguments)},L)},count:function(P){var Z=0;return q(P,function(){Z++}),Z},toArray:function(P){return q(P,function(Z){return Z})||[]},only:function(P){if(!V(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return Ie.Activity=O,Ie.Children=F,Ie.Component=k,Ie.Fragment=n,Ie.Profiler=i,Ie.PureComponent=E,Ie.StrictMode=r,Ie.Suspense=u,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(P){return T.H.useMemoCache(P)}},Ie.cache=function(P){return function(){return P.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(P,Z,L){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var B=w({},P.props),J=P.key;if(Z!=null)for(te in Z.key!==void 0&&(J=""+Z.key),Z)!N.call(Z,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&Z.ref===void 0||(B[te]=Z[te]);var te=arguments.length-2;if(te===1)B.children=L;else if(1<te){for(var Y=Array(te),re=0;re<te;re++)Y[re]=arguments[re+2];B.children=Y}return R(P.type,J,B)},Ie.createContext=function(P){return P={$$typeof:s,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:l,_context:P},P},Ie.createElement=function(P,Z,L){var B,J={},te=null;if(Z!=null)for(B in Z.key!==void 0&&(te=""+Z.key),Z)N.call(Z,B)&&B!=="key"&&B!=="__self"&&B!=="__source"&&(J[B]=Z[B]);var Y=arguments.length-2;if(Y===1)J.children=L;else if(1<Y){for(var re=Array(Y),ae=0;ae<Y;ae++)re[ae]=arguments[ae+2];J.children=re}if(P&&P.defaultProps)for(B in Y=P.defaultProps,Y)J[B]===void 0&&(J[B]=Y[B]);return R(P,te,J)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(P){return{$$typeof:c,render:P}},Ie.isValidElement=V,Ie.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:X}},Ie.memo=function(P,Z){return{$$typeof:h,type:P,compare:Z===void 0?null:Z}},Ie.startTransition=function(P){var Z=T.T,L={};T.T=L;try{var B=P(),J=T.S;J!==null&&J(L,B),typeof B=="object"&&B!==null&&typeof B.then=="function"&&B.then(j,G)}catch(te){G(te)}finally{Z!==null&&L.types!==null&&(Z.types=L.types),T.T=Z}},Ie.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ie.use=function(P){return T.H.use(P)},Ie.useActionState=function(P,Z,L){return T.H.useActionState(P,Z,L)},Ie.useCallback=function(P,Z){return T.H.useCallback(P,Z)},Ie.useContext=function(P){return T.H.useContext(P)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(P,Z){return T.H.useDeferredValue(P,Z)},Ie.useEffect=function(P,Z){return T.H.useEffect(P,Z)},Ie.useEffectEvent=function(P){return T.H.useEffectEvent(P)},Ie.useId=function(){return T.H.useId()},Ie.useImperativeHandle=function(P,Z,L){return T.H.useImperativeHandle(P,Z,L)},Ie.useInsertionEffect=function(P,Z){return T.H.useInsertionEffect(P,Z)},Ie.useLayoutEffect=function(P,Z){return T.H.useLayoutEffect(P,Z)},Ie.useMemo=function(P,Z){return T.H.useMemo(P,Z)},Ie.useOptimistic=function(P,Z){return T.H.useOptimistic(P,Z)},Ie.useReducer=function(P,Z,L){return T.H.useReducer(P,Z,L)},Ie.useRef=function(P){return T.H.useRef(P)},Ie.useState=function(P){return T.H.useState(P)},Ie.useSyncExternalStore=function(P,Z,L){return T.H.useSyncExternalStore(P,Z,L)},Ie.useTransition=function(){return T.H.useTransition()},Ie.version="19.2.6",Ie}var P5;function v8(){return P5||(P5=1,ap.exports=uT()),ap.exports}var d=v8();const O1=sT(d);var lp={exports:{}},$c={},sp={exports:{}},op={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Q5;function fT(){return Q5||(Q5=1,(function(t){function e(H,q){var X=H.length;H.push(q);e:for(;0<X;){var G=X-1>>>1,F=H[G];if(0<i(F,q))H[G]=q,H[X]=F,X=G;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var q=H[0],X=H.pop();if(X!==q){H[0]=X;e:for(var G=0,F=H.length,P=F>>>1;G<P;){var Z=2*(G+1)-1,L=H[Z],B=Z+1,J=H[B];if(0>i(L,X))B<F&&0>i(J,L)?(H[G]=J,H[B]=X,G=B):(H[G]=L,H[Z]=X,G=Z);else if(B<F&&0>i(J,X))H[G]=J,H[B]=X,G=B;else break e}}return q}function i(H,q){var X=H.sortIndex-q.sortIndex;return X!==0?X:H.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();t.unstable_now=function(){return s.now()-c}}var u=[],h=[],g=1,O=null,x=3,y=!1,v=!1,w=!1,A=!1,k=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function $(H){for(var q=n(h);q!==null;){if(q.callback===null)r(h);else if(q.startTime<=H)r(h),q.sortIndex=q.expirationTime,e(u,q);else break;q=n(h)}}function C(H){if(w=!1,$(H),!v)if(n(u)!==null)v=!0,j||(j=!0,z());else{var q=n(h);q!==null&&K(C,q.startTime-H)}}var j=!1,T=-1,N=5,R=-1;function D(){return A?!0:!(t.unstable_now()-R<N)}function V(){if(A=!1,j){var H=t.unstable_now();R=H;var q=!0;try{e:{v=!1,w&&(w=!1,M(T),T=-1),y=!0;var X=x;try{t:{for($(H),O=n(u);O!==null&&!(O.expirationTime>H&&D());){var G=O.callback;if(typeof G=="function"){O.callback=null,x=O.priorityLevel;var F=G(O.expirationTime<=H);if(H=t.unstable_now(),typeof F=="function"){O.callback=F,$(H),q=!0;break t}O===n(u)&&r(u),$(H)}else r(u);O=n(u)}if(O!==null)q=!0;else{var P=n(h);P!==null&&K(C,P.startTime-H),q=!1}}break e}finally{O=null,x=X,y=!1}q=void 0}}finally{q?z():j=!1}}}var z;if(typeof E=="function")z=function(){E(V)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,U=I.port2;I.port1.onmessage=V,z=function(){U.postMessage(null)}}else z=function(){k(V,0)};function K(H,q){T=k(function(){H(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(H){switch(x){case 1:case 2:case 3:var q=3;break;default:q=x}var X=x;x=q;try{return H()}finally{x=X}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(H,q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var X=x;x=H;try{return q()}finally{x=X}},t.unstable_scheduleCallback=function(H,q,X){var G=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?G+X:G):X=G,H){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=X+F,H={id:g++,callback:q,priorityLevel:H,startTime:X,expirationTime:F,sortIndex:-1},X>G?(H.sortIndex=X,e(h,H),n(u)===null&&H===n(h)&&(w?(M(T),T=-1):w=!0,K(C,X-G))):(H.sortIndex=F,e(u,H),v||y||(v=!0,j||(j=!0,z()))),H},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(H){var q=x;return function(){var X=x;x=q;try{return H.apply(this,arguments)}finally{x=X}}}})(op)),op}var Z5;function dT(){return Z5||(Z5=1,sp.exports=fT()),sp.exports}var cp={exports:{}},_n={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var N5;function hT(){if(N5)return _n;N5=1;var t=v8();function e(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(u,h,g){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:O==null?null:""+O,children:u,containerInfo:h,implementation:g}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return _n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,_n.createPortal=function(u,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return l(u,h,null,g)},_n.flushSync=function(u){var h=s.T,g=r.p;try{if(s.T=null,r.p=2,u)return u()}finally{s.T=h,r.p=g,r.d.f()}},_n.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(u,h))},_n.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},_n.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var g=h.as,O=c(g,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:O,integrity:x,fetchPriority:y}):g==="script"&&r.d.X(u,{crossOrigin:O,integrity:x,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},_n.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=c(h.as,h.crossOrigin);r.d.M(u,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(u)},_n.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,O=c(g,h.crossOrigin);r.d.L(u,g,{crossOrigin:O,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},_n.preloadModule=function(u,h){if(typeof u=="string")if(h){var g=c(h.as,h.crossOrigin);r.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(u)},_n.requestFormReset=function(u){r.d.r(u)},_n.unstable_batchedUpdates=function(u,h){return u(h)},_n.useFormState=function(u,h,g){return s.H.useFormState(u,h,g)},_n.useFormStatus=function(){return s.H.useHostTransitionStatus()},_n.version="19.2.6",_n}var R5;function CS(){if(R5)return cp.exports;R5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),cp.exports=hT(),cp.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var V5;function mT(){if(V5)return $c;V5=1;var t=dT(),e=v8(),n=CS();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var o=a,f=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(f=o.return),a=o.return;while(a)}return o.tag===3?f:null}function s(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function u(a){if(l(a)!==a)throw Error(r(188))}function h(a){var o=a.alternate;if(!o){if(o=l(a),o===null)throw Error(r(188));return o!==a?null:a}for(var f=a,p=o;;){var b=f.return;if(b===null)break;var S=b.alternate;if(S===null){if(p=b.return,p!==null){f=p;continue}break}if(b.child===S.child){for(S=b.child;S;){if(S===f)return u(b),a;if(S===p)return u(b),o;S=S.sibling}throw Error(r(188))}if(f.return!==p.return)f=b,p=S;else{for(var Q=!1,_=b.child;_;){if(_===f){Q=!0,f=b,p=S;break}if(_===p){Q=!0,p=b,f=S;break}_=_.sibling}if(!Q){for(_=S.child;_;){if(_===f){Q=!0,f=S,p=b;break}if(_===p){Q=!0,p=S,f=b;break}_=_.sibling}if(!Q)throw Error(r(189))}}if(f.alternate!==p)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?a:o}function g(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=g(a),o!==null)return o;a=a.sibling}return null}var O=Object.assign,x=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),E=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function z(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var I=Symbol.for("react.client.reference");function U(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===I?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case k:return"Profiler";case A:return"StrictMode";case C:return"Suspense";case j:return"SuspenseList";case R:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case E:return a.displayName||"Context";case M:return(a._context.displayName||"Context")+".Consumer";case $:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case T:return o=a.displayName||null,o!==null?o:U(a.type)||"Memo";case N:o=a._payload,a=a._init;try{return U(a(o))}catch{}}return null}var K=Array.isArray,H=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},G=[],F=-1;function P(a){return{current:a}}function Z(a){0>F||(a.current=G[F],G[F]=null,F--)}function L(a,o){F++,G[F]=a.current,a.current=o}var B=P(null),J=P(null),te=P(null),Y=P(null);function re(a,o){switch(L(te,o),L(J,a),L(B,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?Wx(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=Wx(o),a=Kx(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Z(B),L(B,a)}function ae(){Z(B),Z(J),Z(te)}function ue(a){a.memoizedState!==null&&L(Y,a);var o=B.current,f=Kx(o,a.type);o!==f&&(L(J,a),L(B,f))}function me(a){J.current===a&&(Z(B),Z(J)),Y.current===a&&(Z(Y),Ac._currentValue=X)}var ye,Oe;function Se(a){if(ye===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);ye=o&&o[1]||"",Oe=-1<f.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ye+a+Oe}var Ae=!1;function Me(a,o){if(!a||Ae)return"";Ae=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(o){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ce){var oe=ce}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(ce){oe=ce}a.call(pe.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),Q=S[0],_=S[1];if(Q&&_){var W=Q.split(`
44
- `),se=_.split(`
45
- `);for(b=p=0;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;for(;b<se.length&&!se[b].includes("DetermineComponentFrameRoot");)b++;if(p===W.length||b===se.length)for(p=W.length-1,b=se.length-1;1<=p&&0<=b&&W[p]!==se[b];)b--;for(;1<=p&&0<=b;p--,b--)if(W[p]!==se[b]){if(p!==1||b!==1)do if(p--,b--,0>b||W[p]!==se[b]){var de=`
46
- `+W[p].replace(" at new "," at ");return a.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",a.displayName)),de}while(1<=p&&0<=b);break}}}finally{Ae=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Se(f):""}function Ve(a,o){switch(a.tag){case 26:case 27:case 5:return Se(a.type);case 16:return Se("Lazy");case 13:return a.child!==o&&o!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return Me(a.type,!1);case 11:return Me(a.type.render,!1);case 1:return Me(a.type,!0);case 31:return Se("Activity");default:return""}}function Pe(a){try{var o="",f=null;do o+=Ve(a,f),f=a,a=a.return;while(a);return o}catch(p){return`
47
- Error generating stack: `+p.message+`
48
- `+p.stack}}var ft=Object.prototype.hasOwnProperty,yt=t.unstable_scheduleCallback,Le=t.unstable_cancelCallback,Ye=t.unstable_shouldYield,_e=t.unstable_requestPaint,be=t.unstable_now,dt=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,bt=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,on=t.unstable_LowPriority,Rt=t.unstable_IdlePriority,we=t.log,ht=t.unstable_setDisableYieldValue,Mt=null,ot=null;function ve(a){if(typeof we=="function"&&ht(a),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Mt,a)}catch{}}var ze=Math.clz32?Math.clz32:vt,Ze=Math.log,Be=Math.LN2;function vt(a){return a>>>=0,a===0?32:31-(Ze(a)/Be|0)|0}var lt=256,Je=262144,mt=4194304;function Tt(a){var o=a&42;if(o!==0)return o;switch(a&-a){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function cn(a,o,f){var p=a.pendingLanes;if(p===0)return 0;var b=0,S=a.suspendedLanes,Q=a.pingedLanes;a=a.warmLanes;var _=p&134217727;return _!==0?(p=_&~S,p!==0?b=Tt(p):(Q&=_,Q!==0?b=Tt(Q):f||(f=_&~a,f!==0&&(b=Tt(f))))):(_=p&~S,_!==0?b=Tt(_):Q!==0?b=Tt(Q):f||(f=p&~a,f!==0&&(b=Tt(f)))),b===0?0:o!==0&&o!==b&&(o&S)===0&&(S=b&-b,f=o&-o,S>=f||S===32&&(f&4194048)!==0)?o:b}function Bn(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function bl(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32: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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Sa(){var a=mt;return mt<<=1,(mt&62914560)===0&&(mt=4194304),a}function Zi(a){for(var o=[],f=0;31>f;f++)o.push(a);return o}function En(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function di(a,o,f,p,b,S){var Q=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var _=a.entanglements,W=a.expirationTimes,se=a.hiddenUpdates;for(f=Q&~f;0<f;){var de=31-ze(f),pe=1<<de;_[de]=0,W[de]=-1;var oe=se[de];if(oe!==null)for(se[de]=null,de=0;de<oe.length;de++){var ce=oe[de];ce!==null&&(ce.lane&=-536870913)}f&=~pe}p!==0&&wa(a,p,0),S!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=S&~(Q&~o))}function wa(a,o,f){a.pendingLanes|=o,a.suspendedLanes&=~o;var p=31-ze(o);a.entangledLanes|=o,a.entanglements[p]=a.entanglements[p]|1073741824|f&261930}function ka(a,o){var f=a.entangledLanes|=o;for(a=a.entanglements;f;){var p=31-ze(f),b=1<<p;b&o|a[p]&o&&(a[p]|=o),f&=~b}}function Ce(a,o){var f=o&-o;return f=(f&42)!==0?1:rt(f),(f&(a.suspendedLanes|o))!==0?0:f}function rt(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function bn(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function mr(){var a=q.p;return a!==0?a:(a=window.event,a===void 0?32:v5(a.type))}function vl(a,o){var f=q.p;try{return q.p=a,o()}finally{q.p=f}}var jr=Math.random().toString(36).slice(2),tn="__reactFiber$"+jr,vn="__reactProps$"+jr,Ur="__reactContainer$"+jr,Aa="__reactEvents$"+jr,Ni="__reactListeners$"+jr,xe="__reactHandles$"+jr,Fe="__reactResources$"+jr,ct="__reactMarker$"+jr;function zt(a){delete a[tn],delete a[vn],delete a[Aa],delete a[Ni],delete a[xe]}function Tn(a){var o=a[tn];if(o)return o;for(var f=a.parentNode;f;){if(o=f[Ur]||f[tn]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(a=a5(a);a!==null;){if(f=a[tn])return f;a=a5(a)}return o}a=f,f=a.parentNode}return null}function Pr(a){if(a=a[tn]||a[Ur]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function Kn(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function Ma(a){var o=a[Fe];return o||(o=a[Fe]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function un(a){a[ct]=!0}var r0=new Set,i0={};function Ri(a,o){Ca(a,o),Ca(a+"Capture",o)}function Ca(a,o){for(i0[a]=o,a=0;a<o.length;a++)r0.add(o[a])}var Ud=RegExp("^[: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]*$"),a0={},l0={};function Wd(a){return ft.call(l0,a)?!0:ft.call(a0,a)?!1:Ud.test(a)?l0[a]=!0:(a0[a]=!0,!1)}function Ea(a,o,f){if(Wd(o))if(f===null)a.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var p=o.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+f)}}function pt(a,o,f){if(f===null)a.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+f)}}function $t(a,o,f,p){if(p===null)a.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(o,f,""+p)}}function _t(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Jn(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Wr(a,o,f){var p=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,S=p.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(Q){f=""+Q,S.call(this,Q)}}),Object.defineProperty(a,o,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(Q){f=""+Q},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Kr(a){if(!a._valueTracker){var o=Jn(a)?"checked":"value";a._valueTracker=Wr(a,o,""+a[o])}}function F6(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var f=o.getValue(),p="";return a&&(p=Jn(a)?a.checked?"true":"false":a.value),a=p,a!==f?(o.setValue(a),!0):!1}function s0(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var JM=/[\n"\\]/g;function Qr(a){return a.replace(JM,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Kd(a,o,f,p,b,S,Q,_){a.name="",Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?a.type=Q:a.removeAttribute("type"),o!=null?Q==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+_t(o)):a.value!==""+_t(o)&&(a.value=""+_t(o)):Q!=="submit"&&Q!=="reset"||a.removeAttribute("value"),o!=null?Jd(a,Q,_t(o)):f!=null?Jd(a,Q,_t(f)):p!=null&&a.removeAttribute("value"),b==null&&S!=null&&(a.defaultChecked=!!S),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?a.name=""+_t(_):a.removeAttribute("name")}function B6(a,o,f,p,b,S,Q,_){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),o!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||o!=null)){Kr(a);return}f=f!=null?""+_t(f):"",o=o!=null?""+_t(o):f,_||o===a.value||(a.value=o),a.defaultValue=o}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=_?a.checked:!!p,a.defaultChecked=!!p,Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"&&(a.name=Q),Kr(a)}function Jd(a,o,f){o==="number"&&s0(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function ls(a,o,f,p){if(a=a.options,o){o={};for(var b=0;b<f.length;b++)o["$"+f[b]]=!0;for(f=0;f<a.length;f++)b=o.hasOwnProperty("$"+a[f].value),a[f].selected!==b&&(a[f].selected=b),b&&p&&(a[f].defaultSelected=!0)}else{for(f=""+_t(f),o=null,b=0;b<a.length;b++){if(a[b].value===f){a[b].selected=!0,p&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function Y6(a,o,f){if(o!=null&&(o=""+_t(o),o!==a.value&&(a.value=o),f==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=f!=null?""+_t(f):""}function I6(a,o,f,p){if(o==null){if(p!=null){if(f!=null)throw Error(r(92));if(K(p)){if(1<p.length)throw Error(r(93));p=p[0]}f=p}f==null&&(f=""),o=f}f=_t(o),a.defaultValue=f,p=a.textContent,p===f&&p!==""&&p!==null&&(a.value=p),Kr(a)}function ss(a,o){if(o){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=o;return}}a.textContent=o}var eC=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function q6(a,o,f){var p=o.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?p?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":p?a.setProperty(o,f):typeof f!="number"||f===0||eC.has(o)?o==="float"?a.cssFloat=f:a[o]=(""+f).trim():a[o]=f+"px"}function G6(a,o,f){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,f!=null){for(var p in f)!f.hasOwnProperty(p)||o!=null&&o.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var b in o)p=o[b],o.hasOwnProperty(b)&&f[b]!==p&&q6(a,b,p)}else for(var S in o)o.hasOwnProperty(S)&&q6(a,S,o[S])}function eh(a){if(a.indexOf("-")===-1)return!1;switch(a){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 tC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function o0(a){return nC.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Vi(){}var th=null;function nh(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var os=null,cs=null;function U6(a){var o=Pr(a);if(o&&(a=o.stateNode)){var f=a[vn]||null;e:switch(a=o.stateNode,o.type){case"input":if(Kd(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),o=f.name,f.type==="radio"&&o!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Qr(""+o)+'"][type="radio"]'),o=0;o<f.length;o++){var p=f[o];if(p!==a&&p.form===a.form){var b=p[vn]||null;if(!b)throw Error(r(90));Kd(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<f.length;o++)p=f[o],p.form===a.form&&F6(p)}break e;case"textarea":Y6(a,f.value,f.defaultValue);break e;case"select":o=f.value,o!=null&&ls(a,!!f.multiple,o,!1)}}}var rh=!1;function W6(a,o,f){if(rh)return a(o,f);rh=!0;try{var p=a(o);return p}finally{if(rh=!1,(os!==null||cs!==null)&&(G0(),os&&(o=os,a=cs,cs=os=null,U6(o),a)))for(o=0;o<a.length;o++)U6(a[o])}}function Xo(a,o){var f=a.stateNode;if(f===null)return null;var p=f[vn]||null;if(p===null)return null;f=p[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(r(231,o,typeof f));return f}var Li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ih=!1;if(Li)try{var zo={};Object.defineProperty(zo,"passive",{get:function(){ih=!0}}),window.addEventListener("test",zo,zo),window.removeEventListener("test",zo,zo)}catch{ih=!1}var Ta=null,ah=null,c0=null;function K6(){if(c0)return c0;var a,o=ah,f=o.length,p,b="value"in Ta?Ta.value:Ta.textContent,S=b.length;for(a=0;a<f&&o[a]===b[a];a++);var Q=f-a;for(p=1;p<=Q&&o[f-p]===b[S-p];p++);return c0=b.slice(a,1<p?1-p:void 0)}function u0(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function f0(){return!0}function J6(){return!1}function er(a){function o(f,p,b,S,Q){this._reactName=f,this._targetInst=b,this.type=p,this.nativeEvent=S,this.target=Q,this.currentTarget=null;for(var _ in a)a.hasOwnProperty(_)&&(f=a[_],this[_]=f?f(S):S[_]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?f0:J6,this.isPropagationStopped=J6,this}return O(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=f0)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=f0)},persist:function(){},isPersistent:f0}),o}var Sl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},d0=er(Sl),Fo=O({},Sl,{view:0,detail:0}),rC=er(Fo),lh,sh,Bo,h0=O({},Fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ch,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Bo&&(Bo&&a.type==="mousemove"?(lh=a.screenX-Bo.screenX,sh=a.screenY-Bo.screenY):sh=lh=0,Bo=a),lh)},movementY:function(a){return"movementY"in a?a.movementY:sh}}),eO=er(h0),iC=O({},h0,{dataTransfer:0}),aC=er(iC),lC=O({},Fo,{relatedTarget:0}),oh=er(lC),sC=O({},Sl,{animationName:0,elapsedTime:0,pseudoElement:0}),oC=er(sC),cC=O({},Sl,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),uC=er(cC),fC=O({},Sl,{data:0}),tO=er(fC),dC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hC={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pC(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=mC[a])?!!o[a]:!1}function ch(){return pC}var gC=O({},Fo,{key:function(a){if(a.key){var o=dC[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=u0(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?hC[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ch,charCode:function(a){return a.type==="keypress"?u0(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?u0(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),OC=er(gC),xC=O({},h0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nO=er(xC),yC=O({},Fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ch}),bC=er(yC),vC=O({},Sl,{propertyName:0,elapsedTime:0,pseudoElement:0}),SC=er(vC),wC=O({},h0,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),kC=er(wC),AC=O({},Sl,{newState:0,oldState:0}),MC=er(AC),CC=[9,13,27,32],uh=Li&&"CompositionEvent"in window,Yo=null;Li&&"documentMode"in document&&(Yo=document.documentMode);var EC=Li&&"TextEvent"in window&&!Yo,rO=Li&&(!uh||Yo&&8<Yo&&11>=Yo),iO=" ",aO=!1;function lO(a,o){switch(a){case"keyup":return CC.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sO(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var us=!1;function TC(a,o){switch(a){case"compositionend":return sO(o);case"keypress":return o.which!==32?null:(aO=!0,iO);case"textInput":return a=o.data,a===iO&&aO?null:a;default:return null}}function $C(a,o){if(us)return a==="compositionend"||!uh&&lO(a,o)?(a=K6(),c0=ah=Ta=null,us=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return rO&&o.locale!=="ko"?null:o.data;default:return null}}var jC={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function oO(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!jC[a.type]:o==="textarea"}function cO(a,o,f,p){os?cs?cs.push(p):cs=[p]:os=p,o=n1(o,"onChange"),0<o.length&&(f=new d0("onChange","change",null,f,p),a.push({event:f,listeners:o}))}var Io=null,qo=null;function PC(a){Bx(a,0)}function m0(a){var o=Kn(a);if(F6(o))return a}function uO(a,o){if(a==="change")return o}var fO=!1;if(Li){var fh;if(Li){var dh="oninput"in document;if(!dh){var dO=document.createElement("div");dO.setAttribute("oninput","return;"),dh=typeof dO.oninput=="function"}fh=dh}else fh=!1;fO=fh&&(!document.documentMode||9<document.documentMode)}function hO(){Io&&(Io.detachEvent("onpropertychange",mO),qo=Io=null)}function mO(a){if(a.propertyName==="value"&&m0(qo)){var o=[];cO(o,qo,a,nh(a)),W6(PC,o)}}function QC(a,o,f){a==="focusin"?(hO(),Io=o,qo=f,Io.attachEvent("onpropertychange",mO)):a==="focusout"&&hO()}function ZC(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return m0(qo)}function NC(a,o){if(a==="click")return m0(o)}function RC(a,o){if(a==="input"||a==="change")return m0(o)}function VC(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var pr=typeof Object.is=="function"?Object.is:VC;function Go(a,o){if(pr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var f=Object.keys(a),p=Object.keys(o);if(f.length!==p.length)return!1;for(p=0;p<f.length;p++){var b=f[p];if(!ft.call(o,b)||!pr(a[b],o[b]))return!1}return!0}function pO(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function gO(a,o){var f=pO(a);a=0;for(var p;f;){if(f.nodeType===3){if(p=a+f.textContent.length,a<=o&&p>=o)return{node:f,offset:o-a};a=p}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=pO(f)}}function OO(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?OO(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function xO(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=s0(a.document);o instanceof a.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)a=o.contentWindow;else break;o=s0(a.document)}return o}function hh(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var LC=Li&&"documentMode"in document&&11>=document.documentMode,fs=null,mh=null,Uo=null,ph=!1;function yO(a,o,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;ph||fs==null||fs!==s0(p)||(p=fs,"selectionStart"in p&&hh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Uo&&Go(Uo,p)||(Uo=p,p=n1(mh,"onSelect"),0<p.length&&(o=new d0("onSelect","select",null,o,f),a.push({event:o,listeners:p}),o.target=fs)))}function wl(a,o){var f={};return f[a.toLowerCase()]=o.toLowerCase(),f["Webkit"+a]="webkit"+o,f["Moz"+a]="moz"+o,f}var ds={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionrun:wl("Transition","TransitionRun"),transitionstart:wl("Transition","TransitionStart"),transitioncancel:wl("Transition","TransitionCancel"),transitionend:wl("Transition","TransitionEnd")},gh={},bO={};Li&&(bO=document.createElement("div").style,"AnimationEvent"in window||(delete ds.animationend.animation,delete ds.animationiteration.animation,delete ds.animationstart.animation),"TransitionEvent"in window||delete ds.transitionend.transition);function kl(a){if(gh[a])return gh[a];if(!ds[a])return a;var o=ds[a],f;for(f in o)if(o.hasOwnProperty(f)&&f in bO)return gh[a]=o[f];return a}var vO=kl("animationend"),SO=kl("animationiteration"),wO=kl("animationstart"),_C=kl("transitionrun"),DC=kl("transitionstart"),HC=kl("transitioncancel"),kO=kl("transitionend"),AO=new Map,Oh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Oh.push("scrollEnd");function Jr(a,o){AO.set(a,o),Ri(o,[a])}var p0=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Zr=[],hs=0,xh=0;function g0(){for(var a=hs,o=xh=hs=0;o<a;){var f=Zr[o];Zr[o++]=null;var p=Zr[o];Zr[o++]=null;var b=Zr[o];Zr[o++]=null;var S=Zr[o];if(Zr[o++]=null,p!==null&&b!==null){var Q=p.pending;Q===null?b.next=b:(b.next=Q.next,Q.next=b),p.pending=b}S!==0&&MO(f,b,S)}}function O0(a,o,f,p){Zr[hs++]=a,Zr[hs++]=o,Zr[hs++]=f,Zr[hs++]=p,xh|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function yh(a,o,f,p){return O0(a,o,f,p),x0(a)}function Al(a,o){return O0(a,null,null,o),x0(a)}function MO(a,o,f){a.lanes|=f;var p=a.alternate;p!==null&&(p.lanes|=f);for(var b=!1,S=a.return;S!==null;)S.childLanes|=f,p=S.alternate,p!==null&&(p.childLanes|=f),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(b=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,b&&o!==null&&(b=31-ze(f),a=S.hiddenUpdates,p=a[b],p===null?a[b]=[o]:p.push(o),o.lane=f|536870912),S):null}function x0(a){if(50<xc)throw xc=0,Em=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var ms={};function XC(a,o,f,p){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gr(a,o,f,p){return new XC(a,o,f,p)}function bh(a){return a=a.prototype,!(!a||!a.isReactComponent)}function _i(a,o){var f=a.alternate;return f===null?(f=gr(a.tag,o,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=o,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,o=a.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function CO(a,o){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,o=f.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function y0(a,o,f,p,b,S){var Q=0;if(p=a,typeof a=="function")bh(a)&&(Q=1);else if(typeof a=="string")Q=IE(a,f,B.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case R:return a=gr(31,f,o,b),a.elementType=R,a.lanes=S,a;case w:return Ml(f.children,b,S,o);case A:Q=8,b|=24;break;case k:return a=gr(12,f,o,b|2),a.elementType=k,a.lanes=S,a;case C:return a=gr(13,f,o,b),a.elementType=C,a.lanes=S,a;case j:return a=gr(19,f,o,b),a.elementType=j,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case E:Q=10;break e;case M:Q=9;break e;case $:Q=11;break e;case T:Q=14;break e;case N:Q=16,p=null;break e}Q=29,f=Error(r(130,a===null?"null":typeof a,"")),p=null}return o=gr(Q,f,o,b),o.elementType=a,o.type=p,o.lanes=S,o}function Ml(a,o,f,p){return a=gr(7,a,p,o),a.lanes=f,a}function vh(a,o,f){return a=gr(6,a,null,o),a.lanes=f,a}function EO(a){var o=gr(18,null,null,0);return o.stateNode=a,o}function Sh(a,o,f){return o=gr(4,a.children!==null?a.children:[],a.key,o),o.lanes=f,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var TO=new WeakMap;function Nr(a,o){if(typeof a=="object"&&a!==null){var f=TO.get(a);return f!==void 0?f:(o={value:a,source:o,stack:Pe(o)},TO.set(a,o),o)}return{value:a,source:o,stack:Pe(o)}}var ps=[],gs=0,b0=null,Wo=0,Rr=[],Vr=0,$a=null,hi=1,mi="";function Di(a,o){ps[gs++]=Wo,ps[gs++]=b0,b0=a,Wo=o}function $O(a,o,f){Rr[Vr++]=hi,Rr[Vr++]=mi,Rr[Vr++]=$a,$a=a;var p=hi;a=mi;var b=32-ze(p)-1;p&=~(1<<b),f+=1;var S=32-ze(o)+b;if(30<S){var Q=b-b%5;S=(p&(1<<Q)-1).toString(32),p>>=Q,b-=Q,hi=1<<32-ze(o)+b|f<<b|p,mi=S+a}else hi=1<<S|f<<b|p,mi=a}function wh(a){a.return!==null&&(Di(a,1),$O(a,1,0))}function kh(a){for(;a===b0;)b0=ps[--gs],ps[gs]=null,Wo=ps[--gs],ps[gs]=null;for(;a===$a;)$a=Rr[--Vr],Rr[Vr]=null,mi=Rr[--Vr],Rr[Vr]=null,hi=Rr[--Vr],Rr[Vr]=null}function jO(a,o){Rr[Vr++]=hi,Rr[Vr++]=mi,Rr[Vr++]=$a,hi=o.id,mi=o.overflow,$a=a}var $n=null,Dt=null,st=!1,ja=null,Lr=!1,Ah=Error(r(519));function Pa(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ko(Nr(o,a)),Ah}function PO(a){var o=a.stateNode,f=a.type,p=a.memoizedProps;switch(o[tn]=a,o[vn]=p,f){case"dialog":tt("cancel",o),tt("close",o);break;case"iframe":case"object":case"embed":tt("load",o);break;case"video":case"audio":for(f=0;f<bc.length;f++)tt(bc[f],o);break;case"source":tt("error",o);break;case"img":case"image":case"link":tt("error",o),tt("load",o);break;case"details":tt("toggle",o);break;case"input":tt("invalid",o),B6(o,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":tt("invalid",o);break;case"textarea":tt("invalid",o),I6(o,p.value,p.defaultValue,p.children)}f=p.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||o.textContent===""+f||p.suppressHydrationWarning===!0||Gx(o.textContent,f)?(p.popover!=null&&(tt("beforetoggle",o),tt("toggle",o)),p.onScroll!=null&&tt("scroll",o),p.onScrollEnd!=null&&tt("scrollend",o),p.onClick!=null&&(o.onclick=Vi),o=!0):o=!1,o||Pa(a,!0)}function QO(a){for($n=a.return;$n;)switch($n.tag){case 5:case 31:case 13:Lr=!1;return;case 27:case 3:Lr=!0;return;default:$n=$n.return}}function Os(a){if(a!==$n)return!1;if(!st)return QO(a),st=!0,!1;var o=a.tag,f;if((f=o!==3&&o!==27)&&((f=o===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||zm(a.type,a.memoizedProps)),f=!f),f&&Dt&&Pa(a),QO(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Dt=i5(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Dt=i5(a)}else o===27?(o=Dt,Ya(a.type)?(a=qm,qm=null,Dt=a):Dt=o):Dt=$n?Dr(a.stateNode.nextSibling):null;return!0}function Cl(){Dt=$n=null,st=!1}function Mh(){var a=ja;return a!==null&&(ir===null?ir=a:ir.push.apply(ir,a),ja=null),a}function Ko(a){ja===null?ja=[a]:ja.push(a)}var Ch=P(null),El=null,Hi=null;function Qa(a,o,f){L(Ch,o._currentValue),o._currentValue=f}function Xi(a){a._currentValue=Ch.current,Z(Ch)}function Eh(a,o,f){for(;a!==null;){var p=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),a===f)break;a=a.return}}function Th(a,o,f,p){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var S=b.dependencies;if(S!==null){var Q=b.child;S=S.firstContext;e:for(;S!==null;){var _=S;S=b;for(var W=0;W<o.length;W++)if(_.context===o[W]){S.lanes|=f,_=S.alternate,_!==null&&(_.lanes|=f),Eh(S.return,f,a),p||(Q=null);break e}S=_.next}}else if(b.tag===18){if(Q=b.return,Q===null)throw Error(r(341));Q.lanes|=f,S=Q.alternate,S!==null&&(S.lanes|=f),Eh(Q,f,a),Q=null}else Q=b.child;if(Q!==null)Q.return=b;else for(Q=b;Q!==null;){if(Q===a){Q=null;break}if(b=Q.sibling,b!==null){b.return=Q.return,Q=b;break}Q=Q.return}b=Q}}function xs(a,o,f,p){a=null;for(var b=o,S=!1;b!==null;){if(!S){if((b.flags&524288)!==0)S=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var Q=b.alternate;if(Q===null)throw Error(r(387));if(Q=Q.memoizedProps,Q!==null){var _=b.type;pr(b.pendingProps.value,Q.value)||(a!==null?a.push(_):a=[_])}}else if(b===Y.current){if(Q=b.alternate,Q===null)throw Error(r(387));Q.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Ac):a=[Ac])}b=b.return}a!==null&&Th(o,a,f,p),o.flags|=262144}function v0(a){for(a=a.firstContext;a!==null;){if(!pr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Tl(a){El=a,Hi=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function jn(a){return ZO(El,a)}function S0(a,o){return El===null&&Tl(a),ZO(a,o)}function ZO(a,o){var f=o._currentValue;if(o={context:o,memoizedValue:f,next:null},Hi===null){if(a===null)throw Error(r(308));Hi=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Hi=Hi.next=o;return f}var zC=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(f,p){a.push(p)}};this.abort=function(){o.aborted=!0,a.forEach(function(f){return f()})}},FC=t.unstable_scheduleCallback,BC=t.unstable_NormalPriority,fn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $h(){return{controller:new zC,data:new Map,refCount:0}}function Jo(a){a.refCount--,a.refCount===0&&FC(BC,function(){a.controller.abort()})}var ec=null,jh=0,ys=0,bs=null;function YC(a,o){if(ec===null){var f=ec=[];jh=0,ys=Zm(),bs={status:"pending",value:void 0,then:function(p){f.push(p)}}}return jh++,o.then(NO,NO),o}function NO(){if(--jh===0&&ec!==null){bs!==null&&(bs.status="fulfilled");var a=ec;ec=null,ys=0,bs=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function IC(a,o){var f=[],p={status:"pending",value:null,reason:null,then:function(b){f.push(b)}};return a.then(function(){p.status="fulfilled",p.value=o;for(var b=0;b<f.length;b++)(0,f[b])(o)},function(b){for(p.status="rejected",p.reason=b,b=0;b<f.length;b++)(0,f[b])(void 0)}),p}var RO=H.S;H.S=function(a,o){yx=be(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&YC(a,o),RO!==null&&RO(a,o)};var $l=P(null);function Ph(){var a=$l.current;return a!==null?a:Zt.pooledCache}function w0(a,o){o===null?L($l,$l.current):L($l,o.pool)}function VO(){var a=Ph();return a===null?null:{parent:fn._currentValue,pool:a}}var vs=Error(r(460)),Qh=Error(r(474)),k0=Error(r(542)),A0={then:function(){}};function LO(a){return a=a.status,a==="fulfilled"||a==="rejected"}function _O(a,o,f){switch(f=a[f],f===void 0?a.push(o):f!==o&&(o.then(Vi,Vi),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,HO(a),a;default:if(typeof o.status=="string")o.then(Vi,Vi);else{if(a=Zt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(p){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=p}},function(p){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=p}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,HO(a),a}throw Pl=o,vs}}function jl(a){try{var o=a._init;return o(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Pl=f,vs):f}}var Pl=null;function DO(){if(Pl===null)throw Error(r(459));var a=Pl;return Pl=null,a}function HO(a){if(a===vs||a===k0)throw Error(r(483))}var Ss=null,tc=0;function M0(a){var o=tc;return tc+=1,Ss===null&&(Ss=[]),_O(Ss,a,o)}function nc(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function C0(a,o){throw o.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function XO(a){function o(ie,ne){if(a){var le=ie.deletions;le===null?(ie.deletions=[ne],ie.flags|=16):le.push(ne)}}function f(ie,ne){if(!a)return null;for(;ne!==null;)o(ie,ne),ne=ne.sibling;return null}function p(ie){for(var ne=new Map;ie!==null;)ie.key!==null?ne.set(ie.key,ie):ne.set(ie.index,ie),ie=ie.sibling;return ne}function b(ie,ne){return ie=_i(ie,ne),ie.index=0,ie.sibling=null,ie}function S(ie,ne,le){return ie.index=le,a?(le=ie.alternate,le!==null?(le=le.index,le<ne?(ie.flags|=67108866,ne):le):(ie.flags|=67108866,ne)):(ie.flags|=1048576,ne)}function Q(ie){return a&&ie.alternate===null&&(ie.flags|=67108866),ie}function _(ie,ne,le,he){return ne===null||ne.tag!==6?(ne=vh(le,ie.mode,he),ne.return=ie,ne):(ne=b(ne,le),ne.return=ie,ne)}function W(ie,ne,le,he){var De=le.type;return De===w?de(ie,ne,le.props.children,he,le.key):ne!==null&&(ne.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===N&&jl(De)===ne.type)?(ne=b(ne,le.props),nc(ne,le),ne.return=ie,ne):(ne=y0(le.type,le.key,le.props,null,ie.mode,he),nc(ne,le),ne.return=ie,ne)}function se(ie,ne,le,he){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==le.containerInfo||ne.stateNode.implementation!==le.implementation?(ne=Sh(le,ie.mode,he),ne.return=ie,ne):(ne=b(ne,le.children||[]),ne.return=ie,ne)}function de(ie,ne,le,he,De){return ne===null||ne.tag!==7?(ne=Ml(le,ie.mode,he,De),ne.return=ie,ne):(ne=b(ne,le),ne.return=ie,ne)}function pe(ie,ne,le){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=vh(""+ne,ie.mode,le),ne.return=ie,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case y:return le=y0(ne.type,ne.key,ne.props,null,ie.mode,le),nc(le,ne),le.return=ie,le;case v:return ne=Sh(ne,ie.mode,le),ne.return=ie,ne;case N:return ne=jl(ne),pe(ie,ne,le)}if(K(ne)||z(ne))return ne=Ml(ne,ie.mode,le,null),ne.return=ie,ne;if(typeof ne.then=="function")return pe(ie,M0(ne),le);if(ne.$$typeof===E)return pe(ie,S0(ie,ne),le);C0(ie,ne)}return null}function oe(ie,ne,le,he){var De=ne!==null?ne.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return De!==null?null:_(ie,ne,""+le,he);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case y:return le.key===De?W(ie,ne,le,he):null;case v:return le.key===De?se(ie,ne,le,he):null;case N:return le=jl(le),oe(ie,ne,le,he)}if(K(le)||z(le))return De!==null?null:de(ie,ne,le,he,null);if(typeof le.then=="function")return oe(ie,ne,M0(le),he);if(le.$$typeof===E)return oe(ie,ne,S0(ie,le),he);C0(ie,le)}return null}function ce(ie,ne,le,he,De){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return ie=ie.get(le)||null,_(ne,ie,""+he,De);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case y:return ie=ie.get(he.key===null?le:he.key)||null,W(ne,ie,he,De);case v:return ie=ie.get(he.key===null?le:he.key)||null,se(ne,ie,he,De);case N:return he=jl(he),ce(ie,ne,le,he,De)}if(K(he)||z(he))return ie=ie.get(le)||null,de(ne,ie,he,De,null);if(typeof he.then=="function")return ce(ie,ne,le,M0(he),De);if(he.$$typeof===E)return ce(ie,ne,le,S0(ne,he),De);C0(ne,he)}return null}function Te(ie,ne,le,he){for(var De=null,St=null,Qe=ne,We=ne=0,at=null;Qe!==null&&We<le.length;We++){Qe.index>We?(at=Qe,Qe=null):at=Qe.sibling;var wt=oe(ie,Qe,le[We],he);if(wt===null){Qe===null&&(Qe=at);break}a&&Qe&&wt.alternate===null&&o(ie,Qe),ne=S(wt,ne,We),St===null?De=wt:St.sibling=wt,St=wt,Qe=at}if(We===le.length)return f(ie,Qe),st&&Di(ie,We),De;if(Qe===null){for(;We<le.length;We++)Qe=pe(ie,le[We],he),Qe!==null&&(ne=S(Qe,ne,We),St===null?De=Qe:St.sibling=Qe,St=Qe);return st&&Di(ie,We),De}for(Qe=p(Qe);We<le.length;We++)at=ce(Qe,ie,We,le[We],he),at!==null&&(a&&at.alternate!==null&&Qe.delete(at.key===null?We:at.key),ne=S(at,ne,We),St===null?De=at:St.sibling=at,St=at);return a&&Qe.forEach(function(Wa){return o(ie,Wa)}),st&&Di(ie,We),De}function He(ie,ne,le,he){if(le==null)throw Error(r(151));for(var De=null,St=null,Qe=ne,We=ne=0,at=null,wt=le.next();Qe!==null&&!wt.done;We++,wt=le.next()){Qe.index>We?(at=Qe,Qe=null):at=Qe.sibling;var Wa=oe(ie,Qe,wt.value,he);if(Wa===null){Qe===null&&(Qe=at);break}a&&Qe&&Wa.alternate===null&&o(ie,Qe),ne=S(Wa,ne,We),St===null?De=Wa:St.sibling=Wa,St=Wa,Qe=at}if(wt.done)return f(ie,Qe),st&&Di(ie,We),De;if(Qe===null){for(;!wt.done;We++,wt=le.next())wt=pe(ie,wt.value,he),wt!==null&&(ne=S(wt,ne,We),St===null?De=wt:St.sibling=wt,St=wt);return st&&Di(ie,We),De}for(Qe=p(Qe);!wt.done;We++,wt=le.next())wt=ce(Qe,ie,We,wt.value,he),wt!==null&&(a&&wt.alternate!==null&&Qe.delete(wt.key===null?We:wt.key),ne=S(wt,ne,We),St===null?De=wt:St.sibling=wt,St=wt);return a&&Qe.forEach(function(iT){return o(ie,iT)}),st&&Di(ie,We),De}function Qt(ie,ne,le,he){if(typeof le=="object"&&le!==null&&le.type===w&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case y:e:{for(var De=le.key;ne!==null;){if(ne.key===De){if(De=le.type,De===w){if(ne.tag===7){f(ie,ne.sibling),he=b(ne,le.props.children),he.return=ie,ie=he;break e}}else if(ne.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===N&&jl(De)===ne.type){f(ie,ne.sibling),he=b(ne,le.props),nc(he,le),he.return=ie,ie=he;break e}f(ie,ne);break}else o(ie,ne);ne=ne.sibling}le.type===w?(he=Ml(le.props.children,ie.mode,he,le.key),he.return=ie,ie=he):(he=y0(le.type,le.key,le.props,null,ie.mode,he),nc(he,le),he.return=ie,ie=he)}return Q(ie);case v:e:{for(De=le.key;ne!==null;){if(ne.key===De)if(ne.tag===4&&ne.stateNode.containerInfo===le.containerInfo&&ne.stateNode.implementation===le.implementation){f(ie,ne.sibling),he=b(ne,le.children||[]),he.return=ie,ie=he;break e}else{f(ie,ne);break}else o(ie,ne);ne=ne.sibling}he=Sh(le,ie.mode,he),he.return=ie,ie=he}return Q(ie);case N:return le=jl(le),Qt(ie,ne,le,he)}if(K(le))return Te(ie,ne,le,he);if(z(le)){if(De=z(le),typeof De!="function")throw Error(r(150));return le=De.call(le),He(ie,ne,le,he)}if(typeof le.then=="function")return Qt(ie,ne,M0(le),he);if(le.$$typeof===E)return Qt(ie,ne,S0(ie,le),he);C0(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ne!==null&&ne.tag===6?(f(ie,ne.sibling),he=b(ne,le),he.return=ie,ie=he):(f(ie,ne),he=vh(le,ie.mode,he),he.return=ie,ie=he),Q(ie)):f(ie,ne)}return function(ie,ne,le,he){try{tc=0;var De=Qt(ie,ne,le,he);return Ss=null,De}catch(Qe){if(Qe===vs||Qe===k0)throw Qe;var St=gr(29,Qe,null,ie.mode);return St.lanes=he,St.return=ie,St}finally{}}}var Ql=XO(!0),zO=XO(!1),Za=!1;function Zh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nh(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Na(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ra(a,o,f){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(kt&2)!==0){var b=p.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),p.pending=o,o=x0(a),MO(a,null,f),o}return O0(a,p,o,f),x0(a)}function rc(a,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194048)!==0)){var p=o.lanes;p&=a.pendingLanes,f|=p,o.lanes=f,ka(a,f)}}function Rh(a,o){var f=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var b=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var Q={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?b=S=Q:S=S.next=Q,f=f.next}while(f!==null);S===null?b=S=o:S=S.next=o}else b=S=o;f={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=o:a.next=o,f.lastBaseUpdate=o}var Vh=!1;function ic(){if(Vh){var a=bs;if(a!==null)throw a}}function ac(a,o,f,p){Vh=!1;var b=a.updateQueue;Za=!1;var S=b.firstBaseUpdate,Q=b.lastBaseUpdate,_=b.shared.pending;if(_!==null){b.shared.pending=null;var W=_,se=W.next;W.next=null,Q===null?S=se:Q.next=se,Q=W;var de=a.alternate;de!==null&&(de=de.updateQueue,_=de.lastBaseUpdate,_!==Q&&(_===null?de.firstBaseUpdate=se:_.next=se,de.lastBaseUpdate=W))}if(S!==null){var pe=b.baseState;Q=0,de=se=W=null,_=S;do{var oe=_.lane&-536870913,ce=oe!==_.lane;if(ce?(it&oe)===oe:(p&oe)===oe){oe!==0&&oe===ys&&(Vh=!0),de!==null&&(de=de.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Te=a,He=_;oe=o;var Qt=f;switch(He.tag){case 1:if(Te=He.payload,typeof Te=="function"){pe=Te.call(Qt,pe,oe);break e}pe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=He.payload,oe=typeof Te=="function"?Te.call(Qt,pe,oe):Te,oe==null)break e;pe=O({},pe,oe);break e;case 2:Za=!0}}oe=_.callback,oe!==null&&(a.flags|=64,ce&&(a.flags|=8192),ce=b.callbacks,ce===null?b.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:_.tag,payload:_.payload,callback:_.callback,next:null},de===null?(se=de=ce,W=pe):de=de.next=ce,Q|=oe;if(_=_.next,_===null){if(_=b.shared.pending,_===null)break;ce=_,_=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);de===null&&(W=pe),b.baseState=W,b.firstBaseUpdate=se,b.lastBaseUpdate=de,S===null&&(b.shared.lanes=0),Ha|=Q,a.lanes=Q,a.memoizedState=pe}}function FO(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function BO(a,o){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)FO(f[a],o)}var ws=P(null),E0=P(0);function YO(a,o){a=Wi,L(E0,a),L(ws,o),Wi=a|o.baseLanes}function Lh(){L(E0,Wi),L(ws,ws.current)}function _h(){Wi=E0.current,Z(ws),Z(E0)}var Or=P(null),_r=null;function Va(a){var o=a.alternate;L(nn,nn.current&1),L(Or,a),_r===null&&(o===null||ws.current!==null||o.memoizedState!==null)&&(_r=a)}function Dh(a){L(nn,nn.current),L(Or,a),_r===null&&(_r=a)}function IO(a){a.tag===22?(L(nn,nn.current),L(Or,a),_r===null&&(_r=a)):La()}function La(){L(nn,nn.current),L(Or,Or.current)}function xr(a){Z(Or),_r===a&&(_r=null),Z(nn)}var nn=P(0);function T0(a){for(var o=a;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||Ym(f)||Im(f)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var zi=0,Ge=null,jt=null,dn=null,$0=!1,ks=!1,Zl=!1,j0=0,lc=0,As=null,qC=0;function Gt(){throw Error(r(321))}function Hh(a,o){if(o===null)return!1;for(var f=0;f<o.length&&f<a.length;f++)if(!pr(a[f],o[f]))return!1;return!0}function Xh(a,o,f,p,b,S){return zi=S,Ge=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,H.H=a===null||a.memoizedState===null?$4:rm,Zl=!1,S=f(p,b),Zl=!1,ks&&(S=GO(o,f,p,b)),qO(a),S}function qO(a){H.H=cc;var o=jt!==null&&jt.next!==null;if(zi=0,dn=jt=Ge=null,$0=!1,lc=0,As=null,o)throw Error(r(300));a===null||hn||(a=a.dependencies,a!==null&&v0(a)&&(hn=!0))}function GO(a,o,f,p){Ge=a;var b=0;do{if(ks&&(As=null),lc=0,ks=!1,25<=b)throw Error(r(301));if(b+=1,dn=jt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}H.H=j4,S=o(f,p)}while(ks);return S}function GC(){var a=H.H,o=a.useState()[0];return o=typeof o.then=="function"?sc(o):o,a=a.useState()[0],(jt!==null?jt.memoizedState:null)!==a&&(Ge.flags|=1024),o}function zh(){var a=j0!==0;return j0=0,a}function Fh(a,o,f){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~f}function Bh(a){if($0){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}$0=!1}zi=0,dn=jt=Ge=null,ks=!1,lc=j0=0,As=null}function Yn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?Ge.memoizedState=dn=a:dn=dn.next=a,dn}function rn(){if(jt===null){var a=Ge.alternate;a=a!==null?a.memoizedState:null}else a=jt.next;var o=dn===null?Ge.memoizedState:dn.next;if(o!==null)dn=o,jt=a;else{if(a===null)throw Ge.alternate===null?Error(r(467)):Error(r(310));jt=a,a={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},dn===null?Ge.memoizedState=dn=a:dn=dn.next=a}return dn}function P0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sc(a){var o=lc;return lc+=1,As===null&&(As=[]),a=_O(As,a,o),o=Ge,(dn===null?o.memoizedState:dn.next)===null&&(o=o.alternate,H.H=o===null||o.memoizedState===null?$4:rm),a}function Q0(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return sc(a);if(a.$$typeof===E)return jn(a)}throw Error(r(438,String(a)))}function Yh(a){var o=null,f=Ge.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var p=Ge.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(o={data:p.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=P0(),Ge.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(a),p=0;p<a;p++)f[p]=D;return o.index++,f}function Fi(a,o){return typeof o=="function"?o(a):o}function Z0(a){var o=rn();return Ih(o,jt,a)}function Ih(a,o,f){var p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=f;var b=a.baseQueue,S=p.pending;if(S!==null){if(b!==null){var Q=b.next;b.next=S.next,S.next=Q}o.baseQueue=b=S,p.pending=null}if(S=a.baseState,b===null)a.memoizedState=S;else{o=b.next;var _=Q=null,W=null,se=o,de=!1;do{var pe=se.lane&-536870913;if(pe!==se.lane?(it&pe)===pe:(zi&pe)===pe){var oe=se.revertLane;if(oe===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),pe===ys&&(de=!0);else if((zi&oe)===oe){se=se.next,oe===ys&&(de=!0);continue}else pe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(_=W=pe,Q=S):W=W.next=pe,Ge.lanes|=oe,Ha|=oe;pe=se.action,Zl&&f(S,pe),S=se.hasEagerState?se.eagerState:f(S,pe)}else oe={lane:pe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(_=W=oe,Q=S):W=W.next=oe,Ge.lanes|=pe,Ha|=pe;se=se.next}while(se!==null&&se!==o);if(W===null?Q=S:W.next=_,!pr(S,a.memoizedState)&&(hn=!0,de&&(f=bs,f!==null)))throw f;a.memoizedState=S,a.baseState=Q,a.baseQueue=W,p.lastRenderedState=S}return b===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function qh(a){var o=rn(),f=o.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=a;var p=f.dispatch,b=f.pending,S=o.memoizedState;if(b!==null){f.pending=null;var Q=b=b.next;do S=a(S,Q.action),Q=Q.next;while(Q!==b);pr(S,o.memoizedState)||(hn=!0),o.memoizedState=S,o.baseQueue===null&&(o.baseState=S),f.lastRenderedState=S}return[S,p]}function UO(a,o,f){var p=Ge,b=rn(),S=st;if(S){if(f===void 0)throw Error(r(407));f=f()}else f=o();var Q=!pr((jt||b).memoizedState,f);if(Q&&(b.memoizedState=f,hn=!0),b=b.queue,Wh(JO.bind(null,p,b,a),[a]),b.getSnapshot!==o||Q||dn!==null&&dn.memoizedState.tag&1){if(p.flags|=2048,Ms(9,{destroy:void 0},KO.bind(null,p,b,f,o),null),Zt===null)throw Error(r(349));S||(zi&127)!==0||WO(p,o,f)}return f}function WO(a,o,f){a.flags|=16384,a={getSnapshot:o,value:f},o=Ge.updateQueue,o===null?(o=P0(),Ge.updateQueue=o,o.stores=[a]):(f=o.stores,f===null?o.stores=[a]:f.push(a))}function KO(a,o,f,p){o.value=f,o.getSnapshot=p,e4(o)&&t4(a)}function JO(a,o,f){return f(function(){e4(o)&&t4(a)})}function e4(a){var o=a.getSnapshot;a=a.value;try{var f=o();return!pr(a,f)}catch{return!0}}function t4(a){var o=Al(a,2);o!==null&&ar(o,a,2)}function Gh(a){var o=Yn();if(typeof a=="function"){var f=a;if(a=f(),Zl){ve(!0);try{f()}finally{ve(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:a},o}function n4(a,o,f,p){return a.baseState=f,Ih(a,jt,typeof p=="function"?p:Fi)}function UC(a,o,f,p,b){if(V0(a))throw Error(r(485));if(a=o.action,a!==null){var S={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Q){S.listeners.push(Q)}};H.T!==null?f(!0):S.isTransition=!1,p(S),f=o.pending,f===null?(S.next=o.pending=S,r4(o,S)):(S.next=f.next,o.pending=f.next=S)}}function r4(a,o){var f=o.action,p=o.payload,b=a.state;if(o.isTransition){var S=H.T,Q={};H.T=Q;try{var _=f(b,p),W=H.S;W!==null&&W(Q,_),i4(a,o,_)}catch(se){Uh(a,o,se)}finally{S!==null&&Q.types!==null&&(S.types=Q.types),H.T=S}}else try{S=f(b,p),i4(a,o,S)}catch(se){Uh(a,o,se)}}function i4(a,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){a4(a,o,p)},function(p){return Uh(a,o,p)}):a4(a,o,f)}function a4(a,o,f){o.status="fulfilled",o.value=f,l4(o),a.state=f,o=a.pending,o!==null&&(f=o.next,f===o?a.pending=null:(f=f.next,o.next=f,r4(a,f)))}function Uh(a,o,f){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do o.status="rejected",o.reason=f,l4(o),o=o.next;while(o!==p)}a.action=null}function l4(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function s4(a,o){return o}function o4(a,o){if(st){var f=Zt.formState;if(f!==null){e:{var p=Ge;if(st){if(Dt){t:{for(var b=Dt,S=Lr;b.nodeType!==8;){if(!S){b=null;break t}if(b=Dr(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){Dt=Dr(b.nextSibling),p=b.data==="F!";break e}}Pa(p)}p=!1}p&&(o=f[0])}}return f=Yn(),f.memoizedState=f.baseState=o,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s4,lastRenderedState:o},f.queue=p,f=C4.bind(null,Ge,p),p.dispatch=f,p=Gh(!1),S=nm.bind(null,Ge,!1,p.queue),p=Yn(),b={state:o,dispatch:null,action:a,pending:null},p.queue=b,f=UC.bind(null,Ge,b,S,f),b.dispatch=f,p.memoizedState=a,[o,f,!1]}function c4(a){var o=rn();return u4(o,jt,a)}function u4(a,o,f){if(o=Ih(a,o,s4)[0],a=Z0(Fi)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var p=sc(o)}catch(Q){throw Q===vs?k0:Q}else p=o;o=rn();var b=o.queue,S=b.dispatch;return f!==o.memoizedState&&(Ge.flags|=2048,Ms(9,{destroy:void 0},WC.bind(null,b,f),null)),[p,S,a]}function WC(a,o){a.action=o}function f4(a){var o=rn(),f=jt;if(f!==null)return u4(o,f,a);rn(),o=o.memoizedState,f=rn();var p=f.queue.dispatch;return f.memoizedState=a,[o,p,!1]}function Ms(a,o,f,p){return a={tag:a,create:f,deps:p,inst:o,next:null},o=Ge.updateQueue,o===null&&(o=P0(),Ge.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=a.next=a:(p=f.next,f.next=a,a.next=p,o.lastEffect=a),a}function d4(){return rn().memoizedState}function N0(a,o,f,p){var b=Yn();Ge.flags|=a,b.memoizedState=Ms(1|o,{destroy:void 0},f,p===void 0?null:p)}function R0(a,o,f,p){var b=rn();p=p===void 0?null:p;var S=b.memoizedState.inst;jt!==null&&p!==null&&Hh(p,jt.memoizedState.deps)?b.memoizedState=Ms(o,S,f,p):(Ge.flags|=a,b.memoizedState=Ms(1|o,S,f,p))}function h4(a,o){N0(8390656,8,a,o)}function Wh(a,o){R0(2048,8,a,o)}function KC(a){Ge.flags|=4;var o=Ge.updateQueue;if(o===null)o=P0(),Ge.updateQueue=o,o.events=[a];else{var f=o.events;f===null?o.events=[a]:f.push(a)}}function m4(a){var o=rn().memoizedState;return KC({ref:o,nextImpl:a}),function(){if((kt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function p4(a,o){return R0(4,2,a,o)}function g4(a,o){return R0(4,4,a,o)}function O4(a,o){if(typeof o=="function"){a=a();var f=o(a);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function x4(a,o,f){f=f!=null?f.concat([a]):null,R0(4,4,O4.bind(null,o,a),f)}function Kh(){}function y4(a,o){var f=rn();o=o===void 0?null:o;var p=f.memoizedState;return o!==null&&Hh(o,p[1])?p[0]:(f.memoizedState=[a,o],a)}function b4(a,o){var f=rn();o=o===void 0?null:o;var p=f.memoizedState;if(o!==null&&Hh(o,p[1]))return p[0];if(p=a(),Zl){ve(!0);try{a()}finally{ve(!1)}}return f.memoizedState=[p,o],p}function Jh(a,o,f){return f===void 0||(zi&1073741824)!==0&&(it&261930)===0?a.memoizedState=o:(a.memoizedState=f,a=vx(),Ge.lanes|=a,Ha|=a,f)}function v4(a,o,f,p){return pr(f,o)?f:ws.current!==null?(a=Jh(a,f,p),pr(a,o)||(hn=!0),a):(zi&42)===0||(zi&1073741824)!==0&&(it&261930)===0?(hn=!0,a.memoizedState=f):(a=vx(),Ge.lanes|=a,Ha|=a,o)}function S4(a,o,f,p,b){var S=q.p;q.p=S!==0&&8>S?S:8;var Q=H.T,_={};H.T=_,nm(a,!1,o,f);try{var W=b(),se=H.S;if(se!==null&&se(_,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var de=IC(W,p);oc(a,o,de,vr(a))}else oc(a,o,p,vr(a))}catch(pe){oc(a,o,{then:function(){},status:"rejected",reason:pe},vr())}finally{q.p=S,Q!==null&&_.types!==null&&(Q.types=_.types),H.T=Q}}function JC(){}function em(a,o,f,p){if(a.tag!==5)throw Error(r(476));var b=w4(a).queue;S4(a,b,o,X,f===null?JC:function(){return k4(a),f(p)})}function w4(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:X},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:f},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function k4(a){var o=w4(a);o.next===null&&(o=a.alternate.memoizedState),oc(a,o.next.queue,{},vr())}function tm(){return jn(Ac)}function A4(){return rn().memoizedState}function M4(){return rn().memoizedState}function eE(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var f=vr();a=Na(f);var p=Ra(o,a,f);p!==null&&(ar(p,o,f),rc(p,o,f)),o={cache:$h()},a.payload=o;return}o=o.return}}function tE(a,o,f){var p=vr();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},V0(a)?E4(o,f):(f=yh(a,o,f,p),f!==null&&(ar(f,a,p),T4(f,o,p)))}function C4(a,o,f){var p=vr();oc(a,o,f,p)}function oc(a,o,f,p){var b={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(V0(a))E4(o,b);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var Q=o.lastRenderedState,_=S(Q,f);if(b.hasEagerState=!0,b.eagerState=_,pr(_,Q))return O0(a,o,b,0),Zt===null&&g0(),!1}catch{}finally{}if(f=yh(a,o,b,p),f!==null)return ar(f,a,p),T4(f,o,p),!0}return!1}function nm(a,o,f,p){if(p={lane:2,revertLane:Zm(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},V0(a)){if(o)throw Error(r(479))}else o=yh(a,f,p,2),o!==null&&ar(o,a,2)}function V0(a){var o=a.alternate;return a===Ge||o!==null&&o===Ge}function E4(a,o){ks=$0=!0;var f=a.pending;f===null?o.next=o:(o.next=f.next,f.next=o),a.pending=o}function T4(a,o,f){if((f&4194048)!==0){var p=o.lanes;p&=a.pendingLanes,f|=p,o.lanes=f,ka(a,f)}}var cc={readContext:jn,use:Q0,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};cc.useEffectEvent=Gt;var $4={readContext:jn,use:Q0,useCallback:function(a,o){return Yn().memoizedState=[a,o===void 0?null:o],a},useContext:jn,useEffect:h4,useImperativeHandle:function(a,o,f){f=f!=null?f.concat([a]):null,N0(4194308,4,O4.bind(null,o,a),f)},useLayoutEffect:function(a,o){return N0(4194308,4,a,o)},useInsertionEffect:function(a,o){N0(4,2,a,o)},useMemo:function(a,o){var f=Yn();o=o===void 0?null:o;var p=a();if(Zl){ve(!0);try{a()}finally{ve(!1)}}return f.memoizedState=[p,o],p},useReducer:function(a,o,f){var p=Yn();if(f!==void 0){var b=f(o);if(Zl){ve(!0);try{f(o)}finally{ve(!1)}}}else b=o;return p.memoizedState=p.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},p.queue=a,a=a.dispatch=tE.bind(null,Ge,a),[p.memoizedState,a]},useRef:function(a){var o=Yn();return a={current:a},o.memoizedState=a},useState:function(a){a=Gh(a);var o=a.queue,f=C4.bind(null,Ge,o);return o.dispatch=f,[a.memoizedState,f]},useDebugValue:Kh,useDeferredValue:function(a,o){var f=Yn();return Jh(f,a,o)},useTransition:function(){var a=Gh(!1);return a=S4.bind(null,Ge,a.queue,!0,!1),Yn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,f){var p=Ge,b=Yn();if(st){if(f===void 0)throw Error(r(407));f=f()}else{if(f=o(),Zt===null)throw Error(r(349));(it&127)!==0||WO(p,o,f)}b.memoizedState=f;var S={value:f,getSnapshot:o};return b.queue=S,h4(JO.bind(null,p,S,a),[a]),p.flags|=2048,Ms(9,{destroy:void 0},KO.bind(null,p,S,f,o),null),f},useId:function(){var a=Yn(),o=Zt.identifierPrefix;if(st){var f=mi,p=hi;f=(p&~(1<<32-ze(p)-1)).toString(32)+f,o="_"+o+"R_"+f,f=j0++,0<f&&(o+="H"+f.toString(32)),o+="_"}else f=qC++,o="_"+o+"r_"+f.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:tm,useFormState:o4,useActionState:o4,useOptimistic:function(a){var o=Yn();o.memoizedState=o.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=nm.bind(null,Ge,!0,f),f.dispatch=o,[a,o]},useMemoCache:Yh,useCacheRefresh:function(){return Yn().memoizedState=eE.bind(null,Ge)},useEffectEvent:function(a){var o=Yn(),f={impl:a};return o.memoizedState=f,function(){if((kt&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},rm={readContext:jn,use:Q0,useCallback:y4,useContext:jn,useEffect:Wh,useImperativeHandle:x4,useInsertionEffect:p4,useLayoutEffect:g4,useMemo:b4,useReducer:Z0,useRef:d4,useState:function(){return Z0(Fi)},useDebugValue:Kh,useDeferredValue:function(a,o){var f=rn();return v4(f,jt.memoizedState,a,o)},useTransition:function(){var a=Z0(Fi)[0],o=rn().memoizedState;return[typeof a=="boolean"?a:sc(a),o]},useSyncExternalStore:UO,useId:A4,useHostTransitionStatus:tm,useFormState:c4,useActionState:c4,useOptimistic:function(a,o){var f=rn();return n4(f,jt,a,o)},useMemoCache:Yh,useCacheRefresh:M4};rm.useEffectEvent=m4;var j4={readContext:jn,use:Q0,useCallback:y4,useContext:jn,useEffect:Wh,useImperativeHandle:x4,useInsertionEffect:p4,useLayoutEffect:g4,useMemo:b4,useReducer:qh,useRef:d4,useState:function(){return qh(Fi)},useDebugValue:Kh,useDeferredValue:function(a,o){var f=rn();return jt===null?Jh(f,a,o):v4(f,jt.memoizedState,a,o)},useTransition:function(){var a=qh(Fi)[0],o=rn().memoizedState;return[typeof a=="boolean"?a:sc(a),o]},useSyncExternalStore:UO,useId:A4,useHostTransitionStatus:tm,useFormState:f4,useActionState:f4,useOptimistic:function(a,o){var f=rn();return jt!==null?n4(f,jt,a,o):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:Yh,useCacheRefresh:M4};j4.useEffectEvent=m4;function im(a,o,f,p){o=a.memoizedState,f=f(p,o),f=f==null?o:O({},o,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var am={enqueueSetState:function(a,o,f){a=a._reactInternals;var p=vr(),b=Na(p);b.payload=o,f!=null&&(b.callback=f),o=Ra(a,b,p),o!==null&&(ar(o,a,p),rc(o,a,p))},enqueueReplaceState:function(a,o,f){a=a._reactInternals;var p=vr(),b=Na(p);b.tag=1,b.payload=o,f!=null&&(b.callback=f),o=Ra(a,b,p),o!==null&&(ar(o,a,p),rc(o,a,p))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var f=vr(),p=Na(f);p.tag=2,o!=null&&(p.callback=o),o=Ra(a,p,f),o!==null&&(ar(o,a,f),rc(o,a,f))}};function P4(a,o,f,p,b,S,Q){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,S,Q):o.prototype&&o.prototype.isPureReactComponent?!Go(f,p)||!Go(b,S):!0}function Q4(a,o,f,p){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,p),o.state!==a&&am.enqueueReplaceState(o,o.state,null)}function Nl(a,o){var f=o;if("ref"in o){f={};for(var p in o)p!=="ref"&&(f[p]=o[p])}if(a=a.defaultProps){f===o&&(f=O({},f));for(var b in a)f[b]===void 0&&(f[b]=a[b])}return f}function Z4(a){p0(a)}function N4(a){console.error(a)}function R4(a){p0(a)}function L0(a,o){try{var f=a.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(p){setTimeout(function(){throw p})}}function V4(a,o,f){try{var p=a.onCaughtError;p(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function lm(a,o,f){return f=Na(f),f.tag=3,f.payload={element:null},f.callback=function(){L0(a,o)},f}function L4(a){return a=Na(a),a.tag=3,a}function _4(a,o,f,p){var b=f.type.getDerivedStateFromError;if(typeof b=="function"){var S=p.value;a.payload=function(){return b(S)},a.callback=function(){V4(o,f,p)}}var Q=f.stateNode;Q!==null&&typeof Q.componentDidCatch=="function"&&(a.callback=function(){V4(o,f,p),typeof b!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var _=p.stack;this.componentDidCatch(p.value,{componentStack:_!==null?_:""})})}function nE(a,o,f,p,b){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(o=f.alternate,o!==null&&xs(o,f,b,!0),f=Or.current,f!==null){switch(f.tag){case 31:case 13:return _r===null?U0():f.alternate===null&&Ut===0&&(Ut=3),f.flags&=-257,f.flags|=65536,f.lanes=b,p===A0?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([p]):o.add(p),jm(a,p,b)),!1;case 22:return f.flags|=65536,p===A0?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([p])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([p]):f.add(p)),jm(a,p,b)),!1}throw Error(r(435,f.tag))}return jm(a,p,b),U0(),!1}if(st)return o=Or.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,p!==Ah&&(a=Error(r(422),{cause:p}),Ko(Nr(a,f)))):(p!==Ah&&(o=Error(r(423),{cause:p}),Ko(Nr(o,f))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,p=Nr(p,f),b=lm(a.stateNode,p,b),Rh(a,b),Ut!==4&&(Ut=2)),!1;var S=Error(r(520),{cause:p});if(S=Nr(S,f),Oc===null?Oc=[S]:Oc.push(S),Ut!==4&&(Ut=2),o===null)return!0;p=Nr(p,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,a=b&-b,f.lanes|=a,a=lm(f.stateNode,p,a),Rh(f,a),!1;case 1:if(o=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Xa===null||!Xa.has(S))))return f.flags|=65536,b&=-b,f.lanes|=b,b=L4(b),_4(b,a,f,p),Rh(f,b),!1}f=f.return}while(f!==null);return!1}var sm=Error(r(461)),hn=!1;function Pn(a,o,f,p){o.child=a===null?zO(o,null,f,p):Ql(o,a.child,f,p)}function D4(a,o,f,p,b){f=f.render;var S=o.ref;if("ref"in p){var Q={};for(var _ in p)_!=="ref"&&(Q[_]=p[_])}else Q=p;return Tl(o),p=Xh(a,o,f,Q,S,b),_=zh(),a!==null&&!hn?(Fh(a,o,b),Bi(a,o,b)):(st&&_&&wh(o),o.flags|=1,Pn(a,o,p,b),o.child)}function H4(a,o,f,p,b){if(a===null){var S=f.type;return typeof S=="function"&&!bh(S)&&S.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=S,X4(a,o,S,p,b)):(a=y0(f.type,null,p,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(S=a.child,!pm(a,b)){var Q=S.memoizedProps;if(f=f.compare,f=f!==null?f:Go,f(Q,p)&&a.ref===o.ref)return Bi(a,o,b)}return o.flags|=1,a=_i(S,p),a.ref=o.ref,a.return=o,o.child=a}function X4(a,o,f,p,b){if(a!==null){var S=a.memoizedProps;if(Go(S,p)&&a.ref===o.ref)if(hn=!1,o.pendingProps=p=S,pm(a,b))(a.flags&131072)!==0&&(hn=!0);else return o.lanes=a.lanes,Bi(a,o,b)}return om(a,o,f,p,b)}function z4(a,o,f,p){var b=p.children,S=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((o.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,a!==null){for(p=o.child=a.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~S}else p=0,o.child=null;return F4(a,o,S,f,p)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&w0(o,S!==null?S.cachePool:null),S!==null?YO(o,S):Lh(),IO(o);else return p=o.lanes=536870912,F4(a,o,S!==null?S.baseLanes|f:f,f,p)}else S!==null?(w0(o,S.cachePool),YO(o,S),La(),o.memoizedState=null):(a!==null&&w0(o,null),Lh(),La());return Pn(a,o,b,f),o.child}function uc(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function F4(a,o,f,p,b){var S=Ph();return S=S===null?null:{parent:fn._currentValue,pool:S},o.memoizedState={baseLanes:f,cachePool:S},a!==null&&w0(o,null),Lh(),IO(o),a!==null&&xs(a,o,p,!0),o.childLanes=b,null}function _0(a,o){return o=H0({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function B4(a,o,f){return Ql(o,a.child,null,f),a=_0(o,o.pendingProps),a.flags|=2,xr(o),o.memoizedState=null,a}function rE(a,o,f){var p=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(st){if(p.mode==="hidden")return a=_0(o,p),o.lanes=536870912,uc(null,a);if(Dh(o),(a=Dt)?(a=r5(a,Lr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:$a!==null?{id:hi,overflow:mi}:null,retryLane:536870912,hydrationErrors:null},f=EO(a),f.return=o,o.child=f,$n=o,Dt=null)):a=null,a===null)throw Pa(o);return o.lanes=536870912,null}return _0(o,p)}var S=a.memoizedState;if(S!==null){var Q=S.dehydrated;if(Dh(o),b)if(o.flags&256)o.flags&=-257,o=B4(a,o,f);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(hn||xs(a,o,f,!1),b=(f&a.childLanes)!==0,hn||b){if(p=Zt,p!==null&&(Q=Ce(p,f),Q!==0&&Q!==S.retryLane))throw S.retryLane=Q,Al(a,Q),ar(p,a,Q),sm;U0(),o=B4(a,o,f)}else a=S.treeContext,Dt=Dr(Q.nextSibling),$n=o,st=!0,ja=null,Lr=!1,a!==null&&jO(o,a),o=_0(o,p),o.flags|=4096;return o}return a=_i(a.child,{mode:p.mode,children:p.children}),a.ref=o.ref,o.child=a,a.return=o,a}function D0(a,o){var f=o.ref;if(f===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(a===null||a.ref!==f)&&(o.flags|=4194816)}}function om(a,o,f,p,b){return Tl(o),f=Xh(a,o,f,p,void 0,b),p=zh(),a!==null&&!hn?(Fh(a,o,b),Bi(a,o,b)):(st&&p&&wh(o),o.flags|=1,Pn(a,o,f,b),o.child)}function Y4(a,o,f,p,b,S){return Tl(o),o.updateQueue=null,f=GO(o,p,f,b),qO(a),p=zh(),a!==null&&!hn?(Fh(a,o,S),Bi(a,o,S)):(st&&p&&wh(o),o.flags|=1,Pn(a,o,f,S),o.child)}function I4(a,o,f,p,b){if(Tl(o),o.stateNode===null){var S=ms,Q=f.contextType;typeof Q=="object"&&Q!==null&&(S=jn(Q)),S=new f(p,S),o.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=am,o.stateNode=S,S._reactInternals=o,S=o.stateNode,S.props=p,S.state=o.memoizedState,S.refs={},Zh(o),Q=f.contextType,S.context=typeof Q=="object"&&Q!==null?jn(Q):ms,S.state=o.memoizedState,Q=f.getDerivedStateFromProps,typeof Q=="function"&&(im(o,f,Q,p),S.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(Q=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),Q!==S.state&&am.enqueueReplaceState(S,S.state,null),ac(o,p,S,b),ic(),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4194308),p=!0}else if(a===null){S=o.stateNode;var _=o.memoizedProps,W=Nl(f,_);S.props=W;var se=S.context,de=f.contextType;Q=ms,typeof de=="object"&&de!==null&&(Q=jn(de));var pe=f.getDerivedStateFromProps;de=typeof pe=="function"||typeof S.getSnapshotBeforeUpdate=="function",_=o.pendingProps!==_,de||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_||se!==Q)&&Q4(o,S,p,Q),Za=!1;var oe=o.memoizedState;S.state=oe,ac(o,p,S,b),ic(),se=o.memoizedState,_||oe!==se||Za?(typeof pe=="function"&&(im(o,f,pe,p),se=o.memoizedState),(W=Za||P4(o,f,W,p,oe,se,Q))?(de||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(o.flags|=4194308)):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=p,o.memoizedState=se),S.props=p,S.state=se,S.context=Q,p=W):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{S=o.stateNode,Nh(a,o),Q=o.memoizedProps,de=Nl(f,Q),S.props=de,pe=o.pendingProps,oe=S.context,se=f.contextType,W=ms,typeof se=="object"&&se!==null&&(W=jn(se)),_=f.getDerivedStateFromProps,(se=typeof _=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(Q!==pe||oe!==W)&&Q4(o,S,p,W),Za=!1,oe=o.memoizedState,S.state=oe,ac(o,p,S,b),ic();var ce=o.memoizedState;Q!==pe||oe!==ce||Za||a!==null&&a.dependencies!==null&&v0(a.dependencies)?(typeof _=="function"&&(im(o,f,_,p),ce=o.memoizedState),(de=Za||P4(o,f,de,p,oe,ce,W)||a!==null&&a.dependencies!==null&&v0(a.dependencies))?(se||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,ce,W),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,ce,W)),typeof S.componentDidUpdate=="function"&&(o.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof S.componentDidUpdate!="function"||Q===a.memoizedProps&&oe===a.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||Q===a.memoizedProps&&oe===a.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=ce),S.props=p,S.state=ce,S.context=W,p=de):(typeof S.componentDidUpdate!="function"||Q===a.memoizedProps&&oe===a.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||Q===a.memoizedProps&&oe===a.memoizedState||(o.flags|=1024),p=!1)}return S=p,D0(a,o),p=(o.flags&128)!==0,S||p?(S=o.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:S.render(),o.flags|=1,a!==null&&p?(o.child=Ql(o,a.child,null,b),o.child=Ql(o,null,f,b)):Pn(a,o,f,b),o.memoizedState=S.state,a=o.child):a=Bi(a,o,b),a}function q4(a,o,f,p){return Cl(),o.flags|=256,Pn(a,o,f,p),o.child}var cm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function um(a){return{baseLanes:a,cachePool:VO()}}function fm(a,o,f){return a=a!==null?a.childLanes&~f:0,o&&(a|=br),a}function G4(a,o,f){var p=o.pendingProps,b=!1,S=(o.flags&128)!==0,Q;if((Q=S)||(Q=a!==null&&a.memoizedState===null?!1:(nn.current&2)!==0),Q&&(b=!0,o.flags&=-129),Q=(o.flags&32)!==0,o.flags&=-33,a===null){if(st){if(b?Va(o):La(),(a=Dt)?(a=r5(a,Lr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:$a!==null?{id:hi,overflow:mi}:null,retryLane:536870912,hydrationErrors:null},f=EO(a),f.return=o,o.child=f,$n=o,Dt=null)):a=null,a===null)throw Pa(o);return Im(a)?o.lanes=32:o.lanes=536870912,null}var _=p.children;return p=p.fallback,b?(La(),b=o.mode,_=H0({mode:"hidden",children:_},b),p=Ml(p,b,f,null),_.return=o,p.return=o,_.sibling=p,o.child=_,p=o.child,p.memoizedState=um(f),p.childLanes=fm(a,Q,f),o.memoizedState=cm,uc(null,p)):(Va(o),dm(o,_))}var W=a.memoizedState;if(W!==null&&(_=W.dehydrated,_!==null)){if(S)o.flags&256?(Va(o),o.flags&=-257,o=hm(a,o,f)):o.memoizedState!==null?(La(),o.child=a.child,o.flags|=128,o=null):(La(),_=p.fallback,b=o.mode,p=H0({mode:"visible",children:p.children},b),_=Ml(_,b,f,null),_.flags|=2,p.return=o,_.return=o,p.sibling=_,o.child=p,Ql(o,a.child,null,f),p=o.child,p.memoizedState=um(f),p.childLanes=fm(a,Q,f),o.memoizedState=cm,o=uc(null,p));else if(Va(o),Im(_)){if(Q=_.nextSibling&&_.nextSibling.dataset,Q)var se=Q.dgst;Q=se,p=Error(r(419)),p.stack="",p.digest=Q,Ko({value:p,source:null,stack:null}),o=hm(a,o,f)}else if(hn||xs(a,o,f,!1),Q=(f&a.childLanes)!==0,hn||Q){if(Q=Zt,Q!==null&&(p=Ce(Q,f),p!==0&&p!==W.retryLane))throw W.retryLane=p,Al(a,p),ar(Q,a,p),sm;Ym(_)||U0(),o=hm(a,o,f)}else Ym(_)?(o.flags|=192,o.child=a.child,o=null):(a=W.treeContext,Dt=Dr(_.nextSibling),$n=o,st=!0,ja=null,Lr=!1,a!==null&&jO(o,a),o=dm(o,p.children),o.flags|=4096);return o}return b?(La(),_=p.fallback,b=o.mode,W=a.child,se=W.sibling,p=_i(W,{mode:"hidden",children:p.children}),p.subtreeFlags=W.subtreeFlags&65011712,se!==null?_=_i(se,_):(_=Ml(_,b,f,null),_.flags|=2),_.return=o,p.return=o,p.sibling=_,o.child=p,uc(null,p),p=o.child,_=a.child.memoizedState,_===null?_=um(f):(b=_.cachePool,b!==null?(W=fn._currentValue,b=b.parent!==W?{parent:W,pool:W}:b):b=VO(),_={baseLanes:_.baseLanes|f,cachePool:b}),p.memoizedState=_,p.childLanes=fm(a,Q,f),o.memoizedState=cm,uc(a.child,p)):(Va(o),f=a.child,a=f.sibling,f=_i(f,{mode:"visible",children:p.children}),f.return=o,f.sibling=null,a!==null&&(Q=o.deletions,Q===null?(o.deletions=[a],o.flags|=16):Q.push(a)),o.child=f,o.memoizedState=null,f)}function dm(a,o){return o=H0({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function H0(a,o){return a=gr(22,a,null,o),a.lanes=0,a}function hm(a,o,f){return Ql(o,a.child,null,f),a=dm(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function U4(a,o,f){a.lanes|=o;var p=a.alternate;p!==null&&(p.lanes|=o),Eh(a.return,o,f)}function mm(a,o,f,p,b,S){var Q=a.memoizedState;Q===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:b,treeForkCount:S}:(Q.isBackwards=o,Q.rendering=null,Q.renderingStartTime=0,Q.last=p,Q.tail=f,Q.tailMode=b,Q.treeForkCount=S)}function W4(a,o,f){var p=o.pendingProps,b=p.revealOrder,S=p.tail;p=p.children;var Q=nn.current,_=(Q&2)!==0;if(_?(Q=Q&1|2,o.flags|=128):Q&=1,L(nn,Q),Pn(a,o,p,f),p=st?Wo:0,!_&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&U4(a,f,o);else if(a.tag===19)U4(a,f,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(f=o.child,b=null;f!==null;)a=f.alternate,a!==null&&T0(a)===null&&(b=f),f=f.sibling;f=b,f===null?(b=o.child,o.child=null):(b=f.sibling,f.sibling=null),mm(o,!1,b,f,S,p);break;case"backwards":case"unstable_legacy-backwards":for(f=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&T0(a)===null){o.child=b;break}a=b.sibling,b.sibling=f,f=b,b=a}mm(o,!0,f,null,S,p);break;case"together":mm(o,!1,null,null,void 0,p);break;default:o.memoizedState=null}return o.child}function Bi(a,o,f){if(a!==null&&(o.dependencies=a.dependencies),Ha|=o.lanes,(f&o.childLanes)===0)if(a!==null){if(xs(a,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,f=_i(a,a.pendingProps),o.child=f,f.return=o;a.sibling!==null;)a=a.sibling,f=f.sibling=_i(a,a.pendingProps),f.return=o;f.sibling=null}return o.child}function pm(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&v0(a)))}function iE(a,o,f){switch(o.tag){case 3:re(o,o.stateNode.containerInfo),Qa(o,fn,a.memoizedState.cache),Cl();break;case 27:case 5:ue(o);break;case 4:re(o,o.stateNode.containerInfo);break;case 10:Qa(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Dh(o),null;break;case 13:var p=o.memoizedState;if(p!==null)return p.dehydrated!==null?(Va(o),o.flags|=128,null):(f&o.child.childLanes)!==0?G4(a,o,f):(Va(o),a=Bi(a,o,f),a!==null?a.sibling:null);Va(o);break;case 19:var b=(a.flags&128)!==0;if(p=(f&o.childLanes)!==0,p||(xs(a,o,f,!1),p=(f&o.childLanes)!==0),b){if(p)return W4(a,o,f);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),L(nn,nn.current),p)break;return null;case 22:return o.lanes=0,z4(a,o,f,o.pendingProps);case 24:Qa(o,fn,a.memoizedState.cache)}return Bi(a,o,f)}function K4(a,o,f){if(a!==null)if(a.memoizedProps!==o.pendingProps)hn=!0;else{if(!pm(a,f)&&(o.flags&128)===0)return hn=!1,iE(a,o,f);hn=(a.flags&131072)!==0}else hn=!1,st&&(o.flags&1048576)!==0&&$O(o,Wo,o.index);switch(o.lanes=0,o.tag){case 16:e:{var p=o.pendingProps;if(a=jl(o.elementType),o.type=a,typeof a=="function")bh(a)?(p=Nl(a,p),o.tag=1,o=I4(null,o,a,p,f)):(o.tag=0,o=om(null,o,a,p,f));else{if(a!=null){var b=a.$$typeof;if(b===$){o.tag=11,o=D4(null,o,a,p,f);break e}else if(b===T){o.tag=14,o=H4(null,o,a,p,f);break e}}throw o=U(a)||a,Error(r(306,o,""))}}return o;case 0:return om(a,o,o.type,o.pendingProps,f);case 1:return p=o.type,b=Nl(p,o.pendingProps),I4(a,o,p,b,f);case 3:e:{if(re(o,o.stateNode.containerInfo),a===null)throw Error(r(387));p=o.pendingProps;var S=o.memoizedState;b=S.element,Nh(a,o),ac(o,p,null,f);var Q=o.memoizedState;if(p=Q.cache,Qa(o,fn,p),p!==S.cache&&Th(o,[fn],f,!0),ic(),p=Q.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:Q.cache},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){o=q4(a,o,p,f);break e}else if(p!==b){b=Nr(Error(r(424)),o),Ko(b),o=q4(a,o,p,f);break e}else{switch(a=o.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Dt=Dr(a.firstChild),$n=o,st=!0,ja=null,Lr=!0,f=zO(o,null,p,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Cl(),p===b){o=Bi(a,o,f);break e}Pn(a,o,p,f)}o=o.child}return o;case 26:return D0(a,o),a===null?(f=c5(o.type,null,o.pendingProps,null))?o.memoizedState=f:st||(f=o.type,a=o.pendingProps,p=r1(te.current).createElement(f),p[tn]=o,p[vn]=a,Qn(p,f,a),un(p),o.stateNode=p):o.memoizedState=c5(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return ue(o),a===null&&st&&(p=o.stateNode=l5(o.type,o.pendingProps,te.current),$n=o,Lr=!0,b=Dt,Ya(o.type)?(qm=b,Dt=Dr(p.firstChild)):Dt=b),Pn(a,o,o.pendingProps.children,f),D0(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&st&&((b=p=Dt)&&(p=ZE(p,o.type,o.pendingProps,Lr),p!==null?(o.stateNode=p,$n=o,Dt=Dr(p.firstChild),Lr=!1,b=!0):b=!1),b||Pa(o)),ue(o),b=o.type,S=o.pendingProps,Q=a!==null?a.memoizedProps:null,p=S.children,zm(b,S)?p=null:Q!==null&&zm(b,Q)&&(o.flags|=32),o.memoizedState!==null&&(b=Xh(a,o,GC,null,null,f),Ac._currentValue=b),D0(a,o),Pn(a,o,p,f),o.child;case 6:return a===null&&st&&((a=f=Dt)&&(f=NE(f,o.pendingProps,Lr),f!==null?(o.stateNode=f,$n=o,Dt=null,a=!0):a=!1),a||Pa(o)),null;case 13:return G4(a,o,f);case 4:return re(o,o.stateNode.containerInfo),p=o.pendingProps,a===null?o.child=Ql(o,null,p,f):Pn(a,o,p,f),o.child;case 11:return D4(a,o,o.type,o.pendingProps,f);case 7:return Pn(a,o,o.pendingProps,f),o.child;case 8:return Pn(a,o,o.pendingProps.children,f),o.child;case 12:return Pn(a,o,o.pendingProps.children,f),o.child;case 10:return p=o.pendingProps,Qa(o,o.type,p.value),Pn(a,o,p.children,f),o.child;case 9:return b=o.type._context,p=o.pendingProps.children,Tl(o),b=jn(b),p=p(b),o.flags|=1,Pn(a,o,p,f),o.child;case 14:return H4(a,o,o.type,o.pendingProps,f);case 15:return X4(a,o,o.type,o.pendingProps,f);case 19:return W4(a,o,f);case 31:return rE(a,o,f);case 22:return z4(a,o,f,o.pendingProps);case 24:return Tl(o),p=jn(fn),a===null?(b=Ph(),b===null&&(b=Zt,S=$h(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=f),b=S),o.memoizedState={parent:p,cache:b},Zh(o),Qa(o,fn,b)):((a.lanes&f)!==0&&(Nh(a,o),ac(o,null,null,f),ic()),b=a.memoizedState,S=o.memoizedState,b.parent!==p?(b={parent:p,cache:p},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),Qa(o,fn,p)):(p=S.cache,Qa(o,fn,p),p!==b.cache&&Th(o,[fn],f,!0))),Pn(a,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Yi(a){a.flags|=4}function gm(a,o,f,p,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(Ax())a.flags|=8192;else throw Pl=A0,Qh}else a.flags&=-16777217}function J4(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!m5(o))if(Ax())a.flags|=8192;else throw Pl=A0,Qh}function X0(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?Sa():536870912,a.lanes|=o,$s|=o)}function fc(a,o){if(!st)switch(a.tailMode){case"hidden":o=a.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function Ht(a){var o=a.alternate!==null&&a.alternate.child===a.child,f=0,p=0;if(o)for(var b=a.child;b!==null;)f|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)f|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=p,a.childLanes=f,o}function aE(a,o,f){var p=o.pendingProps;switch(kh(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(o),null;case 1:return Ht(o),null;case 3:return f=o.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),Xi(fn),ae(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(Os(o)?Yi(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Mh())),Ht(o),null;case 26:var b=o.type,S=o.memoizedState;return a===null?(Yi(o),S!==null?(Ht(o),J4(o,S)):(Ht(o),gm(o,b,null,p,f))):S?S!==a.memoizedState?(Yi(o),Ht(o),J4(o,S)):(Ht(o),o.flags&=-16777217):(a=a.memoizedProps,a!==p&&Yi(o),Ht(o),gm(o,b,a,p,f)),null;case 27:if(me(o),f=te.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==p&&Yi(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return Ht(o),null}a=B.current,Os(o)?PO(o):(a=l5(b,p,f),o.stateNode=a,Yi(o))}return Ht(o),null;case 5:if(me(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==p&&Yi(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return Ht(o),null}if(S=B.current,Os(o))PO(o);else{var Q=r1(te.current);switch(S){case 1:S=Q.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:S=Q.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":S=Q.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":S=Q.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":S=Q.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?Q.createElement("select",{is:p.is}):Q.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?Q.createElement(b,{is:p.is}):Q.createElement(b)}}S[tn]=o,S[vn]=p;e:for(Q=o.child;Q!==null;){if(Q.tag===5||Q.tag===6)S.appendChild(Q.stateNode);else if(Q.tag!==4&&Q.tag!==27&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===o)break e;for(;Q.sibling===null;){if(Q.return===null||Q.return===o)break e;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}o.stateNode=S;e:switch(Qn(S,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Yi(o)}}return Ht(o),gm(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,f),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==p&&Yi(o);else{if(typeof p!="string"&&o.stateNode===null)throw Error(r(166));if(a=te.current,Os(o)){if(a=o.stateNode,f=o.memoizedProps,p=null,b=$n,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}a[tn]=o,a=!!(a.nodeValue===f||p!==null&&p.suppressHydrationWarning===!0||Gx(a.nodeValue,f)),a||Pa(o,!0)}else a=r1(a).createTextNode(p),a[tn]=o,o.stateNode=a}return Ht(o),null;case 31:if(f=o.memoizedState,a===null||a.memoizedState!==null){if(p=Os(o),f!==null){if(a===null){if(!p)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[tn]=o}else Cl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ht(o),a=!1}else f=Mh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return o.flags&256?(xr(o),o):(xr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Ht(o),null;case 13:if(p=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Os(o),p!==null&&p.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[tn]=o}else Cl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ht(o),b=!1}else b=Mh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(xr(o),o):(xr(o),null)}return xr(o),(o.flags&128)!==0?(o.lanes=f,o):(f=p!==null,a=a!==null&&a.memoizedState!==null,f&&(p=o.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==b&&(p.flags|=2048)),f!==a&&f&&(o.child.flags|=8192),X0(o,o.updateQueue),Ht(o),null);case 4:return ae(),a===null&&Lm(o.stateNode.containerInfo),Ht(o),null;case 10:return Xi(o.type),Ht(o),null;case 19:if(Z(nn),p=o.memoizedState,p===null)return Ht(o),null;if(b=(o.flags&128)!==0,S=p.rendering,S===null)if(b)fc(p,!1);else{if(Ut!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(S=T0(a),S!==null){for(o.flags|=128,fc(p,!1),a=S.updateQueue,o.updateQueue=a,X0(o,a),o.subtreeFlags=0,a=f,f=o.child;f!==null;)CO(f,a),f=f.sibling;return L(nn,nn.current&1|2),st&&Di(o,p.treeForkCount),o.child}a=a.sibling}p.tail!==null&&be()>I0&&(o.flags|=128,b=!0,fc(p,!1),o.lanes=4194304)}else{if(!b)if(a=T0(S),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,X0(o,a),fc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!st)return Ht(o),null}else 2*be()-p.renderingStartTime>I0&&f!==536870912&&(o.flags|=128,b=!0,fc(p,!1),o.lanes=4194304);p.isBackwards?(S.sibling=o.child,o.child=S):(a=p.last,a!==null?a.sibling=S:o.child=S,p.last=S)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=be(),a.sibling=null,f=nn.current,L(nn,b?f&1|2:f&1),st&&Di(o,p.treeForkCount),a):(Ht(o),null);case 22:case 23:return xr(o),_h(),p=o.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(o.flags|=8192):p&&(o.flags|=8192),p?(f&536870912)!==0&&(o.flags&128)===0&&(Ht(o),o.subtreeFlags&6&&(o.flags|=8192)):Ht(o),f=o.updateQueue,f!==null&&X0(o,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==f&&(o.flags|=2048),a!==null&&Z($l),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Xi(fn),Ht(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function lE(a,o){switch(kh(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Xi(fn),ae(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return me(o),null;case 31:if(o.memoizedState!==null){if(xr(o),o.alternate===null)throw Error(r(340));Cl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(xr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Cl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return Z(nn),null;case 4:return ae(),null;case 10:return Xi(o.type),null;case 22:case 23:return xr(o),_h(),a!==null&&Z($l),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return Xi(fn),null;case 25:return null;default:return null}}function ex(a,o){switch(kh(o),o.tag){case 3:Xi(fn),ae();break;case 26:case 27:case 5:me(o);break;case 4:ae();break;case 31:o.memoizedState!==null&&xr(o);break;case 13:xr(o);break;case 19:Z(nn);break;case 10:Xi(o.type);break;case 22:case 23:xr(o),_h(),a!==null&&Z($l);break;case 24:Xi(fn)}}function dc(a,o){try{var f=o.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var b=p.next;f=b;do{if((f.tag&a)===a){p=void 0;var S=f.create,Q=f.inst;p=S(),Q.destroy=p}f=f.next}while(f!==b)}}catch(_){Et(o,o.return,_)}}function _a(a,o,f){try{var p=o.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var S=b.next;p=S;do{if((p.tag&a)===a){var Q=p.inst,_=Q.destroy;if(_!==void 0){Q.destroy=void 0,b=o;var W=f,se=_;try{se()}catch(de){Et(b,W,de)}}}p=p.next}while(p!==S)}}catch(de){Et(o,o.return,de)}}function tx(a){var o=a.updateQueue;if(o!==null){var f=a.stateNode;try{BO(o,f)}catch(p){Et(a,a.return,p)}}}function nx(a,o,f){f.props=Nl(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(p){Et(a,o,p)}}function hc(a,o){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof f=="function"?a.refCleanup=f(p):f.current=p}}catch(b){Et(a,o,b)}}function pi(a,o){var f=a.ref,p=a.refCleanup;if(f!==null)if(typeof p=="function")try{p()}catch(b){Et(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(b){Et(a,o,b)}else f.current=null}function rx(a){var o=a.type,f=a.memoizedProps,p=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":f.autoFocus&&p.focus();break e;case"img":f.src?p.src=f.src:f.srcSet&&(p.srcset=f.srcSet)}}catch(b){Et(a,a.return,b)}}function Om(a,o,f){try{var p=a.stateNode;EE(p,a.type,f,o),p[vn]=o}catch(b){Et(a,a.return,b)}}function ix(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ya(a.type)||a.tag===4}function xm(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||ix(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ya(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function ym(a,o,f){var p=a.tag;if(p===5||p===6)a=a.stateNode,o?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,o):(o=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,o.appendChild(a),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=Vi));else if(p!==4&&(p===27&&Ya(a.type)&&(f=a.stateNode,o=null),a=a.child,a!==null))for(ym(a,o,f),a=a.sibling;a!==null;)ym(a,o,f),a=a.sibling}function z0(a,o,f){var p=a.tag;if(p===5||p===6)a=a.stateNode,o?f.insertBefore(a,o):f.appendChild(a);else if(p!==4&&(p===27&&Ya(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(z0(a,o,f),a=a.sibling;a!==null;)z0(a,o,f),a=a.sibling}function ax(a){var o=a.stateNode,f=a.memoizedProps;try{for(var p=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);Qn(o,p,f),o[tn]=a,o[vn]=f}catch(S){Et(a,a.return,S)}}var Ii=!1,mn=!1,bm=!1,lx=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function sE(a,o){if(a=a.containerInfo,Hm=u1,a=xO(a),hh(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var p=f.getSelection&&f.getSelection();if(p&&p.rangeCount!==0){f=p.anchorNode;var b=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var Q=0,_=-1,W=-1,se=0,de=0,pe=a,oe=null;t:for(;;){for(var ce;pe!==f||b!==0&&pe.nodeType!==3||(_=Q+b),pe!==S||p!==0&&pe.nodeType!==3||(W=Q+p),pe.nodeType===3&&(Q+=pe.nodeValue.length),(ce=pe.firstChild)!==null;)oe=pe,pe=ce;for(;;){if(pe===a)break t;if(oe===f&&++se===b&&(_=Q),oe===S&&++de===p&&(W=Q),(ce=pe.nextSibling)!==null)break;pe=oe,oe=pe.parentNode}pe=ce}f=_===-1||W===-1?null:{start:_,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(Xm={focusedElem:a,selectionRange:f},u1=!1,Sn=o;Sn!==null;)if(o=Sn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Sn=a;else for(;Sn!==null;){switch(o=Sn,S=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)b=a[f],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,f=o,b=S.memoizedProps,S=S.memoizedState,p=f.stateNode;try{var Te=Nl(f.type,b);a=p.getSnapshotBeforeUpdate(Te,S),p.__reactInternalSnapshotBeforeUpdate=a}catch(He){Et(f,f.return,He)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,f=a.nodeType,f===9)Bm(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Bm(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,Sn=a;break}Sn=o.return}}function sx(a,o,f){var p=f.flags;switch(f.tag){case 0:case 11:case 15:Gi(a,f),p&4&&dc(5,f);break;case 1:if(Gi(a,f),p&4)if(a=f.stateNode,o===null)try{a.componentDidMount()}catch(Q){Et(f,f.return,Q)}else{var b=Nl(f.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(Q){Et(f,f.return,Q)}}p&64&&tx(f),p&512&&hc(f,f.return);break;case 3:if(Gi(a,f),p&64&&(a=f.updateQueue,a!==null)){if(o=null,f.child!==null)switch(f.child.tag){case 27:case 5:o=f.child.stateNode;break;case 1:o=f.child.stateNode}try{BO(a,o)}catch(Q){Et(f,f.return,Q)}}break;case 27:o===null&&p&4&&ax(f);case 26:case 5:Gi(a,f),o===null&&p&4&&rx(f),p&512&&hc(f,f.return);break;case 12:Gi(a,f);break;case 31:Gi(a,f),p&4&&ux(a,f);break;case 13:Gi(a,f),p&4&&fx(a,f),p&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=gE.bind(null,f),RE(a,f))));break;case 22:if(p=f.memoizedState!==null||Ii,!p){o=o!==null&&o.memoizedState!==null||mn,b=Ii;var S=mn;Ii=p,(mn=o)&&!S?Ui(a,f,(f.subtreeFlags&8772)!==0):Gi(a,f),Ii=b,mn=S}break;case 30:break;default:Gi(a,f)}}function ox(a){var o=a.alternate;o!==null&&(a.alternate=null,ox(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&zt(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Ft=null,tr=!1;function qi(a,o,f){for(f=f.child;f!==null;)cx(a,o,f),f=f.sibling}function cx(a,o,f){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Mt,f)}catch{}switch(f.tag){case 26:mn||pi(f,o),qi(a,o,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:mn||pi(f,o);var p=Ft,b=tr;Ya(f.type)&&(Ft=f.stateNode,tr=!1),qi(a,o,f),Sc(f.stateNode),Ft=p,tr=b;break;case 5:mn||pi(f,o);case 6:if(p=Ft,b=tr,Ft=null,qi(a,o,f),Ft=p,tr=b,Ft!==null)if(tr)try{(Ft.nodeType===9?Ft.body:Ft.nodeName==="HTML"?Ft.ownerDocument.body:Ft).removeChild(f.stateNode)}catch(S){Et(f,o,S)}else try{Ft.removeChild(f.stateNode)}catch(S){Et(f,o,S)}break;case 18:Ft!==null&&(tr?(a=Ft,t5(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),Ls(a)):t5(Ft,f.stateNode));break;case 4:p=Ft,b=tr,Ft=f.stateNode.containerInfo,tr=!0,qi(a,o,f),Ft=p,tr=b;break;case 0:case 11:case 14:case 15:_a(2,f,o),mn||_a(4,f,o),qi(a,o,f);break;case 1:mn||(pi(f,o),p=f.stateNode,typeof p.componentWillUnmount=="function"&&nx(f,o,p)),qi(a,o,f);break;case 21:qi(a,o,f);break;case 22:mn=(p=mn)||f.memoizedState!==null,qi(a,o,f),mn=p;break;default:qi(a,o,f)}}function ux(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Ls(a)}catch(f){Et(o,o.return,f)}}}function fx(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Ls(a)}catch(f){Et(o,o.return,f)}}function oE(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new lx),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new lx),o;default:throw Error(r(435,a.tag))}}function F0(a,o){var f=oE(a);o.forEach(function(p){if(!f.has(p)){f.add(p);var b=OE.bind(null,a,p);p.then(b,b)}})}function nr(a,o){var f=o.deletions;if(f!==null)for(var p=0;p<f.length;p++){var b=f[p],S=a,Q=o,_=Q;e:for(;_!==null;){switch(_.tag){case 27:if(Ya(_.type)){Ft=_.stateNode,tr=!1;break e}break;case 5:Ft=_.stateNode,tr=!1;break e;case 3:case 4:Ft=_.stateNode.containerInfo,tr=!0;break e}_=_.return}if(Ft===null)throw Error(r(160));cx(S,Q,b),Ft=null,tr=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)dx(o,a),o=o.sibling}var ei=null;function dx(a,o){var f=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:nr(o,a),rr(a),p&4&&(_a(3,a,a.return),dc(3,a),_a(5,a,a.return));break;case 1:nr(o,a),rr(a),p&512&&(mn||f===null||pi(f,f.return)),p&64&&Ii&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?p:f.concat(p))));break;case 26:var b=ei;if(nr(o,a),rr(a),p&512&&(mn||f===null||pi(f,f.return)),p&4){var S=f!==null?f.memoizedState:null;if(p=a.memoizedState,f===null)if(p===null)if(a.stateNode===null){e:{p=a.type,f=a.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":S=b.getElementsByTagName("title")[0],(!S||S[ct]||S[tn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=b.createElement(p),b.head.insertBefore(S,b.querySelector("head > title"))),Qn(S,p,f),S[tn]=a,un(S),p=S;break e;case"link":var Q=d5("link","href",b).get(p+(f.href||""));if(Q){for(var _=0;_<Q.length;_++)if(S=Q[_],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){Q.splice(_,1);break t}}S=b.createElement(p),Qn(S,p,f),b.head.appendChild(S);break;case"meta":if(Q=d5("meta","content",b).get(p+(f.content||""))){for(_=0;_<Q.length;_++)if(S=Q[_],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){Q.splice(_,1);break t}}S=b.createElement(p),Qn(S,p,f),b.head.appendChild(S);break;default:throw Error(r(468,p))}S[tn]=a,un(S),p=S}a.stateNode=p}else h5(b,a.type,a.stateNode);else a.stateNode=f5(b,p,a.memoizedProps);else S!==p?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,p===null?h5(b,a.type,a.stateNode):f5(b,p,a.memoizedProps)):p===null&&a.stateNode!==null&&Om(a,a.memoizedProps,f.memoizedProps)}break;case 27:nr(o,a),rr(a),p&512&&(mn||f===null||pi(f,f.return)),f!==null&&p&4&&Om(a,a.memoizedProps,f.memoizedProps);break;case 5:if(nr(o,a),rr(a),p&512&&(mn||f===null||pi(f,f.return)),a.flags&32){b=a.stateNode;try{ss(b,"")}catch(Te){Et(a,a.return,Te)}}p&4&&a.stateNode!=null&&(b=a.memoizedProps,Om(a,b,f!==null?f.memoizedProps:b)),p&1024&&(bm=!0);break;case 6:if(nr(o,a),rr(a),p&4){if(a.stateNode===null)throw Error(r(162));p=a.memoizedProps,f=a.stateNode;try{f.nodeValue=p}catch(Te){Et(a,a.return,Te)}}break;case 3:if(l1=null,b=ei,ei=i1(o.containerInfo),nr(o,a),ei=b,rr(a),p&4&&f!==null&&f.memoizedState.isDehydrated)try{Ls(o.containerInfo)}catch(Te){Et(a,a.return,Te)}bm&&(bm=!1,hx(a));break;case 4:p=ei,ei=i1(a.stateNode.containerInfo),nr(o,a),rr(a),ei=p;break;case 12:nr(o,a),rr(a);break;case 31:nr(o,a),rr(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,F0(a,p)));break;case 13:nr(o,a),rr(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Y0=be()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,F0(a,p)));break;case 22:b=a.memoizedState!==null;var W=f!==null&&f.memoizedState!==null,se=Ii,de=mn;if(Ii=se||b,mn=de||W,nr(o,a),mn=de,Ii=se,rr(a),p&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(f===null||W||Ii||mn||Rl(a)),f=null,o=a;;){if(o.tag===5||o.tag===26){if(f===null){W=f=o;try{if(S=W.stateNode,b)Q=S.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none";else{_=W.stateNode;var pe=W.memoizedProps.style,oe=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;_.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Te){Et(W,W.return,Te)}}}else if(o.tag===6){if(f===null){W=o;try{W.stateNode.nodeValue=b?"":W.memoizedProps}catch(Te){Et(W,W.return,Te)}}}else if(o.tag===18){if(f===null){W=o;try{var ce=W.stateNode;b?n5(ce,!0):n5(W.stateNode,!1)}catch(Te){Et(W,W.return,Te)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}p&4&&(p=a.updateQueue,p!==null&&(f=p.retryQueue,f!==null&&(p.retryQueue=null,F0(a,f))));break;case 19:nr(o,a),rr(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,F0(a,p)));break;case 30:break;case 21:break;default:nr(o,a),rr(a)}}function rr(a){var o=a.flags;if(o&2){try{for(var f,p=a.return;p!==null;){if(ix(p)){f=p;break}p=p.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var b=f.stateNode,S=xm(a);z0(a,S,b);break;case 5:var Q=f.stateNode;f.flags&32&&(ss(Q,""),f.flags&=-33);var _=xm(a);z0(a,_,Q);break;case 3:case 4:var W=f.stateNode.containerInfo,se=xm(a);ym(a,se,W);break;default:throw Error(r(161))}}catch(de){Et(a,a.return,de)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function hx(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;hx(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function Gi(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)sx(a,o.alternate,o),o=o.sibling}function Rl(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:_a(4,o,o.return),Rl(o);break;case 1:pi(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&nx(o,o.return,f),Rl(o);break;case 27:Sc(o.stateNode);case 26:case 5:pi(o,o.return),Rl(o);break;case 22:o.memoizedState===null&&Rl(o);break;case 30:Rl(o);break;default:Rl(o)}a=a.sibling}}function Ui(a,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var p=o.alternate,b=a,S=o,Q=S.flags;switch(S.tag){case 0:case 11:case 15:Ui(b,S,f),dc(4,S);break;case 1:if(Ui(b,S,f),p=S,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(se){Et(p,p.return,se)}if(p=S,b=p.updateQueue,b!==null){var _=p.stateNode;try{var W=b.shared.hiddenCallbacks;if(W!==null)for(b.shared.hiddenCallbacks=null,b=0;b<W.length;b++)FO(W[b],_)}catch(se){Et(p,p.return,se)}}f&&Q&64&&tx(S),hc(S,S.return);break;case 27:ax(S);case 26:case 5:Ui(b,S,f),f&&p===null&&Q&4&&rx(S),hc(S,S.return);break;case 12:Ui(b,S,f);break;case 31:Ui(b,S,f),f&&Q&4&&ux(b,S);break;case 13:Ui(b,S,f),f&&Q&4&&fx(b,S);break;case 22:S.memoizedState===null&&Ui(b,S,f),hc(S,S.return);break;case 30:break;default:Ui(b,S,f)}o=o.sibling}}function vm(a,o){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Jo(f))}function Sm(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Jo(a))}function ti(a,o,f,p){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)mx(a,o,f,p),o=o.sibling}function mx(a,o,f,p){var b=o.flags;switch(o.tag){case 0:case 11:case 15:ti(a,o,f,p),b&2048&&dc(9,o);break;case 1:ti(a,o,f,p);break;case 3:ti(a,o,f,p),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Jo(a)));break;case 12:if(b&2048){ti(a,o,f,p),a=o.stateNode;try{var S=o.memoizedProps,Q=S.id,_=S.onPostCommit;typeof _=="function"&&_(Q,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){Et(o,o.return,W)}}else ti(a,o,f,p);break;case 31:ti(a,o,f,p);break;case 13:ti(a,o,f,p);break;case 23:break;case 22:S=o.stateNode,Q=o.alternate,o.memoizedState!==null?S._visibility&2?ti(a,o,f,p):mc(a,o):S._visibility&2?ti(a,o,f,p):(S._visibility|=2,Cs(a,o,f,p,(o.subtreeFlags&10256)!==0||!1)),b&2048&&vm(Q,o);break;case 24:ti(a,o,f,p),b&2048&&Sm(o.alternate,o);break;default:ti(a,o,f,p)}}function Cs(a,o,f,p,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var S=a,Q=o,_=f,W=p,se=Q.flags;switch(Q.tag){case 0:case 11:case 15:Cs(S,Q,_,W,b),dc(8,Q);break;case 23:break;case 22:var de=Q.stateNode;Q.memoizedState!==null?de._visibility&2?Cs(S,Q,_,W,b):mc(S,Q):(de._visibility|=2,Cs(S,Q,_,W,b)),b&&se&2048&&vm(Q.alternate,Q);break;case 24:Cs(S,Q,_,W,b),b&&se&2048&&Sm(Q.alternate,Q);break;default:Cs(S,Q,_,W,b)}o=o.sibling}}function mc(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=a,p=o,b=p.flags;switch(p.tag){case 22:mc(f,p),b&2048&&vm(p.alternate,p);break;case 24:mc(f,p),b&2048&&Sm(p.alternate,p);break;default:mc(f,p)}o=o.sibling}}var pc=8192;function Es(a,o,f){if(a.subtreeFlags&pc)for(a=a.child;a!==null;)px(a,o,f),a=a.sibling}function px(a,o,f){switch(a.tag){case 26:Es(a,o,f),a.flags&pc&&a.memoizedState!==null&&qE(f,ei,a.memoizedState,a.memoizedProps);break;case 5:Es(a,o,f);break;case 3:case 4:var p=ei;ei=i1(a.stateNode.containerInfo),Es(a,o,f),ei=p;break;case 22:a.memoizedState===null&&(p=a.alternate,p!==null&&p.memoizedState!==null?(p=pc,pc=16777216,Es(a,o,f),pc=p):Es(a,o,f));break;default:Es(a,o,f)}}function gx(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function gc(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var p=o[f];Sn=p,xx(p,a)}gx(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ox(a),a=a.sibling}function Ox(a){switch(a.tag){case 0:case 11:case 15:gc(a),a.flags&2048&&_a(9,a,a.return);break;case 3:gc(a);break;case 12:gc(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,B0(a)):gc(a);break;default:gc(a)}}function B0(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var p=o[f];Sn=p,xx(p,a)}gx(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:_a(8,o,o.return),B0(o);break;case 22:f=o.stateNode,f._visibility&2&&(f._visibility&=-3,B0(o));break;default:B0(o)}a=a.sibling}}function xx(a,o){for(;Sn!==null;){var f=Sn;switch(f.tag){case 0:case 11:case 15:_a(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var p=f.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Jo(f.memoizedState.cache)}if(p=f.child,p!==null)p.return=f,Sn=p;else e:for(f=a;Sn!==null;){p=Sn;var b=p.sibling,S=p.return;if(ox(p),p===f){Sn=null;break e}if(b!==null){b.return=S,Sn=b;break e}Sn=S}}}var cE={getCacheForType:function(a){var o=jn(fn),f=o.data.get(a);return f===void 0&&(f=a(),o.data.set(a,f)),f},cacheSignal:function(){return jn(fn).controller.signal}},uE=typeof WeakMap=="function"?WeakMap:Map,kt=0,Zt=null,et=null,it=0,Ct=0,yr=null,Da=!1,Ts=!1,wm=!1,Wi=0,Ut=0,Ha=0,Vl=0,km=0,br=0,$s=0,Oc=null,ir=null,Am=!1,Y0=0,yx=0,I0=1/0,q0=null,Xa=null,On=0,za=null,js=null,Ki=0,Mm=0,Cm=null,bx=null,xc=0,Em=null;function vr(){return(kt&2)!==0&&it!==0?it&-it:H.T!==null?Zm():mr()}function vx(){if(br===0)if((it&536870912)===0||st){var a=Je;Je<<=1,(Je&3932160)===0&&(Je=262144),br=a}else br=536870912;return a=Or.current,a!==null&&(a.flags|=32),br}function ar(a,o,f){(a===Zt&&(Ct===2||Ct===9)||a.cancelPendingCommit!==null)&&(Ps(a,0),Fa(a,it,br,!1)),En(a,f),((kt&2)===0||a!==Zt)&&(a===Zt&&((kt&2)===0&&(Vl|=f),Ut===4&&Fa(a,it,br,!1)),gi(a))}function Sx(a,o,f){if((kt&6)!==0)throw Error(r(327));var p=!f&&(o&127)===0&&(o&a.expiredLanes)===0||Bn(a,o),b=p?hE(a,o):$m(a,o,!0),S=p;do{if(b===0){Ts&&!p&&Fa(a,o,0,!1);break}else{if(f=a.current.alternate,S&&!fE(f)){b=$m(a,o,!1),S=!1;continue}if(b===2){if(S=o,a.errorRecoveryDisabledLanes&S)var Q=0;else Q=a.pendingLanes&-536870913,Q=Q!==0?Q:Q&536870912?536870912:0;if(Q!==0){o=Q;e:{var _=a;b=Oc;var W=_.current.memoizedState.isDehydrated;if(W&&(Ps(_,Q).flags|=256),Q=$m(_,Q,!1),Q!==2){if(wm&&!W){_.errorRecoveryDisabledLanes|=S,Vl|=S,b=4;break e}S=ir,ir=b,S!==null&&(ir===null?ir=S:ir.push.apply(ir,S))}b=Q}if(S=!1,b!==2)continue}}if(b===1){Ps(a,0),Fa(a,o,0,!0);break}e:{switch(p=a,S=b,S){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Fa(p,o,br,!Da);break e;case 2:ir=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=Y0+300-be(),10<b)){if(Fa(p,o,br,!Da),cn(p,0,!0)!==0)break e;Ki=o,p.timeoutHandle=Jx(wx.bind(null,p,f,ir,q0,Am,o,br,Vl,$s,Da,S,"Throttled",-0,0),b);break e}wx(p,f,ir,q0,Am,o,br,Vl,$s,Da,S,null,-0,0)}}break}while(!0);gi(a)}function wx(a,o,f,p,b,S,Q,_,W,se,de,pe,oe,ce){if(a.timeoutHandle=-1,pe=o.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vi},px(o,S,pe);var Te=(S&62914560)===S?Y0-be():(S&4194048)===S?yx-be():0;if(Te=GE(pe,Te),Te!==null){Ki=S,a.cancelPendingCommit=Te(jx.bind(null,a,o,S,f,p,b,Q,_,W,de,pe,null,oe,ce)),Fa(a,S,Q,!se);return}}jx(a,o,S,f,p,b,Q,_,W)}function fE(a){for(var o=a;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var p=0;p<f.length;p++){var b=f[p],S=b.getSnapshot;b=b.value;try{if(!pr(S(),b))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Fa(a,o,f,p){o&=~km,o&=~Vl,a.suspendedLanes|=o,a.pingedLanes&=~o,p&&(a.warmLanes|=o),p=a.expirationTimes;for(var b=o;0<b;){var S=31-ze(b),Q=1<<S;p[S]=-1,b&=~Q}f!==0&&wa(a,f,o)}function G0(){return(kt&6)===0?(yc(0),!1):!0}function Tm(){if(et!==null){if(Ct===0)var a=et.return;else a=et,Hi=El=null,Bh(a),Ss=null,tc=0,a=et;for(;a!==null;)ex(a.alternate,a),a=a.return;et=null}}function Ps(a,o){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,jE(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),Ki=0,Tm(),Zt=a,et=f=_i(a.current,null),it=o,Ct=0,yr=null,Da=!1,Ts=Bn(a,o),wm=!1,$s=br=km=Vl=Ha=Ut=0,ir=Oc=null,Am=!1,(o&8)!==0&&(o|=o&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=o;0<p;){var b=31-ze(p),S=1<<b;o|=a[b],p&=~S}return Wi=o,g0(),f}function kx(a,o){Ge=null,H.H=cc,o===vs||o===k0?(o=DO(),Ct=3):o===Qh?(o=DO(),Ct=4):Ct=o===sm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,yr=o,et===null&&(Ut=1,L0(a,Nr(o,a.current)))}function Ax(){var a=Or.current;return a===null?!0:(it&4194048)===it?_r===null:(it&62914560)===it||(it&536870912)!==0?a===_r:!1}function Mx(){var a=H.H;return H.H=cc,a===null?cc:a}function Cx(){var a=H.A;return H.A=cE,a}function U0(){Ut=4,Da||(it&4194048)!==it&&Or.current!==null||(Ts=!0),(Ha&134217727)===0&&(Vl&134217727)===0||Zt===null||Fa(Zt,it,br,!1)}function $m(a,o,f){var p=kt;kt|=2;var b=Mx(),S=Cx();(Zt!==a||it!==o)&&(q0=null,Ps(a,o)),o=!1;var Q=Ut;e:do try{if(Ct!==0&&et!==null){var _=et,W=yr;switch(Ct){case 8:Tm(),Q=6;break e;case 3:case 2:case 9:case 6:Or.current===null&&(o=!0);var se=Ct;if(Ct=0,yr=null,Qs(a,_,W,se),f&&Ts){Q=0;break e}break;default:se=Ct,Ct=0,yr=null,Qs(a,_,W,se)}}dE(),Q=Ut;break}catch(de){kx(a,de)}while(!0);return o&&a.shellSuspendCounter++,Hi=El=null,kt=p,H.H=b,H.A=S,et===null&&(Zt=null,it=0,g0()),Q}function dE(){for(;et!==null;)Ex(et)}function hE(a,o){var f=kt;kt|=2;var p=Mx(),b=Cx();Zt!==a||it!==o?(q0=null,I0=be()+500,Ps(a,o)):Ts=Bn(a,o);e:do try{if(Ct!==0&&et!==null){o=et;var S=yr;t:switch(Ct){case 1:Ct=0,yr=null,Qs(a,o,S,1);break;case 2:case 9:if(LO(S)){Ct=0,yr=null,Tx(o);break}o=function(){Ct!==2&&Ct!==9||Zt!==a||(Ct=7),gi(a)},S.then(o,o);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:LO(S)?(Ct=0,yr=null,Tx(o)):(Ct=0,yr=null,Qs(a,o,S,7));break;case 5:var Q=null;switch(et.tag){case 26:Q=et.memoizedState;case 5:case 27:var _=et;if(Q?m5(Q):_.stateNode.complete){Ct=0,yr=null;var W=_.sibling;if(W!==null)et=W;else{var se=_.return;se!==null?(et=se,W0(se)):et=null}break t}}Ct=0,yr=null,Qs(a,o,S,5);break;case 6:Ct=0,yr=null,Qs(a,o,S,6);break;case 8:Tm(),Ut=6;break e;default:throw Error(r(462))}}mE();break}catch(de){kx(a,de)}while(!0);return Hi=El=null,H.H=p,H.A=b,kt=f,et!==null?0:(Zt=null,it=0,g0(),Ut)}function mE(){for(;et!==null&&!Ye();)Ex(et)}function Ex(a){var o=K4(a.alternate,a,Wi);a.memoizedProps=a.pendingProps,o===null?W0(a):et=o}function Tx(a){var o=a,f=o.alternate;switch(o.tag){case 15:case 0:o=Y4(f,o,o.pendingProps,o.type,void 0,it);break;case 11:o=Y4(f,o,o.pendingProps,o.type.render,o.ref,it);break;case 5:Bh(o);default:ex(f,o),o=et=CO(o,Wi),o=K4(f,o,Wi)}a.memoizedProps=a.pendingProps,o===null?W0(a):et=o}function Qs(a,o,f,p){Hi=El=null,Bh(o),Ss=null,tc=0;var b=o.return;try{if(nE(a,b,o,f,it)){Ut=1,L0(a,Nr(f,a.current)),et=null;return}}catch(S){if(b!==null)throw et=b,S;Ut=1,L0(a,Nr(f,a.current)),et=null;return}o.flags&32768?(st||p===1?a=!0:Ts||(it&536870912)!==0?a=!1:(Da=a=!0,(p===2||p===9||p===3||p===6)&&(p=Or.current,p!==null&&p.tag===13&&(p.flags|=16384))),$x(o,a)):W0(o)}function W0(a){var o=a;do{if((o.flags&32768)!==0){$x(o,Da);return}a=o.return;var f=aE(o.alternate,o,Wi);if(f!==null){et=f;return}if(o=o.sibling,o!==null){et=o;return}et=o=a}while(o!==null);Ut===0&&(Ut=5)}function $x(a,o){do{var f=lE(a.alternate,a);if(f!==null){f.flags&=32767,et=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(a=a.sibling,a!==null)){et=a;return}et=a=f}while(a!==null);Ut=6,et=null}function jx(a,o,f,p,b,S,Q,_,W){a.cancelPendingCommit=null;do K0();while(On!==0);if((kt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(S=o.lanes|o.childLanes,S|=xh,di(a,f,S,Q,_,W),a===Zt&&(et=Zt=null,it=0),js=o,za=a,Ki=f,Mm=S,Cm=b,bx=p,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,xE(Re,function(){return Rx(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||p){p=H.T,H.T=null,b=q.p,q.p=2,Q=kt,kt|=4;try{sE(a,o,f)}finally{kt=Q,q.p=b,H.T=p}}On=1,Px(),Qx(),Zx()}}function Px(){if(On===1){On=0;var a=za,o=js,f=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||f){f=H.T,H.T=null;var p=q.p;q.p=2;var b=kt;kt|=4;try{dx(o,a);var S=Xm,Q=xO(a.containerInfo),_=S.focusedElem,W=S.selectionRange;if(Q!==_&&_&&_.ownerDocument&&OO(_.ownerDocument.documentElement,_)){if(W!==null&&hh(_)){var se=W.start,de=W.end;if(de===void 0&&(de=se),"selectionStart"in _)_.selectionStart=se,_.selectionEnd=Math.min(de,_.value.length);else{var pe=_.ownerDocument||document,oe=pe&&pe.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Te=_.textContent.length,He=Math.min(W.start,Te),Qt=W.end===void 0?He:Math.min(W.end,Te);!ce.extend&&He>Qt&&(Q=Qt,Qt=He,He=Q);var ie=gO(_,He),ne=gO(_,Qt);if(ie&&ne&&(ce.rangeCount!==1||ce.anchorNode!==ie.node||ce.anchorOffset!==ie.offset||ce.focusNode!==ne.node||ce.focusOffset!==ne.offset)){var le=pe.createRange();le.setStart(ie.node,ie.offset),ce.removeAllRanges(),He>Qt?(ce.addRange(le),ce.extend(ne.node,ne.offset)):(le.setEnd(ne.node,ne.offset),ce.addRange(le))}}}}for(pe=[],ce=_;ce=ce.parentNode;)ce.nodeType===1&&pe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<pe.length;_++){var he=pe[_];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}u1=!!Hm,Xm=Hm=null}finally{kt=b,q.p=p,H.T=f}}a.current=o,On=2}}function Qx(){if(On===2){On=0;var a=za,o=js,f=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||f){f=H.T,H.T=null;var p=q.p;q.p=2;var b=kt;kt|=4;try{sx(a,o.alternate,o)}finally{kt=b,q.p=p,H.T=f}}On=3}}function Zx(){if(On===4||On===3){On=0,_e();var a=za,o=js,f=Ki,p=bx;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?On=5:(On=0,js=za=null,Nx(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(Xa=null),bn(f),o=o.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Mt,o,void 0,(o.current.flags&128)===128)}catch{}if(p!==null){o=H.T,b=q.p,q.p=2,H.T=null;try{for(var S=a.onRecoverableError,Q=0;Q<p.length;Q++){var _=p[Q];S(_.value,{componentStack:_.stack})}}finally{H.T=o,q.p=b}}(Ki&3)!==0&&K0(),gi(a),b=a.pendingLanes,(f&261930)!==0&&(b&42)!==0?a===Em?xc++:(xc=0,Em=a):xc=0,yc(0)}}function Nx(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Jo(o)))}function K0(){return Px(),Qx(),Zx(),Rx()}function Rx(){if(On!==5)return!1;var a=za,o=Mm;Mm=0;var f=bn(Ki),p=H.T,b=q.p;try{q.p=32>f?32:f,H.T=null,f=Cm,Cm=null;var S=za,Q=Ki;if(On=0,js=za=null,Ki=0,(kt&6)!==0)throw Error(r(331));var _=kt;if(kt|=4,Ox(S.current),mx(S,S.current,Q,f),kt=_,yc(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Mt,S)}catch{}return!0}finally{q.p=b,H.T=p,Nx(a,o)}}function Vx(a,o,f){o=Nr(f,o),o=lm(a.stateNode,o,2),a=Ra(a,o,2),a!==null&&(En(a,2),gi(a))}function Et(a,o,f){if(a.tag===3)Vx(a,a,f);else for(;o!==null;){if(o.tag===3){Vx(o,a,f);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Xa===null||!Xa.has(p))){a=Nr(f,a),f=L4(2),p=Ra(o,f,2),p!==null&&(_4(f,p,o,a),En(p,2),gi(p));break}}o=o.return}}function jm(a,o,f){var p=a.pingCache;if(p===null){p=a.pingCache=new uE;var b=new Set;p.set(o,b)}else b=p.get(o),b===void 0&&(b=new Set,p.set(o,b));b.has(f)||(wm=!0,b.add(f),a=pE.bind(null,a,o,f),o.then(a,a))}function pE(a,o,f){var p=a.pingCache;p!==null&&p.delete(o),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,Zt===a&&(it&f)===f&&(Ut===4||Ut===3&&(it&62914560)===it&&300>be()-Y0?(kt&2)===0&&Ps(a,0):km|=f,$s===it&&($s=0)),gi(a)}function Lx(a,o){o===0&&(o=Sa()),a=Al(a,o),a!==null&&(En(a,o),gi(a))}function gE(a){var o=a.memoizedState,f=0;o!==null&&(f=o.retryLane),Lx(a,f)}function OE(a,o){var f=0;switch(a.tag){case 31:case 13:var p=a.stateNode,b=a.memoizedState;b!==null&&(f=b.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(o),Lx(a,f)}function xE(a,o){return yt(a,o)}var J0=null,Zs=null,Pm=!1,e1=!1,Qm=!1,Ba=0;function gi(a){a!==Zs&&a.next===null&&(Zs===null?J0=Zs=a:Zs=Zs.next=a),e1=!0,Pm||(Pm=!0,bE())}function yc(a,o){if(!Qm&&e1){Qm=!0;do for(var f=!1,p=J0;p!==null;){if(a!==0){var b=p.pendingLanes;if(b===0)var S=0;else{var Q=p.suspendedLanes,_=p.pingedLanes;S=(1<<31-ze(42|a)+1)-1,S&=b&~(Q&~_),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,Xx(p,S))}else S=it,S=cn(p,p===Zt?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||Bn(p,S)||(f=!0,Xx(p,S));p=p.next}while(f);Qm=!1}}function yE(){_x()}function _x(){e1=Pm=!1;var a=0;Ba!==0&&$E()&&(a=Ba);for(var o=be(),f=null,p=J0;p!==null;){var b=p.next,S=Dx(p,o);S===0?(p.next=null,f===null?J0=b:f.next=b,b===null&&(Zs=f)):(f=p,(a!==0||(S&3)!==0)&&(e1=!0)),p=b}On!==0&&On!==5||yc(a),Ba!==0&&(Ba=0)}function Dx(a,o){for(var f=a.suspendedLanes,p=a.pingedLanes,b=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var Q=31-ze(S),_=1<<Q,W=b[Q];W===-1?((_&f)===0||(_&p)!==0)&&(b[Q]=bl(_,o)):W<=o&&(a.expiredLanes|=_),S&=~_}if(o=Zt,f=it,f=cn(a,a===o?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,f===0||a===o&&(Ct===2||Ct===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&Le(p),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||Bn(a,f)){if(o=f&-f,o===a.callbackPriority)return o;switch(p!==null&&Le(p),bn(f)){case 2:case 8:f=bt;break;case 32:f=Re;break;case 268435456:f=Rt;break;default:f=Re}return p=Hx.bind(null,a),f=yt(f,p),a.callbackPriority=o,a.callbackNode=f,o}return p!==null&&p!==null&&Le(p),a.callbackPriority=2,a.callbackNode=null,2}function Hx(a,o){if(On!==0&&On!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(K0()&&a.callbackNode!==f)return null;var p=it;return p=cn(a,a===Zt?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(Sx(a,p,o),Dx(a,be()),a.callbackNode!=null&&a.callbackNode===f?Hx.bind(null,a):null)}function Xx(a,o){if(K0())return null;Sx(a,o,!0)}function bE(){PE(function(){(kt&6)!==0?yt(Ue,yE):_x()})}function Zm(){if(Ba===0){var a=ys;a===0&&(a=lt,lt<<=1,(lt&261888)===0&&(lt=256)),Ba=a}return Ba}function zx(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:o0(""+a)}function Fx(a,o){var f=o.ownerDocument.createElement("input");return f.name=o.name,f.value=o.value,a.id&&f.setAttribute("form",a.id),o.parentNode.insertBefore(f,o),a=new FormData(a),f.parentNode.removeChild(f),a}function vE(a,o,f,p,b){if(o==="submit"&&f&&f.stateNode===b){var S=zx((b[vn]||null).action),Q=p.submitter;Q&&(o=(o=Q[vn]||null)?zx(o.formAction):Q.getAttribute("formAction"),o!==null&&(S=o,Q=null));var _=new d0("action","action",null,p,b);a.push({event:_,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Ba!==0){var W=Q?Fx(b,Q):new FormData(b);em(f,{pending:!0,data:W,method:b.method,action:S},null,W)}}else typeof S=="function"&&(_.preventDefault(),W=Q?Fx(b,Q):new FormData(b),em(f,{pending:!0,data:W,method:b.method,action:S},S,W))},currentTarget:b}]})}}for(var Nm=0;Nm<Oh.length;Nm++){var Rm=Oh[Nm],SE=Rm.toLowerCase(),wE=Rm[0].toUpperCase()+Rm.slice(1);Jr(SE,"on"+wE)}Jr(vO,"onAnimationEnd"),Jr(SO,"onAnimationIteration"),Jr(wO,"onAnimationStart"),Jr("dblclick","onDoubleClick"),Jr("focusin","onFocus"),Jr("focusout","onBlur"),Jr(_C,"onTransitionRun"),Jr(DC,"onTransitionStart"),Jr(HC,"onTransitionCancel"),Jr(kO,"onTransitionEnd"),Ca("onMouseEnter",["mouseout","mouseover"]),Ca("onMouseLeave",["mouseout","mouseover"]),Ca("onPointerEnter",["pointerout","pointerover"]),Ca("onPointerLeave",["pointerout","pointerover"]),Ri("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ri("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ri("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ri("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ri("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ri("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bc));function Bx(a,o){o=(o&4)!==0;for(var f=0;f<a.length;f++){var p=a[f],b=p.event;p=p.listeners;e:{var S=void 0;if(o)for(var Q=p.length-1;0<=Q;Q--){var _=p[Q],W=_.instance,se=_.currentTarget;if(_=_.listener,W!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=se;try{S(b)}catch(de){p0(de)}b.currentTarget=null,S=W}else for(Q=0;Q<p.length;Q++){if(_=p[Q],W=_.instance,se=_.currentTarget,_=_.listener,W!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=se;try{S(b)}catch(de){p0(de)}b.currentTarget=null,S=W}}}}function tt(a,o){var f=o[Aa];f===void 0&&(f=o[Aa]=new Set);var p=a+"__bubble";f.has(p)||(Yx(o,a,2,!1),f.add(p))}function Vm(a,o,f){var p=0;o&&(p|=4),Yx(f,a,p,o)}var t1="_reactListening"+Math.random().toString(36).slice(2);function Lm(a){if(!a[t1]){a[t1]=!0,r0.forEach(function(f){f!=="selectionchange"&&(kE.has(f)||Vm(f,!1,a),Vm(f,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[t1]||(o[t1]=!0,Vm("selectionchange",!1,o))}}function Yx(a,o,f,p){switch(v5(o)){case 2:var b=KE;break;case 8:b=JE;break;default:b=Jm}f=b.bind(null,o,f,a),b=void 0,!ih||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),p?b!==void 0?a.addEventListener(o,f,{capture:!0,passive:b}):a.addEventListener(o,f,!0):b!==void 0?a.addEventListener(o,f,{passive:b}):a.addEventListener(o,f,!1)}function _m(a,o,f,p,b){var S=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var Q=p.tag;if(Q===3||Q===4){var _=p.stateNode.containerInfo;if(_===b)break;if(Q===4)for(Q=p.return;Q!==null;){var W=Q.tag;if((W===3||W===4)&&Q.stateNode.containerInfo===b)return;Q=Q.return}for(;_!==null;){if(Q=Tn(_),Q===null)return;if(W=Q.tag,W===5||W===6||W===26||W===27){p=S=Q;continue e}_=_.parentNode}}p=p.return}W6(function(){var se=S,de=nh(f),pe=[];e:{var oe=AO.get(a);if(oe!==void 0){var ce=d0,Te=a;switch(a){case"keypress":if(u0(f)===0)break e;case"keydown":case"keyup":ce=OC;break;case"focusin":Te="focus",ce=oh;break;case"focusout":Te="blur",ce=oh;break;case"beforeblur":case"afterblur":ce=oh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=eO;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=aC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=bC;break;case vO:case SO:case wO:ce=oC;break;case kO:ce=SC;break;case"scroll":case"scrollend":ce=rC;break;case"wheel":ce=kC;break;case"copy":case"cut":case"paste":ce=uC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=nO;break;case"toggle":case"beforetoggle":ce=MC}var He=(o&4)!==0,Qt=!He&&(a==="scroll"||a==="scrollend"),ie=He?oe!==null?oe+"Capture":null:oe;He=[];for(var ne=se,le;ne!==null;){var he=ne;if(le=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||le===null||ie===null||(he=Xo(ne,ie),he!=null&&He.push(vc(ne,he,le))),Qt)break;ne=ne.return}0<He.length&&(oe=new ce(oe,Te,null,f,de),pe.push({event:oe,listeners:He}))}}if((o&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",ce=a==="mouseout"||a==="pointerout",oe&&f!==th&&(Te=f.relatedTarget||f.fromElement)&&(Tn(Te)||Te[Ur]))break e;if((ce||oe)&&(oe=de.window===de?de:(oe=de.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Te=f.relatedTarget||f.toElement,ce=se,Te=Te?Tn(Te):null,Te!==null&&(Qt=l(Te),He=Te.tag,Te!==Qt||He!==5&&He!==27&&He!==6)&&(Te=null)):(ce=null,Te=se),ce!==Te)){if(He=eO,he="onMouseLeave",ie="onMouseEnter",ne="mouse",(a==="pointerout"||a==="pointerover")&&(He=nO,he="onPointerLeave",ie="onPointerEnter",ne="pointer"),Qt=ce==null?oe:Kn(ce),le=Te==null?oe:Kn(Te),oe=new He(he,ne+"leave",ce,f,de),oe.target=Qt,oe.relatedTarget=le,he=null,Tn(de)===se&&(He=new He(ie,ne+"enter",Te,f,de),He.target=le,He.relatedTarget=Qt,he=He),Qt=he,ce&&Te)t:{for(He=AE,ie=ce,ne=Te,le=0,he=ie;he;he=He(he))le++;he=0;for(var De=ne;De;De=He(De))he++;for(;0<le-he;)ie=He(ie),le--;for(;0<he-le;)ne=He(ne),he--;for(;le--;){if(ie===ne||ne!==null&&ie===ne.alternate){He=ie;break t}ie=He(ie),ne=He(ne)}He=null}else He=null;ce!==null&&Ix(pe,oe,ce,He,!1),Te!==null&&Qt!==null&&Ix(pe,Qt,Te,He,!0)}}e:{if(oe=se?Kn(se):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var St=uO;else if(oO(oe))if(fO)St=RC;else{St=ZC;var Qe=QC}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?se&&eh(se.elementType)&&(St=uO):St=NC;if(St&&(St=St(a,se))){cO(pe,St,f,de);break e}Qe&&Qe(a,oe,se),a==="focusout"&&se&&oe.type==="number"&&se.memoizedProps.value!=null&&Jd(oe,"number",oe.value)}switch(Qe=se?Kn(se):window,a){case"focusin":(oO(Qe)||Qe.contentEditable==="true")&&(fs=Qe,mh=se,Uo=null);break;case"focusout":Uo=mh=fs=null;break;case"mousedown":ph=!0;break;case"contextmenu":case"mouseup":case"dragend":ph=!1,yO(pe,f,de);break;case"selectionchange":if(LC)break;case"keydown":case"keyup":yO(pe,f,de)}var We;if(uh)e:{switch(a){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else us?lO(a,f)&&(at="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(at="onCompositionStart");at&&(rO&&f.locale!=="ko"&&(us||at!=="onCompositionStart"?at==="onCompositionEnd"&&us&&(We=K6()):(Ta=de,ah="value"in Ta?Ta.value:Ta.textContent,us=!0)),Qe=n1(se,at),0<Qe.length&&(at=new tO(at,a,null,f,de),pe.push({event:at,listeners:Qe}),We?at.data=We:(We=sO(f),We!==null&&(at.data=We)))),(We=EC?TC(a,f):$C(a,f))&&(at=n1(se,"onBeforeInput"),0<at.length&&(Qe=new tO("onBeforeInput","beforeinput",null,f,de),pe.push({event:Qe,listeners:at}),Qe.data=We)),vE(pe,a,se,f,de)}Bx(pe,o)})}function vc(a,o,f){return{instance:a,listener:o,currentTarget:f}}function n1(a,o){for(var f=o+"Capture",p=[];a!==null;){var b=a,S=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||S===null||(b=Xo(a,f),b!=null&&p.unshift(vc(a,b,S)),b=Xo(a,o),b!=null&&p.push(vc(a,b,S))),a.tag===3)return p;a=a.return}return[]}function AE(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Ix(a,o,f,p,b){for(var S=o._reactName,Q=[];f!==null&&f!==p;){var _=f,W=_.alternate,se=_.stateNode;if(_=_.tag,W!==null&&W===p)break;_!==5&&_!==26&&_!==27||se===null||(W=se,b?(se=Xo(f,S),se!=null&&Q.unshift(vc(f,se,W))):b||(se=Xo(f,S),se!=null&&Q.push(vc(f,se,W)))),f=f.return}Q.length!==0&&a.push({event:o,listeners:Q})}var ME=/\r\n?/g,CE=/\u0000|\uFFFD/g;function qx(a){return(typeof a=="string"?a:""+a).replace(ME,`
49
- `).replace(CE,"")}function Gx(a,o){return o=qx(o),qx(a)===o}function Pt(a,o,f,p,b,S){switch(f){case"children":typeof p=="string"?o==="body"||o==="textarea"&&p===""||ss(a,p):(typeof p=="number"||typeof p=="bigint")&&o!=="body"&&ss(a,""+p);break;case"className":pt(a,"class",p);break;case"tabIndex":pt(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":pt(a,f,p);break;case"style":G6(a,p,S);break;case"data":if(o!=="object"){pt(a,"data",p);break}case"src":case"href":if(p===""&&(o!=="a"||f!=="href")){a.removeAttribute(f);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(f);break}p=o0(""+p),a.setAttribute(f,p);break;case"action":case"formAction":if(typeof p=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(o!=="input"&&Pt(a,o,"name",b.name,b,null),Pt(a,o,"formEncType",b.formEncType,b,null),Pt(a,o,"formMethod",b.formMethod,b,null),Pt(a,o,"formTarget",b.formTarget,b,null)):(Pt(a,o,"encType",b.encType,b,null),Pt(a,o,"method",b.method,b,null),Pt(a,o,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(f);break}p=o0(""+p),a.setAttribute(f,p);break;case"onClick":p!=null&&(a.onclick=Vi);break;case"onScroll":p!=null&&tt("scroll",a);break;case"onScrollEnd":p!=null&&tt("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=f}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}f=o0(""+p),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(f,""+p):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":p===!0?a.setAttribute(f,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(f,p):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(f,p):a.removeAttribute(f);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(f):a.setAttribute(f,p);break;case"popover":tt("beforetoggle",a),tt("toggle",a),Ea(a,"popover",p);break;case"xlinkActuate":$t(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":$t(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":$t(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":$t(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":$t(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":$t(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":$t(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":$t(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":$t(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Ea(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=tC.get(f)||f,Ea(a,f,p))}}function Dm(a,o,f,p,b,S){switch(f){case"style":G6(a,p,S);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=f}}break;case"children":typeof p=="string"?ss(a,p):(typeof p=="number"||typeof p=="bigint")&&ss(a,""+p);break;case"onScroll":p!=null&&tt("scroll",a);break;case"onScrollEnd":p!=null&&tt("scrollend",a);break;case"onClick":p!=null&&(a.onclick=Vi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!i0.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(b=f.endsWith("Capture"),o=f.slice(2,b?f.length-7:void 0),S=a[vn]||null,S=S!=null?S[f]:null,typeof S=="function"&&a.removeEventListener(o,S,b),typeof p=="function")){typeof S!="function"&&S!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(o,p,b);break e}f in a?a[f]=p:p===!0?a.setAttribute(f,""):Ea(a,f,p)}}}function Qn(a,o,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",a),tt("load",a);var p=!1,b=!1,S;for(S in f)if(f.hasOwnProperty(S)){var Q=f[S];if(Q!=null)switch(S){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Pt(a,o,S,Q,f,null)}}b&&Pt(a,o,"srcSet",f.srcSet,f,null),p&&Pt(a,o,"src",f.src,f,null);return;case"input":tt("invalid",a);var _=S=Q=b=null,W=null,se=null;for(p in f)if(f.hasOwnProperty(p)){var de=f[p];if(de!=null)switch(p){case"name":b=de;break;case"type":Q=de;break;case"checked":W=de;break;case"defaultChecked":se=de;break;case"value":S=de;break;case"defaultValue":_=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,o));break;default:Pt(a,o,p,de,f,null)}}B6(a,S,_,W,se,Q,b,!1);return;case"select":tt("invalid",a),p=Q=S=null;for(b in f)if(f.hasOwnProperty(b)&&(_=f[b],_!=null))switch(b){case"value":S=_;break;case"defaultValue":Q=_;break;case"multiple":p=_;default:Pt(a,o,b,_,f,null)}o=S,f=Q,a.multiple=!!p,o!=null?ls(a,!!p,o,!1):f!=null&&ls(a,!!p,f,!0);return;case"textarea":tt("invalid",a),S=b=p=null;for(Q in f)if(f.hasOwnProperty(Q)&&(_=f[Q],_!=null))switch(Q){case"value":p=_;break;case"defaultValue":b=_;break;case"children":S=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:Pt(a,o,Q,_,f,null)}I6(a,p,b,S);return;case"option":for(W in f)if(f.hasOwnProperty(W)&&(p=f[W],p!=null))switch(W){case"selected":a.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Pt(a,o,W,p,f,null)}return;case"dialog":tt("beforetoggle",a),tt("toggle",a),tt("cancel",a),tt("close",a);break;case"iframe":case"object":tt("load",a);break;case"video":case"audio":for(p=0;p<bc.length;p++)tt(bc[p],a);break;case"image":tt("error",a),tt("load",a);break;case"details":tt("toggle",a);break;case"embed":case"source":case"link":tt("error",a),tt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in f)if(f.hasOwnProperty(se)&&(p=f[se],p!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Pt(a,o,se,p,f,null)}return;default:if(eh(o)){for(de in f)f.hasOwnProperty(de)&&(p=f[de],p!==void 0&&Dm(a,o,de,p,f,void 0));return}}for(_ in f)f.hasOwnProperty(_)&&(p=f[_],p!=null&&Pt(a,o,_,p,f,null))}function EE(a,o,f,p){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,S=null,Q=null,_=null,W=null,se=null,de=null;for(ce in f){var pe=f[ce];if(f.hasOwnProperty(ce)&&pe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":W=pe;default:p.hasOwnProperty(ce)||Pt(a,o,ce,null,p,pe)}}for(var oe in p){var ce=p[oe];if(pe=f[oe],p.hasOwnProperty(oe)&&(ce!=null||pe!=null))switch(oe){case"type":S=ce;break;case"name":b=ce;break;case"checked":se=ce;break;case"defaultChecked":de=ce;break;case"value":Q=ce;break;case"defaultValue":_=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,o));break;default:ce!==pe&&Pt(a,o,oe,ce,p,pe)}}Kd(a,Q,_,W,se,de,S,b);return;case"select":ce=Q=_=oe=null;for(S in f)if(W=f[S],f.hasOwnProperty(S)&&W!=null)switch(S){case"value":break;case"multiple":ce=W;default:p.hasOwnProperty(S)||Pt(a,o,S,null,p,W)}for(b in p)if(S=p[b],W=f[b],p.hasOwnProperty(b)&&(S!=null||W!=null))switch(b){case"value":oe=S;break;case"defaultValue":_=S;break;case"multiple":Q=S;default:S!==W&&Pt(a,o,b,S,p,W)}o=_,f=Q,p=ce,oe!=null?ls(a,!!f,oe,!1):!!p!=!!f&&(o!=null?ls(a,!!f,o,!0):ls(a,!!f,f?[]:"",!1));return;case"textarea":ce=oe=null;for(_ in f)if(b=f[_],f.hasOwnProperty(_)&&b!=null&&!p.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Pt(a,o,_,null,p,b)}for(Q in p)if(b=p[Q],S=f[Q],p.hasOwnProperty(Q)&&(b!=null||S!=null))switch(Q){case"value":oe=b;break;case"defaultValue":ce=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==S&&Pt(a,o,Q,b,p,S)}Y6(a,oe,ce);return;case"option":for(var Te in f)if(oe=f[Te],f.hasOwnProperty(Te)&&oe!=null&&!p.hasOwnProperty(Te))switch(Te){case"selected":a.selected=!1;break;default:Pt(a,o,Te,null,p,oe)}for(W in p)if(oe=p[W],ce=f[W],p.hasOwnProperty(W)&&oe!==ce&&(oe!=null||ce!=null))switch(W){case"selected":a.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:Pt(a,o,W,oe,p,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var He in f)oe=f[He],f.hasOwnProperty(He)&&oe!=null&&!p.hasOwnProperty(He)&&Pt(a,o,He,null,p,oe);for(se in p)if(oe=p[se],ce=f[se],p.hasOwnProperty(se)&&oe!==ce&&(oe!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,o));break;default:Pt(a,o,se,oe,p,ce)}return;default:if(eh(o)){for(var Qt in f)oe=f[Qt],f.hasOwnProperty(Qt)&&oe!==void 0&&!p.hasOwnProperty(Qt)&&Dm(a,o,Qt,void 0,p,oe);for(de in p)oe=p[de],ce=f[de],!p.hasOwnProperty(de)||oe===ce||oe===void 0&&ce===void 0||Dm(a,o,de,oe,p,ce);return}}for(var ie in f)oe=f[ie],f.hasOwnProperty(ie)&&oe!=null&&!p.hasOwnProperty(ie)&&Pt(a,o,ie,null,p,oe);for(pe in p)oe=p[pe],ce=f[pe],!p.hasOwnProperty(pe)||oe===ce||oe==null&&ce==null||Pt(a,o,pe,oe,p,ce)}function Ux(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TE(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,f=performance.getEntriesByType("resource"),p=0;p<f.length;p++){var b=f[p],S=b.transferSize,Q=b.initiatorType,_=b.duration;if(S&&_&&Ux(Q)){for(Q=0,_=b.responseEnd,p+=1;p<f.length;p++){var W=f[p],se=W.startTime;if(se>_)break;var de=W.transferSize,pe=W.initiatorType;de&&Ux(pe)&&(W=W.responseEnd,Q+=de*(W<_?1:(_-se)/(W-se)))}if(--p,o+=8*(S+Q)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Hm=null,Xm=null;function r1(a){return a.nodeType===9?a:a.ownerDocument}function Wx(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Kx(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function zm(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Fm=null;function $E(){var a=window.event;return a&&a.type==="popstate"?a===Fm?!1:(Fm=a,!0):(Fm=null,!1)}var Jx=typeof setTimeout=="function"?setTimeout:void 0,jE=typeof clearTimeout=="function"?clearTimeout:void 0,e5=typeof Promise=="function"?Promise:void 0,PE=typeof queueMicrotask=="function"?queueMicrotask:typeof e5<"u"?function(a){return e5.resolve(null).then(a).catch(QE)}:Jx;function QE(a){setTimeout(function(){throw a})}function Ya(a){return a==="head"}function t5(a,o){var f=o,p=0;do{var b=f.nextSibling;if(a.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"||f==="/&"){if(p===0){a.removeChild(b),Ls(o);return}p--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")p++;else if(f==="html")Sc(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,Sc(f);for(var S=f.firstChild;S;){var Q=S.nextSibling,_=S.nodeName;S[ct]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=Q}}else f==="body"&&Sc(a.ownerDocument.body);f=b}while(f);Ls(o)}function n5(a,o){var f=a;a=0;do{var p=f.nextSibling;if(f.nodeType===1?o?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(o?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),p&&p.nodeType===8)if(f=p.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=p}while(f)}function Bm(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var f=o;switch(o=o.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Bm(f),zt(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function ZE(a,o,f,p){for(;a.nodeType===1;){var b=f;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[ct])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var S=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=Dr(a.nextSibling),a===null)break}return null}function NE(a,o,f){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=Dr(a.nextSibling),a===null))return null;return a}function r5(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Dr(a.nextSibling),a===null))return null;return a}function Ym(a){return a.data==="$?"||a.data==="$~"}function Im(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function RE(a,o){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||f.readyState!=="loading")o();else{var p=function(){o(),f.removeEventListener("DOMContentLoaded",p)};f.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function Dr(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var qm=null;function i5(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(o===0)return Dr(a.nextSibling);o--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||o++}a=a.nextSibling}return null}function a5(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(o===0)return a;o--}else f!=="/$"&&f!=="/&"||o++}a=a.previousSibling}return null}function l5(a,o,f){switch(o=r1(f),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Sc(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);zt(a)}var Hr=new Map,s5=new Set;function i1(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ji=q.d;q.d={f:VE,r:LE,D:_E,C:DE,L:HE,m:XE,X:FE,S:zE,M:BE};function VE(){var a=Ji.f(),o=G0();return a||o}function LE(a){var o=Pr(a);o!==null&&o.tag===5&&o.type==="form"?k4(o):Ji.r(a)}var Ns=typeof document>"u"?null:document;function o5(a,o,f){var p=Ns;if(p&&typeof o=="string"&&o){var b=Qr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof f=="string"&&(b+='[crossorigin="'+f+'"]'),s5.has(b)||(s5.add(b),a={rel:a,crossOrigin:f,href:o},p.querySelector(b)===null&&(o=p.createElement("link"),Qn(o,"link",a),un(o),p.head.appendChild(o)))}}function _E(a){Ji.D(a),o5("dns-prefetch",a,null)}function DE(a,o){Ji.C(a,o),o5("preconnect",a,o)}function HE(a,o,f){Ji.L(a,o,f);var p=Ns;if(p&&a&&o){var b='link[rel="preload"][as="'+Qr(o)+'"]';o==="image"&&f&&f.imageSrcSet?(b+='[imagesrcset="'+Qr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(b+='[imagesizes="'+Qr(f.imageSizes)+'"]')):b+='[href="'+Qr(a)+'"]';var S=b;switch(o){case"style":S=Rs(a);break;case"script":S=Vs(a)}Hr.has(S)||(a=O({rel:"preload",href:o==="image"&&f&&f.imageSrcSet?void 0:a,as:o},f),Hr.set(S,a),p.querySelector(b)!==null||o==="style"&&p.querySelector(wc(S))||o==="script"&&p.querySelector(kc(S))||(o=p.createElement("link"),Qn(o,"link",a),un(o),p.head.appendChild(o)))}}function XE(a,o){Ji.m(a,o);var f=Ns;if(f&&a){var p=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Qr(p)+'"][href="'+Qr(a)+'"]',S=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Vs(a)}if(!Hr.has(S)&&(a=O({rel:"modulepreload",href:a},o),Hr.set(S,a),f.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(kc(S)))return}p=f.createElement("link"),Qn(p,"link",a),un(p),f.head.appendChild(p)}}}function zE(a,o,f){Ji.S(a,o,f);var p=Ns;if(p&&a){var b=Ma(p).hoistableStyles,S=Rs(a);o=o||"default";var Q=b.get(S);if(!Q){var _={loading:0,preload:null};if(Q=p.querySelector(wc(S)))_.loading=5;else{a=O({rel:"stylesheet",href:a,"data-precedence":o},f),(f=Hr.get(S))&&Gm(a,f);var W=Q=p.createElement("link");un(W),Qn(W,"link",a),W._p=new Promise(function(se,de){W.onload=se,W.onerror=de}),W.addEventListener("load",function(){_.loading|=1}),W.addEventListener("error",function(){_.loading|=2}),_.loading|=4,a1(Q,o,p)}Q={type:"stylesheet",instance:Q,count:1,state:_},b.set(S,Q)}}}function FE(a,o){Ji.X(a,o);var f=Ns;if(f&&a){var p=Ma(f).hoistableScripts,b=Vs(a),S=p.get(b);S||(S=f.querySelector(kc(b)),S||(a=O({src:a,async:!0},o),(o=Hr.get(b))&&Um(a,o),S=f.createElement("script"),un(S),Qn(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function BE(a,o){Ji.M(a,o);var f=Ns;if(f&&a){var p=Ma(f).hoistableScripts,b=Vs(a),S=p.get(b);S||(S=f.querySelector(kc(b)),S||(a=O({src:a,async:!0,type:"module"},o),(o=Hr.get(b))&&Um(a,o),S=f.createElement("script"),un(S),Qn(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function c5(a,o,f,p){var b=(b=te.current)?i1(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(o=Rs(f.href),f=Ma(b).hoistableStyles,p=f.get(o),p||(p={type:"style",instance:null,count:0,state:null},f.set(o,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=Rs(f.href);var S=Ma(b).hoistableStyles,Q=S.get(a);if(Q||(b=b.ownerDocument||b,Q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,Q),(S=b.querySelector(wc(a)))&&!S._p&&(Q.instance=S,Q.state.loading=5),Hr.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Hr.set(a,f),S||YE(b,a,f,Q.state))),o&&p===null)throw Error(r(528,""));return Q}if(o&&p!==null)throw Error(r(529,""));return null;case"script":return o=f.async,f=f.src,typeof f=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Vs(f),f=Ma(b).hoistableScripts,p=f.get(o),p||(p={type:"script",instance:null,count:0,state:null},f.set(o,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Rs(a){return'href="'+Qr(a)+'"'}function wc(a){return'link[rel="stylesheet"]['+a+"]"}function u5(a){return O({},a,{"data-precedence":a.precedence,precedence:null})}function YE(a,o,f,p){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?p.loading=1:(o=a.createElement("link"),p.preload=o,o.addEventListener("load",function(){return p.loading|=1}),o.addEventListener("error",function(){return p.loading|=2}),Qn(o,"link",f),un(o),a.head.appendChild(o))}function Vs(a){return'[src="'+Qr(a)+'"]'}function kc(a){return"script[async]"+a}function f5(a,o,f){if(o.count++,o.instance===null)switch(o.type){case"style":var p=a.querySelector('style[data-href~="'+Qr(f.href)+'"]');if(p)return o.instance=p,un(p),p;var b=O({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),un(p),Qn(p,"style",b),a1(p,f.precedence,a),o.instance=p;case"stylesheet":b=Rs(f.href);var S=a.querySelector(wc(b));if(S)return o.state.loading|=4,o.instance=S,un(S),S;p=u5(f),(b=Hr.get(b))&&Gm(p,b),S=(a.ownerDocument||a).createElement("link"),un(S);var Q=S;return Q._p=new Promise(function(_,W){Q.onload=_,Q.onerror=W}),Qn(S,"link",p),o.state.loading|=4,a1(S,f.precedence,a),o.instance=S;case"script":return S=Vs(f.src),(b=a.querySelector(kc(S)))?(o.instance=b,un(b),b):(p=f,(b=Hr.get(S))&&(p=O({},f),Um(p,b)),a=a.ownerDocument||a,b=a.createElement("script"),un(b),Qn(b,"link",p),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(p=o.instance,o.state.loading|=4,a1(p,f.precedence,a));return o.instance}function a1(a,o,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,S=b,Q=0;Q<p.length;Q++){var _=p[Q];if(_.dataset.precedence===o)S=_;else if(S!==b)break}S?S.parentNode.insertBefore(a,S.nextSibling):(o=f.nodeType===9?f.head:f,o.insertBefore(a,o.firstChild))}function Gm(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function Um(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var l1=null;function d5(a,o,f){if(l1===null){var p=new Map,b=l1=new Map;b.set(f,p)}else b=l1,p=b.get(f),p||(p=new Map,b.set(f,p));if(p.has(a))return p;for(p.set(a,null),f=f.getElementsByTagName(a),b=0;b<f.length;b++){var S=f[b];if(!(S[ct]||S[tn]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var Q=S.getAttribute(o)||"";Q=a+Q;var _=p.get(Q);_?_.push(S):p.set(Q,[S])}}return p}function h5(a,o,f){a=a.ownerDocument||a,a.head.insertBefore(f,o==="title"?a.querySelector("head > title"):null)}function IE(a,o,f){if(f===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function m5(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function qE(a,o,f,p){if(f.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var b=Rs(p.href),S=o.querySelector(wc(b));if(S){o=S._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=s1.bind(a),o.then(a,a)),f.state.loading|=4,f.instance=S,un(S);return}S=o.ownerDocument||o,p=u5(p),(b=Hr.get(b))&&Gm(p,b),S=S.createElement("link"),un(S);var Q=S;Q._p=new Promise(function(_,W){Q.onload=_,Q.onerror=W}),Qn(S,"link",p),f.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,o),(o=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=s1.bind(a),o.addEventListener("load",f),o.addEventListener("error",f))}}var Wm=0;function GE(a,o){return a.stylesheets&&a.count===0&&c1(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var p=setTimeout(function(){if(a.stylesheets&&c1(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+o);0<a.imgBytes&&Wm===0&&(Wm=62500*TE());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&c1(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Wm?50:800)+o);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function s1(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)c1(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var o1=null;function c1(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,o1=new Map,o.forEach(UE,a),o1=null,s1.call(a))}function UE(a,o){if(!(o.state.loading&4)){var f=o1.get(a);if(f)var p=f.get(null);else{f=new Map,o1.set(a,f);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<b.length;S++){var Q=b[S];(Q.nodeName==="LINK"||Q.getAttribute("media")!=="not all")&&(f.set(Q.dataset.precedence,Q),p=Q)}p&&f.set(null,p)}b=o.instance,Q=b.getAttribute("data-precedence"),S=f.get(Q)||p,S===p&&f.set(null,b),f.set(Q,b),this.count++,p=s1.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),S?S.parentNode.insertBefore(b,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var Ac={$$typeof:E,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function WE(a,o,f,p,b,S,Q,_,W){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Zi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zi(0),this.hiddenUpdates=Zi(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=Q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function p5(a,o,f,p,b,S,Q,_,W,se,de,pe){return a=new WE(a,o,f,Q,W,se,de,pe,_),o=1,S===!0&&(o|=24),S=gr(3,null,null,o),a.current=S,S.stateNode=a,o=$h(),o.refCount++,a.pooledCache=o,o.refCount++,S.memoizedState={element:p,isDehydrated:f,cache:o},Zh(S),a}function g5(a){return a?(a=ms,a):ms}function O5(a,o,f,p,b,S){b=g5(b),p.context===null?p.context=b:p.pendingContext=b,p=Na(o),p.payload={element:f},S=S===void 0?null:S,S!==null&&(p.callback=S),f=Ra(a,p,o),f!==null&&(ar(f,a,o),rc(f,a,o))}function x5(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<o?f:o}}function Km(a,o){x5(a,o),(a=a.alternate)&&x5(a,o)}function y5(a){if(a.tag===13||a.tag===31){var o=Al(a,67108864);o!==null&&ar(o,a,67108864),Km(a,67108864)}}function b5(a){if(a.tag===13||a.tag===31){var o=vr();o=rt(o);var f=Al(a,o);f!==null&&ar(f,a,o),Km(a,o)}}var u1=!0;function KE(a,o,f,p){var b=H.T;H.T=null;var S=q.p;try{q.p=2,Jm(a,o,f,p)}finally{q.p=S,H.T=b}}function JE(a,o,f,p){var b=H.T;H.T=null;var S=q.p;try{q.p=8,Jm(a,o,f,p)}finally{q.p=S,H.T=b}}function Jm(a,o,f,p){if(u1){var b=ep(p);if(b===null)_m(a,o,p,f1,f),S5(a,p);else if(tT(b,a,o,f,p))p.stopPropagation();else if(S5(a,p),o&4&&-1<eT.indexOf(a)){for(;b!==null;){var S=Pr(b);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var Q=Tt(S.pendingLanes);if(Q!==0){var _=S;for(_.pendingLanes|=2,_.entangledLanes|=2;Q;){var W=1<<31-ze(Q);_.entanglements[1]|=W,Q&=~W}gi(S),(kt&6)===0&&(I0=be()+500,yc(0))}}break;case 31:case 13:_=Al(S,2),_!==null&&ar(_,S,2),G0(),Km(S,2)}if(S=ep(p),S===null&&_m(a,o,p,f1,f),S===b)break;b=S}b!==null&&p.stopPropagation()}else _m(a,o,p,null,f)}}function ep(a){return a=nh(a),tp(a)}var f1=null;function tp(a){if(f1=null,a=Tn(a),a!==null){var o=l(a);if(o===null)a=null;else{var f=o.tag;if(f===13){if(a=s(o),a!==null)return a;a=null}else if(f===31){if(a=c(o),a!==null)return a;a=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return f1=a,null}function v5(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(dt()){case Ue:return 2;case bt:return 8;case Re:case on:return 32;case Rt:return 268435456;default:return 32}default:return 32}}var np=!1,Ia=null,qa=null,Ga=null,Mc=new Map,Cc=new Map,Ua=[],eT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function S5(a,o){switch(a){case"focusin":case"focusout":Ia=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":Mc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cc.delete(o.pointerId)}}function Ec(a,o,f,p,b,S){return a===null||a.nativeEvent!==S?(a={blockedOn:o,domEventName:f,eventSystemFlags:p,nativeEvent:S,targetContainers:[b]},o!==null&&(o=Pr(o),o!==null&&y5(o)),a):(a.eventSystemFlags|=p,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function tT(a,o,f,p,b){switch(o){case"focusin":return Ia=Ec(Ia,a,o,f,p,b),!0;case"dragenter":return qa=Ec(qa,a,o,f,p,b),!0;case"mouseover":return Ga=Ec(Ga,a,o,f,p,b),!0;case"pointerover":var S=b.pointerId;return Mc.set(S,Ec(Mc.get(S)||null,a,o,f,p,b)),!0;case"gotpointercapture":return S=b.pointerId,Cc.set(S,Ec(Cc.get(S)||null,a,o,f,p,b)),!0}return!1}function w5(a){var o=Tn(a.target);if(o!==null){var f=l(o);if(f!==null){if(o=f.tag,o===13){if(o=s(f),o!==null){a.blockedOn=o,vl(a.priority,function(){b5(f)});return}}else if(o===31){if(o=c(f),o!==null){a.blockedOn=o,vl(a.priority,function(){b5(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function d1(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var f=ep(a.nativeEvent);if(f===null){f=a.nativeEvent;var p=new f.constructor(f.type,f);th=p,f.target.dispatchEvent(p),th=null}else return o=Pr(f),o!==null&&y5(o),a.blockedOn=f,!1;o.shift()}return!0}function k5(a,o,f){d1(a)&&f.delete(o)}function nT(){np=!1,Ia!==null&&d1(Ia)&&(Ia=null),qa!==null&&d1(qa)&&(qa=null),Ga!==null&&d1(Ga)&&(Ga=null),Mc.forEach(k5),Cc.forEach(k5)}function h1(a,o){a.blockedOn===o&&(a.blockedOn=null,np||(np=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,nT)))}var m1=null;function A5(a){m1!==a&&(m1=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){m1===a&&(m1=null);for(var o=0;o<a.length;o+=3){var f=a[o],p=a[o+1],b=a[o+2];if(typeof p!="function"){if(tp(p||f)===null)continue;break}var S=Pr(f);S!==null&&(a.splice(o,3),o-=3,em(S,{pending:!0,data:b,method:f.method,action:p},p,b))}}))}function Ls(a){function o(W){return h1(W,a)}Ia!==null&&h1(Ia,a),qa!==null&&h1(qa,a),Ga!==null&&h1(Ga,a),Mc.forEach(o),Cc.forEach(o);for(var f=0;f<Ua.length;f++){var p=Ua[f];p.blockedOn===a&&(p.blockedOn=null)}for(;0<Ua.length&&(f=Ua[0],f.blockedOn===null);)w5(f),f.blockedOn===null&&Ua.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var b=f[p],S=f[p+1],Q=b[vn]||null;if(typeof S=="function")Q||A5(f);else if(Q){var _=null;if(S&&S.hasAttribute("formAction")){if(b=S,Q=S[vn]||null)_=Q.formAction;else if(tp(b)!==null)continue}else _=Q.action;typeof _=="function"?f[p+1]=_:(f.splice(p,3),p-=3),A5(f)}}}function M5(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(Q){return b=Q})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(f,100),function(){p=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function rp(a){this._internalRoot=a}p1.prototype.render=rp.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var f=o.current,p=vr();O5(f,p,a,o,null,null)},p1.prototype.unmount=rp.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;O5(a.current,2,null,a,null,null),G0(),o[Ur]=null}};function p1(a){this._internalRoot=a}p1.prototype.unstable_scheduleHydration=function(a){if(a){var o=mr();a={blockedOn:null,target:a,priority:o};for(var f=0;f<Ua.length&&o!==0&&o<Ua[f].priority;f++);Ua.splice(f,0,a),f===0&&w5(a)}};var C5=e.version;if(C5!=="19.2.6")throw Error(r(527,C5,"19.2.6"));q.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(o),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var rT={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var g1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!g1.isDisabled&&g1.supportsFiber)try{Mt=g1.inject(rT),ot=g1}catch{}}return $c.createRoot=function(a,o){if(!i(a))throw Error(r(299));var f=!1,p="",b=Z4,S=N4,Q=R4;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(Q=o.onRecoverableError)),o=p5(a,1,!1,null,null,f,p,null,b,S,Q,M5),a[Ur]=o.current,Lm(a),new rp(o)},$c.hydrateRoot=function(a,o,f){if(!i(a))throw Error(r(299));var p=!1,b="",S=Z4,Q=N4,_=R4,W=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(Q=f.onCaughtError),f.onRecoverableError!==void 0&&(_=f.onRecoverableError),f.formState!==void 0&&(W=f.formState)),o=p5(a,1,!0,o,f??null,p,b,W,S,Q,_,M5),o.context=g5(null),f=o.current,p=vr(),p=rt(p),b=Na(p),b.callback=null,Ra(f,b,p),f=p,o.current.lanes=f,En(o,f),gi(o),a[Ur]=o.current,Lm(a),new p1(o)},$c.version="19.2.6",$c}var L5;function pT(){if(L5)return lp.exports;L5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),lp.exports=mT(),lp.exports}var gT=pT();const _5="hyperframes-studio:anonymousId",OT="hyperframes-studio:telemetryDisabled",ES="hyperframes-studio:telemetryNoticeShown";function wd(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function xT(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`anon-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function yT(){const t=wd();if(!t)return"anonymous";const e=t.getItem(_5);if(e)return e;const n=xT();try{t.setItem(_5,n)}catch{}return n}function bT(){var t;return((t=wd())==null?void 0:t.getItem(OT))==="1"}function vT(){var t;return((t=wd())==null?void 0:t.getItem(ES))==="1"}function ST(){var t;try{(t=wd())==null||t.setItem(ES,"1")}catch{}}const TS="hyperframes-studio:sessionStartFired";function $S(){try{return typeof sessionStorage>"u"?null:sessionStorage}catch{return null}}function wT(){var t;return((t=$S())==null?void 0:t.getItem(TS))==="1"}function kT(){var t;try{(t=$S())==null||t.setItem(TS,"1")}catch{}}const AT={user_agent:"",language:"",screen_width:0,screen_height:0,device_pixel_ratio:0,timezone_offset_minutes:0,is_mobile:!1,studio_version:"dev"};let _s=null;function MT(){if(_s)return _s;if(typeof navigator>"u"||typeof window>"u")return _s=AT,_s;const t=navigator.userAgent,e=window.screen;return _s={user_agent:t,language:navigator.language,screen_width:e.width,screen_height:e.height,device_pixel_ratio:window.devicePixelRatio,timezone_offset_minutes:new Date().getTimezoneOffset(),is_mobile:/Android|iPhone|iPad/i.test(t),studio_version:"0.6.86"},_s}const jS="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",CT="https://us.i.posthog.com",ET=1e3;let Of=[],up=null,x1=null;function TT(){return typeof navigator<"u"&&navigator.doNotTrack==="1"}function $T(){return jS.startsWith("phc_")}function jT(){try{return!1}catch{return!1}}function PT(){try{return!1}catch{return!1}}function QT(){return x1!==null||(x1=$T()&&!jT()&&!PT()&&!bT()&&!TT()),x1}function S8(t,e={}){if(!QT())return;const n=MT();Of.push({event:t,properties:{...e,...n},timestamp:new Date().toISOString()}),up===null&&(up=setTimeout(()=>{up=null,_2()},ET)),NT()}function _2(){if(Of.length===0)return;const t=yT(),e=Of.map(n=>({event:n.event,properties:{...n.properties,$ip:null},distinct_id:t,timestamp:n.timestamp}));Of=[],ZT(`${CT}/batch/`,JSON.stringify({api_key:jS,batch:e}))}function ZT(t,e){try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e,keepalive:!0}).catch(()=>{});return}catch{}try{navigator.sendBeacon(t,new Blob([e],{type:"application/json"}))}catch{}}function NT(){vT()||(ST(),console.info("%c[HyperFrames]%c Anonymous studio usage analytics enabled. Disable: localStorage.setItem('hyperframes-studio:telemetryDisabled','1') (then reload).","color:#7c3aed;font-weight:bold","color:inherit"))}typeof window<"u"&&(window.addEventListener("pagehide",()=>_2(),{capture:!0}),window.addEventListener("visibilitychange",()=>{typeof document<"u"&&document.visibilityState==="hidden"&&_2()}));function RT(t){S8("studio_session_start",{has_project:t.has_project})}function VT(t){S8("studio_render_start",{fps:t.fps,quality:t.quality,format:t.format,resolution:t.resolution,composition:t.composition})}function LT(){var t,e;try{const n=navigator,i=[`ua=${((t=n.userAgentData)==null?void 0:t.platform)??navigator.platform??"unknown"}`,`screen=${screen.width}x${screen.height}@${devicePixelRatio}x`,`lang=${navigator.language}`];return n.deviceMemory&&i.push(`mem=${n.deviceMemory}GB`),(e=n.connection)!=null&&e.effectiveType&&i.push(`net=${n.connection.effectiveType}`),navigator.hardwareConcurrency&&i.push(`cpu=${navigator.hardwareConcurrency}cores`),i.join(" ")}catch{return""}}function _T(t){S8("survey sent",{$survey_id:"studio_experience",$survey_response:t.rating,...t.comment?{$survey_response_2:t.comment}:{},doctor_summary:LT(),source:"studio"})}function DT(t){const[e,n]=d.useState([]),r=d.useRef(null),i=d.useRef(null),l=d.useCallback(async()=>{if(t)try{const h=await fetch(`/api/projects/${t}/renders`);if(!h.ok)return;const g=await h.json();Array.isArray(g.renders)&&n(O=>{const x=new Set(O.map(v=>v.id)),y=g.renders.filter(v=>!x.has(v.id)).map(v=>({id:v.id,status:v.status==="failed"?"failed":"complete",progress:100,filename:v.filename,createdAt:v.createdAt,durationMs:v.durationMs}));return[...O,...y]})}catch{}},[t]);d.useEffect(()=>{l()},[l]);const s=d.useCallback(async(h={})=>{if(!t)return;const g=h.fps??30,O=h.quality??"standard",x=h.format??"mp4",y=h.resolution,v=h.composition;VT({fps:g,quality:O,format:x,resolution:y,composition:v});const w=Date.now(),A={fps:g,quality:O,format:x};y&&y!=="auto"&&(A.resolution=y),v&&(A.composition=v);let k;try{k=await fetch(`/api/projects/${t}/render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)})}catch{const T={id:crypto.randomUUID(),status:"failed",progress:0,error:"Could not reach render server. Use `hyperframes render` from the CLI instead.",filename:"Export failed",createdAt:w};n(N=>[...N,T]);return}if(!k.ok){const T={id:crypto.randomUUID(),status:"failed",progress:0,error:`Server error (${k.status}). Check the terminal for details.`,filename:"Export failed",createdAt:w};n(N=>[...N,T]);return}const{jobId:M}=await k.json(),$={mp4:".mp4",webm:".webm",mov:".mov"}[x]??".mp4",C={id:M,status:"rendering",progress:0,filename:`${M}${$}`,createdAt:w};n(T=>[...T,C]),i.current=M;const j=new EventSource(`/api/render/${M}/progress`);return r.current=j,j.addEventListener("progress",T=>{try{const N=JSON.parse(T.data);n(R=>R.map(D=>D.id===M?{...D,progress:N.progress??D.progress,stage:N.stage??N.message??D.stage,status:N.status==="complete"?"complete":N.status==="failed"?"failed":D.status,durationMs:N.status==="complete"?Date.now()-w:void 0,error:N.error??D.error}:D)),(N.status==="complete"||N.status==="failed")&&(j.close(),i.current=null)}catch{}}),j.onerror=()=>{j.close(),n(T=>T.map(N=>N.id===M&&N.status==="rendering"?{...N,status:"failed",error:"Connection lost. Is the render server running?"}:N)),i.current=null},M},[t]),c=d.useCallback(async h=>{try{await fetch(`/api/render/${h}`,{method:"DELETE"})}catch{}n(g=>g.filter(O=>O.id!==h))},[]),u=d.useCallback(()=>{n(h=>h.filter(g=>g.status==="rendering"))},[]);return d.useEffect(()=>()=>{var h;(h=r.current)==null||h.close(),r.current=null},[t]),{jobs:e,startRender:s,deleteRender:c,clearCompleted:u,isRendering:e.some(h=>h.status==="rendering")}}const HT="modulepreload",XT=function(t){return"/"+t},D5={},PS=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(O=>({status:"fulfilled",value:O}),O=>({status:"rejected",reason:O}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=s(n.map(h=>{if(h=XT(h),h in D5)return;D5[h]=!0;const g=h.endsWith(".css"),O=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${O}`))return;const x=document.createElement("link");if(x.rel=g?"stylesheet":HT,g||(x.as="script"),x.crossOrigin="",x.href=h,u&&x.setAttribute("nonce",u),document.head.appendChild(x),g)return new Promise((y,v)=>{x.addEventListener("load",y),x.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(s){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=s,window.dispatchEvent(c),!c.defaultPrevented)throw s}return i.then(s=>{for(const c of s||[])c.status==="rejected"&&l(c.reason);return e().catch(l)})};function zT(t){if(typeof t!="object"||t===null)return!0;const e=t;return e.isLoaded===!0||typeof e.totalFrames=="number"&&e.totalFrames>0}function Xt(t){d.useEffect(t,[])}const QS={primary:["bg-white text-neutral-950 font-medium","shadow-btn-primary","hover:bg-neutral-200","active:scale-[0.97]"].join(" "),secondary:["bg-transparent text-neutral-300 font-medium","border border-border","hover:bg-surface-hover hover:text-white hover:border-border-strong","active:scale-[0.98]"].join(" "),danger:["bg-accent-red text-white font-medium","hover:bg-red-600","active:scale-[0.97]"].join(" "),ghost:["bg-transparent text-neutral-400","hover:bg-surface-hover hover:text-white","active:scale-[0.98]"].join(" ")},FT={sm:"h-7 px-2.5 text-xs gap-1.5 rounded-button",md:"h-8 px-3 text-sm gap-1.5 rounded-button",lg:"h-9 px-4 text-base gap-2 rounded-button"},BT=d.forwardRef(({variant:t="secondary",size:e="md",loading:n,icon:r,children:i,className:l="",disabled:s,...c},u)=>m.jsxs("button",{ref:u,disabled:s||n,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:pointer-events-none","select-none cursor-pointer",QS[t],FT[e],l].join(" "),...c,children:[n?m.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",children:[m.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),m.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):r?m.jsx("span",{className:"flex-shrink-0",children:r}):null,i&&m.jsx("span",{children:i})]}));BT.displayName="Button";const YT={sm:"min-w-7 min-h-7 rounded-button",md:"min-w-8 min-h-8 rounded-button",lg:"min-w-9 min-h-9 rounded-button"},IT=d.forwardRef(({icon:t,size:e="md",variant:n="ghost",className:r="",...i},l)=>m.jsx("button",{ref:l,className:["inline-flex items-center justify-center","transition-all duration-press ease-standard","disabled:opacity-40 disabled:pointer-events-none","select-none cursor-pointer",QS[n],YT[e],r].join(" "),...i,children:t}));IT.displayName="IconButton";function H5({title:t,detail:e,mono:n,size:r=64,progress:i}){const l=typeof i=="number"&&Number.isFinite(i)?Math.min(1,Math.max(0,i)):void 0,s=Math.round(r*1.16);return m.jsxs("div",{className:"hf-loader",draggable:!1,children:[m.jsx("div",{className:"hf-loader-mark-frame",style:{width:s,height:s},draggable:!1,children:m.jsxs("svg",{className:"hf-loader-mark",width:r,height:r,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[m.jsx("g",{className:"hf-loader-mark__mark",transform:"translate(50 50)",children:m.jsx("g",{className:"hf-loader-mark__core",transform:"scale(1)",opacity:".92",children:m.jsxs("g",{transform:"translate(-50 -50)",children:[m.jsx("path",{d:"M10.1851 57.8021L33.1145 73.8313C36.2202 75.9978 41.5173 73.5433 42.4816 69.4984L51.7611 30.4271C52.7253 26.3822 48.5802 23.9277 44.4602 26.0942L13.917 42.1235C6.96677 45.7676 4.97564 54.1579 10.1851 57.8021Z",fill:"url(#hf-loader-grad-left)"}),m.jsx("path",{d:"M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z",fill:"url(#hf-loader-grad-right)"})]})})}),m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"hf-loader-grad-left",x1:"48.5676",y1:"25",x2:"44.7804",y2:"71.9384",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]}),m.jsxs("linearGradient",{id:"hf-loader-grad-right",x1:"54.8282",y1:"73.8392",x2:"72.0989",y2:"32.8932",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]})]})]})}),m.jsx("div",{className:"hf-loader-title",children:t}),e&&m.jsx("div",{className:"hf-loader-detail",children:e}),l!==void 0&&m.jsx("div",{className:"hf-loader-progress","aria-hidden":"true",children:m.jsx("div",{className:"hf-loader-progress__fill",style:{transform:`scaleX(${l})`}})}),n&&m.jsx("div",{className:"hf-loader-mono",children:n})]})}var w8=CS();function Yt({label:t,children:e,delay:n=400,side:r="top"}){const[i,l]=d.useState(!1),[s,c]=d.useState({x:0,y:0}),u=d.useRef(null),h=d.useRef(null),g=d.useCallback(()=>{u.current=setTimeout(()=>{const x=h.current;if(!x)return;const v=(x.firstElementChild??x).getBoundingClientRect();v.width===0&&v.height===0||(c({x:v.left+v.width/2,y:r==="top"?v.top-6:v.bottom+6}),l(!0))},n)},[n,r]),O=d.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),l(!1)},[]);return m.jsxs(m.Fragment,{children:[m.jsx("span",{ref:h,onPointerEnter:g,onPointerLeave:O,className:"contents",children:e}),i&&w8.createPortal(m.jsx("div",{className:"fixed z-[200] pointer-events-none",style:{left:s.x,top:s.y,transform:r==="top"?"translate(-50%, -100%)":"translate(-50%, 0)"},children:m.jsx("div",{className:"px-2 py-1 rounded-md bg-neutral-800 border border-neutral-700/50 text-[10px] font-medium text-neutral-200 whitespace-nowrap shadow-lg",children:t})}),document.body)]})}const qT=3,GT=3;function X5(t){return typeof t=="object"&&t!==null}function UT(t){if(!(t instanceof CustomEvent))return null;const e=t.detail;if(!X5(e))return null;const n=e.state;return X5(n)?n.loading===!0&&n.ready!==!0:null}const WT=400;function KT(t){const e=t.shadowRoot;if(!e)return;const n=e.querySelector(".hfp-container"),r=e.querySelector(".hfp-iframe");n==null||n.style.setProperty("pointer-events","auto"),r==null||r.style.setProperty("pointer-events","auto")}function JT(t){const e=t.tagName.toLowerCase();return e==="video"||e==="audio"}function z5(t,e){try{const n=t.contentWindow,r=t.contentDocument;if(!n||!r)return e;for(const l of r.querySelectorAll("video, audio"))if(JT(l)&&!l.error&&l.networkState!==GT&&l.readyState<qT)return!0;const i=n.__hfLottie;if(i!=null&&i.length){for(const l of i)if(!zT(l))return!0}return!1}catch{return e}}const D2=d.forwardRef(({projectId:t,directUrl:e,onLoad:n,onCompositionLoadingChange:r,portrait:i,style:l,suppressLoadingOverlay:s},c)=>{const u=d.useRef(null),h=d.useRef(0),g=d.useRef(null),O=d.useRef(null),[x,y]=d.useState(!1),[v,w]=d.useState(!1),[A,k]=d.useState(!1),[M,E]=d.useState(!1),[$,C]=d.useState(!0),[j,T]=d.useState(!0);d.useEffect(()=>{if(!$){T(!0);return}const D=setTimeout(()=>T(!1),WT);return()=>clearTimeout(D)},[$]),Xt(()=>{const D=u.current;if(!D)return;let V=!1,z;return PS(()=>import("./hyperframes-player-0esDKGRk.js"),[]).then(()=>{if(V)return;const I=document.createElement("hyperframes-player"),U=e||`/api/projects/${t}/preview`;if(I.setAttribute("shader-capture-scale","1"),I.setAttribute("shader-loading","player"),I.setAttribute("src",U),I.setAttribute("width",String(i?1080:1920)),I.setAttribute("height",String(i?1920:1080)),I.style.width="100%",I.style.height="100%",I.style.display="block",I.style.background="transparent",D.appendChild(I),I.shadowRoot){const P=document.createElement("style");P.textContent=".hfp-container{overflow:visible}.hfp-iframe{box-shadow:0 0 0 1px rgba(255,255,255,0.08),0 4px 32px rgba(0,0,0,.7)}",I.shadowRoot.appendChild(P)}KT(I);const K=I.iframeElement;typeof c=="function"?c(K):c&&(c.current=K);const H=P=>P.stopImmediatePropagation();I.addEventListener("click",H,{capture:!0});const q=P=>{const Z=UT(P);Z!==null&&E(Z)};I.addEventListener("shadertransitionstate",q);const X=()=>{C(!1)},G=()=>{C(!1)};I.addEventListener("ready",X),I.addEventListener("error",G);const F=()=>{if(h.current++,E(!1),C(!0),h.current>1){D.classList.remove("preview-revealing"),D.offsetWidth,D.classList.add("preview-revealing");const L=()=>D.classList.remove("preview-revealing");D.addEventListener("animationend",L,{once:!0})}n(),g.current&&clearInterval(g.current);let Z=h.current>1?!1:z5(K,!1);if(Z){y(!0);let L=0;g.current=setInterval(()=>{L+=1,Z=z5(K,Z),(!Z||L>100)&&(g.current&&clearInterval(g.current),g.current=null,y(!1),Z&&console.debug("[Player] Asset-loading overlay timed out after 10s; hiding anyway. Check network or asset integrity."))},100)}else y(!1)};K.addEventListener("load",F),z=()=>{if(K.removeEventListener("load",F),I.removeEventListener("click",H,{capture:!0}),I.removeEventListener("shadertransitionstate",q),I.removeEventListener("ready",X),I.removeEventListener("error",G),g.current&&clearInterval(g.current),g.current=null,D.removeChild(I),typeof c!="function"){if(c){const P=c;P.current===K&&(P.current=null)}}}}),()=>{V=!0,z==null||z()}}),d.useEffect(()=>{if(O.current&&(clearTimeout(O.current),O.current=null),x){w(!0),k(!1);return}return k(!0),O.current=setTimeout(()=>{w(!1),k(!1),O.current=null},240),()=>{O.current&&(clearTimeout(O.current),O.current=null)}},[x]);const N=!s&&!j&&$,R=v&&!M&&!N;return d.useEffect(()=>{r==null||r(N||R)},[r,N,R]),m.jsxs("div",{className:"relative w-full h-full max-w-full max-h-full overflow-hidden flex items-center justify-center",style:l,children:[m.jsx("div",{ref:u,className:"w-full h-full"}),N&&m.jsx("div",{className:"absolute inset-0 bg-black flex items-center justify-center z-30 select-none","data-hyperframes-ignore":"","data-testid":"composition-loading-overlay",draggable:!1,onDragStart:D=>D.preventDefault(),onMouseDown:D=>D.preventDefault(),onPointerDown:D=>D.preventDefault(),children:m.jsx(H5,{title:"Loading composition",detail:"Preparing the Studio preview.",size:56})}),R&&m.jsx("div",{className:"absolute inset-0 bg-black flex items-center justify-center z-20 select-none","data-hyperframes-ignore":"",draggable:!1,style:{opacity:A?0:1,pointerEvents:A?"none":"auto",transition:"opacity 240ms ease-out"},onDragStart:D=>D.preventDefault(),onMouseDown:D=>D.preventDefault(),onPointerDown:D=>D.preventDefault(),children:m.jsx(H5,{title:"Preparing preview assets",detail:"Waiting for media and motion assets before playback starts.",size:56})})]})});D2.displayName="Player";const Zu=30;function yn(t){if(!Number.isFinite(t)||t<0)return"0:00";const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n.toString().padStart(2,"0")}`}function H2(t,e=Zu){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:Math.round(t*e)}function ZS(t,e=Zu){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<=0?0:t/e}function X2(t,e,n=Zu){const r=H2(t,n),i=Math.max(0,r+e);return ZS(i,n)}function NS(t,e,n=Zu){const r=H2(t,n),i=H2(e,n);return`${r}f / ${i}f`}function RS(t){return Number.isFinite(t)&&t>0}function F5(t,e){const n=Math.max(0,Number.isFinite(e)?e:0),r=Math.max(0,Number.isFinite(t)?t:0);return n>0?Math.min(r,n):r}function fp(t){if(!t)return 0;try{const e=Number(t.getDuration());return RS(e)?e:0}catch{return 0}}function e$(t){return{now:()=>t.performance.now(),requestAnimationFrame:e=>t.requestAnimationFrame(e),cancelAnimationFrame:e=>t.cancelAnimationFrame(e)}}function t$(t,e,n,r=()=>1){var y;const i=Math.max(0,Number.isFinite(e)?e:0);let l=F5(Number(((y=t.getTime)==null?void 0:y.call(t))??0),i),s=!1,c=0,u=l,h=n.now();const g=v=>{var w;if(l=F5(v,i),typeof t.renderSeek=="function"){t.renderSeek(l);return}(w=t.seek)==null||w.call(t,l)},O=()=>{c&&(n.cancelAnimationFrame(c),c=0)},x=v=>{if(!s)return;const w=Math.max(.1,Number(r())||1),A=(v-h)/1e3*w;if(g(u+A),l>=i){s=!1,c=0;return}c=n.requestAnimationFrame(x)};return{play:()=>{s||i<=0||(l>=i&&g(0),s=!0,u=l,h=n.now(),O(),c=n.requestAnimationFrame(x))},pause:()=>{s=!1,O()},seek:(v,w)=>{if(g(v),w!=null&&w.keepPlaying){s&&(u=l,h=n.now());return}s=!1,O()},getTime:()=>l,getDuration:()=>i,isPlaying:()=>s}}function B5(t){return{play:()=>t.play(),pause:()=>t.pause(),seek:(e,n)=>{const r=!(n!=null&&n.keepPlaying);r&&t.pause(),t.seek(e),r&&t.pause()},getTime:()=>t.time(),getDuration:()=>t.duration(),isPlaying:()=>t.isActive()}}function Y5(t){if(!t)return 0;const e=Number.parseFloat(t.getAttribute("data-duration")??"")||Number.parseFloat(t.getAttribute("data-hf-authored-duration")??"");return RS(e)?e:0}function n$(t){if(!t)return 0;const e=Y5(t.querySelector("[data-composition-id]"));if(e>0)return e;let n=0;for(const r of Array.from(t.querySelectorAll("[data-start]"))){const i=Number.parseFloat(r.getAttribute("data-start")??""),l=Y5(r);!Number.isFinite(i)||i<0||l<=0||(n=Math.max(n,i+l))}return n}function z2(t){var n;const e=((n=t.ownerDocument.defaultView)==null?void 0:n.HTMLElement)??globalThis.HTMLElement;return typeof e<"u"&&t instanceof e}function VS(t){const e=t.ownerDocument.defaultView??window,n=e.HTMLMediaElement??globalThis.HTMLMediaElement,r=e.HTMLImageElement??globalThis.HTMLImageElement;if(t instanceof n||t instanceof r)return t;const i=t.querySelector("video, audio, img");return i instanceof n||i instanceof r?i:null}function LS(t,e){const n=e.getAttribute("data-playback-start")?"playback-start":e.getAttribute("data-media-start")?"media-start":void 0,r=e.getAttribute("data-playback-start")??e.getAttribute("data-media-start");if(r!=null){const O=parseFloat(r);Number.isFinite(O)&&(t.playbackStart=O)}n&&(t.playbackStartAttr=n);const i=VS(e);if(!i)return;t.tag=i.tagName.toLowerCase();const l=i.getAttribute("src");l&&(t.src=l);const c=(i.ownerDocument.defaultView??window).HTMLMediaElement??globalThis.HTMLMediaElement;if(typeof c>"u"||!(i instanceof c))return;const u=e.getAttribute("data-source-duration")??i.getAttribute("data-source-duration"),h=u?parseFloat(u):i.duration;Number.isFinite(h)&&h>0&&(t.sourceDuration=h);const g=i.defaultPlaybackRate;Number.isFinite(g)&&g>0&&(t.playbackRate=g)}function Nu(t){var i,l,s;const e=(i=t.label)==null?void 0:i.trim();if(e)return e;const n=(l=t.id)==null?void 0:l.trim();if(n)return n;const r=(s=t.tag)==null?void 0:s.trim().toLowerCase();return r?`${r} clip`:"Timeline clip"}const r$=new Set(["base","link","meta","noscript","script","style","template"]);function I5(t){return t.trim().replace(/[_-]+/g," ").replace(/\s+/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function i$(t){const e=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label");if(e!=null&&e.trim())return e.trim();if(t.id.trim())return I5(t.id);const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];return r?I5(r):Nu({tag:t.tagName})}function Ul(t){if(z2(t)&&t.id)return`#${t.id}`;const e=t.getAttribute("data-composition-id");if(e)return`[data-composition-id="${e}"]`;if(z2(t)){const n=t.className.split(/\s+/).filter(Boolean),r=n.find(i=>i!=="clip")??n[0];if(r)return`.${r}`}}function au(t){var n;const e=(n=t.parentElement)==null?void 0:n.closest("[data-composition-id]");return(e==null?void 0:e.getAttribute("data-composition-file"))??(e==null?void 0:e.getAttribute("data-composition-src"))??void 0}function lu(t,e,n){if(!(!n||n.startsWith("#")||n.startsWith("[data-composition-id=")))try{const i=Array.from(t.querySelectorAll(n)).indexOf(e);return i>=0?i:void 0}catch{return}}function F2(t){const e=t.sourceFile??"index.html";return t.domId?`${e}#${t.domId}`:t.selector?`${e}:${t.selector}:${t.selectorIndex??0}`:`${e}:${t.id}:${t.fallbackIndex}`}function su(t){var r;const e=((r=t.preferredId)==null?void 0:r.trim())||F2({id:t.label,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile}),n=F2({id:e,fallbackIndex:t.fallbackIndex,domId:t.domId,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:t.sourceFile});return{id:e,key:n}}function B2(t){return t.key??t.id}function a$(t){const e=t.querySelector("[data-composition-id]");return Array.from(t.querySelectorAll("[data-start]")).filter(n=>n!==e)}function q5(t,e){return Math.abs(t-e)<.001}function l$(t,e){var s;const n=(s=e.tagName)==null?void 0:s.toLowerCase();if(n&&t.tagName.toLowerCase()!==n)return!1;const r=Number.parseFloat(t.getAttribute("data-start")??"");if(Number.isFinite(r)&&!q5(r,e.start))return!1;const i=Number.parseFloat(t.getAttribute("data-duration")??"");if(Number.isFinite(i)&&!q5(i,e.duration))return!1;const l=Number.parseInt(t.getAttribute("data-track-index")??"",10);return!(Number.isFinite(l)&&l!==e.track)}function s$(t,e){return t.getElementById(e)??t.querySelector(`[data-composition-id="${e}"]`)??t.querySelector(`.${e}`)??null}function o$(t,e,n,r=new Set){const i=e.id?s$(t,e.id):null;if(i&&!r.has(i))return i;const l=a$(t).filter(c=>!r.has(c)),s=l.find(c=>l$(c,e));return s||(l[n]??null)}function c$(t,e){if(!z2(e)||e.parentElement!==t)return!1;const n=e.tagName.toLowerCase();return r$.has(n)||e.hasAttribute("data-start")||e.hasAttribute("data-track-index")?!1:!!Ul(e)}function u$(t,e){t.documentElement&&(t.documentElement.style.overflow="hidden",t.documentElement.style.margin="0"),t.body&&(t.body.style.overflow="hidden",t.body.style.margin="0"),e.scrollTo({top:0,left:0,behavior:"auto"})}function f$(t){const e=/data-composition-id=["']([^"']+)["']/gi,n=new Set,r=Array.from(t.querySelectorAll("style, script"));for(const s of r){const c=s.textContent||"";if(!c)continue;let u;for(;(u=e.exec(c))!==null;){const h=(u[1]||"").trim();h&&n.add(h)}}if(n.size===0)return;const i=new Set,l=Array.from(t.querySelectorAll("[data-composition-id]"));for(const s of l){const c=s.getAttribute("data-composition-id");c&&i.add(c)}for(const s of n){if(s==="root"||i.has(s))continue;const c=t.getElementById(`${s}-layer`)||t.getElementById(`${s}-comp`)||t.getElementById(s);c&&(c.getAttribute("data-composition-id")||c.setAttribute("data-composition-id",s))}}function d$(t){return t instanceof HTMLElement}function _S(t){const e=t.getRootNode();return typeof ShadowRoot<"u"&&e instanceof ShadowRoot&&d$(e.host)?e.host:null}function DS(t,e,n){var r;(r=t.contentWindow)==null||r.postMessage({source:"hf-parent",type:"control",action:e,...n},"*")}function HS(t,e){return t||e>1}function h$(t,e){if(t)try{const n=_S(t);if(n&&typeof n.muted=="boolean"){n.muted=e;return}DS(t,"set-muted",{muted:e})}catch(n){console.warn("[useTimelinePlayer] Failed to set preview media mute state",n)}}function m$(t,e){if(!t)return;const n=Number.isFinite(e)&&e>0?e:1;try{const r=_S(t);if(r&&typeof r.playbackRate=="number"){r.playbackRate=n;return}DS(t,"set-playback-rate",{playbackRate:n})}catch(r){console.warn("[useTimelinePlayer] Failed to set preview playback rate",r)}}function p$(t,e,n,r){const i=new Set(n.map(O=>O.id)),l=t.querySelector("[data-composition-id]"),s=l==null?void 0:l.getAttribute("data-composition-id"),c=t.querySelectorAll("[data-composition-id][data-start]"),u=[];c.forEach(O=>{var D,V,z,I,U,K,H,q,X;const x=O,y=x.getAttribute("data-composition-id");if(!y||y===s||i.has(x.id)||i.has(y))return;const v=x.getAttribute("data-start")??"0";let w=parseFloat(v);if(isNaN(w)){const G=t.getElementById(v)||t.querySelector(`[data-composition-id="${v}"]`);if(G){const F=G.getAttribute("data-start")??"0";let P=parseFloat(F);if(isNaN(P)){const B=t.getElementById(F)||t.querySelector(`[data-composition-id="${F}"]`),J=parseFloat((B==null?void 0:B.getAttribute("data-start"))??"0")||0,te=B==null?void 0:B.getAttribute("data-composition-id"),Y=parseFloat((B==null?void 0:B.getAttribute("data-duration"))??"")||(te?((z=(V=(D=e.__timelines)==null?void 0:D[te])==null?void 0:V.duration)==null?void 0:z.call(V))??0:0);P=J+Y}const Z=G.getAttribute("data-composition-id"),L=parseFloat(G.getAttribute("data-duration")??"")||(Z?((K=(U=(I=e.__timelines)==null?void 0:I[Z])==null?void 0:U.duration)==null?void 0:K.call(U))??0:0);w=P+L}else w=0}let A=parseFloat(x.getAttribute("data-duration")??"");if((isNaN(A)||A<=0)&&(A=((X=(q=(H=e.__timelines)==null?void 0:H[y])==null?void 0:q.duration)==null?void 0:X.call(q))??0),!Number.isFinite(A)||A<=0||(Number.isFinite(w)||(w=0),Number.isFinite(r)&&r>0&&(w>=r||(A=Math.min(A,Math.max(0,r-w)),A<=0))))return;const k=x.getAttribute("data-track-index"),M=k!=null?parseInt(k,10):0,E=x.getAttribute("data-composition-src")||x.getAttribute("data-composition-file"),$=Ul(x),C=au(x),j=lu(t,x,$),T=Nu({id:x.id||y||null,label:x.getAttribute("data-timeline-label")??x.getAttribute("data-label"),tag:x.tagName}),N=su({preferredId:x.id||y||null,label:T,fallbackIndex:u.length,domId:x.id||void 0,selector:$,selectorIndex:j,sourceFile:C}),R={id:N.id,label:T,key:N.key,tag:x.tagName.toLowerCase(),start:w,duration:A,track:isNaN(M)?0:M,domId:x.id||void 0,selector:$,selectorIndex:j,sourceFile:C};if(E)R.compositionSrc=E;else{const G=x.querySelector("video[src]");G&&(R.src=G.getAttribute("src")||void 0,R.tag="video")}u.push(R)});let h=!1;const g=n.map(O=>{if(O.compositionSrc)return O;const x=t.getElementById(O.id)??t.querySelector(`[data-composition-id="${O.id}"]`);if(!x)return O;const y=x.getAttribute("data-composition-src")||x.getAttribute("data-composition-file");return y?(h=!0,{...O,compositionSrc:y}):O});return{missing:u,updatedEls:g,patched:h}}const G5=t=>{let e;const n=new Set,r=(h,g)=>{const O=typeof h=="function"?h(e):h;if(!Object.is(O,e)){const x=e;e=g??(typeof O!="object"||O===null)?O:Object.assign({},e,O),n.forEach(y=>y(e,x))}},i=()=>e,c={setState:r,getState:i,getInitialState:()=>u,subscribe:h=>(n.add(h),()=>n.delete(h))},u=e=t(r,i,c);return c},g$=(t=>t?G5(t):G5),O$=t=>t;function x$(t,e=O$){const n=O1.useSyncExternalStore(t.subscribe,O1.useCallback(()=>e(t.getState()),[t,e]),O1.useCallback(()=>e(t.getInitialState()),[t,e]));return O1.useDebugValue(n),n}const U5=t=>{const e=g$(t),n=r=>x$(e,r);return Object.assign(n,e),n},XS=(t=>t?U5(t):U5),zS="hf-studio-ui-preferences";function W5(t){return typeof t=="object"&&t!==null}function FS(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function BS(t){if(!t)return{};try{const e=t.getItem(zS);if(!e)return{};const n=JSON.parse(e);if(!W5(n))return{};const r={};if(typeof n.leftCollapsed=="boolean"&&(r.leftCollapsed=n.leftCollapsed),typeof n.timelineVisible=="boolean"&&(r.timelineVisible=n.timelineVisible),typeof n.playbackRate=="number"&&Number.isFinite(n.playbackRate)&&(r.playbackRate=n.playbackRate),typeof n.audioMuted=="boolean"&&(r.audioMuted=n.audioMuted),W5(n.previewZoom)){const{zoomPercent:i,panX:l,panY:s}=n.previewZoom;typeof i=="number"&&Number.isFinite(i)&&typeof l=="number"&&Number.isFinite(l)&&typeof s=="number"&&Number.isFinite(s)&&(r.previewZoom={zoomPercent:i,panX:l,panY:s})}return Array.isArray(n.recentBlocks)&&(r.recentBlocks=n.recentBlocks.filter(i=>typeof i=="string")),typeof n.snapEnabled=="boolean"&&(r.snapEnabled=n.snapEnabled),typeof n.gridVisible=="boolean"&&(r.gridVisible=n.gridVisible),typeof n.gridSpacing=="number"&&Number.isFinite(n.gridSpacing)&&(r.gridSpacing=n.gridSpacing),typeof n.snapToGrid=="boolean"&&(r.snapToGrid=n.snapToGrid),r}catch{return{}}}function ul(t=FS()){return BS(t)}function ho(t,e=FS()){if(e)try{const n={...BS(e),...t};e.setItem(zS,JSON.stringify(n))}catch{}}const dp=new Set,zr={notify:t=>dp.forEach(e=>e(t)),subscribe:t=>(dp.add(t),()=>dp.delete(t))},fe=XS(t=>({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,elements:[],selectedElementId:null,playbackRate:ul().playbackRate??1,audioMuted:ul().audioMuted??!1,loopEnabled:!1,zoomMode:"fit",manualZoomPercent:100,inPoint:null,outPoint:null,selectedKeyframes:new Set,toggleSelectedKeyframe:e=>t(n=>{const r=new Set(n.selectedKeyframes);return r.has(e)?r.delete(e):r.add(e),{selectedKeyframes:r}}),clearSelectedKeyframes:()=>t({selectedKeyframes:new Set}),keyframeCache:new Map,setKeyframeCache:(e,n)=>t(r=>{const i=new Map(r.keyframeCache);return n?i.set(e,n):i.delete(e),{keyframeCache:i}}),requestedSeekTime:null,requestSeek:e=>t({requestedSeekTime:e}),clearSeekRequest:()=>t({requestedSeekTime:null}),setIsPlaying:e=>t({isPlaying:e}),setPlaybackRate:e=>{ho({playbackRate:e}),t({playbackRate:e})},setAudioMuted:e=>{ho({audioMuted:e}),t({audioMuted:e})},setLoopEnabled:e=>t({loopEnabled:e}),setZoomMode:e=>t({zoomMode:e}),setInPoint:e=>t(n=>{const r=e!==null&&Number.isFinite(e)?e:null;return{inPoint:r,outPoint:r!==null&&n.outPoint!==null&&r>=n.outPoint?null:n.outPoint,loopEnabled:r!==null?!0:n.loopEnabled}}),setOutPoint:e=>t(n=>{const r=e!==null&&Number.isFinite(e)?e:null;return{outPoint:r,inPoint:r!==null&&n.inPoint!==null&&r<=n.inPoint?null:n.inPoint,loopEnabled:r!==null?!0:n.loopEnabled}}),setManualZoomPercent:e=>t({manualZoomPercent:Math.max(10,Math.min(2e3,Math.round(e)))}),setCurrentTime:e=>t({currentTime:Number.isFinite(e)?e:0}),setDuration:e=>t({duration:Number.isFinite(e)?e:0}),setTimelineReady:e=>t({timelineReady:e}),setElements:e=>t({elements:e}),setSelectedElementId:e=>t({selectedElementId:e}),updateElement:(e,n)=>t(r=>({elements:r.elements.map(i=>(i.key??i.id)===e?{...i,...n}:i)})),reset:()=>t({isPlaying:!1,currentTime:0,duration:0,timelineReady:!1,elements:[],selectedElementId:null,inPoint:null,outPoint:null,selectedKeyframes:new Set,keyframeCache:new Map})})),YS="phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx",IS="https://us.i.posthog.com",y$=3e4,b$=5e3;let ql=[],qc=null,Ds=null;function qS(){if(Ds)return Ds;try{const t=localStorage.getItem("hf-studio-anon-id");if(t)return Ds=t,t}catch{}Ds=crypto.randomUUID();try{localStorage.setItem("hf-studio-anon-id",Ds)}catch{}return Ds}function v$(){try{return localStorage.getItem("hf-studio-telemetry-opt-out")!=="1"}catch{return!0}}function S$(){var t,e;return{studio_version:"0.6.86",screen_width:(t=window.screen)==null?void 0:t.width,screen_height:(e=window.screen)==null?void 0:e.height,viewport_width:window.innerWidth,viewport_height:window.innerHeight,user_agent:navigator.userAgent,url_hash:location.hash.replace(/#project\//,"")}}function Lt(t,e={}){v$()&&(ql.push({event:`studio:${t}`,properties:{...S$(),...e},timestamp:new Date().toISOString()}),qc||(qc=setInterval(w$,y$)))}async function w$(){if(ql.length===0)return;const t=ql.map(r=>({event:r.event,properties:{...r.properties,$ip:null},distinct_id:qS(),timestamp:r.timestamp}));ql=[];const e=new AbortController,n=setTimeout(()=>e.abort(),b$);try{await fetch(`${IS}/batch/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:YS,batch:t}),signal:e.signal})}catch{}finally{clearTimeout(n)}}typeof window<"u"&&window.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){if(qc&&(clearInterval(qc),qc=null),ql.length===0)return;const t=ql.map(n=>({event:n.event,properties:{...n.properties,$ip:null},distinct_id:qS(),timestamp:n.timestamp}));ql=[];const e=JSON.stringify({api_key:YS,batch:t});try{navigator.sendBeacon(`${IS}/batch/`,e)}catch{}}});const k$=[{title:"Playback",hints:[{key:"Space",label:"Play / Pause"},{key:"J",label:"Play backward"},{key:"K",label:"Stop"},{key:"L",label:"Play forward"},{key:"M",label:"Toggle mute"},{key:"⇧L",label:"Toggle loop"},{key:"←/→",label:"Step 1 frame"},{key:"⇧←/⇧→",label:"Step 10 frames"},{key:"F",label:"Toggle fullscreen"}]},{title:"Work area",hints:[{key:"I",label:"Set in-point"},{key:"⇧I",label:"Clear in-point"},{key:"O",label:"Set out-point"},{key:"⇧O",label:"Clear out-point"},{key:"A",label:"Jump to in-point"},{key:"E",label:"Jump to out-point"}]}],A$=d.memo(function({disabled:e,duration:n,inPoint:r,outPoint:i,setInPoint:l,setOutPoint:s,onSeek:c}){const[u,h]=d.useState(!1),[g,O]=d.useState(""),x=d.useRef(null);d.useEffect(()=>{if(!u)return;const A=k=>{x.current&&!x.current.contains(k.target)&&h(!1)};return document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[u]);const y=d.useCallback(()=>{if(e)return;const A=Number.parseInt(g,10);!Number.isFinite(A)||n<=0||c(Math.min(n,ZS(Math.max(0,A))))},[e,n,g,c]),v=d.useCallback(A=>{A.preventDefault(),y()},[y]),w=d.useCallback(A=>{A.key==="Enter"&&(A.preventDefault(),y())},[y]);return m.jsxs("div",{ref:x,className:"relative flex-shrink-0",children:[m.jsx(Yt,{label:"Shortcuts and tools",children:m.jsx("button",{type:"button",onClick:()=>h(A=>!A),className:`w-6 h-6 flex items-center justify-center rounded border transition-colors ${u?"border-neutral-600 text-neutral-200 bg-neutral-800":"border-neutral-800 text-neutral-600 hover:text-neutral-300 hover:border-neutral-600"}`,"aria-label":"Shortcuts and tools","aria-expanded":u,children:m.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),m.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M10 12h.01M14 12h.01M18 12h.01M8 16h8"})]})})}),u&&m.jsxs("div",{className:"absolute bottom-full right-0 mb-2 z-50 rounded-lg shadow-xl min-w-[220px] overflow-y-auto",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)",maxHeight:"min(280px, calc(100vh - 80px))"},children:[m.jsxs("div",{className:"px-3 pt-3 pb-2.5",children:[m.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Jump to frame"}),m.jsxs("form",{onSubmit:v,className:"flex items-center gap-1.5",children:[m.jsx("input",{value:g,onChange:A=>O(A.target.value),disabled:e,inputMode:"numeric",pattern:"[0-9]*","aria-label":"Jump to frame",placeholder:"frame number",className:"h-6 flex-1 rounded border border-neutral-700 bg-neutral-900 px-2 text-[10px] font-mono tabular-nums text-neutral-200 outline-none transition-colors placeholder:text-neutral-600 focus:border-studio-accent/60",onKeyDown:w,onBlur:y}),m.jsx(Yt,{label:"Jump to frame",children:m.jsx("button",{type:"submit",disabled:e,className:"h-6 px-2 rounded border border-neutral-700 text-[10px] text-neutral-300 transition-colors hover:border-neutral-500 hover:bg-neutral-800 disabled:opacity-40",children:"Go"})})]})]}),m.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),m.jsxs("div",{className:"px-3 pt-2.5 pb-2",children:[m.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:"Work area"}),m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[20px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:"I"}),m.jsx("span",{className:"text-[10px] text-neutral-400",children:"In-point"})]}),m.jsx("div",{className:"flex items-center gap-1.5",children:r!==null?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:yn(r)}),m.jsx(Yt,{label:"Clear in-point",children:m.jsx("button",{type:"button",onClick:()=>l(null),className:"w-4 h-4 flex items-center justify-center rounded text-neutral-500 hover:text-neutral-200 transition-colors","aria-label":"Clear in-point",children:m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):m.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]}),m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[20px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:"O"}),m.jsx("span",{className:"text-[10px] text-neutral-400",children:"Out-point"})]}),m.jsx("div",{className:"flex items-center gap-1.5",children:i!==null?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:yn(i)}),m.jsx(Yt,{label:"Clear out-point",children:m.jsx("button",{type:"button",onClick:()=>s(null),className:"w-4 h-4 flex items-center justify-center rounded text-neutral-500 hover:text-neutral-200 transition-colors","aria-label":"Clear out-point",children:m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}):m.jsx("span",{className:"text-[10px] text-neutral-600",children:"—"})})]})]})]}),m.jsx("div",{style:{borderTop:"1px solid rgba(255,255,255,0.06)"}}),m.jsx("div",{className:"px-3 pt-2.5 pb-3 flex flex-col gap-3",children:k$.map(A=>m.jsxs("div",{children:[m.jsx("p",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider mb-1.5",children:A.title}),m.jsx("div",{className:"flex flex-col gap-1",children:A.hints.map(k=>m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"font-mono text-[10px] rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 min-w-[36px] text-center",style:{background:"rgba(255,255,255,0.05)"},children:k.key}),m.jsx("span",{className:"text-[10px] text-neutral-400",children:k.label})]},k.key))})]},A.title))})]})]})}),M$=[.25,.5,1,1.5,2],C$=d.memo(function({playbackRate:e,setPlaybackRate:n,disabled:r}){const[i,l]=d.useState(!1),s=d.useRef(null);return d.useEffect(()=>{if(!i)return;const c=u=>{s.current&&!s.current.contains(u.target)&&l(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[i]),m.jsxs("div",{ref:s,className:"relative flex-shrink-0",children:[m.jsx(Yt,{label:"Playback speed",children:m.jsx("button",{type:"button",onClick:()=>l(c=>!c),disabled:r,className:"w-10 px-2 py-1 rounded-md text-[10px] font-mono tabular-nums transition-colors",style:{color:"#71717A",background:"rgba(255,255,255,0.04)"},children:e===1?"1x":`${e}x`})}),i&&m.jsx("div",{className:"absolute bottom-full right-0 mb-1.5 rounded-lg shadow-xl z-50 min-w-[56px] overflow-hidden",style:{background:"#161618",border:"1px solid rgba(255,255,255,0.08)"},children:M$.map(c=>m.jsxs("button",{onClick:()=>{Lt("playback",{action:"speed_change",rate:c}),n(c),l(!1)},className:"block w-full px-3 py-1.5 text-[11px] text-left font-mono tabular-nums transition-colors",style:{color:c===e?"#FAFAFA":"#71717A",background:c===e?"rgba(255,255,255,0.06)":"transparent"},onMouseEnter:u=>{c!==e&&(u.currentTarget.style.background="rgba(255,255,255,0.04)")},onMouseLeave:u=>{c!==e&&(u.currentTarget.style.background="transparent")},children:[c,"x"]},c))})]})}),E$=8;function K5(t,e,n){if(!Number.isFinite(n)||n<=0)return 0;const r=(t-e)/n,i=Math.max(0,Math.min(1,r)),l=Math.min(.5,E$/n);return i<=l?0:i>=1-l?1:i}function y1(t,e,n){t.current&&(t.current.style.width=`${n}%`),e.current&&(e.current.style.left=`${n}%`)}function T$(t,e,n,r){const i=d.useCallback(s=>{if(n)return;const c=t.seekBarRef.current;if(!c||r<=0)return;const u=c.getBoundingClientRect(),h=K5(s,u.left,u.width);y1(t.progressFillRef,t.progressThumbRef,h*100),e(h*r)},[n,r,e,t]),l=d.useCallback(s=>{if(s.button!==0)return;s.preventDefault(),s.currentTarget.focus(),t.isDraggingRef.current=!0;const c=s.currentTarget,u=s.pointerId;try{c.setPointerCapture(u)}catch{}i(s.clientX);let h=0,g=s.clientX;const O=w=>{if(w.pointerId!==u||!t.isDraggingRef.current)return;g=w.clientX;const A=t.seekBarRef.current,k=t.durationRef.current;if(A&&k>0){const M=A.getBoundingClientRect(),E=K5(w.clientX,M.left,M.width)*100;y1(t.progressFillRef,t.progressThumbRef,E)}h||(h=requestAnimationFrame(()=>{h=0,t.isDraggingRef.current&&i(g)}))},x=()=>{t.isDraggingRef.current=!1,h&&(cancelAnimationFrame(h),h=0),i(g);try{c.releasePointerCapture(u)}catch{}c.removeEventListener("pointermove",O),c.removeEventListener("pointerup",y),c.removeEventListener("pointercancel",y),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),document.removeEventListener("visibilitychange",v),window.removeEventListener("blur",x),c.blur()},y=w=>{w.pointerId===u&&x()},v=()=>{document.visibilityState==="hidden"&&x()};c.addEventListener("pointermove",O),c.addEventListener("pointerup",y),c.addEventListener("pointercancel",y),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),document.addEventListener("visibilitychange",v),window.addEventListener("blur",x)},[i,t]);return Xt(()=>{const s=h=>{t.currentTimeRef.current=h;const g=t.durationRef.current,O=g>0?Math.min(100,h/g*100):0;y1(t.progressFillRef,t.progressThumbRef,O),t.timeDisplayRef.current&&(t.timeDisplayRef.current.textContent=t.timeDisplayModeRef.current==="frame"?NS(h,g):yn(h)),t.sliderRef.current&&t.sliderRef.current.setAttribute("aria-valuenow",String(Math.round(h)))},c=zr.subscribe(s);s(fe.getState().currentTime);const u=setInterval(()=>{const h=fe.getState().currentTime,g=fe.getState().duration;g>0&&h>0&&y1(t.progressFillRef,t.progressThumbRef,Math.min(100,h/g*100))},500);return()=>{c(),clearInterval(u)}}),{handlePointerDown:l}}function $$(){return m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#FAFAFA","aria-hidden":"true",children:m.jsx("polygon",{points:"6,3 20,12 6,21"})})}function j$(){return m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#FAFAFA","aria-hidden":"true",children:[m.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),m.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})}const P$=d.memo(function({audioMuted:e,audioAutoMuted:n,effectiveAudioMuted:r,controlsDisabled:i,setAudioMuted:l}){const s=n?"Audio muted above 1x speed":e?"Unmute audio":"Mute audio";return m.jsx(Yt,{label:s,children:m.jsx("button",{type:"button",onClick:()=>{n||(Lt("playback",{action:"mute_toggle",muted:!e}),l(!e))},disabled:i||n,"aria-label":s,"aria-pressed":r,className:`h-7 w-7 flex-shrink-0 flex items-center justify-center rounded-md border transition-colors disabled:pointer-events-none ${r?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:bg-neutral-800"} ${n?"opacity-70":""}`,children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M11 5 6 9H3v6h3l5 4V5Z"}),r?m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"m19 9-6 6"}),m.jsx("path",{d:"m13 9 6 6"})]}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),m.jsx("path",{d:"M18.5 5.5a9 9 0 0 1 0 13"})]})]})})})}),Q$=d.memo(function({loopEnabled:e,disabled:n,setLoopEnabled:r}){return m.jsx(Yt,{label:"Loop playback",children:m.jsx("button",{type:"button",onClick:()=>{Lt("playback",{action:"loop_toggle",enabled:!e}),r(!e)},disabled:n,className:`h-7 w-7 flex items-center justify-center rounded-md border transition-colors ${e?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:bg-neutral-800"}`,"aria-label":e?"Disable loop playback":"Enable loop playback","aria-pressed":e,children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M17 2l4 4-4 4"}),m.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),m.jsx("path",{d:"M7 22l-4-4 4-4"}),m.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]})})})}),Z$=d.memo(function({isFullscreen:e,onToggleFullscreen:n}){return m.jsx(Yt,{label:e?"Exit fullscreen (F)":"Enter fullscreen (F)",children:m.jsx("button",{type:"button",onClick:()=>{Lt("playback",{action:"fullscreen_toggle",active:!e}),n()},className:`h-7 w-7 flex-shrink-0 flex items-center justify-center rounded-md border transition-colors ${e?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:bg-neutral-800"}`,"aria-label":e?"Exit fullscreen":"Enter fullscreen",children:m.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e?m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}),m.jsx("path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}),m.jsx("path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}),m.jsx("path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"})]}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),m.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),m.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),m.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})})})})});function J5({position:t,duration:e}){return e<=0?null:m.jsx("div",{className:"absolute z-[3] pointer-events-none",style:{left:`${Math.min(100,t/e*100)}%`,top:"50%",transform:"translate(-50%, -50%)",width:"2px",height:"10px",background:"#3CE6AC",borderRadius:"1px"}})}function N$({inPoint:t,outPoint:e,duration:n}){return t===null&&e===null||n<=0?null:m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"absolute top-0 bottom-0 pointer-events-none",style:{left:`${t!==null?Math.min(100,t/n*100):0}%`,right:`${e!==null?100-Math.min(100,e/n*100):0}%`,background:"rgba(60,230,172,0.15)"}}),t!==null&&m.jsx(J5,{position:t,duration:n}),e!==null&&m.jsx(J5,{position:e,duration:n})]})}const R$=d.memo(function({disabled:e,duration:n,inPoint:r,outPoint:i,progressFillRef:l,progressThumbRef:s,seekBarRef:c,sliderRef:u,onPointerDown:h,onKeyDown:g}){return m.jsx("div",{ref:O=>{c.current=O,u.current=O},role:"slider",tabIndex:e?-1:0,"aria-label":"Seek","aria-disabled":e||void 0,"aria-valuemin":0,"aria-valuemax":Math.round(n),"aria-valuenow":0,className:`min-w-[96px] flex-1 h-6 flex items-center group outline-none focus-visible:ring-1 focus-visible:ring-white/30 focus-visible:rounded ${e?"cursor-not-allowed opacity-50":"cursor-pointer"}`,style:{touchAction:"none"},onPointerDown:h,onKeyDown:g,children:m.jsxs("div",{className:"w-full rounded-full relative",style:{background:"rgba(255,255,255,0.15)",height:"3px"},children:[m.jsx(N$,{inPoint:r,outPoint:i,duration:n}),m.jsx("div",{ref:l,className:"absolute top-0 bottom-0 left-0 z-[1] rounded-full",style:{background:"linear-gradient(90deg, var(--hf-accent, #3CE6AC), #2BBFA0)"}}),m.jsx("div",{ref:s,className:"absolute top-1/2 z-[4] w-3 h-3 rounded-full -translate-y-1/2 -translate-x-1/2 transition-transform group-hover:scale-125",style:{background:"var(--hf-accent, #3CE6AC)",boxShadow:"0 0 6px rgba(60,230,172,0.4), 0 1px 4px rgba(0,0,0,0.4)"}})]})})}),V$=d.memo(function({onTogglePlay:e,onSeek:n,disabled:r=!1,isFullscreen:i=!1,onToggleFullscreen:l}){const s=fe(G=>G.isPlaying),c=fe(G=>G.duration),u=fe(G=>G.timelineReady),h=fe(G=>G.playbackRate),g=fe(G=>G.audioMuted),O=fe(G=>G.loopEnabled),x=fe.getState().setPlaybackRate,y=fe.getState().setAudioMuted,v=fe.getState().setLoopEnabled,w=fe(G=>G.inPoint),A=fe(G=>G.outPoint),k=fe.getState().setInPoint,M=fe.getState().setOutPoint,[E,$]=d.useState("time"),C=d.useRef(null),j=d.useRef(null),T=d.useRef(null),N=d.useRef(null),R=d.useRef(null),D=d.useRef(!1),V=d.useRef(0),z=d.useRef(E);z.current=E;const I=d.useRef(c);I.current=c;const U=r||!u,K=h>1,H=HS(g,h);d.useEffect(()=>{if(!T.current)return;const G=V.current;T.current.textContent=E==="frame"?NS(G,c):yn(G)},[c,E]);const{handlePointerDown:q}=T$({seekBarRef:N,progressFillRef:C,progressThumbRef:j,sliderRef:R,timeDisplayRef:T,isDraggingRef:D,durationRef:I,currentTimeRef:V,timeDisplayModeRef:z},n,r,c),X=d.useCallback(G=>{if(r||!u||c<=0)return;const F=G.shiftKey?10:1;G.key==="ArrowLeft"?(G.preventDefault(),n(X2(V.current,-F))):G.key==="ArrowRight"&&(G.preventDefault(),n(Math.min(c,X2(V.current,F))))},[r,u,c,n]);return m.jsxs("div",{className:"px-4 py-2 flex flex-wrap items-center gap-x-2 gap-y-1","aria-disabled":r||void 0,style:{borderTop:"1px solid rgba(255,255,255,0.04)",paddingBottom:"calc(0.5rem + env(safe-area-inset-bottom))"},children:[m.jsx(Yt,{label:s?"Pause":"Play",children:m.jsx("button",{type:"button","aria-label":s?"Pause":"Play",onClick:()=>{Lt("playback",{action:s?"pause":"play"}),e()},disabled:U,className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-lg disabled:opacity-30 disabled:pointer-events-none transition-colors",style:{background:"rgba(255,255,255,0.06)"},children:s?m.jsx(j$,{}):m.jsx($$,{})})}),m.jsx(Yt,{label:E==="time"?"Switch to frame display":"Switch to time display",children:m.jsxs("button",{type:"button",onClick:()=>$(G=>G==="time"?"frame":"time"),disabled:r,className:"font-mono text-[11px] tabular-nums flex-shrink-0 w-[118px] text-left transition-colors disabled:pointer-events-none hover:opacity-80",style:{color:"#A1A1AA",cursor:"pointer"},children:[m.jsx("span",{ref:T,children:yn(0)}),E==="time"?m.jsxs(m.Fragment,{children:[m.jsx("span",{style:{color:"#3F3F46",margin:"0 2px"},children:"/"}),m.jsx("span",{style:{color:"#52525B"},children:yn(c)})]}):null]})}),m.jsx(R$,{disabled:r,duration:c,inPoint:w,outPoint:A,progressFillRef:C,progressThumbRef:j,seekBarRef:N,sliderRef:R,onPointerDown:q,onKeyDown:X}),m.jsx(P$,{audioMuted:g,audioAutoMuted:K,effectiveAudioMuted:H,controlsDisabled:U,setAudioMuted:y}),m.jsx(C$,{playbackRate:h,setPlaybackRate:x,disabled:r}),m.jsx(Q$,{loopEnabled:O,disabled:r,setLoopEnabled:v}),l&&m.jsx(Z$,{isFullscreen:i,onToggleFullscreen:l}),m.jsx(A$,{disabled:r,duration:c,inPoint:w,outPoint:A,setInPoint:k,setOutPoint:M,onSeek:n})]})}),ey=100;function qs(t){return Math.round(t*ey)/ey}function ou(t,e,n){return Math.min(Math.max(t,e),n)}const ty=.55,b1=40,ny=12;function ry(t,e,n){const r=(i,l,s)=>{if(s<i+b1){const c=Math.max(0,1-(s-i)/b1);return-Math.round(ny*c)}if(s>l-b1){const c=Math.max(0,1-(l-s)/b1);return Math.round(ny*c)}return 0};return{x:r(t.left,t.right,e),y:r(t.top,t.bottom,n)}}function L$(t,e,n){const r=(t.currentScrollLeft??0)-(t.originScrollLeft??0),i=(t.currentScrollTop??0)-(t.originScrollTop??0),l=(e-t.originClientX+r)/Math.max(t.pixelsPerSecond,1),s=(n-t.originClientY+i)/Math.max(t.trackHeight,1),c=Math.round(s),u=Math.max(0,t.trackOrder.indexOf(t.track)),h=u+c,g=ou(h,0,Math.max(0,t.trackOrder.length-1)),O=Math.min(...t.trackOrder),x=Math.max(...t.trackOrder);let y=t.trackOrder[g]??t.track;const v=u===0,w=u===t.trackOrder.length-1;return v&&h<0&&u+s<=-ty?y=O-1:w&&h>t.trackOrder.length-1&&u+s>=t.trackOrder.length-1+ty&&(y=x+1),{start:ou(qs(t.start+l),0,Math.max(0,t.maxStart)),track:y}}function _$(t,e,n){const r=Math.max(.05,t.minDuration??.1),i=(n-t.originClientX)/Math.max(t.pixelsPerSecond,1);if(e==="end"){const y=ou(qs(t.duration+i),r,Math.max(r,t.maxEnd-t.start));return{start:t.start,duration:y,playbackStart:t.playbackStart}}const l=Math.max(.1,t.playbackRate??1),s=t.playbackStart!=null?t.playbackStart/l:Number.POSITIVE_INFINITY,c=-Math.min(t.start-t.minStart,s),u=t.duration-r,h=ou(i,c,u),g=qs(t.start+h),O=qs(t.duration-h),x=t.playbackStart!=null?qs(Math.max(0,t.playbackStart+h*l)):void 0;return{start:g,duration:O,playbackStart:x}}function D$(t){if(t.compositionSrc||t.playbackStartAttr!=null||t.sourceDuration!=null&&Number.isFinite(t.sourceDuration)&&t.sourceDuration>0)return!0;const e=t.tag.toLowerCase();return["video","audio","img"].includes(e)}function H$(t){return!!(t.domId||t.selector)}function iy(t){if(t.timingSource==="implicit"||t.timelineLocked)return{canMove:!1,canTrimStart:!1,canTrimEnd:!1};const e=H$(t),n=Number.isFinite(t.duration)&&t.duration>0,r=D$(t);return{canMove:e&&(r||n),canTrimEnd:e&&n,canTrimStart:e&&n}}function X$(t){if(t.capabilities.canMove)return null;const e=Math.max(0,t.width),n=ou(t.offsetX,0,e),r=Math.max(0,t.handleWidth);return n<=r&&!t.capabilities.canTrimStart?"resize-start":n>=Math.max(0,e-r)&&!t.capabilities.canTrimEnd?"resize-end":"move"}function z$(t,e){return{start:t.start,end:t.start+t.duration,anchorX:e.anchorX,anchorY:e.anchorY}}function F$({rangeStart:t,rangeEnd:e,elements:n,prompt:r}){const i=Math.min(t,e),l=Math.max(t,e),s=n.map(c=>`- #${c.id} (${c.tag}) — ${yn(c.start)} to ${yn(c.start+c.duration)}, track ${c.track}`).join(`
50
- `);return`Edit the following HyperFrames composition:
51
-
52
- Time range: ${yn(i)} — ${yn(l)}
53
-
54
- Elements in range:
55
- ${s||"(none)"}
56
-
57
- User request:
58
- ${r.trim()||"(no prompt provided)"}
59
-
60
- Instructions:
61
- Modify only the elements listed above within the specified time range.
62
- The composition uses HyperFrames data attributes (data-start, data-duration, data-track-index) and GSAP for animations.
63
- Preserve all other elements and timing outside this range.`}function ay(t){return t.trim()}function Dn(t){return Number(qs(t).toFixed(2)).toString()}function ly(t){if(typeof document>"u"||!document.body||!document.execCommand)return!1;const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.border="0",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e),e.focus({preventScroll:!0}),e.select(),e.setSelectionRange(0,t.length);try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(e)}}function B$(){if(typeof navigator>"u")return!1;const t=navigator.userAgent;return/Safari/i.test(t)&&!/Chrome|Chromium|CriOS|FxiOS|Edg|OPR/i.test(t)}async function cu(t){const e=B$();if(e&&ly(t))return!0;const n=typeof navigator<"u"?navigator.clipboard:void 0;if(n!=null&&n.writeText)try{return await n.writeText(t),!0}catch{}return!e&&ly(t)}function Y$({rangeStart:t,rangeEnd:e,anchorX:n,anchorY:r,onClose:i}){const l=fe(C=>C.elements),[s,c]=d.useState(""),[u,h]=d.useState(!1),[g,O]=d.useState(!1),x=d.useRef(null),y=d.useRef(null),v=Math.min(t,e),w=Math.max(t,e),A=d.useMemo(()=>l.filter(C=>{const j=C.start+C.duration;return C.start<w&&j>v}),[l,v,w]);Xt(()=>{setTimeout(()=>{var C;return(C=y.current)==null?void 0:C.focus()},50)}),Xt(()=>{const C=j=>{j.key==="Escape"&&i()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)}),Xt(()=>{const C=j=>{x.current&&!x.current.contains(j.target)&&i()};return setTimeout(()=>window.addEventListener("mousedown",C),100),()=>window.removeEventListener("mousedown",C)});const k=d.useCallback(()=>F$({rangeStart:v,rangeEnd:w,elements:A,prompt:s}),[v,w,A,s]),M=d.useCallback(async()=>{await cu(k())&&(h(!0),setTimeout(()=>{h(!1),i()},800))},[k,i]),E=d.useCallback(async()=>{const C=ay(s);!C||!await cu(C)||(O(!0),setTimeout(()=>{O(!1)},800))},[s]),$={position:"fixed",left:Math.max(8,Math.min(n-160,window.innerWidth-336)),top:Math.max(8,r-280),zIndex:200};return m.jsx("div",{ref:x,style:$,children:m.jsxs("div",{className:"w-80 bg-neutral-900 border border-neutral-700/60 rounded-xl shadow-2xl shadow-black/40 overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-neutral-800/60",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-studio-accent"}),m.jsxs("span",{className:"text-[11px] font-medium text-neutral-300",children:[yn(v)," — ",yn(w)]})]}),m.jsxs("span",{className:"text-[10px] text-neutral-600",children:[A.length," element",A.length!==1?"s":""]})]}),A.length>0&&m.jsx("div",{className:"px-4 py-2 border-b border-neutral-800/40 max-h-24 overflow-y-auto",children:A.map(C=>m.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[m.jsxs("span",{className:"text-[10px] font-mono text-studio-accent/80",children:["#",C.id]}),m.jsx("span",{className:"text-[10px] text-neutral-600",children:C.tag})]},C.id))}),m.jsx("div",{className:"p-3",children:m.jsx("textarea",{ref:y,value:s,onChange:C=>c(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),M())},placeholder:"What should change?",rows:2,className:"w-full px-3 py-2 text-xs bg-neutral-800/60 border border-neutral-700/40 rounded-lg text-neutral-200 placeholder:text-neutral-600 resize-none focus:outline-none focus:border-studio-accent/40 transition-colors"})}),m.jsxs("div",{className:"grid grid-cols-2 gap-2 px-3 pb-3",children:[m.jsx("button",{onClick:E,disabled:!ay(s),className:`py-1.5 text-[11px] font-medium rounded-lg transition-all border ${g?"bg-green-500/20 text-green-400 border-green-500/30":"bg-neutral-800/70 text-neutral-200 border-neutral-700/50 hover:bg-neutral-800"} disabled:opacity-50 disabled:cursor-not-allowed`,children:g?"Prompt Copied!":"Copy Prompt"}),m.jsxs("button",{onClick:M,className:`py-1.5 text-[11px] font-medium rounded-lg transition-all ${u?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-studio-accent/15 text-studio-accent border border-studio-accent/25 hover:bg-studio-accent/25"}`,children:[u?"Copied!":"Copy to Agent",!u&&m.jsx("span",{className:"text-[9px] text-studio-accent/50 ml-1.5",children:"Cmd+Enter"})]})]})]})})}const I$={clip:"#1c2028",accent:"#3CE6AC",label:"#dde1e8",iconBackground:"rgba(255,255,255,0.06)"},GS={shellBackground:"#0A0A0B",shellBorder:"rgba(255,255,255,0.05)",rulerBorder:"rgba(255,255,255,0.045)",rowBackground:"#0A0A0B",rowBorder:"rgba(255,255,255,0.05)",gutterBackground:"#0A0A0B",gutterBorder:"rgba(255,255,255,0.05)",textPrimary:"#E8EDF5",textSecondary:"#8391A8",tickText:"rgba(131,145,168,0.92)",tickMajor:"rgba(255,255,255,0.13)",tickMinor:"rgba(255,255,255,0.08)",clipBackground:"#141922",clipBackgroundActive:"#181e28",clipBorder:"rgba(255,255,255,0.10)",clipBorderHover:"rgba(255,255,255,0.18)",clipBorderActive:"rgba(255,255,255,0.24)",clipShadow:"none",clipShadowHover:"0 2px 8px rgba(0,0,0,0.2)",clipShadowActive:"0 2px 8px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.04)",clipShadowDragging:"0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06)",handleColor:"rgba(255,255,255,0.2)",panelResizeSeam:"rgba(255,255,255,0.12)",panelResizeActive:"rgba(255,255,255,0.24)",clipRadius:"6px"};function q$(t){return I$}function G$({isHovered:t,isSelected:e,isDragging:n}){return n?.95:e?.82:t?.76:0}function U$({element:t,draggedElementId:e,previewStart:n,previewTrack:r}){return(t.key??t.id)!==e||n===null||r===null?t:{...t,start:n,track:r}}const pn=32,no=48,mo=24,hp=3,W$=18,K$=20;function J$(t,e){const n=[.25,.5,1,2,5,10,15,30,60,120,300,600];if(Number.isFinite(e)&&(e??0)>0)return n.find(s=>s*(e??0)>=128)??600;const r=[.25,.5,1,2,5,10,15,30,60],i=t/6;return r.find(l=>l>=i)??60}function ej(t,e){let n=t/2;return t>=30?n=t/6:t>=15?n=t/3:t>=5?n=t/5:t>=1&&(n=t/4),Number.isFinite(e)&&(e??0)>0&&n*(e??0)<20?Math.max(.25,t/2):Math.max(.25,n)}function tj(t,e){if(t<=0||!Number.isFinite(t)||t>7200)return{major:[],minor:[]};const n=J$(t,e),r=ej(n,e),i=[],l=[],s=2e3;for(let c=0;c<=t+.001&&i.length+l.length<s;c+=r){const u=Math.round(c*100)/100;Math.abs(u%n)<.01||Math.abs(u%n-n)<.01?i.push(u):l.push(u)}return{major:i,minor:l}}function nj(t,e,n){if(!Number.isFinite(t))return"0:00";const r=Math.max(0,t);if(n<1){const i=Math.round(r*10),l=Math.floor(i/10),s=i%10;return`${yn(l)}.${s}`}if(e>=3600||r>=3600){const i=Math.floor(r),l=Math.floor(i/3600),s=Math.floor(i%3600/60),c=i%60;return`${l}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`}return yn(r)}function sy(t,e,n){return t==="fit"||!Number.isFinite(e)||!Number.isFinite(n)?!1:e-n>1}function rj(t,e,n){return t==="manual"&&e==="fit"?0:n}function ij(t){const e=Math.max(0,t.currentPixelsPerSecond),n=Math.max(0,t.nextPixelsPerSecond);if(!Number.isFinite(t.pointerX)||!Number.isFinite(t.currentScrollLeft)||!Number.isFinite(t.duration)||t.duration<=0||e<=0||n<=0)return Math.max(0,t.currentScrollLeft);const r=Math.max(0,t.currentScrollLeft+t.pointerX-t.gutter),i=Math.max(0,Math.min(t.duration,r/e));return Math.max(0,t.gutter+i*n-t.pointerX)}function oy(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?pn:pn+Math.max(0,t)*Math.max(0,e)}function aj(t){return mo+Math.max(0,t)*no+K$}function lj(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?!0:t-e<=1}function sj(t,e){return t.length===0?0:e==null||e<0?t[0]:e>=t.length?Math.max(...t)+1:t[e]??t[t.length-1]??0}function mp(t,e,n){const r=e-t.rectLeft+t.scrollLeft-pn,i=n-t.rectTop+t.scrollTop-mo,l=Math.max(0,Math.min(t.duration,Math.round(r/Math.max(t.pixelsPerSecond,1)*100)/100)),s=Math.floor(i/Math.max(t.trackHeight,1));return{start:l,track:sj(t.trackOrder,s)}}function oj({scrollRef:t,ppsRef:e,effectiveDuration:n,pps:r,onSeek:i,seekFromX:l,autoScrollDuringDrag:s,dragScrollRaf:c,isDragging:u,setShowPopover:h}){const g=d.useRef(!1),O=d.useRef(0),[x,y]=d.useState(null),v=d.useRef(null),w=d.useRef(0),A=d.useRef(0),k=d.useCallback($=>{var C,j;if($.button===0){if($.shiftKey){$.currentTarget.setPointerCapture($.pointerId),g.current=!0,h(!1);const T=(C=t.current)==null?void 0:C.getBoundingClientRect();if(T){const N=$.clientX-T.left+(((j=t.current)==null?void 0:j.scrollLeft)??0)-pn,R=Math.max(0,N/r);O.current=R,y({start:R,end:R,anchorX:$.clientX,anchorY:$.clientY})}return}v.current=null,!$.target.closest("[data-clip]")&&($.currentTarget.setPointerCapture($.pointerId),u.current=!0,y(null),h(!1),l($.clientX))}},[l,r,t,u,h]),M=d.useCallback($=>{var j,T;if(g.current){const N=(j=t.current)==null?void 0:j.getBoundingClientRect();if(N){const R=$.clientX-N.left+(((T=t.current)==null?void 0:T.scrollLeft)??0)-pn;y(D=>D?{...D,end:Math.max(0,R/r),anchorX:$.clientX,anchorY:$.clientY}:null)}return}if(!u.current)return;A.current=$.clientX;const C=t.current;if(C){const N=C.getBoundingClientRect(),R=$.clientX-N.left+C.scrollLeft-pn;if(R>=0){const D=C.scrollWidth/r;zr.notify(Math.max(0,Math.min(D,R/r)))}}w.current||(w.current=requestAnimationFrame(()=>{w.current=0,u.current&&(l(A.current),s(A.current))}))},[l,s,r,t,u]),E=d.useCallback(()=>{if(g.current){g.current=!1;const $=v.current;v.current=null,y(C=>C&&$&&Math.abs(C.end-C.start)<=.2?(h(!0),z$($.element,$)):C&&Math.abs(C.end-C.start)>.2?(h(!0),C):null);return}w.current&&(cancelAnimationFrame(w.current),w.current=0),l(A.current),u.current=!1,cancelAnimationFrame(c.current)},[u,c,h,l]);return{rangeSelection:x,setRangeSelection:y,shiftClickClipRef:v,handlePointerDown:k,handlePointerMove:M,handlePointerUp:E}}const cj=10,uj=2e3,fj=.8,dj=1.25,hj=.0035;function k8(t){return Number.isFinite(t)?Math.max(cj,Math.min(uj,Math.round(t))):100}function kd(t,e){return t==="fit"?100:k8(e)}function mj(t,e,n){if(!Number.isFinite(t)||t<=0)return 100;const r=kd(e,n);return e==="fit"?t:t*(r/100)}function cy(t,e,n){const r=kd(e,n),i=t==="in"?r*dj:r*fj;return k8(i)}function pj(t,e,n){const r=kd(e,n);return!Number.isFinite(t)||t===0?r:k8(r*Math.exp(-t*hj))}function gj({playheadRef:t,scrollRef:e,ppsRef:n,durationRef:r,isDragging:i,currentTime:l,zoomMode:s,zoomModeRef:c,manualZoomPercentRef:u,fitPps:h,fitPpsRef:g,effectiveDuration:O,pps:x,timelineReady:y,elementsLength:v,setZoomMode:w,setManualZoomPercent:A,onSeek:k}){const M=d.useRef(0),E=d.useRef(s),$=d.useCallback(N=>{!t.current||r.current<=0||(t.current.style.left=`${oy(N,n.current)}px`)},[t,r,n]);d.useEffect(()=>{$(l)},[l,x,$]),d.useEffect(()=>{const N=e.current;if(!N){E.current=s;return}N.scrollLeft=rj(E.current,s,N.scrollLeft),E.current=s},[s,e]),Xt(()=>zr.subscribe(R=>{if(!t.current||r.current<=0)return;const D=oy(R,n.current);t.current.style.left=`${D}px`;const V=e.current;if(V&&!i.current&&sy(c.current,V.scrollWidth,V.clientWidth)){const z=V.clientWidth*.12;D>V.scrollLeft+V.clientWidth-z?V.scrollLeft=D-V.clientWidth*.15:D<V.scrollLeft+pn&&(V.scrollLeft=Math.max(0,D-pn))}}));const C=d.useCallback(N=>{const R=e.current;if(!R||O<=0)return;const D=R.getBoundingClientRect(),V=N-D.left+R.scrollLeft-pn;if(V<0)return;const z=Math.max(0,Math.min(O,V/x));zr.notify(z),k==null||k(z)},[e,O,x,k]),j=d.useCallback(N=>{cancelAnimationFrame(M.current);const R=e.current;if(!R||!i.current||!sy(c.current,R.scrollWidth,R.clientWidth))return;const D=R.getBoundingClientRect(),V=40,z=12;let I=0;N<D.left+V?I=-z*Math.max(0,1-(N-D.left)/V):N>D.right-V&&(I=z*Math.max(0,1-(D.right-N)/V)),I!==0&&(R.scrollLeft+=I,C(N),M.current=requestAnimationFrame(()=>j(N)))},[e,i,c,C]),T=d.useCallback(N=>{if(!N.ctrlKey)return;const R=e.current;if(!R||r.current<=0||g.current<=0||n.current<=0)return;N.preventDefault(),N.stopPropagation();const D=R.getBoundingClientRect(),V=pj(N.deltaY,c.current,u.current);if(V===u.current&&c.current==="manual")return;const z=g.current*(V/100),I=ij({pointerX:N.clientX-D.left,currentScrollLeft:R.scrollLeft,gutter:pn,currentPixelsPerSecond:n.current,nextPixelsPerSecond:z,duration:r.current});w("manual"),A(V),requestAnimationFrame(()=>{const U=Math.max(0,R.scrollWidth-R.clientWidth);R.scrollLeft=Math.min(U,I)})},[e,r,g,n,c,u,A,w]);return d.useEffect(()=>{const N=e.current;if(N)return N.addEventListener("wheel",T,{passive:!1,capture:!0}),()=>{N.removeEventListener("wheel",T,{capture:!0})}},[T,e,y,v]),{seekFromX:C,autoScrollDuringDrag:j,dragScrollRaf:M}}const $o="/icons/timeline";function jo({src:t}){return m.jsx("img",{src:t,alt:"",width:12,height:12,style:{filter:"brightness(0) invert(1)"},draggable:!1})}const Oj=m.jsx(jo,{src:`${$o}/captions.svg`}),uy=m.jsx(jo,{src:`${$o}/image.svg`}),xj=m.jsx(jo,{src:`${$o}/music.svg`}),fy=m.jsx(jo,{src:`${$o}/text.svg`}),Y2=m.jsx(jo,{src:`${$o}/composition.svg`}),yj=m.jsx(jo,{src:`${$o}/audio.svg`}),dy={video:uy,audio:xj,img:uy,div:Y2,span:Oj,p:fy,h1:fy,section:Y2,sfx:yj};function hy(t){const e=q$(),n=t.toLowerCase(),r=n.startsWith("h")&&n.length===2&&"123456".includes(n[1]??"")?dy.h1:dy[n]??Y2;return{...e,icon:r}}const uu=/\.(jpg|jpeg|png|gif|webp|svg|ico)$/i,A8=/\.(mp4|webm|mov)$/i,M8=/\.(mp3|wav|ogg|m4a|aac)$/i,xf=/\.(woff|woff2|ttf|ttc|otf|eot)$/i,US=/\.(mp4|webm|mov|mp3|wav|ogg|m4a|aac|jpg|jpeg|png|gif|webp|svg|ico)$/i;function WS(t){return US.test(t)}const I2="application/x-hyperframes-asset",Qf="application/x-hyperframes-block",bj=5;function my(t){return uu.test(t)?"image":A8.test(t)?"video":M8.test(t)?"audio":null}function vj(t,e){const i=(t.split("/").pop()??"asset").replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"").toLowerCase()||"asset",l=new Set(e);if(!l.has(i))return i;let s=2;for(;l.has(`${i}_${s}`);)s+=1;return`${i}_${s}`}function Sj(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";if(!n)return e;const r=n.split("/").filter(Boolean),i=e.split("/").filter(Boolean);for(;r.length>0&&i.length>0&&r[0]===i[0];)r.shift(),i.shift();return[...r.map(()=>".."),...i].join("/")||e.split("/").pop()||e}function wj(t,e,n=[]){let r=Math.round(Math.max(0,t.start)*100)/100;const i=r,l=e.map(h=>Number.isFinite(h)&&h>0?h:bj),s=l.reduce((h,g)=>Math.round((h+g)*100)/100,i),u=n.some(h=>{if(h.track!==t.track)return!1;const g=Math.max(0,h.start),O=g+Math.max(0,h.duration);return i<O&&s>g})?Math.max(t.track,...n.map(h=>h.track))+1:t.track;return l.map(h=>{const g=r;return r=Math.round((r+h)*100)/100,{start:g,track:u}})}function KS(t){var r,i;const e=Number.parseFloat(((r=t.match(/\bdata-width=(["'])([^"']+)\1/i))==null?void 0:r[2])??""),n=Number.parseFloat(((i=t.match(/\bdata-height=(["'])([^"']+)\1/i))==null?void 0:i[2])??"");return{left:0,top:0,width:Number.isFinite(e)&&e>0?Math.round(e):640,height:Number.isFinite(n)&&n>0?Math.round(n):360}}function kj(t){const e=`id="${t.id}" class="clip" src="${t.assetPath}" data-start="${t.start}" data-duration="${t.duration}" data-track-index="${t.track}"`,n=t.geometry??{left:0,top:0,width:640,height:360},r=`position: absolute; left: ${n.left}px; top: ${n.top}px; width: ${n.width}px; height: ${n.height}px; object-fit: contain; z-index: ${t.zIndex}`;return t.kind==="image"?`<img ${e} style="${r}" />`:t.kind==="video"?`<video ${e} muted playsinline style="${r}"></video>`:`<audio ${e} style="z-index: ${t.zIndex}"></audio>`}function C8(t,e){var h;const r=/<[^>]*data-composition-id="[^"]+"[^>]*>/i.exec(t);if(!r||r.index==null)throw new Error("No composition root found in target source");const i=r.index+r[0].length,l=t.lastIndexOf(`
64
- `,r.index),c=(((h=t.slice(l+1,r.index).match(/^(\s*)/))==null?void 0:h[1])??"")+" ",u=e.split(`
65
- `).map((g,O)=>O===0?g:c+g).join(`
66
- `);return`${t.slice(0,i)}
67
- ${c}${u}${t.slice(i)}`}function Aj({scrollRef:t,ppsRef:e,durationRef:n,trackOrderRef:r,onFileDrop:i,onAssetDrop:l,onBlockDrop:s}){const[c,u]=d.useState(!1),h=d.useCallback(O=>{const x=O.dataTransfer.files.length>0,y=Array.from(O.dataTransfer.types),v=y.includes(I2),w=y.includes(Qf);!x&&!v&&!w||(O.preventDefault(),(v||w)&&(O.dataTransfer.dropEffect="copy"),u(!0))},[]),g=d.useCallback(O=>{O.preventDefault(),u(!1);const x=t.current,y=x==null?void 0:x.getBoundingClientRect(),v={rectLeft:(y==null?void 0:y.left)??0,rectTop:(y==null?void 0:y.top)??0,scrollLeft:(x==null?void 0:x.scrollLeft)??0,scrollTop:(x==null?void 0:x.scrollTop)??0,pixelsPerSecond:e.current,duration:n.current,trackHeight:no,trackOrder:r.current};if(i&&O.dataTransfer.files.length>0){i(Array.from(O.dataTransfer.files),x&&y?mp(v,O.clientX,O.clientY):void 0);return}const w=O.dataTransfer.getData(I2);if(w&&l&&x&&y){try{const k=JSON.parse(w);k.path&&l(k.path,mp(v,O.clientX,O.clientY))}catch{}return}const A=O.dataTransfer.getData(Qf);if(A&&s&&x&&y)try{const k=JSON.parse(A);k.name&&s(k.name,mp(v,O.clientX,O.clientY))}catch{}},[l,s,i,t,e,n,r]);return{isDragOver:c,setIsDragOver:u,handleAssetDragOver:h,handleAssetDrop:g}}function Mj({isDragOver:t,onFileDrop:e,onDragOver:n,onDragLeave:r,onDrop:i}){return m.jsxs("div",{className:`h-full border-t bg-[#0a0a0b] flex flex-col select-none transition-colors duration-150 ${t?"border-studio-accent/50 bg-studio-accent/[0.03]":"border-neutral-800/50"}`,onDragOver:n,onDragLeave:r,onDrop:i,children:[m.jsx("div",{className:"flex-shrink-0 border-b border-neutral-800/40 flex items-end relative",style:{height:mo,paddingLeft:pn},children:[0,10,20,30,40,50].map(l=>m.jsxs("div",{className:"flex flex-col items-center",style:{position:"absolute",left:pn+l*14},children:[m.jsx("span",{className:"text-[9px] text-neutral-600 font-mono tabular-nums leading-none mb-0.5",children:`${Math.floor(l/60)}:${(l%60).toString().padStart(2,"0")}`}),m.jsx("div",{className:"w-px h-[5px] bg-neutral-700/40"})]},l))}),m.jsx("div",{className:"flex-1 flex items-center justify-center",children:m.jsx("div",{className:`flex items-center gap-3 px-6 py-3 border border-dashed rounded-lg transition-colors duration-150 ${t?"border-studio-accent/60 bg-studio-accent/[0.06]":"border-neutral-700/50"}`,children:t?m.jsxs(m.Fragment,{children:[m.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-studio-accent flex-shrink-0",children:[m.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),m.jsx("span",{className:"text-[13px] text-studio-accent",children:"Drop media files to import"})]}):m.jsxs(m.Fragment,{children:[m.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-600 flex-shrink-0",children:[m.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2"}),m.jsx("path",{d:"M7 2v20"}),m.jsx("path",{d:"M17 2v20"}),m.jsx("path",{d:"M2 7h20"}),m.jsx("path",{d:"M2 17h20"})]}),m.jsx("span",{className:"text-[13px] text-neutral-500",children:e?"Drop media here or describe your video to start":"Describe your video to start creating"})]})})})]})}const py=d.memo(function({el:e,pps:n,clipY:r,isSelected:i,isHovered:l,isDragging:s=!1,hasCustomContent:c,capabilities:u,theme:h=GS,trackStyle:g,isComposition:O,onHoverStart:x,onHoverEnd:y,onPointerDown:v,onResizeStart:w,onClick:A,onDoubleClick:k,onContextMenu:M,children:E}){const $=e.start*n,C=Math.max(e.duration*n,4),j=G$({isHovered:l,isSelected:i,isDragging:s}),T=i?g.accent:l?h.clipBorderHover:h.clipBorder,N=s?h.clipShadowDragging:i?`0 0 0 1px ${g.accent}80, 0 0 8px ${g.accent}25`:l?h.clipShadowHover:h.clipShadow,R=e.label||e.id||e.tag,D=j>.01;return m.jsxs("div",{"data-clip":"true",className:c?"absolute overflow-visible":"absolute flex items-center overflow-visible",style:{left:$,width:C,top:r,bottom:r,borderRadius:h.clipRadius,background:g.clip,border:`1px solid ${T}`,boxShadow:N,transition:"border-color 100ms, box-shadow 100ms",zIndex:s?20:i?10:l?5:1,cursor:u.canMove?"grab":"default",transform:s?"translateY(-1px)":void 0,opacity:s?.92:1},title:O?`${e.compositionSrc} • Double-click to open`:`${R} • ${e.start.toFixed(1)}s – ${(e.start+e.duration).toFixed(1)}s`,onPointerEnter:x,onPointerLeave:y,onPointerDown:v,onClick:A,onDoubleClick:k,onContextMenu:M,children:[m.jsx("div",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,bottom:0,width:3,background:g.accent,opacity:i?.7:.3,borderRadius:`${h.clipRadius} 0 0 ${h.clipRadius}`,zIndex:2,pointerEvents:"none"}}),D&&u.canTrimStart&&m.jsx("div",{"aria-hidden":"true",onPointerDown:V=>w==null?void 0:w("start",V),style:{position:"absolute",left:0,top:0,bottom:0,width:14,cursor:"col-resize",zIndex:4},children:m.jsx("div",{style:{position:"absolute",left:4,top:6,bottom:6,width:2,borderRadius:1,background:g.accent,opacity:j*.6}})}),D&&u.canTrimEnd&&m.jsx("div",{"aria-hidden":"true",onPointerDown:V=>w==null?void 0:w("end",V),style:{position:"absolute",right:0,top:0,bottom:0,width:14,cursor:"col-resize",zIndex:4},children:m.jsx("div",{style:{position:"absolute",right:4,top:6,bottom:6,width:2,borderRadius:1,background:g.accent,opacity:j*.6}})}),E]})}),Cj=.8,Ej=d.memo(function({keyframesData:e,clipWidthPx:n,clipHeightPx:r,accentColor:i,isSelected:l,currentPercentage:s,elementId:c,selectedKeyframes:u,onClickKeyframe:h,onShiftClickKeyframe:g,onDragKeyframe:O,onContextMenuKeyframe:x}){const y=d.useRef(null);if(n<20)return null;const v=Math.round(r*Cj),w=v/2,A=e.keyframes.slice().sort((C,j)=>C.percentage-j.percentage),k=l?i:"#a3a3a3",M=l?.4:.25,E=(C,j)=>{C.stopPropagation(),C.shiftKey?g==null||g(c,j):h==null||h(j)},$=(C,j)=>{if(C.button!==0)return;C.stopPropagation();const T=C.clientX,N=D=>{const V=D.clientX-T;Math.abs(V)>4&&(y.current={startX:T,startPct:j})},R=D=>{document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",R);const V=y.current;if(y.current=null,!V)return;const I=(D.clientX-V.startX)/n*100,U=Math.max(0,Math.min(100,Math.round(V.startPct+I)));Math.abs(U-V.startPct)>.5&&(O==null||O(V.startPct,U))};document.addEventListener("pointermove",N),document.addEventListener("pointerup",R)};return m.jsxs("div",{className:"absolute inset-0",style:{zIndex:3,pointerEvents:"none"},children:[A.map((C,j)=>{if(j===0)return null;const T=A[j-1],N=T.percentage/100*n,R=C.percentage/100*n;return m.jsx("div",{className:"absolute",style:{left:N,top:"50%",width:R-N,height:2,transform:"translateY(-1px)",background:k,opacity:M,borderRadius:1}},`line-${T.percentage}-${C.percentage}`)}),A.map(C=>{const j=C.percentage/100*n-w,T=`${c}:${C.percentage}`,N=u.has(T),R=l&&Math.abs(C.percentage-s)<.5,D=N||R?i:"#a3a3a3";return m.jsx("button",{type:"button",className:"absolute",style:{left:j,top:"50%",transform:"translateY(-50%)",width:v,height:v,pointerEvents:"auto",background:"none",border:"none",cursor:"pointer",padding:0},onClick:V=>E(V,C.percentage),onPointerDown:V=>$(V,C.percentage),onContextMenu:V=>{V.preventDefault(),V.stopPropagation(),x==null||x(V,c,C.percentage)},title:`${C.percentage}%`,children:m.jsxs("svg",{width:v,height:v,viewBox:"0 0 10 10",children:[N&&m.jsx("path",{d:"M5 0L10 5L5 10L0 5Z",fill:"none",stroke:i,strokeWidth:"0.8",opacity:.5}),m.jsx("path",{d:"M5 1L9 5L5 9L1 5Z",fill:D,opacity:N||R?1:.55})]})},C.percentage)})]})}),Tj=d.memo(function({major:e,minor:n,pps:r,trackContentWidth:i,totalH:l,effectiveDuration:s,majorTickInterval:c,shiftHeld:u,rangeSelection:h,theme:g}){return m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"absolute pointer-events-none",style:{left:pn,width:i},height:l,children:e.map(O=>{const x=O*r;return m.jsx("line",{x1:x,y1:mo,x2:x,y2:l,stroke:g.tickMinor,strokeWidth:"1"},`g-${O}`)})}),m.jsxs("div",{className:"relative overflow-hidden",style:{height:mo,marginLeft:pn,width:i},children:[u&&!h&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none z-10",children:m.jsx("span",{className:"text-[9px] font-medium",style:{color:g.textSecondary},children:"Drag or click a clip to edit range"})}),n.map(O=>m.jsx("div",{className:"absolute bottom-0",style:{left:O*r},children:m.jsx("div",{className:"w-px h-[3px]",style:{background:g.tickMinor}})},`m-${O}`)),e.map(O=>m.jsxs("div",{className:"absolute bottom-0 flex flex-col items-center",style:{left:O*r},children:[m.jsx("span",{className:"text-[9px] font-mono tabular-nums leading-none mb-0.5",style:{color:g.tickText},children:nj(O,s,c)}),m.jsx("div",{className:"w-px h-[5px]",style:{background:g.tickMajor}})]},`M-${O}`))]})]})}),$j={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},jj="VITE_STUDIO_ENABLE_PREVIEW_MANUAL_DRAGGING",Pj="VITE_STUDIO_ENABLE_INSPECTOR_PANELS",Qj="VITE_STUDIO_ENABLE_MOTION_PANEL",Zj=new Set(["1","true","yes","on","enabled"]),Nj=new Set(["0","false","no","off","disabled"]);function Po(t,e,n){for(const r of e){const i=t[r];if(typeof i=="boolean")return i;if(typeof i!="string")continue;const l=i.trim().toLowerCase();if(l){if(Zj.has(l))return!0;if(Nj.has(l))return!1}}return n}const Rj=typeof window<"u"?window.__HF_STUDIO_ENV__??{}:{},Qo={...$j??{},...Rj},Vj=Po(Qo,[jj,"VITE_STUDIO_PREVIEW_MANUAL_EDITING_ENABLED"],!0),Mn=Po(Qo,[Pj,"VITE_STUDIO_INSPECTOR_PANELS_ENABLED"],!0),E8=Po(Qo,[Qj,"VITE_STUDIO_MOTION_PANEL_ENABLED"],!1),pp=Po(Qo,["VITE_STUDIO_ENABLE_BLOCKS_PANEL","VITE_STUDIO_BLOCKS_PANEL_ENABLED"],!0),q2=Po(Qo,["VITE_STUDIO_ENABLE_GSAP_PANEL","VITE_STUDIO_GSAP_PANEL_ENABLED"],!0),Ja=Po(Qo,["VITE_STUDIO_ENABLE_KEYFRAMES","VITE_STUDIO_KEYFRAMES_ENABLED"],!1),G2=Mn,gy="Manual editing is temporarily disabled",Lj=d.memo(function({major:e,minor:n,pps:r,trackContentWidth:i,totalH:l,effectiveDuration:s,majorTickInterval:c,shiftHeld:u,rangeSelection:h,theme:g,displayTrackOrder:O,trackOrder:x,tracks:y,trackStyles:v,selectedElementId:w,hoveredClip:A,draggedClip:k,resizingClip:M,blockedClipRef:E,suppressClickRef:$,scrollRef:C,renderClipContent:j,renderClipOverlay:T,playheadRef:N,onResizeElement:R,onMoveElement:D,onDrillDown:V,onSelectElement:z,setHoveredClip:I,setShowPopover:U,setRangeSelection:K,setResizingClip:H,setDraggedClip:q,setSelectedElementId:X,syncClipDragAutoScroll:G,shiftClickClipRef:F,getPreviewElement:P,getTrackStyle:Z,keyframeCache:L,selectedKeyframes:B,currentTime:J,onClickKeyframe:te,onShiftClickKeyframe:Y,onDragKeyframe:re,onContextMenuKeyframe:ae,onContextMenuClip:ue,onToggleKeyframeAtPlayhead:me}){const ye=(k==null?void 0:k.element)??null,Oe=(k==null?void 0:k.started)===!0&&ye?U$({element:ye,draggedElementId:ye.key??ye.id,previewStart:k.previewStart,previewTrack:k.previewTrack}):null,Se=(k==null?void 0:k.started)===!0&&Oe&&C.current?{left:k.pointerClientX-C.current.getBoundingClientRect().left+C.current.scrollLeft-k.pointerOffsetX,top:k.pointerClientY-C.current.getBoundingClientRect().top+C.current.scrollTop-k.pointerOffsetY}:null,Ae=(Me,Ve)=>m.jsxs(m.Fragment,{children:[T==null?void 0:T(Me),m.jsx("div",{className:j?"absolute inset-0 overflow-hidden":"flex items-center overflow-hidden flex-1 min-w-0 px-3 gap-2",children:(j==null?void 0:j(Me,Ve))??m.jsx("span",{className:"truncate text-[10px] font-medium leading-none",style:{color:Ve.label},children:Me.label||Me.id||Me.tag})})]});return m.jsxs("div",{className:"relative",style:{height:l,width:pn+i},children:[m.jsx(Tj,{major:e,minor:n,pps:r,trackContentWidth:i,totalH:l,effectiveDuration:s,majorTickInterval:c,shiftHeld:u,rangeSelection:h,theme:g}),O.map(Me=>{var yt;const Ve=((yt=y.find(([Le])=>Le===Me))==null?void 0:yt[1])??[],Pe=v.get(Me)??Z(""),ft=(k==null?void 0:k.started)===!0&&!x.includes(Me)&&Ve.length===0;return m.jsxs("div",{className:"relative flex",style:{height:no,background:g.rowBackground,borderBottom:`1px solid ${g.rowBorder}`},children:[m.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",style:{width:pn,background:g.gutterBackground,borderRight:`1px solid ${g.gutterBorder}`},children:m.jsx("div",{className:"flex items-center justify-center",style:{width:18,height:18,borderRadius:6,backgroundColor:Pe.iconBackground,border:`1px solid ${g.gutterBorder}`,color:"#fff"},children:Pe.icon})}),m.jsxs("div",{style:{width:i},className:"relative",children:[ft&&m.jsx("div",{className:"absolute inset-0 flex items-center",style:{paddingLeft:16,color:Pe.label,fontSize:11,letterSpacing:"0.06em",textTransform:"uppercase",opacity:.5},children:"New track"}),Ve.map((Le,Ye)=>{const _e=Z(Le.tag),be=Le.key??Le.id,dt=iy(Le),Ue=w===be,bt=!!Le.compositionSrc,Re=`${be}-${Ye}`;if((k==null?void 0:k.started)===!0&&((ye==null?void 0:ye.key)??(ye==null?void 0:ye.id))===be)return null;const Rt=P(Le);return m.jsxs(py,{onContextMenu:we=>{we.preventDefault(),ue==null||ue(we,Le)},el:Rt,pps:r,clipY:hp,isSelected:Ue,isHovered:A===Re,isDragging:!1,hasCustomContent:!!j,capabilities:dt,theme:g,trackStyle:_e,isComposition:bt,onHoverStart:()=>I(Re),onHoverEnd:()=>I(null),onResizeStart:(we,ht)=>{ht.button!==0||ht.shiftKey||!R||we==="start"&&!dt.canTrimStart||we==="end"&&!dt.canTrimEnd||(ht.stopPropagation(),E.current=null,U(!1),K(null),H({element:Le,edge:we,originClientX:ht.clientX,previewStart:Le.start,previewDuration:Le.duration,previewPlaybackStart:Le.playbackStart,started:!1}))},onPointerDown:we=>{var ve,ze;if(we.button!==0)return;if(we.shiftKey){F.current={element:Le,anchorX:we.clientX,anchorY:we.clientY};return}const Mt=we.currentTarget.getBoundingClientRect(),ot=X$({width:Mt.width,offsetX:we.clientX-Mt.left,handleWidth:W$,capabilities:dt});if(ot&&(ot==="move"&&D||ot!=="move"&&R)){E.current={element:Le,intent:ot,originClientX:we.clientX,originClientY:we.clientY,started:!1};return}!D||!dt.canMove||(E.current=null,U(!1),K(null),q({element:Le,originClientX:we.clientX,originClientY:we.clientY,originScrollLeft:((ve=C.current)==null?void 0:ve.scrollLeft)??0,originScrollTop:((ze=C.current)==null?void 0:ze.scrollTop)??0,pointerClientX:we.clientX,pointerClientY:we.clientY,pointerOffsetX:we.clientX-Mt.left,pointerOffsetY:we.clientY-Mt.top,previewStart:Le.start,previewTrack:Le.track,started:!1}),G(we.clientX,we.clientY))},onClick:we=>{if(we.stopPropagation(),$.current)return;const ht=Ue?null:Le;X(ht?be:null),z==null||z(ht)},onDoubleClick:we=>{we.stopPropagation(),!$.current&&bt&&V&&V(Le)},children:[Ae(Rt,_e),Ja&&(L==null?void 0:L.get(be))&&m.jsx(Ej,{keyframesData:L.get(be),clipWidthPx:Math.max(Rt.duration*r,4),clipHeightPx:no-2*hp,accentColor:_e.accent,isSelected:Ue,currentPercentage:Rt.duration>0?(J-Rt.start)/Rt.duration*100:0,elementId:be,selectedKeyframes:B,onClickKeyframe:we=>te==null?void 0:te(Rt,we),onShiftClickKeyframe:Y,onDragKeyframe:(we,ht)=>re==null?void 0:re(Rt,we,ht),onContextMenuKeyframe:ae})]},Re)})]})]},Me)}),Oe&&Se&&m.jsx("div",{className:"absolute pointer-events-none",style:{top:Se.top,left:Se.left,width:Math.max(Oe.duration*r,4),height:no-hp*2,zIndex:40},children:m.jsx(py,{el:{...Oe,start:0},pps:r,clipY:0,isSelected:w===(Oe.key??Oe.id),isHovered:!1,isDragging:!0,hasCustomContent:!!j,capabilities:iy(Oe),theme:g,trackStyle:Z(Oe.tag),isComposition:!!Oe.compositionSrc,onHoverStart:()=>{},onHoverEnd:()=>{},onResizeStart:()=>{},onClick:()=>{},onDoubleClick:()=>{},children:Ae(Oe,Z(Oe.tag))})}),h&&m.jsx("div",{className:"absolute pointer-events-none",style:{left:pn+Math.min(h.start,h.end)*r,width:Math.abs(h.end-h.start)*r,top:mo,bottom:0,backgroundColor:"rgba(59, 130, 246, 0.12)",borderLeft:"1px solid rgba(59, 130, 246, 0.4)",borderRight:"1px solid rgba(59, 130, 246, 0.4)",zIndex:50}}),m.jsxs("div",{ref:N,className:"absolute top-0 bottom-0 pointer-events-none",style:{left:`${pn}px`,zIndex:100},children:[m.jsx("div",{className:"absolute top-0 bottom-0",style:{left:"50%",width:2,marginLeft:-1,background:"var(--hf-accent, #3CE6AC)",boxShadow:"0 0 8px rgba(60,230,172,0.5)"}}),m.jsx("div",{className:"absolute",style:{left:"50%",top:0,transform:"translateX(-50%)"},children:m.jsx("div",{style:{width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"8px solid var(--hf-accent, #3CE6AC)",filter:"drop-shadow(0 1px 3px rgba(0,0,0,0.6))"}})})]})]})}),U2=".hyperframes/studio-motion.json",gp="studio-motion",fl="data-hf-studio-motion",po="data-hf-studio-motion-original-transform",fu="data-hf-studio-motion-original-opacity",du="data-hf-studio-motion-original-visibility",v1=["none","power1.in","power1.out","power1.inOut","power2.in","power2.out","power2.inOut","power3.in","power3.out","power3.inOut","power4.in","power4.out","power4.inOut","sine.in","sine.out","sine.inOut","expo.in","expo.out","expo.inOut","circ.in","circ.out","circ.inOut","back.in(1.7)","back.out(1.7)","back.inOut(1.7)","elastic.out(1, 0.45)","bounce.out"],Hc={x1:.215,y1:.61,x2:.355,y2:1},_j={none:{x1:0,y1:0,x2:1,y2:1},"power1.in":{x1:.55,y1:.085,x2:.68,y2:.53},"power1.out":{x1:.25,y1:.46,x2:.45,y2:.94},"power1.inOut":{x1:.455,y1:.03,x2:.515,y2:.955},"power2.in":{x1:.55,y1:.055,x2:.675,y2:.19},"power2.out":{x1:.215,y1:.61,x2:.355,y2:1},"power2.inOut":{x1:.645,y1:.045,x2:.355,y2:1},"power3.in":{x1:.895,y1:.03,x2:.685,y2:.22},"power3.out":{x1:.165,y1:.84,x2:.44,y2:1},"power3.inOut":{x1:.77,y1:0,x2:.175,y2:1},"power4.in":{x1:.755,y1:.05,x2:.855,y2:.06},"power4.out":{x1:.23,y1:1,x2:.32,y2:1},"power4.inOut":{x1:.86,y1:0,x2:.07,y2:1},"sine.in":{x1:.47,y1:0,x2:.745,y2:.715},"sine.out":{x1:.39,y1:.575,x2:.565,y2:1},"sine.inOut":{x1:.445,y1:.05,x2:.55,y2:.95},"expo.in":{x1:.95,y1:.05,x2:.795,y2:.035},"expo.out":{x1:.19,y1:1,x2:.22,y2:1},"expo.inOut":{x1:1,y1:0,x2:0,y2:1},"circ.in":{x1:.6,y1:.04,x2:.98,y2:.335},"circ.out":{x1:.075,y1:.82,x2:.165,y2:1},"circ.inOut":{x1:.785,y1:.135,x2:.15,y2:.86},"back.in(1.7)":{x1:.6,y1:-.28,x2:.735,y2:.045},"back.out(1.7)":{x1:.175,y1:.885,x2:.32,y2:1.275},"back.inOut(1.7)":{x1:.68,y1:-.55,x2:.265,y2:1.55},"elastic.out(1, 0.45)":{x1:.16,y1:1.32,x2:.28,y2:.86},"bounce.out":{x1:.34,y1:1.56,x2:.64,y2:.74}},Dj=/^M\s*0\s*,\s*0\s*C\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s+1\s*,\s*1\s*$/i;function Oy(t,e){return Number.isFinite(t)&&t>0?t:e}function Hj(t,e){return Number.isFinite(t)&&t>=0?t:e}function Xj(t){return t.trim()||"none"}function Xc(t){return Math.round(t*1e3)/1e3}function S1(t,e,n,r){return Number.isFinite(t)?Math.min(n,Math.max(e,t)):r}function w1(t){const e=Xc(t);return Object.is(e,-0)?"0":`${e}`}function W2(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function T8(t){return{x1:Xc(S1(t.x1??Hc.x1,0,1,.215)),y1:Xc(S1(t.y1??Hc.y1,-.6,1.6,.61)),x2:Xc(S1(t.x2??Hc.x2,0,1,.355)),y2:Xc(S1(t.y2??Hc.y2,-.6,1.6,1))}}function xy(t){if(!t)return null;const e=t.trim().match(Dj);if(!e)return null;const n={x1:Number.parseFloat(e[1]??""),y1:Number.parseFloat(e[2]??""),x2:Number.parseFloat(e[3]??""),y2:Number.parseFloat(e[4]??"")};return Object.values(n).every(Number.isFinite)?T8(n):null}function JS(t){const e=T8(t);return`M0,0 C${w1(e.x1)},${w1(e.y1)} ${w1(e.x2)},${w1(e.y2)} 1,1`}function hu(t){return _j[t]??Hc}function zj(t,e){const n=Hj(e.start,0),r=Oy(e.duration,.6),i=Oy(e.distance,32),l=Xj(e.ease),s=e.direction??"up",c={start:n,duration:r,ease:l,customEase:e.customEase};if(t==="pop")return{...c,from:{scale:.88,autoAlpha:0},to:{scale:1,autoAlpha:1}};if(t==="slide"){const u=s==="right"?-i:s==="left"?i:0,h=s==="down"?-i:s==="up"?i:0;return{...c,from:{x:u,y:h,autoAlpha:0},to:{x:0,y:0,autoAlpha:1}}}return{...c,from:{y:s==="down"?-i:i,autoAlpha:0},to:{y:0,autoAlpha:1}}}function yy(t){if(!t||typeof t!="object")return null;const e=t,n={};for(const r of["x","y","scale","rotation","opacity","autoAlpha"]){const i=W2(e[r]);i!=null&&(n[r]=i)}return Object.keys(n).length>0?n:null}function Fj(t){if(!t||typeof t!="object")return;const e=t,n=typeof e.id=="string"?e.id.trim():"",r=typeof e.data=="string"?e.data.trim():"";if(!(!n||!r))return{id:n,data:r}}function e7(t){const e=t.getAttribute(fl);if(!e||e==="true")return null;try{const n=JSON.parse(e);if(!n||typeof n!="object")return null;const r=n,i=W2(r.start),l=W2(r.duration);if(i==null||l==null||i<0||l<=0)return null;const s=typeof r.ease=="string"&&r.ease.trim()?r.ease.trim():"none",c=yy(r.from),u=yy(r.to);return!c||!u?null:{start:i,duration:l,ease:s,customEase:Fj(r.customEase),from:c,to:u}}catch{return null}}function Bj(t,e){t.getAttribute(po)||(t.setAttribute(po,t.style.transform),t.setAttribute(fu,t.style.opacity),t.setAttribute(du,t.style.visibility));const n={start:e.start,duration:e.duration,ease:e.ease,from:e.from,to:e.to};e.customEase&&(n.customEase=e.customEase),t.setAttribute(fl,JSON.stringify(n))}function Yj(t,e){var n;t.hasAttribute(fl)&&((n=e==null?void 0:e.set)==null||n.call(e,t,{clearProps:"transform,opacity,visibility"}),t.style.transform=t.getAttribute(po)??"",t.style.opacity=t.getAttribute(fu)??"",t.style.visibility=t.getAttribute(du)??"",t.removeAttribute(fl),t.removeAttribute(po),t.removeAttribute(fu),t.removeAttribute(du))}function Ij(t,e){var n,r,i,l;try{const s=(r=(n=t.__player)==null?void 0:n.getTime)==null?void 0:r.call(n);if(typeof s=="number"&&Number.isFinite(s))return Math.max(0,s)}catch{}try{const s=(l=(i=t.__timeline)==null?void 0:i.time)==null?void 0:l.call(i);if(typeof s=="number"&&Number.isFinite(s))return Math.max(0,s)}catch{}return 0}function K2(t,e){var h,g,O,x,y,v;const n=t.defaultView;if(!n)return 0;const r=n.gsap;n.__timelines=n.__timelines??{},(g=(h=n.__timelines[gp])==null?void 0:h.kill)==null||g.call(h),delete n.__timelines[gp];const i=(O=t.defaultView)==null?void 0:O.HTMLElement;if(!i)return 0;const l=[];for(const w of Array.from(t.querySelectorAll(`[${fl}]`))){if(!(w instanceof i))continue;const A=e7(w);A&&l.push({element:w,motion:A})}if(!(r!=null&&r.timeline)||l.length===0)return 0;const s=r.timeline({paused:!0,defaults:{overwrite:"auto"}});let c=0;for(const{element:w,motion:A}of l){if(!s.fromTo)continue;const k={...A.from},M=qj(n,A),E={...A.to,duration:A.duration,ease:M,overwrite:"auto",immediateRender:!1};s.fromTo(w,k,E,A.start),c+=1}if(c===0)return(x=s.kill)==null||x.call(s),0;n.__timelines[gp]=s,(y=s.pause)==null||y.call(s);const u=Ij(n);return s.totalTime?s.totalTime(u,!1):(v=s.time)==null||v.call(s,u),c}function qj(t,e){var i,l;const n=e.customEase;if(!n)return e.ease;const r=t.CustomEase;if(typeof(r==null?void 0:r.create)!="function")return e.ease;try{return(l=(i=t.gsap)==null?void 0:i.registerPlugin)==null||l.call(i,r),r.create(n.id,n.data),n.id}catch{return e.ease}}const Gj={set:"Set",to:"Animate",from:"Animate In",fromTo:"From → To"},t7={set:"Instantly snap to these values — no transition",to:"Smoothly animate the element to these target values",from:"Element starts at these values and transitions to its normal state",fromTo:"Animate from one state to another"},sl={x:"Move X",y:"Move Y",width:"Width",height:"Height",rotation:"Rotate",opacity:"Opacity",scale:"Scale",scaleX:"Scale X",scaleY:"Scale Y",autoAlpha:"Visibility",visibility:"Visible",scaleX_alias:"Stretch X",filter:"Filter",clipPath:"Clip Path",color:"Color",backgroundColor:"Background",borderColor:"Border Color",borderRadius:"Radius",fontSize:"Font Size",letterSpacing:"Tracking",skewX:"Skew X",skewY:"Skew Y",innerText:"Counter Value"},n7={x:"px",y:"px",width:"px",height:"px",rotation:"°",opacity:"%",scale:"×",scaleX:"×",scaleY:"×",autoAlpha:"%",visibility:""},Uj={x:"Move left/right (negative = left, positive = right)",y:"Move up/down (negative = up, positive = down)",opacity:"How visible (0 = invisible, 1 = fully visible)",scale:"Size multiplier (1 = normal, 2 = double, 0.5 = half)",scaleX:"Horizontal stretch (1 = normal)",scaleY:"Vertical stretch (1 = normal)",rotation:"Spin angle (360 = full rotation)",width:"Element width",height:"Element height",autoAlpha:"Like opacity but hides element completely at 0",visibility:"Show or hide the element",innerText:"End value for a number roll-up (the number it counts up/down to)"},mu={none:"Constant speed","power1.out":"Gentle slowdown","power2.out":"Smooth slowdown","power3.out":"Snappy slowdown","power4.out":"Sharp slowdown","power1.in":"Gentle speedup","power2.in":"Smooth speedup","power3.in":"Strong speedup","power4.in":"Sharp speedup","power1.inOut":"Gentle ease","power2.inOut":"Smooth ease","power3.inOut":"Strong ease","power4.inOut":"Sharp ease","back.out":"Overshoot & settle","back.in":"Pull back & go","back.inOut":"Pull & overshoot","elastic.out":"Springy bounce","elastic.in":"Wind up spring","elastic.inOut":"Full spring","bounce.out":"Drop & bounce","bounce.in":"Reverse bounce","bounce.inOut":"Double bounce","expo.out":"Very snappy stop","expo.in":"Very slow start","expo.inOut":"Dramatic ease","spring-gentle":"Gentle spring","spring-bouncy":"Bouncy spring","spring-stiff":"Stiff spring","spring-wobbly":"Wobbly spring","spring-heavy":"Heavy spring"},Wj={none:[0,0,1,1],"power1.out":[0,0,.58,1],"power2.out":[.16,1,.3,1],"power3.out":[.08,.82,.17,1],"power4.out":[.06,.73,.09,1],"power1.in":[.42,0,1,1],"power2.in":[.55,.06,.68,.19],"power3.in":[.6,.04,.98,.34],"power4.in":[.7,0,.84,0],"power1.inOut":[.42,0,.58,1],"power2.inOut":[.45,.05,.55,.95],"power3.inOut":[.65,.05,.35,1],"power4.inOut":[.76,0,.24,1],"back.out":[.34,1.56,.64,1],"back.in":[.36,0,.66,-.56],"back.inOut":[.68,-.55,.27,1.55],"expo.out":[.16,1,.3,1],"expo.in":[.7,0,.84,0],"expo.inOut":[.87,0,.13,1]};function Kj(t){var i;const e=t.match(/^custom\((.+)\)$/);if(!e)return hu("power2.out");const r=(i=e[1].match(/[\d.]+/g))==null?void 0:i.map(Number);return!r||r.length<6?hu("power2.out"):{x1:r[2],y1:r[3],x2:r[4],y2:r[5]}}const r7=new Set(["opacity","autoAlpha"]),i7={opacity:{min:0,max:1,step:.01},autoAlpha:{min:0,max:1,step:.01},scale:{min:-10,max:10,step:.01},scaleX:{min:-10,max:10,step:.01},scaleY:{min:-10,max:10,step:.01},rotation:{step:1},skewX:{min:-90,max:90,step:1},skewY:{min:-90,max:90,step:1},width:{min:0,step:1},height:{min:0,step:1},borderRadius:{min:0,step:1},x:{step:1},y:{step:1},fontSize:{min:1,step:1},letterSpacing:{step:.1},innerText:{step:1}};function by(t,e){const n=i7[t];if(!n)return e;let r=e;return n.min!==void 0&&(r=Math.max(n.min,r)),n.max!==void 0&&(r=Math.min(n.max,r)),r}const Jj=["to","from","fromTo","set"],eP={to:"Animate",from:"Animate In",fromTo:"From → To",set:"Set Instantly"},tP=["none","power1.out","power2.out","power3.out","power1.in","power2.in","power1.inOut","power2.inOut","back.out","elastic.out","bounce.out","expo.out"],nP=d.memo(function({state:e,onClose:n,onDelete:r,onDeleteAll:i,onChangeEase:l,onCopyProperties:s}){const c=d.useRef(null),u=d.useRef(null),h=d.useCallback(y=>{var v;y instanceof KeyboardEvent&&y.key!=="Escape"||y instanceof MouseEvent&&((v=c.current)!=null&&v.contains(y.target))||n()},[n]);d.useEffect(()=>(document.addEventListener("mousedown",h),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",h)}),[h]);const g=Math.min(e.x,window.innerWidth-200),O=Math.min(e.y,window.innerHeight-300),x=e.currentEase?mu[e.currentEase]??e.currentEase:"Default";return m.jsxs("div",{ref:c,className:"fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:g,top:O},children:[m.jsxs("div",{className:"relative group",children:[m.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",children:[m.jsxs("span",{children:["Ease: ",m.jsx("span",{className:"text-neutral-500",children:x})]}),m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"text-neutral-500 ml-2",children:m.jsx("path",{d:"M3 1l4 3-4 3",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})})]}),m.jsx("div",{ref:u,className:"absolute left-full top-0 ml-0.5 hidden group-hover:block bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[160px] max-h-[300px] overflow-y-auto",children:tP.map(y=>m.jsxs("button",{type:"button",className:`w-full flex items-center gap-2 px-3 py-1.5 text-xs hover:bg-neutral-800 cursor-pointer text-left ${y===e.currentEase?"text-white font-medium":"text-neutral-300"}`,onClick:()=>{l(e.elementId,e.percentage,y),n()},children:[y===e.currentEase&&m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"text-green-400 flex-shrink-0",children:m.jsx("path",{d:"M1 4l2 2 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})}),m.jsx("span",{className:y===e.currentEase?"":"ml-[16px]",children:mu[y]??y})]},y))})]}),m.jsx("div",{className:"my-1 border-t border-neutral-700/60"}),m.jsx("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{r(e.elementId,e.percentage),n()},children:"Delete Keyframe"}),m.jsx("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{i(e.elementId),n()},children:"Delete All Keyframes"}),m.jsx("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{s(e.elementId,e.percentage),n()},children:"Copy Properties"})]})});function rP({scrollRef:t,ppsRef:e,durationRef:n,trackOrderRef:r,onMoveElement:i,onResizeElement:l,onBlockedEditAttempt:s,setShowPopover:c,setRangeSelectionRef:u}){const h=fe(I=>I.updateElement),[g,O]=d.useState(null),x=d.useRef(null);x.current=g;const[y,v]=d.useState(null),w=d.useRef(null);w.current=y;const A=d.useRef(null),k=d.useRef(!1),M=d.useRef(i);M.current=i;const E=d.useRef(l);E.current=l;const $=d.useRef(0),C=d.useRef(null),j=d.useCallback((I,U,K)=>{const H=t.current,q=L$({start:I.element.start,track:I.element.track,duration:I.element.duration,originClientX:I.originClientX,originClientY:I.originClientY,originScrollLeft:I.originScrollLeft,originScrollTop:I.originScrollTop,currentScrollLeft:(H==null?void 0:H.scrollLeft)??I.originScrollLeft,currentScrollTop:(H==null?void 0:H.scrollTop)??I.originScrollTop,pixelsPerSecond:e.current,trackHeight:no,maxStart:Math.max(0,n.current-I.element.duration),trackOrder:r.current},U,K);return{...I,started:!0,pointerClientX:U,pointerClientY:K,previewStart:q.start,previewTrack:q.track}},[t,e,n,r]),T=d.useCallback(()=>{C.current=null,$.current&&(cancelAnimationFrame($.current),$.current=0)},[]),N=d.useCallback(()=>{$.current=0;const I=x.current,U=C.current,K=t.current;if(!I||!U||!K)return;const H=K.getBoundingClientRect(),q=ry(H,U.clientX,U.clientY);if(q.x===0&&q.y===0)return;const X=Math.max(0,K.scrollWidth-K.clientWidth),G=Math.max(0,K.scrollHeight-K.clientHeight),F=Math.max(0,Math.min(X,K.scrollLeft+q.x)),P=Math.max(0,Math.min(G,K.scrollTop+q.y));F===K.scrollLeft&&P===K.scrollTop||(K.scrollLeft=F,K.scrollTop=P,O(Z=>Z&&j(Z,U.clientX,U.clientY)),$.current=requestAnimationFrame(N))},[t,j]),R=d.useCallback((I,U)=>{C.current={clientX:I,clientY:U};const K=t.current;if(!K)return;const H=K.getBoundingClientRect(),q=ry(H,I,U);if(q.x===0&&q.y===0){$.current&&(cancelAnimationFrame($.current),$.current=0);return}$.current||($.current=requestAnimationFrame(N))},[t,N]),D=d.useRef(j);D.current=j;const V=d.useRef(R);V.current=R;const z=d.useRef(T);return z.current=T,Xt(()=>{const I=()=>{requestAnimationFrame(()=>{k.current=!1})},U=H=>{var P,Z,L;const q=x.current,X=w.current,G=A.current;if(X){const B=Math.abs(H.clientX-X.originClientX);if(!X.started&&B<2)return;c(!1),(P=u.current)==null||P.call(u,null);const J=X.element.sourceDuration!=null?Math.max(0,(X.element.sourceDuration-(X.element.playbackStart??0))/Math.max(X.element.playbackRate??1,.1)):Number.POSITIVE_INFINITY,te=X.element.tag.toLowerCase(),Y=te==="audio"||te==="video",re=_$({start:X.element.start,duration:X.element.duration,originClientX:X.originClientX,pixelsPerSecond:e.current,minStart:0,maxEnd:Math.min(n.current,X.element.start+J),playbackStart:X.edge==="start"&&Y?X.element.playbackStart??0:X.element.playbackStart,playbackRate:X.element.playbackRate},X.edge,H.clientX);v(ae=>ae&&{...ae,started:!0,previewStart:re.start,previewDuration:re.duration,previewPlaybackStart:re.playbackStart});return}if(G){const B=Math.hypot(H.clientX-G.originClientX,H.clientY-G.originClientY),J=G.intent==="move"?4:2;if(!G.started&&B<J)return;G.started||(G.started=!0,A.current=G,k.current=!0,c(!1),(Z=u.current)==null||Z.call(u,null),s==null||s(G.element,G.intent));return}if(!q)return;const F=Math.hypot(H.clientX-q.originClientX,H.clientY-q.originClientY);!q.started&&F<4||(c(!1),(L=u.current)==null||L.call(u,null),O(B=>B&&D.current(B,H.clientX,H.clientY)),V.current(H.clientX,H.clientY))},K=()=>{var F,P;z.current();const H=w.current;if(H){if(w.current=null,v(null),!H.started||(k.current=!0,I(),!(H.previewStart!==H.element.start||H.previewDuration!==H.element.duration||H.previewPlaybackStart!==H.element.playbackStart)))return;h(H.element.key??H.element.id,{start:H.previewStart,duration:H.previewDuration,playbackStart:H.previewPlaybackStart}),Promise.resolve((F=E.current)==null?void 0:F.call(E,H.element,{start:H.previewStart,duration:H.previewDuration,playbackStart:H.previewPlaybackStart})).catch(L=>{h(H.element.key??H.element.id,{start:H.element.start,duration:H.element.duration,playbackStart:H.element.playbackStart}),console.error("[Timeline] Failed to persist clip resize",L)});return}const q=A.current;if(q){if(A.current=null,!q.started)return;I();return}const X=x.current;!X||(x.current=null,O(null),!X.started)||(k.current=!0,I(),!(X.previewStart!==X.element.start||X.previewTrack!==X.element.track))||(h(X.element.key??X.element.id,{start:X.previewStart,track:X.previewTrack}),Promise.resolve((P=M.current)==null?void 0:P.call(M,X.element,{start:X.previewStart,track:X.previewTrack})).catch(Z=>{h(X.element.key??X.element.id,{start:X.element.start,track:X.element.track}),console.error("[Timeline] Failed to persist clip move",Z)}))};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),()=>{z.current(),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K)}}),{draggedClip:g,setDraggedClip:O,resizingClip:y,setResizingClip:v,blockedClipRef:A,suppressClickRef:k,syncClipDragAutoScroll:R,stopClipDragAutoScroll:T}}const iP=d.memo(function({x:e,y:n,element:r,currentTime:i,onClose:l,onSplit:s,onDelete:c}){const u=d.useRef(null),h=d.useCallback(w=>{var A;w instanceof KeyboardEvent&&w.key!=="Escape"||w instanceof MouseEvent&&((A=u.current)!=null&&A.contains(w.target))||l()},[l]);d.useEffect(()=>(document.addEventListener("mousedown",h),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",h)}),[h]);const g=Math.min(e,window.innerWidth-200),O=Math.min(n,window.innerHeight-200),x=["video","audio","img"].includes(r.tag),y=x&&i>r.start&&i<r.start+r.duration,v=x?y?`Split at ${i.toFixed(2)}s`:"Split (move playhead inside clip)":null;return m.jsxs("div",{ref:u,className:"fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",style:{left:g,top:O},children:[v&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:`w-full flex items-center justify-between px-3 py-1.5 text-xs text-left ${y?"text-neutral-300 hover:bg-neutral-800 cursor-pointer":"text-neutral-600 cursor-not-allowed"}`,disabled:!y,onClick:()=>{y&&(s(r,i),l())},children:[m.jsx("span",{children:v}),m.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"S"})]}),m.jsx("div",{className:"my-1 border-t border-neutral-700/60"})]}),m.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-1.5 text-xs text-red-400 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{c(r),l()},children:[m.jsx("span",{children:"Delete"}),m.jsx("span",{className:"text-neutral-500 text-[10px] ml-3",children:"⌫"})]})]})}),aP=d.memo(function({onSeek:e,onDrillDown:n,renderClipContent:r,renderClipOverlay:i,onFileDrop:l,onAssetDrop:s,onBlockDrop:c,onDeleteElement:u,onMoveElement:h,onResizeElement:g,onBlockedEditAttempt:O,onSplitElement:x,onSelectElement:y,onDeleteKeyframe:v,onDeleteAllKeyframes:w,onChangeKeyframeEase:A,onMoveKeyframe:k,onToggleKeyframeAtPlayhead:M,theme:E}={}){const $=d.useMemo(()=>({...GS,...E}),[E]),C=fe(xe=>xe.elements),j=fe(xe=>xe.duration),T=fe(xe=>xe.timelineReady),N=fe(xe=>xe.selectedElementId),R=fe(xe=>xe.setSelectedElementId),D=fe(xe=>xe.currentTime),V=fe(xe=>xe.zoomMode),z=fe(xe=>xe.manualZoomPercent),I=fe(xe=>xe.setZoomMode),U=fe(xe=>xe.setManualZoomPercent),K=d.useRef(null),H=d.useRef(null),q=d.useRef(null),[X,G]=d.useState(null),F=d.useRef(!1),[P,Z]=d.useState(!1);Xt(()=>{const xe=zt=>zt.key==="Shift"&&Z(!0),Fe=zt=>zt.key==="Shift"&&Z(!1),ct=()=>Z(!1);return window.addEventListener("keydown",xe),window.addEventListener("keyup",Fe),window.addEventListener("blur",ct),()=>{window.removeEventListener("keydown",xe),window.removeEventListener("keyup",Fe),window.removeEventListener("blur",ct)}});const[L,B]=d.useState(!1),[J,te]=d.useState(!0),[Y,re]=d.useState(null),[ae,ue]=d.useState(null),[me,ye]=d.useState(0),Oe=d.useRef(null),Se=d.useRef(0),Ae=d.useCallback(()=>{const xe=q.current;te(xe?lj(xe.scrollHeight,xe.clientHeight):!0)},[]),Me=d.useCallback(()=>{Se.current&&cancelAnimationFrame(Se.current),Se.current=requestAnimationFrame(()=>{Se.current=0,Ae()})},[Ae]),Ve=d.useCallback(xe=>{Oe.current&&(Oe.current.disconnect(),Oe.current=null),H.current=xe,xe&&(ye(xe.clientWidth),Me(),Oe.current=new ResizeObserver(([Fe])=>{ye(Fe.contentRect.width),Me()}),Oe.current.observe(xe))},[Me]);Xt(()=>()=>{var xe;(xe=Oe.current)==null||xe.disconnect(),Se.current&&cancelAnimationFrame(Se.current)});const Pe=d.useMemo(()=>{const xe=Number.isFinite(j)?j:0;if(C.length===0)return xe;const Fe=Math.max(...C.map(zt=>zt.start+zt.duration)),ct=Math.max(xe,Fe);return Number.isFinite(ct)?ct:xe},[C,j]),ft=d.useMemo(()=>{const xe=new Map;for(const Fe of C){const ct=xe.get(Fe.track)??[];ct.push(Fe),xe.set(Fe.track,ct)}return Array.from(xe.entries()).sort(([Fe],[ct])=>Fe-ct)},[C]),yt=d.useMemo(()=>{var Fe;const xe=new Map;for(const[ct,zt]of ft)xe.set(ct,hy(((Fe=zt[0])==null?void 0:Fe.tag)??""));return xe},[ft]),Le=d.useMemo(()=>ft.map(([xe])=>xe),[ft]),Ye=d.useRef(Le);Ye.current=Le;const _e=d.useRef(100),be=d.useRef(Pe);be.current=Pe;const dt=d.useRef(null),{draggedClip:Ue,setDraggedClip:bt,resizingClip:Re,setResizingClip:on,blockedClipRef:Rt,suppressClickRef:we,syncClipDragAutoScroll:ht}=rP({scrollRef:q,ppsRef:_e,durationRef:be,trackOrderRef:Ye,onMoveElement:h,onResizeElement:g,onBlockedEditAttempt:O,setShowPopover:B,setRangeSelectionRef:dt}),Mt=d.useMemo(()=>!(Ue!=null&&Ue.started)||Le.length===0||Le.includes(Ue.previewTrack)?Le:[...Le,Ue.previewTrack].sort((xe,Fe)=>xe-Fe),[Ue,Le]),ot=aj(Mt.length),ve=fe(xe=>xe.keyframeCache),ze=fe(xe=>xe.selectedKeyframes),Ze=fe(xe=>xe.toggleSelectedKeyframe),Be=d.useMemo(()=>C.find(xe=>(xe.key??xe.id)===N)??null,[C,N]),vt=d.useRef(Be);vt.current=Be;const lt=me>pn&&Pe>0?(me-pn-2)/Pe:100,Je=mj(lt,V,z);_e.current=Je;const mt=Math.max(0,Pe*Je),Tt=d.useRef(V);Tt.current=V;const cn=d.useRef(z);cn.current=z;const Bn=d.useRef(lt);Bn.current=lt;const{seekFromX:bl,autoScrollDuringDrag:Sa,dragScrollRaf:Zi}=gj({playheadRef:K,scrollRef:q,ppsRef:_e,durationRef:be,isDragging:F,currentTime:D,zoomMode:V,zoomModeRef:Tt,manualZoomPercentRef:cn,fitPps:lt,fitPpsRef:Bn,effectiveDuration:Pe,pps:Je,timelineReady:T,elementsLength:C.length,setZoomMode:I,setManualZoomPercent:U,onSeek:e}),{rangeSelection:En,setRangeSelection:di,shiftClickClipRef:wa,handlePointerDown:ka,handlePointerMove:Ce,handlePointerUp:rt}=oj({scrollRef:q,ppsRef:_e,effectiveDuration:Pe,pps:Je,onSeek:e,seekFromX:bl,autoScrollDuringDrag:Sa,dragScrollRaf:Zi,isDragging:F,setShowPopover:B});dt.current=di;const bn=d.useRef(vt.current);d.useEffect(()=>{const xe=bn.current,Fe=vt.current;bn.current=Fe,xe&&!Fe&&(B(!1),di(null))});const{major:mr,minor:vl}=d.useMemo(()=>tj(Pe,Je),[Pe,Je]),jr=mr.length>=2?Math.max(.25,mr[1]-mr[0]):Pe;d.useEffect(()=>{Ae()},[Ae,T,C.length,ot]);const tn=d.useCallback(xe=>Re&&(Re.element.key??Re.element.id)===(xe.key??xe.id)?{...xe,start:Re.previewStart,duration:Re.previewDuration,playbackStart:Re.previewPlaybackStart}:xe,[Re]),{isDragOver:vn,setIsDragOver:Ur,handleAssetDragOver:Aa,handleAssetDrop:Ni}=Aj({scrollRef:q,ppsRef:_e,durationRef:be,trackOrderRef:Ye,onFileDrop:l,onAssetDrop:s,onBlockDrop:c});return!T||C.length===0?m.jsx(Mj,{isDragOver:vn,onFileDrop:!!l,onDragOver:Aa,onDragLeave:()=>Ur(!1),onDrop:Ni}):m.jsxs("div",{ref:Ve,"aria-label":"Timeline",className:`relative border-t select-none h-full overflow-hidden ${P?"cursor-crosshair":"cursor-default"}`,style:{touchAction:"pan-x pan-y",background:$.shellBackground,borderColor:$.shellBorder},children:[m.jsx("div",{ref:q,tabIndex:-1,className:`${V==="fit"?"overflow-x-hidden":"overflow-x-auto"} overflow-y-auto h-full outline-none`,onDragOver:Aa,onDragLeave:()=>Ur(!1),onDrop:Ni,onPointerDown:ka,onPointerMove:Ce,onPointerUp:rt,onLostPointerCapture:rt,children:m.jsx(Lj,{major:mr,minor:vl,pps:Je,trackContentWidth:mt,totalH:ot,effectiveDuration:Pe,majorTickInterval:jr,shiftHeld:P,rangeSelection:En,theme:$,displayTrackOrder:Mt,trackOrder:Le,tracks:ft,trackStyles:yt,selectedElementId:N,hoveredClip:X,draggedClip:Ue,resizingClip:Re,blockedClipRef:Rt,suppressClickRef:we,scrollRef:q,renderClipContent:r,renderClipOverlay:i,playheadRef:K,onResizeElement:g,onMoveElement:h,onDrillDown:n,onSelectElement:y,setHoveredClip:G,setShowPopover:B,setRangeSelection:di,setResizingClip:on,setDraggedClip:bt,setSelectedElementId:R,syncClipDragAutoScroll:ht,shiftClickClipRef:wa,getPreviewElement:tn,getTrackStyle:hy,keyframeCache:ve,selectedKeyframes:ze,currentTime:D,onToggleKeyframeAtPlayhead:M,onClickKeyframe:(xe,Fe)=>{fe.getState().clearSelectedKeyframes();const ct=xe.key??xe.id;R(ct),y==null||y(xe);const zt=xe.start+Fe/100*xe.duration;e==null||e(zt)},onShiftClickKeyframe:(xe,Fe)=>{Ze(`${xe}:${Fe}`)},onDragKeyframe:(xe,Fe,ct)=>{k==null||k(xe,Fe,ct)},onContextMenuKeyframe:(xe,Fe,ct)=>{const zt=C.find(Kn=>(Kn.key??Kn.id)===Fe);if(zt){R(Fe),y==null||y(zt);const Kn=zt.start+ct/100*zt.duration;e==null||e(Kn)}const Tn=ve.get(Fe),Pr=Tn==null?void 0:Tn.keyframes.find(Kn=>Kn.percentage===ct);re({x:xe.clientX,y:xe.clientY,elementId:Fe,percentage:ct,currentEase:(Pr==null?void 0:Pr.ease)??(Tn==null?void 0:Tn.ease)})},onContextMenuClip:(xe,Fe)=>{xe.preventDefault(),R(Fe.key??Fe.id),y==null||y(Fe),ue({x:xe.clientX,y:xe.clientY,element:Fe})}})}),J&&!L&&!En&&m.jsx("div",{className:"absolute bottom-2 right-3 pointer-events-none z-20",children:m.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md border",style:{background:"rgba(17,23,35,0.84)",borderColor:$.gutterBorder},children:[m.jsx("kbd",{className:"text-[9px] font-mono px-1 py-0.5 rounded",style:{color:$.textSecondary,background:"rgba(255,255,255,0.06)"},children:"Shift"}),m.jsx("span",{className:"text-[9px]",style:{color:$.textSecondary},children:"+ drag/click to edit range"})]})}),L&&En&&m.jsx(Y$,{rangeStart:En.start,rangeEnd:En.end,anchorX:En.anchorX,anchorY:En.anchorY,onClose:()=>{B(!1),di(null)}}),Y&&m.jsx(nP,{state:Y,onClose:()=>re(null),onDelete:(xe,Fe)=>v==null?void 0:v(xe,Fe),onDeleteAll:xe=>w==null?void 0:w(xe),onChangeEase:(xe,Fe,ct)=>A==null?void 0:A(xe,Fe,ct),onCopyProperties:(xe,Fe)=>{const ct=ve.get(xe),zt=ct==null?void 0:ct.keyframes.find(Tn=>Tn.percentage===Fe);zt&&navigator.clipboard.writeText(JSON.stringify(zt.properties,null,2))}}),ae&&m.jsx(iP,{x:ae.x,y:ae.y,element:ae.element,currentTime:D,onClose:()=>ue(null),onSplit:(xe,Fe)=>x==null?void 0:x(xe,Fe),onDelete:xe=>u==null?void 0:u(xe)})]})}),vy=66,Sy=6,lP=d.memo(function({videoSrc:e,label:n,labelColor:r,duration:i=5}){const[l,s]=d.useState(0),[c,u]=d.useState(!1),[h,g]=d.useState([]),[O,x]=d.useState(16/9),y=d.useRef(null),v=d.useRef(null),w=d.useRef(!1),A=d.useCallback(E=>{var j,T,N;if((j=y.current)==null||j.disconnect(),(T=v.current)==null||T.disconnect(),!E)return;const $=((N=E.parentElement)==null?void 0:N.clientWidth)||E.clientWidth;s($),y.current=new IntersectionObserver(([R])=>{var D;R.isIntersecting&&(u(!0),(D=y.current)==null||D.disconnect())},{rootMargin:"200px"}),y.current.observe(E);const C=E.parentElement||E;v.current=new ResizeObserver(([R])=>{s(R.contentRect.width)}),v.current.observe(C)},[]);Xt(()=>()=>{var E,$;(E=y.current)==null||E.disconnect(),($=v.current)==null||$.disconnect()}),d.useEffect(()=>{if(!c||w.current)return;w.current=!0;const E=document.createElement("video");E.crossOrigin="anonymous",E.muted=!0,E.preload="auto";const $=document.createElement("canvas"),C=$.getContext("2d");if(!C){w.current=!1;return}const j=[],T=Math.min(.4,i*.05);for(let V=0;V<Sy;V++){const z=V/(Sy-1)*i;j.push(Math.max(z,T))}let N=0,R=!1;const D=()=>{if(R||N>=j.length){R||(E.src="",E.load());return}E.currentTime=j[N]};return E.addEventListener("loadedmetadata",()=>{if(E.videoWidth>0&&E.videoHeight>0){x(E.videoWidth/E.videoHeight);const V=vy*2,z=Math.round(V*(E.videoWidth/E.videoHeight));$.width=z,$.height=V}D()}),E.addEventListener("seeked",()=>{if(R)return;C.drawImage(E,0,0,$.width,$.height);const V=$.toDataURL("image/jpeg",.6);g(z=>[...z,V]),N++,D()}),E.addEventListener("error",()=>{}),E.src=e,E.load(),()=>{R=!0,w.current=!1,g([]),E.src="",E.load()}},[c,e,i]);const k=Math.round(vy*O),M=l>0?Math.max(1,Math.ceil(l/k)):1;return m.jsxs("div",{ref:A,className:"absolute inset-0 overflow-hidden",children:[c&&h.length>0&&m.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:M}).map((E,$)=>{const C=h[$%h.length];return m.jsx("div",{className:"flex-shrink-0 h-full relative overflow-hidden bg-neutral-900",style:{width:k},children:m.jsx("img",{src:C,alt:"",draggable:!1,className:"absolute inset-0 w-full h-full object-cover"})},$)})}),c&&h.length===0&&m.jsx("div",{className:"absolute inset-0 animate-pulse",style:{background:"linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)"}}),m.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-1.5 pb-0.5 pt-3",style:{background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%)"},children:m.jsx("span",{className:"text-[9px] font-semibold truncate block leading-tight",style:{color:r,textShadow:"0 1px 2px rgba(0,0,0,0.9)"},children:n})})]})}),sP=66,oP="v3";function cP({previewUrl:t,seekTime:e=2,duration:n=5,selector:r,selectorIndex:i,origin:l}){const s=t.replace("/preview/comp/","/thumbnail/").replace(/\/preview$/,"/thumbnail/index.html"),c=e+n/2,u=new URL(s,l);return u.searchParams.set("t",c.toFixed(2)),u.searchParams.set("v",oP),r&&(u.searchParams.set("selector",r),i!=null&&i>0&&u.searchParams.set("selectorIndex",String(i))),u.toString()}const Op=d.memo(function({previewUrl:e,label:n,labelColor:r,selector:i,selectorIndex:l,seekTime:s=2,duration:c=5}){const[u,h]=d.useState(0),[g,O]=d.useState(!1),[x,y]=d.useState(16/9),v=d.useRef(null),w=d.useCallback(E=>{var j,T;if((j=v.current)==null||j.disconnect(),!E)return;const $=((T=E.parentElement)==null?void 0:T.clientWidth)||E.clientWidth;h($);const C=E.parentElement||E;v.current=new ResizeObserver(([N])=>{h(N.contentRect.width)}),v.current.observe(C)},[]);Xt(()=>()=>{var E;(E=v.current)==null||E.disconnect()});const A=cP({previewUrl:e,seekTime:s,duration:c,selector:i,selectorIndex:l,origin:window.location.origin}),k=Math.max(48,Math.round(sP*x)),M=u>0?Math.max(1,Math.ceil(u/k)):1;return m.jsxs("div",{ref:w,className:"absolute inset-0 overflow-hidden",children:[m.jsx("img",{src:A,alt:"",draggable:!1,loading:"eager",onLoad:E=>{const $=E.currentTarget;$.naturalWidth>0&&$.naturalHeight>0&&y($.naturalWidth/$.naturalHeight),O(!0)},className:"hidden"}),g&&m.jsx("div",{className:"absolute inset-0 flex",style:{animation:"hf-thumb-fade 200ms ease-out",mixBlendMode:"lighten"},children:Array.from({length:M}).map((E,$)=>m.jsx("div",{className:"relative h-full flex-shrink-0 overflow-hidden",style:{width:k},children:m.jsx("img",{src:A,alt:"",draggable:!1,className:"absolute inset-0 h-full w-full object-cover",style:{opacity:.7}})},$))}),m.jsx("div",{className:"absolute left-3 top-0 bottom-0 flex items-center",style:{zIndex:10},children:m.jsx("span",{className:"block max-w-full truncate text-[10px] font-semibold leading-none",style:{color:r,textShadow:g?"0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.6)":"none"},children:n})})]})});let uP=0;const wy={isEditMode:!1,model:null,selectedSegmentIds:new Set,selectedGroupId:null,sourceFilePath:null},Ot=XS(t=>({...wy,setEditMode:e=>t({isEditMode:e}),setModel:e=>t({model:e}),setSourceFilePath:e=>t({sourceFilePath:e}),selectSegment:(e,n=!1)=>t(r=>{if(n){const i=new Set(r.selectedSegmentIds);return i.has(e)?i.delete(e):i.add(e),{selectedSegmentIds:i,selectedGroupId:null}}return{selectedSegmentIds:new Set([e]),selectedGroupId:null}}),selectGroup:e=>t(n=>{var i;const r=(i=n.model)==null?void 0:i.groups.get(e);return r?{selectedSegmentIds:new Set(r.segmentIds),selectedGroupId:e}:{}}),selectAll:()=>t(e=>e.model?{selectedSegmentIds:new Set(e.model.segments.keys()),selectedGroupId:null}:{}),clearSelection:()=>t({selectedSegmentIds:new Set,selectedGroupId:null}),updateSegmentStyle:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.segments.get(e);if(!i)return{};const l=new Map(r.model.segments);return l.set(e,{...i,style:{...i.style,...n}}),{model:{...r.model,segments:l}}}),updateSegmentText:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.segments.get(e);if(!i)return{};const l=new Map(r.model.segments);return l.set(e,{...i,text:n}),{model:{...r.model,segments:l}}}),updateSegmentTiming:(e,n,r)=>t(i=>{if(!i.model)return{};const l=i.model.segments.get(e);if(!l)return{};const s=new Map(i.model.segments);return s.set(e,{...l,start:n,end:r}),{model:{...i.model,segments:s}}}),updateGroupStyle:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e);if(!i)return{};const l=new Map(r.model.groups);return l.set(e,{...i,style:{...i.style,...n}}),{model:{...r.model,groups:l}}}),updateGroupContainer:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e);if(!i)return{};const l=new Map(r.model.groups);return l.set(e,{...i,containerStyle:{...i.containerStyle,...n}}),{model:{...r.model,groups:l}}}),updateGroupAnimation:(e,n,r)=>t(i=>{if(!i.model)return{};const l=i.model.groups.get(e);if(!l)return{};const s=new Map(i.model.groups),c=l.animation[n],u=c!==null?{...c,...r}:r;return s.set(e,{...l,animation:{...l.animation,[n]:u}}),{model:{...i.model,groups:s}}}),splitGroup:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e);if(!i)return{};const l=i.segmentIds.indexOf(n);if(l<=0)return{};const s=i.segmentIds.slice(0,l),c=i.segmentIds.slice(l),u=`group-split-${uP++}`,h=new Map(r.model.groups);h.set(e,{...i,segmentIds:s}),h.set(u,{...i,id:u,segmentIds:c});const g=r.model.groupOrder.indexOf(e),O=[...r.model.groupOrder];O.splice(g+1,0,u);const x=new Map(r.model.segments);return c.forEach((y,v)=>{const w=x.get(y);w&&x.set(y,{...w,groupIndex:v})}),{model:{...r.model,groups:h,segments:x,groupOrder:O}}}),mergeGroups:(e,n)=>t(r=>{if(!r.model)return{};const i=r.model.groups.get(e),l=r.model.groups.get(n);if(!i||!l)return{};const s=[...i.segmentIds,...l.segmentIds],c=new Map(r.model.groups);c.set(e,{...i,segmentIds:s}),c.delete(n);const u=r.model.groupOrder.filter(O=>O!==n),h=new Map(r.model.segments);l.segmentIds.forEach((O,x)=>{const y=h.get(O);y&&h.set(O,{...y,groupIndex:i.segmentIds.length+x})});const g=r.selectedGroupId===n?null:r.selectedGroupId;return{model:{...r.model,groups:c,segments:h,groupOrder:u},selectedGroupId:g}}),updateSelectedStyle:e=>t(n=>{if(!n.model||n.selectedSegmentIds.size===0)return{};const r=new Map(n.model.segments);for(const i of n.selectedSegmentIds){const l=r.get(i);l&&r.set(i,{...l,style:{...l.style,...e}})}return{model:{...n.model,segments:r}}}),applyAnimationToAll:e=>t(n=>{if(!n.model)return{};const r=new Map(n.model.groups);for(const[i,l]of r)r.set(i,{...l,animation:e});return{model:{...n.model,groups:r}}}),reset:()=>t({...wy,selectedSegmentIds:new Set})})),fP=new Set(["ArrowLeft","ArrowRight"]),dP=["input","textarea","select","button","a[href]","[contenteditable='true']","[role='button']","[role='checkbox']","[role='combobox']","[role='menuitem']","[role='radio']","[role='slider']","[role='spinbutton']","[role='switch']","[role='textbox']"].join(",");function hP(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.closest!="function"?!1:e.closest.call(t,dP)!==null}function mP(t,e={isCaptionEditMode:!1,selectedCaptionSegmentCount:0}){return t.metaKey||t.ctrlKey||t.altKey||hP(t.target)?!0:fP.has(t.code)&&e.isCaptionEditMode&&e.selectedCaptionSegmentCount>0}const ky=[1,2,4];function pP({iframeRef:t,shuttleDirectionRef:e,shuttleSpeedIndexRef:n,iframeShortcutCleanupRef:r,getAdapter:i,play:l,playBackward:s,pause:c,seek:u}){const h=d.useRef(new Set),g=d.useRef(()=>{}),O=d.useRef(()=>{}),x=d.useCallback(M=>{const E=i(),$=(E==null?void 0:E.getTime())??fe.getState().currentTime;u(X2($,M,Zu))},[i,u]),y=d.useCallback(M=>{e.current===M?n.current=Math.min(n.current+1,ky.length-1):n.current=0;const E=ky[n.current];fe.getState().setPlaybackRate(E),M==="forward"?l():s(E)},[l,s,e,n]),v=d.useCallback(()=>{fe.getState().isPlaying?c():l()},[l,c]),w=d.useCallback(M=>{var C,j,T;if(M.defaultPrevented)return;const E=Ot.getState();if(mP(M,{isCaptionEditMode:E.isEditMode,selectedCaptionSegmentCount:E.selectedSegmentIds.size}))return;const $=M.key.toLowerCase();if(h.current.add($),M.code==="Space"){M.preventDefault(),v();return}if(M.code==="ArrowLeft"){M.preventDefault(),x(M.shiftKey?-10:-1);return}if(M.code==="ArrowRight"){M.preventDefault(),x(M.shiftKey?10:1);return}if(!M.repeat){if($==="m"){M.preventDefault();const N=fe.getState();N.playbackRate<=1&&N.setAudioMuted(!N.audioMuted);return}if($==="l"&&M.shiftKey){M.preventDefault();const N=fe.getState();N.setLoopEnabled(!N.loopEnabled);return}if($==="k"){M.preventDefault(),c();return}if($==="j"){if(M.preventDefault(),h.current.has("k")){x(-1);return}y("backward");return}if($==="l"){if(M.preventDefault(),h.current.has("k")){x(1);return}y("forward");return}if($==="i"){M.preventDefault();const N=((C=i())==null?void 0:C.getTime())??fe.getState().currentTime;fe.getState().setInPoint(M.shiftKey?null:N);return}if($==="o"){M.preventDefault();const N=((j=i())==null?void 0:j.getTime())??fe.getState().currentTime;fe.getState().setOutPoint(M.shiftKey?null:N);return}if($==="a"){M.preventDefault(),u(fe.getState().inPoint??0,{keepPlaying:!0});return}if($==="e"){M.preventDefault();const{outPoint:N}=fe.getState();u(N??((T=i())==null?void 0:T.getDuration())??fe.getState().duration,{keepPlaying:!0});return}}},[c,y,x,v,i,u]),A=d.useCallback(M=>{h.current.delete(M.key.toLowerCase())},[]);g.current=w,O.current=A;const k=d.useCallback(()=>{var j,T,N;(j=r.current)==null||j.call(r),r.current=null;let M=null,E=null;try{M=((T=t.current)==null?void 0:T.contentWindow)??null,E=((N=t.current)==null?void 0:N.contentDocument)??null}catch{return}if(!M&&!E)return;const $=R=>g.current(R),C=R=>O.current(R);try{M==null||M.addEventListener("keydown",$,!0),M==null||M.addEventListener("keyup",C,!0)}catch{}E==null||E.addEventListener("keydown",$,!0),E==null||E.addEventListener("keyup",C,!0),r.current=()=>{try{M==null||M.removeEventListener("keydown",$,!0),M==null||M.removeEventListener("keyup",C,!0)}catch{}E==null||E.removeEventListener("keydown",$,!0),E==null||E.removeEventListener("keyup",C,!0)}},[t,r]);return{playbackKeyDownRef:g,playbackKeyUpRef:O,attachIframeShortcutListeners:k,togglePlay:v}}function gP(t){const{clip:e,fallbackIndex:n,doc:r}=t;let i=t.hostEl??null;const l=Nu({id:e.id,label:e.label,tag:e.tagName||e.kind});let s,c,u,h;i&&(s=i.id||void 0,c=Ul(i),u=r&&c?lu(r,i,c):void 0,h=au(i));const g=su({preferredId:e.id,label:l,fallbackIndex:n,domId:s,selector:c,selectorIndex:u,sourceFile:h}),O={id:g.id,label:l,key:g.key,tag:e.tagName||e.kind,start:e.start,duration:e.duration,track:e.track,domId:s,selector:c,selectorIndex:u,sourceFile:h};if(i&&LS(O,i),e.assetUrl&&(O.src=e.assetUrl),e.kind==="composition"&&e.compositionId){let x=e.compositionSrc;if(x||(i=(r==null?void 0:r.querySelector(`[data-composition-id="${e.compositionId}"]`))??i,x=(i==null?void 0:i.getAttribute("data-composition-src"))??(i==null?void 0:i.getAttribute("data-composition-file"))??null),x)O.compositionSrc=x;else if(i){const y=i.querySelector("video[src]");y&&(O.src=y.getAttribute("src")||void 0,O.tag="video")}if(i){O.domId=i.id||void 0,O.selector=Ul(i),O.selectorIndex=r&&O.selector?lu(r,i,O.selector):void 0,O.sourceFile=au(i);const y=su({preferredId:e.id,label:l,fallbackIndex:n,domId:O.domId,selector:O.selector,selectorIndex:O.selectorIndex,sourceFile:O.sourceFile});O.id=y.id,O.key=y.key}}return O}function a7(t,e,n=[]){if(!Number.isFinite(e)||e<=0)return[];const r=t.querySelector("[data-composition-id]");if(!r)return[];const i=new Set(n.map(B2)),l=n.reduce((c,u)=>Math.max(c,Number.isFinite(u.track)?u.track:0),-1),s=[];for(const c of Array.from(r.children)){if(!c$(r,c))continue;const u=Ul(c);if(!u)continue;const h=lu(t,c,u),g=au(c),O=i$(c),x=su({preferredId:c.id||null,label:O,fallbackIndex:n.length+s.length,domId:c.id||void 0,selector:u,selectorIndex:h,sourceFile:g});i.has(x.key)||i.has(x.id)||s.push({domId:c.id||void 0,duration:e,id:x.id,key:x.key,label:O,selector:u,selectorIndex:h,sourceFile:g,start:0,tag:c.tagName.toLowerCase(),timingSource:"implicit",track:l+1+s.length})}return s}function l7(t,e){const n=t.querySelector("[data-composition-id]"),r=t.querySelectorAll("[data-start]"),i=[];let l=0;return r.forEach(s=>{if(s===n)return;const c=s,u=c.getAttribute("data-start");if(u==null)return;const h=parseFloat(u);if(isNaN(h)||Number.isFinite(e)&&e>0&&h>=e)return;const g=c.tagName.toLowerCase();let O=0;const x=c.getAttribute("data-duration");if(x!=null&&(O=parseFloat(x)),(isNaN(O)||O<=0)&&(O=Math.max(0,e-h)),Number.isFinite(e)&&e>0&&(O=Math.min(O,Math.max(0,e-h))),!Number.isFinite(O)||O<=0)return;const y=c.getAttribute("data-track-index"),v=y!=null?parseInt(y,10):l++,w=c.getAttribute("data-composition-id"),A=Ul(c),k=au(c),M=lu(t,c,A),E=Nu({id:c.id||w||null,label:c.getAttribute("data-timeline-label")??c.getAttribute("data-label"),tag:g}),$=su({preferredId:c.id||w||null,label:E,fallbackIndex:i.length,domId:c.id||void 0,selector:A,selectorIndex:M,sourceFile:k}),C={id:$.id,label:E,key:$.key,tag:g,start:h,duration:O,track:isNaN(v)?0:v,domId:c.id||void 0,selector:A,selectorIndex:M,sourceFile:k,timingSource:"authored"},j=VS(c);if(j){j.tagName==="IMG"&&(C.tag="img");const N=j.getAttribute("src");N&&(C.src=N);const R=c.getAttribute("data-volume")??j.getAttribute("data-volume");R&&(C.volume=parseFloat(R)),LS(C,c)}c.hasAttribute("data-timeline-locked")&&(C.timelineLocked=!0);const T=c.getAttribute("data-composition-src")||c.getAttribute("data-composition-file");if(T)C.compositionSrc=T;else if(w&&w!==(n==null?void 0:n.getAttribute("data-composition-id"))){const N=c.querySelector("video[src]");N&&(C.src=N.getAttribute("src")||void 0,C.tag="video")}i.push(C)}),[...i,...a7(t,e,i)]}function OP(t,e,n,r){const i=Number.isFinite(n)?n:0,l=Number.isFinite(r)?r:0;if(t.length===0||e.length>=t.length||l>i)return e;const s=new Set(e.map(B2)),c=t.filter(u=>!s.has(B2(u)));return c.length===0?e:[...e,...c]}function xP(t){const e=t.match(/\/preview\/comp\/(.+?)(?:\?|$)/);return e?decodeURIComponent(e[1]):void 0}function yP(t){if(!Number.isFinite(t.rootDuration)||t.rootDuration<=0)return null;const e=xP(t.iframeSrc);return{id:t.compositionId,label:Nu({id:t.compositionId,tag:t.tagName}),key:F2({id:t.compositionId,fallbackIndex:0,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:e}),tag:t.tagName.toLowerCase()||"div",start:0,duration:t.rootDuration,track:0,compositionSrc:e,selector:t.selector,selectorIndex:t.selectorIndex,sourceFile:e}}function bP({iframeRef:t,probeIntervalRef:e,pendingSeekRef:n,isRefreshingRef:r,getAdapter:i,syncTimelineElements:l,setDuration:s,setCurrentTime:c,setTimelineReady:u,setIsPlaying:h,attachIframeShortcutListeners:g,applyPreviewAudioState:O}){const x=d.useCallback(M=>{var I;if(!M.clips||M.clips.length===0)return;const E=new Set(M.clips.map(U=>U.compositionId).filter(Boolean)),$=M.clips.filter(U=>!U.parentCompositionId||!E.has(U.parentCompositionId));let C=null;try{C=((I=t.current)==null?void 0:I.contentDocument)??null}catch{C=null}const j=new Set,T=$.map((U,K)=>{const H=C?o$(C,U,K,j):null;return H&&j.add(H),gP({clip:U,fallbackIndex:K,doc:C,hostEl:H})}),N=M.durationInFrames/30,R=Number.isFinite(N)&&N<7200?N:0,D=R>0?R:fe.getState().duration,V=D>0?T.filter(U=>U.start<D).map(U=>({...U,duration:Math.min(U.duration,D-U.start)})).filter(U=>U.duration>0):T,z=C&&D>0?[...V,...a7(C,D,V)]:V;z.length>0&&l(z,R>0?R:void 0)},[t,l]),y=d.useCallback(()=>{try{const M=t.current,E=M==null?void 0:M.contentDocument,$=M==null?void 0:M.contentWindow;if(!E||!$)return;const C=fe.getState().elements,j=fe.getState().duration,{missing:T,updatedEls:N,patched:R}=p$(E,$,C,j);if(T.length>0||R){const D=new Set(N.map(z=>z.id)),V=T.filter(z=>!D.has(z.id));l([...N,...V])}}catch(M){console.warn("[useTimelinePlayer] enrichMissingCompositions failed",M)}},[t,l]),v=d.useCallback(()=>{const M=i();if(!M||M.getDuration()<=0)return!1;M.pause();const E=n.current;n.current=null;const $=E!=null?Math.min(E,M.getDuration()):0;M.seek($),zr.notify($);const C=M.getDuration();Number.isFinite(C)&&C>0&&C<7200&&C!==fe.getState().duration&&s(C),c($),r.current||u(!0),r.current=!1,h(!1);try{const j=t.current,T=j==null?void 0:j.contentDocument,N=j==null?void 0:j.contentWindow;T&&N&&(u$(T,N),f$(T),g());const R=N==null?void 0:N.__clipManifest;if(R&&R.clips.length>0&&x(R),y(),O(),fe.getState().elements.length===0&&T){const D=l7(T,M.getDuration());D.length>0&&l(D)}if(fe.getState().elements.length===0&&T){const D=T.querySelector("[data-composition-id]"),V=M.getDuration();if(D&&V>0){const z=yP({compositionId:D.getAttribute("data-composition-id")||"composition",tagName:D.tagName||"div",rootDuration:V,iframeSrc:(j==null?void 0:j.src)||"",selector:Ul(D)});z&&l([z])}}}catch(j){console.warn("[useTimelinePlayer] Could not read timeline elements from iframe",j)}return!0},[i,s,c,u,h,x,y,l,g,O,t,r,n]),w=d.useCallback(()=>{if(O(),e.current&&clearInterval(e.current),v())return;const M=t.current;let E=!1;const $=()=>{E||v()&&(E=!0,window.removeEventListener("message",C),e.current&&clearInterval(e.current))},C=j=>{if(j.source&&M&&j.source!==M.contentWindow)return;const T=j.data;(T==null?void 0:T.source)==="hf-preview"&&((T==null?void 0:T.type)==="state"||(T==null?void 0:T.type)==="timeline")&&$()};window.addEventListener("message",C),e.current=setTimeout(()=>{E||($(),E||console.warn("[useTimelinePlayer] Runtime did not signal readiness within 5s")),window.removeEventListener("message",C)},5e3)},[v,t,e,O]);return{processTimelineMessage:x,processTimelineMessageRef:{current:x},enrichMissingCompositions:y,enrichMissingCompositionsRef:{current:y},initializeAdapter:v,onIframeLoad:w}}const J2=new Map,xp=new Map;let Hs=null;async function vP(){if(Hs===!1)return null;if(Hs)return Hs;try{return Hs=await PS(()=>import("./index-DSLrl2tB.js"),[]),Hs}catch{return Hs=!1,null}}function s7(t){try{return new URL(t,window.location.href).href}catch{return t}}async function SP(t){const e=await vP();if(!e)return null;const n=new e.Input({source:new e.UrlSource(t),formats:e.ALL_FORMATS});try{const r=await n.getDurationFromMetadata();if(r==null||!Number.isFinite(r)||r<=0)return null;const i=await n.getPrimaryVideoTrack(),l=await n.getAudioTracks();return{duration:r,width:i==null?void 0:i.displayWidth,height:i==null?void 0:i.displayHeight,hasVideo:i!=null,hasAudio:l.length>0}}catch{return null}finally{n.dispose()}}function wP(t){return J2.get(s7(t))}async function kP(t){const e=s7(t),n=J2.get(e);if(n)return n;let r=xp.get(e);return r||(r=SP(e).then(i=>(xp.delete(e),i&&J2.set(e,i),i)),xp.set(e,r),r)}function AP(t){return t.keepPlaying&&!t.wasReverseShuttle&&t.storeWasPlaying&&(t.duration<=0||t.nextTime<t.duration)}function MP(t){return!t.keepPlaying||t.wasReverseShuttle}function CP(){const t=d.useRef(null),e=d.useRef(0),n=d.useRef(void 0),r=d.useRef(null),i=d.useRef(!1),l=d.useRef(0),s=d.useRef(null),c=d.useRef(0),u=d.useRef(null),h=d.useRef(0),g=d.useRef(null),{setIsPlaying:O,setCurrentTime:x,setDuration:y,setTimelineReady:v,setElements:w}=fe.getState(),A=d.useCallback((Z,L)=>{const B=fe.getState(),J=L??B.duration,te=OP(B.elements,Z,B.duration,J);(te.length!==B.elements.length||te.some((ae,ue)=>{const me=B.elements[ue];return!me||ae.id!==me.id||ae.start!==me.start||ae.duration!==me.duration||ae.track!==me.track}))&&w(te),Number.isFinite(L)&&(L??0)>0&&L!==B.duration&&y(L??0),B.timelineReady||v(!0);const re=te.filter(ae=>ae.src&&ae.sourceDuration==null&&["video","audio"].includes(ae.tag.toLowerCase())&&!wP(ae.src));re.length>0&&Promise.allSettled(re.map(async ae=>{const ue=await kP(ae.src);if(!ue)return;const me=ae.key??ae.id;fe.setState(ye=>{const Oe=ye.elements.findIndex(Ae=>(Ae.key??Ae.id)===me);if(Oe===-1||ye.elements[Oe].sourceDuration!=null)return{};const Se=ye.elements.slice();return Se[Oe]={...ye.elements[Oe],sourceDuration:ue.duration},{elements:Se}})}))},[w,v,y]),k=d.useCallback(()=>{var Z,L;try{const B=t.current,J=B==null?void 0:B.contentWindow;if(!B||!J)return null;const te=J.__player&&typeof J.__player.play=="function"?J.__player:null,Y=n$(B.contentDocument),re=fp(te);if(re>0&&Y<=re)return te;let ae=null;if(J.__timeline){const ye=B5(J.__timeline),Oe=fp(ye);if(Oe>0&&Y<=Oe)return ye;Oe>0&&(ae??(ae=ye))}if(J.__timelines){const ye=Object.keys(J.__timelines);if(ye.length>0){const Oe=(L=(Z=B==null?void 0:B.contentDocument)==null?void 0:Z.querySelector("[data-composition-id]"))==null?void 0:L.getAttribute("data-composition-id"),Se=Oe&&Oe in J.__timelines?Oe:ye[ye.length-1],Ae=B5(J.__timelines[Se]),Me=fp(Ae);if(Me>0&&Y<=Me)return Ae;Me>0&&(ae??(ae=Ae))}}const ue=te??ae,me=Math.max(fe.getState().duration,Y,re);if(ue&&me>0&&("renderSeek"in ue||typeof ue.seek=="function")){const ye=g.current;if((ye==null?void 0:ye.player)===ue&&ye.duration===me)return ye.adapter;ye==null||ye.adapter.pause();const Oe=t$(ue,me,e$(J),()=>fe.getState().playbackRate);return g.current={player:ue,duration:me,adapter:Oe},Oe}return ue}catch(B){return console.warn("[useTimelinePlayer] Could not get playback adapter (cross-origin)",B),null}},[]),M=d.useCallback(()=>{cancelAnimationFrame(l.current)},[]),E=d.useCallback(()=>{const Z=()=>{const L=k();if(L){const B=L.getTime(),J=L.getDuration(),te=J>0?Math.min(B,J):B;zr.notify(te);const{inPoint:Y,outPoint:re}=fe.getState(),ae=re!==null?Math.min(re,J):J,ue=Y!==null?Y:0,me=ue<ae?ae:J,ye=ue<ae?ue:0;if(te>=me){if(fe.getState().loopEnabled&&J>0){L.seek(ye,{keepPlaying:!0}),zr.notify(ye),L.play(),O(!0),e.current=requestAnimationFrame(Z);return}L.isPlaying()&&L.pause(),x(te),O(!1),cancelAnimationFrame(e.current);return}}e.current=requestAnimationFrame(Z)};e.current=requestAnimationFrame(Z)},[k,x,O]),$=d.useCallback(()=>{cancelAnimationFrame(e.current)},[]),C=d.useCallback(Z=>{const L=t.current;if(L){m$(L,Z);try{const B=L.contentWindow;if(B!=null&&B.__timelines)for(const J of Object.values(B.__timelines))J&&typeof J.timeScale=="function"&&J.timeScale(Z)}catch(B){console.warn("[useTimelinePlayer] Could not set playback rate (cross-origin)",B)}}},[]),j=d.useCallback(Z=>{const{audioMuted:L,playbackRate:B}=fe.getState(),J=Z??B;h$(t.current,HS(L,J))},[]),T=d.useCallback(()=>{$(),M();const Z=k();Z&&(Z.getTime()>=Z.getDuration()&&Z.seek(fe.getState().inPoint??0),C(fe.getState().playbackRate),j(),Z.play(),s.current="forward",O(!0),E())},[k,O,E,C,j,$,M]),N=d.useCallback(Z=>{$(),M();const L=k();if(!L)return;const B=Math.max(0,L.getDuration()),J=L.getTime()<=0&&B>0?B:L.getTime();L.pause(),J!==L.getTime()&&L.seek(J);const te=Math.max(.1,Math.min(4,Z));C(te),j(te);let Y=J,re=performance.now();const ae=ue=>{const me=(ue-re)/1e3*te;let ye=Y-me;const{inPoint:Oe,outPoint:Se}=fe.getState(),Ae=Se!==null?Math.min(Se,B):B,Me=Oe!==null?Oe:0,Ve=Me<Ae?Ae:B,Pe=Me<Ae?Me:0;if(ye<=Pe)if(fe.getState().loopEnabled&&B>0)Y=Ve,re=ue,ye=Ve;else{L.seek(Pe),zr.notify(Pe),x(Pe),O(!1),s.current=null,l.current=0;return}L.seek(Math.max(0,ye)),zr.notify(Math.max(0,ye)),O(!0),l.current=requestAnimationFrame(ae)};O(!0),s.current="backward",l.current=requestAnimationFrame(ae)},[k,x,O,C,j,$,M]),R=d.useCallback(()=>{M();const Z=k();Z&&(Z.pause(),x(Z.getTime()),O(!1),s.current=null,c.current=0,$())},[k,x,O,$,M]),D=d.useCallback((Z,L)=>{const B=s.current==="backward";M();const J=k();if(!J)return r.current=Math.max(0,Z),!1;const te=Math.max(0,J.getDuration()),Y=Math.max(0,te>0?Math.min(te,Z):Z),re=(L==null?void 0:L.keepPlaying)===!0,ae=AP({keepPlaying:re,wasReverseShuttle:B,storeWasPlaying:fe.getState().isPlaying,duration:te,nextTime:Y});return J.seek(Y,L),zr.notify(Y),x(Y),ae?($(),C(fe.getState().playbackRate),j(),J.play(),O(!0),s.current="forward",c.current=0,E()):MP({keepPlaying:re,wasReverseShuttle:B})&&($(),fe.getState().isPlaying&&O(!1),s.current=null,c.current=0),!0},[k,r,x,O,E,$,M,C,j,s,c]);d.useEffect(()=>fe.subscribe((Z,L)=>{Z.requestedSeekTime!==null&&Z.requestedSeekTime!==L.requestedSeekTime&&(D(Z.requestedSeekTime),fe.getState().clearSeekRequest())}),[D]);const{playbackKeyDownRef:V,playbackKeyUpRef:z,attachIframeShortcutListeners:I,togglePlay:U}=pP({iframeRef:t,shuttleDirectionRef:s,shuttleSpeedIndexRef:c,iframeShortcutCleanupRef:u,getAdapter:k,play:T,playBackward:N,pause:R,seek:D}),{processTimelineMessageRef:K,enrichMissingCompositionsRef:H,onIframeLoad:q}=bP({iframeRef:t,probeIntervalRef:n,pendingSeekRef:r,isRefreshingRef:i,getAdapter:k,syncTimelineElements:A,setDuration:y,setCurrentTime:x,setTimelineReady:v,setIsPlaying:O,attachIframeShortcutListeners:I,applyPreviewAudioState:j}),X=d.useCallback(()=>{const Z=k();r.current=Z?Z.getTime():fe.getState().currentTime??0,i.current=!0,$(),M(),O(!1)},[k,$,O,M]),G=d.useCallback(()=>{const Z=t.current;if(!Z)return;X();const L=Z.src,B=new URL(L,window.location.origin);B.searchParams.set("_t",String(Date.now())),Z.src=B.toString()},[X]),F=d.useRef(k);F.current=k,Xt(()=>{const Z=te=>V.current(te),L=te=>z.current(te),B=te=>{const Y=te.data,re=t.current;if(!(te.source&&re&&te.source!==re.contentWindow)){if((Y==null?void 0:Y.source)==="hf-preview"&&(Y==null?void 0:Y.type)==="state")try{if(fe.getState().elements.length===0){const ue=re==null?void 0:re.contentWindow,me=ue==null?void 0:ue.__clipManifest;me&&me.clips.length>0&&K.current(me)}Date.now()-h.current>500&&H.current()}catch(ae){console.warn("[useTimelinePlayer] Could not read clip manifest from iframe",ae)}if((Y==null?void 0:Y.source)==="hf-preview"&&(Y==null?void 0:Y.type)==="timeline"&&Array.isArray(Y.clips)&&(h.current=Date.now(),K.current(Y),H.current(),fe.getState().elements.length===0))try{const ae=re==null?void 0:re.contentDocument,ue=k();if(ae&&ue){const me=l7(ae,ue.getDuration());me.length>0&&A(me)}}catch(ae){console.warn("[useTimelinePlayer] Could not read timeline elements on navigate (cross-origin)",ae)}}},J=()=>{var te;if(document.hidden&&fe.getState().isPlaying){const Y=(te=F.current)==null?void 0:te.call(F);Y&&(Y.pause(),O(!1),$())}};return window.addEventListener("keydown",Z,!0),window.addEventListener("keyup",L,!0),window.addEventListener("message",B),document.addEventListener("visibilitychange",J),()=>{var te;window.removeEventListener("keydown",Z,!0),window.removeEventListener("keyup",L,!0),(te=u.current)==null||te.call(u),u.current=null,window.removeEventListener("message",B),document.removeEventListener("visibilitychange",J),$(),M(),n.current&&clearInterval(n.current)}});const P=d.useCallback(()=>{$(),M(),n.current&&clearInterval(n.current),fe.getState().reset()},[$,M]);return d.useEffect(()=>fe.subscribe((Z,L)=>{const B=Z.playbackRate!==L.playbackRate,J=Z.audioMuted!==L.audioMuted;!B&&!J||(B&&C(Z.playbackRate),j())}),[C,j]),{iframeRef:t,play:T,pause:R,togglePlay:U,seek:D,onIframeLoad:q,refreshPlayer:G,saveSeekPosition:X,resetPlayer:P}}const EP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),d.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"}))]]),TP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),d.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),$P=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),d.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),jP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M87.51,64.49a12,12,0,0,1,0-17l32-32a12,12,0,0,1,17,0l32,32a12,12,0,0,1-17,17L140,53V96a12,12,0,0,1-24,0V53L104.49,64.49A12,12,0,0,1,87.51,64.49Zm64,127L140,203V160a12,12,0,0,0-24,0v43l-11.51-11.52a12,12,0,0,0-17,17l32,32a12,12,0,0,0,17,0l32-32a12,12,0,0,0-17-17Zm89-72-32-32a12,12,0,0,0-17,17L203,116H160a12,12,0,0,0,0,24h43l-11.52,11.51a12,12,0,0,0,17,17l32-32A12,12,0,0,0,240.49,119.51ZM53,140H96a12,12,0,0,0,0-24H53l11.52-11.51a12,12,0,1,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,1,0,17-17Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M232,128,128,232,24,128,128,24Z",opacity:"0.2"}),d.createElement("path",{d:"M90.34,61.66a8,8,0,0,1,0-11.32l32-32a8,8,0,0,1,11.32,0l32,32a8,8,0,0,1-11.32,11.32L136,43.31V96a8,8,0,0,1-16,0V43.31L101.66,61.66A8,8,0,0,1,90.34,61.66Zm64,132.68L136,212.69V160a8,8,0,0,0-16,0v52.69l-18.34-18.35a8,8,0,0,0-11.32,11.32l32,32a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm83.32-72-32-32a8,8,0,0,0-11.32,11.32L212.69,120H160a8,8,0,0,0,0,16h52.69l-18.35,18.34a8,8,0,0,0,11.32,11.32l32-32A8,8,0,0,0,237.66,122.34ZM43.31,136H96a8,8,0,0,0,0-16H43.31l18.35-18.34A8,8,0,0,0,50.34,90.34l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M96,136H64v24a8,8,0,0,1-13.66,5.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,64,96v24H96a8,8,0,0,1,0,16Zm0-72h24V96a8,8,0,0,0,16,0V64h24a8,8,0,0,0,5.66-13.66l-32-32a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,96,64Zm141.66,58.34-32-32A8,8,0,0,0,192,96v24H160a8,8,0,0,0,0,16h32v24a8,8,0,0,0,13.66,5.66l32-32A8,8,0,0,0,237.66,122.34ZM160,192H136V160a8,8,0,0,0-16,0v32H96a8,8,0,0,0-5.66,13.66l32,32a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,160,192Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M91.76,60.24a6,6,0,0,1,0-8.48l32-32a6,6,0,0,1,8.48,0l32,32a6,6,0,1,1-8.48,8.48L134,38.49V96a6,6,0,0,1-12,0V38.49L100.24,60.24A6,6,0,0,1,91.76,60.24Zm64,135.52L134,217.51V160a6,6,0,0,0-12,0v57.51l-21.76-21.75a6,6,0,0,0-8.48,8.48l32,32a6,6,0,0,0,8.48,0l32-32a6,6,0,0,0-8.48-8.48Zm80.48-72-32-32a6,6,0,0,0-8.48,8.48L217.51,122H160a6,6,0,0,0,0,12h57.51l-21.75,21.76a6,6,0,1,0,8.48,8.48l32-32A6,6,0,0,0,236.24,123.76ZM38.49,134H96a6,6,0,0,0,0-12H38.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M90.34,61.66a8,8,0,0,1,0-11.32l32-32a8,8,0,0,1,11.32,0l32,32a8,8,0,0,1-11.32,11.32L136,43.31V96a8,8,0,0,1-16,0V43.31L101.66,61.66A8,8,0,0,1,90.34,61.66Zm64,132.68L136,212.69V160a8,8,0,0,0-16,0v52.69l-18.34-18.35a8,8,0,0,0-11.32,11.32l32,32a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm83.32-72-32-32a8,8,0,0,0-11.32,11.32L212.69,120H160a8,8,0,0,0,0,16h52.69l-18.35,18.34a8,8,0,0,0,11.32,11.32l32-32A8,8,0,0,0,237.66,122.34ZM43.31,136H96a8,8,0,0,0,0-16H43.31l18.35-18.34A8,8,0,0,0,50.34,90.34l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M93.17,58.83a4,4,0,0,1,0-5.66l32-32a4,4,0,0,1,5.66,0l32,32a4,4,0,0,1-5.66,5.66L132,33.66V96a4,4,0,0,1-8,0V33.66L98.83,58.83A4,4,0,0,1,93.17,58.83Zm64,138.34L132,222.34V160a4,4,0,0,0-8,0v62.34L98.83,197.17a4,4,0,0,0-5.66,5.66l32,32a4,4,0,0,0,5.66,0l32-32a4,4,0,0,0-5.66-5.66Zm77.66-72-32-32a4,4,0,0,0-5.66,5.66L222.34,124H160a4,4,0,0,0,0,8h62.34l-25.17,25.17a4,4,0,0,0,5.66,5.66l32-32A4,4,0,0,0,234.83,125.17ZM33.66,132H96a4,4,0,0,0,0-8H33.66L58.83,98.83a4,4,0,0,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,1,0,5.66-5.66Z"}))]]),PP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,52H182.42L170,33.34A12,12,0,0,0,160,28H96a12,12,0,0,0-10,5.34L73.57,52H48A28,28,0,0,0,20,80V192a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V80A28,28,0,0,0,208,52Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4H80a12,12,0,0,0,10-5.34L102.42,52h51.15L166,70.66A12,12,0,0,0,176,76h32a4,4,0,0,1,4,4ZM128,84a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,84Zm0,72a24,24,0,1,1,24-24A24,24,0,0,1,128,156Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,64H176L160,40H96L80,64H48A16,16,0,0,0,32,80V192a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V80A16,16,0,0,0,208,64ZM128,168a36,36,0,1,1,36-36A36,36,0,0,1,128,168Z",opacity:"0.2"}),d.createElement("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm-44,76a36,36,0,1,1-36-36A36,36,0,0,1,164,132Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,58H179.21L165,36.67A6,6,0,0,0,160,34H96a6,6,0,0,0-5,2.67L76.78,58H48A22,22,0,0,0,26,80V192a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V80A22,22,0,0,0,208,58Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V80A10,10,0,0,1,48,70H80a6,6,0,0,0,5-2.67L99.21,46h57.57L171,67.33A6,6,0,0,0,176,70h32a10,10,0,0,1,10,10ZM128,90a42,42,0,1,0,42,42A42,42,0,0,0,128,90Zm0,72a30,30,0,1,1,30-30A30,30,0,0,1,128,162Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,60H178.13L163.32,37.78A4,4,0,0,0,160,36H96a4,4,0,0,0-3.32,1.78L77.85,60H48A20,20,0,0,0,28,80V192a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V80A20,20,0,0,0,208,60Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V80A12,12,0,0,1,48,68H80a4,4,0,0,0,3.33-1.78L98.13,44h59.72l14.82,22.22A4,4,0,0,0,176,68h32a12,12,0,0,1,12,12ZM128,92a40,40,0,1,0,40,40A40,40,0,0,0,128,92Zm0,72a32,32,0,1,1,32-32A32,32,0,0,1,128,164Z"}))]]),QP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),d.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),ZP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),d.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),NP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M84,100A12,12,0,0,1,96,88h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,100Zm12,52h64a12,12,0,0,0,0-24H96a12,12,0,0,0,0,24ZM236,56V184a20,20,0,0,1-20,20H157.89l-12.52,21.92a20,20,0,0,1-34.74,0L98.11,204H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V180h61.07a12,12,0,0,1,10.42,6.05L128,207.94l12.51-21.89A12,12,0,0,1,150.93,180H212Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,56V184a8,8,0,0,1-8,8H150.93l-16,28a8,8,0,0,1-13.9,0l-16-28H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),d.createElement("path",{d:"M88,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,104Zm8,40h64a8,8,0,0,0,0-16H96a8,8,0,0,0,0,16ZM232,56V184a16,16,0,0,1-16,16H155.57l-13.68,23.94a16,16,0,0,1-27.78,0L100.43,200H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Zm-16,0H40V184h65.07a8,8,0,0,1,7,4l16,28,16-28a8,8,0,0,1,7-4H216Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V184a16,16,0,0,0,16,16h60.43l13.68,23.94a16,16,0,0,0,27.78,0L155.57,200H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM160,144H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M166,104a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,104Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-74V184a14,14,0,0,1-14,14H154.41L140.16,223a14,14,0,0,1-24.32,0L101.59,198H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V184a2,2,0,0,0,2,2h65.07a6,6,0,0,1,5.21,3l16,28a2,2,0,0,0,3.48,0l16-28a6,6,0,0,1,5.21-3H216a2,2,0,0,0,2-2Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M88,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,104Zm8,40h64a8,8,0,0,0,0-16H96a8,8,0,0,0,0,16ZM232,56V184a16,16,0,0,1-16,16H155.57l-13.68,23.94a16,16,0,0,1-27.78,0L100.43,200H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Zm-16,0H40V184h65.07a8,8,0,0,1,7,4l16,28,16-28a8,8,0,0,1,7-4H216Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M164,104a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,104Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-76V184a12,12,0,0,1-12,12H153.25L138.42,222a12,12,0,0,1-20.84,0L102.75,196H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V184a4,4,0,0,0,4,4h65.07a4,4,0,0,1,3.47,2l16,28a4,4,0,0,0,6.94,0l16-28a4,4,0,0,1,3.47-2H216a4,4,0,0,0,4-4Z"}))]]),RP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),d.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),VP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),d.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),LP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M172,164a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,164Zm-12-52H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm60-64V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V48A20,20,0,0,1,56,28H90.53a51.88,51.88,0,0,1,74.94,0H200A20,20,0,0,1,220,48ZM100.29,60h55.42a28,28,0,0,0-55.42,0ZM196,52H178.59A52.13,52.13,0,0,1,180,64v8a12,12,0,0,1-12,12H88A12,12,0,0,1,76,72V64a52.13,52.13,0,0,1,1.41-12H60V212H196Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,48V216a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H96a39.83,39.83,0,0,0-8,24v8h80V64a39.83,39.83,0,0,0-8-24h40A8,8,0,0,1,208,48Z",opacity:"0.2"}),d.createElement("path",{d:"M168,152a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,152Zm-8-40H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm56-64V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V48A16,16,0,0,1,56,32H92.26a47.92,47.92,0,0,1,71.48,0H200A16,16,0,0,1,216,48ZM96,64h64a32,32,0,0,0-64,0ZM200,48H173.25A47.93,47.93,0,0,1,176,64v8a8,8,0,0,1-8,8H88a8,8,0,0,1-8-8V64a47.93,47.93,0,0,1,2.75-16H56V216H200Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,32H163.74a47.92,47.92,0,0,0-71.48,0H56A16,16,0,0,0,40,48V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm-72,0a32,32,0,0,1,32,32H96A32,32,0,0,1,128,32Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M166,152a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,152Zm-6-38H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm54-66V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V48A14,14,0,0,1,56,34H93.17a45.91,45.91,0,0,1,69.66,0H200A14,14,0,0,1,214,48ZM94,64v2h68V64a34,34,0,0,0-68,0ZM202,48a2,2,0,0,0-2-2H170.33A45.77,45.77,0,0,1,174,64v8a6,6,0,0,1-6,6H88a6,6,0,0,1-6-6V64a45.77,45.77,0,0,1,3.67-18H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200a2,2,0,0,0,2-2Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M168,152a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,152Zm-8-40H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm56-64V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V48A16,16,0,0,1,56,32H92.26a47.92,47.92,0,0,1,71.48,0H200A16,16,0,0,1,216,48ZM96,64h64a32,32,0,0,0-64,0ZM200,48H173.25A47.93,47.93,0,0,1,176,64v8a8,8,0,0,1-8,8H88a8,8,0,0,1-8-8V64a47.93,47.93,0,0,1,2.75-16H56V216H200Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M164,152a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,152Zm-4-36H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm52-68V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V48A12,12,0,0,1,56,36H94.08a44,44,0,0,1,67.84,0H200A12,12,0,0,1,212,48ZM92,64v4h72V64a36,36,0,0,0-72,0ZM204,48a4,4,0,0,0-4-4H167.17A43.71,43.71,0,0,1,172,64v8a4,4,0,0,1-4,4H88a4,4,0,0,1-4-4V64a43.71,43.71,0,0,1,4.83-20H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200a4,4,0,0,0,4-4Z"}))]]),_P=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),d.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z"}))]]),DP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),d.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),HP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M251,123.13c-.37-.81-9.13-20.26-28.48-39.61C196.63,57.67,164,44,128,44S59.37,57.67,33.51,83.52C14.16,102.87,5.4,122.32,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212s68.63-13.66,94.48-39.51c19.36-19.35,28.12-38.79,28.49-39.61A12.08,12.08,0,0,0,251,123.13Zm-46.06,33C183.47,177.27,157.59,188,128,188s-55.47-10.73-76.91-31.88A130.36,130.36,0,0,1,29.52,128,130.45,130.45,0,0,1,51.09,99.89C72.54,78.73,98.41,68,128,68s55.46,10.73,76.91,31.89A130.36,130.36,0,0,1,226.48,128,130.45,130.45,0,0,1,204.91,156.12ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),d.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M245.48,125.57c-.34-.78-8.66-19.23-27.24-37.81C201,70.54,171.38,50,128,50S55,70.54,37.76,87.76c-18.58,18.58-26.9,37-27.24,37.81a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206s73-20.53,90.24-37.75c18.58-18.58,26.9-37,27.24-37.8A6,6,0,0,0,245.48,125.57ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.77,134.77,0,0,1,22.69,128,134.56,134.56,0,0,1,46.55,95.94C69.22,73.42,96.62,62,128,62s58.78,11.42,81.45,33.94A134.56,134.56,0,0,1,233.31,128C226.94,140.21,195,194,128,194Zm0-112a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z"}))]]),XP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Z"}))]]),zP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M180.49,143.51a12,12,0,0,1,0,17l-24,24a12,12,0,0,1-17-17L155,152l-15.52-15.51a12,12,0,1,1,17-17Zm-64-24a12,12,0,0,0-17,0l-24,24a12,12,0,0,0,0,17l24,24a12,12,0,0,0,17-17L101,152l15.52-15.51A12,12,0,0,0,116.49,119.51ZM220,88V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88ZM160,57V80h23Zm36,155V104H148a12,12,0,0,1-12-12V44H60V212Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34Zm-104,88a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L91.31,152Zm72-12.68-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32l24,24A8,8,0,0,1,181.66,157.66ZM152,88V44l44,44Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M180.24,147.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L167.51,152l-19.75-19.76a6,6,0,1,1,8.48-8.48Zm-72-24a6,6,0,0,0-8.48,0l-24,24a6,6,0,0,0,0,8.48l24,24a6,6,0,1,0,8.48-8.48L88.49,152l19.75-19.76A6,6,0,0,0,108.24,123.76ZM214,88V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.52L158,46.48Zm44,134V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200A2,2,0,0,0,202,216Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M178.83,149.17a4,4,0,0,1,0,5.66l-24,24a4,4,0,0,1-5.66-5.66L170.34,152l-21.17-21.17a4,4,0,1,1,5.66-5.66Zm-72-24a4,4,0,0,0-5.66,0l-24,24a4,4,0,0,0,0,5.66l24,24a4,4,0,1,0,5.66-5.66L85.66,152l21.17-21.17A4,4,0,0,0,106.83,125.17ZM212,88V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.65Zm48,132V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200A4,4,0,0,0,204,216Z"}))]]),FP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,180c0,8.67,5.5,16,12,16a10.27,10.27,0,0,0,7.33-3.43,12,12,0,1,1,17.34,16.6A34,34,0,0,1,60,220C40.15,220,24,202,24,180s16.15-40,36-40a34,34,0,0,1,24.67,10.83,12,12,0,1,1-17.34,16.6A10.27,10.27,0,0,0,60,164C53.5,164,48,171.31,48,180Zm97.51-5.71c-5.12-3.45-11.32-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,143,142a69,69,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.49,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2.48,2.48,0,0,1-.21.71c-1.37,1.55-9.58,1.79-16.39-.06a12,12,0,1,0-6.46,23.11A63.75,63.75,0,0,0,125.1,220c6.46,0,13.73-1.17,19.73-5.15a24.73,24.73,0,0,0,10.95-18C157,187.53,153.33,179.53,145.51,174.27Zm68,0c-5.12-3.45-11.32-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,211,142a69,69,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.49,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2.48,2.48,0,0,1-.21.71c-1.37,1.55-9.58,1.79-16.39-.06a12,12,0,1,0-6.46,23.11A63.75,63.75,0,0,0,193.1,220c6.46,0,13.73-1.17,19.73-5.15a24.73,24.73,0,0,0,10.95-18C225,187.53,221.33,179.53,213.51,174.27ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M48,180c0,11,7.18,20,16,20a14.2,14.2,0,0,0,10.22-4.66A8,8,0,1,1,85.77,206.4,30,30,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30,30,0,0,1,21.77,9.6,8,8,0,1,1-11.55,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.26-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.35-1.73,19.83-.56a8,8,0,0,0,4.07-15.48c-2.12-.55-21-5.22-32.83,2.76a20.55,20.55,0,0,0-9,14.95c-2,15.88,13.64,20.41,23,23.11,12.07,3.49,13.13,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36a8,8,0,0,0-4.3,15.41,61.23,61.23,0,0,0,15.18,2c5.83,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.48,174.17,127.6,171.31Zm64,0c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.15,3.93-4.6,3.06-15.16,1.56-19.54.36A8,8,0,0,0,173.93,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,1,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.68L160,51.31Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,180c0,11,7.18,20,16,20a14.18,14.18,0,0,0,10.06-4.5,8.2,8.2,0,0,1,10.9-.91,8,8,0,0,1,.81,11.81A30,30,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30,30,0,0,1,21.38,9.19,8.26,8.26,0,0,1,.74,11.09,8,8,0,0,1-11.9.38A14.2,14.2,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.26-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.35-1.73,19.83-.56a8,8,0,0,0,4.07-15.48c-2.12-.55-21-5.22-32.83,2.76a20.55,20.55,0,0,0-9,14.95c-2,15.88,13.64,20.41,23,23.11,12.07,3.49,13.13,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36a8,8,0,0,0-4.3,15.41,61.23,61.23,0,0,0,15.18,2c5.83,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.48,174.17,127.6,171.31Zm64,0c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.15,3.93-4.6,3.06-15.16,1.56-19.54.36A8,8,0,0,0,173.93,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,116V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v28a4,4,0,0,1-4,4H44A4,4,0,0,1,40,116ZM152,88h44L152,44Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M46,180c0,12.13,8.07,22,18,22a16.21,16.21,0,0,0,11.66-5.28,6,6,0,0,1,8.67,8.3A28.09,28.09,0,0,1,64,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.09,28.09,0,0,1,20.33,9,6,6,0,0,1-8.67,8.3A16.21,16.21,0,0,0,64,158C54.07,158,46,167.86,46,180Zm81-6.77c-10.85-3.13-13.4-4.69-13-7.91a6.56,6.56,0,0,1,2.88-5.08c5.59-3.79,17.66-1.82,21.44-.84a6,6,0,1,0,3.06-11.6c-2-.53-20.09-5-31.2,2.48a18.62,18.62,0,0,0-8.09,13.54c-1.79,14.19,12.27,18.25,21.57,20.94,12.12,3.5,14.78,5.33,14.21,9.76a6.89,6.89,0,0,1-3,5.34c-5.6,3.73-17.48,1.64-21.18.62A6,6,0,1,0,110.48,212a59.29,59.29,0,0,0,14.67,2c5.49,0,11.55-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C151.83,180.39,136.92,176.08,127,173.22Zm64,0c-10.85-3.13-13.41-4.69-13-7.91a6.59,6.59,0,0,1,2.88-5.08c5.6-3.79,17.65-1.83,21.44-.84a6,6,0,0,0,3.07-11.6c-2-.54-20.1-5-31.21,2.48a18.64,18.64,0,0,0-8.08,13.54c-1.8,14.19,12.26,18.25,21.57,20.94,12.12,3.5,14.77,5.33,14.2,9.76a6.85,6.85,0,0,1-3,5.34c-5.61,3.73-17.48,1.64-21.19.62A6,6,0,0,0,174.47,212a59.41,59.41,0,0,0,14.68,2c5.49,0,11.54-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C215.83,180.39,200.91,176.08,191,173.22ZM202,94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.24,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,1,1-12,0ZM193.5,82,158,46.48V82Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,1,1,85.77,206.4,30,30,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30,30,0,0,1,21.77,9.6,8,8,0,1,1-11.55,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.26-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56a8,8,0,0,0,4.07-15.48c-2.12-.55-21-5.22-32.83,2.76a20.55,20.55,0,0,0-9,14.95c-2,15.88,13.64,20.41,23,23.11,12.07,3.49,13.13,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36a8,8,0,0,0-4.3,15.41,61.23,61.23,0,0,0,15.18,2c5.83,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.48,174.17,127.6,171.31Zm64,0c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56a8,8,0,0,0,4.07-15.48c-2.11-.55-21-5.22-32.83,2.76a20.58,20.58,0,0,0-8.95,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.15,3.93-4.6,3.06-15.16,1.56-19.54.36A8,8,0,0,0,173.93,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.81,20.81,0,0,0,9.18-15.23C218,179,201.48,174.17,191.59,171.31ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,1,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.68L160,51.31Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M44,180c0,13.23,9,24,20,24a18.15,18.15,0,0,0,13.11-5.9,4,4,0,0,1,5.78,5.54A26.13,26.13,0,0,1,64,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a26.13,26.13,0,0,1,18.89,8.36,4,4,0,0,1-5.78,5.54A18.15,18.15,0,0,0,64,156C53,156,44,166.77,44,180Zm82.49-4.85c-10.53-3-15.08-4.91-14.43-10.08a8.57,8.57,0,0,1,3.75-6.49c6.26-4.23,18.77-2.24,23.07-1.11a4,4,0,0,0,2-7.74,61.11,61.11,0,0,0-10.47-1.61c-8.12-.54-14.54.75-19.1,3.82a16.63,16.63,0,0,0-7.22,12.13c-1.58,12.49,10.46,16,20.14,18.77,11.25,3.25,16.47,5.49,15.63,11.94a8.93,8.93,0,0,1-3.9,6.75c-6.28,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.79,57.79,0,0,0,125.19,212c5.18,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C149.64,181.84,136.26,178,126.49,175.15Zm64,0c-10.53-3-15.08-4.91-14.43-10.08a8.57,8.57,0,0,1,3.75-6.49c6.26-4.23,18.77-2.24,23.07-1.11a4,4,0,0,0,2-7.74,61.33,61.33,0,0,0-10.48-1.61c-8.11-.54-14.54.75-19.09,3.82a16.63,16.63,0,0,0-7.22,12.13c-1.59,12.49,10.46,16,20.14,18.77,11.25,3.25,16.46,5.49,15.63,11.94a8.93,8.93,0,0,1-3.9,6.75c-6.28,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.7,57.7,0,0,0,189.19,212c5.17,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C213.63,181.84,200.26,178,190.49,175.15ZM204,92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88v24a4,4,0,0,1-8,0Zm-5.65-8L156,41.65V84Z"}))]]),BP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,128a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v12a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.49l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v76A12,12,0,0,0,48,128ZM183,80H160V57ZM68,160v48a12,12,0,0,1-24,0V196H32v12a12,12,0,0,1-24,0V160a12,12,0,0,1,24,0v12H44V160a12,12,0,0,1,24,0Zm60,0a12,12,0,0,1-12,12h-4v36a12,12,0,0,1-24,0V172H84a12,12,0,0,1,0-24h32A12,12,0,0,1,128,160Zm72,0v48a12,12,0,0,1-24,0v-9.36l-.11.16a12,12,0,0,1-19.78,0l-.11-.16V208a12,12,0,0,1-24,0V160a12,12,0,0,1,21.89-6.8L166,170.82l12.11-17.62A12,12,0,0,1,200,160Zm56,48a12,12,0,0,1-12,12H220a12,12,0,0,1-12-12V160a12,12,0,0,1,24,0v36h12A12,12,0,0,1,256,208Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M216,120V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v80a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v24a8,8,0,0,0,16,0ZM160,51.31,188.69,80H160ZM68,160v48a8,8,0,0,1-16,0V192H32v16a8,8,0,0,1-16,0V160a8,8,0,0,1,16,0v16H52V160a8,8,0,0,1,16,0Zm56,0a8,8,0,0,1-8,8h-8v40a8,8,0,0,1-16,0V168H84a8,8,0,0,1,0-16h32A8,8,0,0,1,124,160Zm72,0v48a8,8,0,0,1-16,0V184l-9.6,12.8a8,8,0,0,1-12.8,0L148,184v24a8,8,0,0,1-16,0V160a8,8,0,0,1,14.4-4.8L164,178.67l17.6-23.47A8,8,0,0,1,196,160Zm56,48a8,8,0,0,1-8,8H216a8,8,0,0,1-8-8V160a8,8,0,0,1,16,0v40h20A8,8,0,0,1,252,208Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M44,128H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v84A4,4,0,0,0,44,128ZM152,44l44,44H152ZM68,160v48a8,8,0,0,1-16,0V192H32v16a8,8,0,0,1-16,0V160a8,8,0,0,1,16,0v16H52V160a8,8,0,0,1,16,0Zm56,0a8,8,0,0,1-8,8h-8v40a8,8,0,0,1-16,0V168H84a8,8,0,0,1,0-16h32A8,8,0,0,1,124,160Zm72,0v48a8,8,0,0,1-16,0V184l-9.6,12.8a8,8,0,0,1-12.8,0L148,184v24a8,8,0,0,1-16,0V160a8,8,0,0,1,14.4-4.8L164,178.67l17.6-23.47A8,8,0,0,1,196,160Zm56,48a8,8,0,0,1-8,8H216a8,8,0,0,1-8-8V160a8,8,0,0,1,16,0v40h20A8,8,0,0,1,252,208Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M214,120V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v80a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v26a6,6,0,0,0,12,0ZM158,46.48,193.52,82H158ZM66,160v48a6,6,0,0,1-12,0V190H30v18a6,6,0,0,1-12,0V160a6,6,0,0,1,12,0v18H54V160a6,6,0,0,1,12,0Zm56,0a6,6,0,0,1-6,6H106v42a6,6,0,0,1-12,0V166H84a6,6,0,0,1,0-12h32A6,6,0,0,1,122,160Zm72,0v48a6,6,0,0,1-12,0V178l-13.2,17.6a6,6,0,0,1-9.6,0L146,178v30a6,6,0,0,1-12,0V160a6,6,0,0,1,10.8-3.6L164,182l19.2-25.6A6,6,0,0,1,194,160Zm56,48a6,6,0,0,1-6,6H216a6,6,0,0,1-6-6V160a6,6,0,0,1,12,0v42h22A6,6,0,0,1,250,208Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,120V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v80a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v24a8,8,0,0,0,16,0ZM160,51.31,188.69,80H160ZM68,160v48a8,8,0,0,1-16,0V192H32v16a8,8,0,0,1-16,0V160a8,8,0,0,1,16,0v16H52V160a8,8,0,0,1,16,0Zm56,0a8,8,0,0,1-8,8h-8v40a8,8,0,0,1-16,0V168H84a8,8,0,0,1,0-16h32A8,8,0,0,1,124,160Zm72,0v48a8,8,0,0,1-16,0V184l-9.6,12.8a8,8,0,0,1-12.8,0L148,184v24a8,8,0,0,1-16,0V160a8,8,0,0,1,14.4-4.8L164,178.67l17.6-23.47A8,8,0,0,1,196,160Zm56,48a8,8,0,0,1-8,8H216a8,8,0,0,1-8-8V160a8,8,0,0,1,16,0v40h20A8,8,0,0,1,252,208Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212,88a4,4,0,0,0-1.17-2.83l-2-2h0l-54-54A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v80a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52v28a4,4,0,0,0,8,0ZM156,41.65,198.34,84H156ZM64,160v48a4,4,0,0,1-8,0V188H28v20a4,4,0,0,1-8,0V160a4,4,0,0,1,8,0v20H56V160a4,4,0,0,1,8,0Zm56,0a4,4,0,0,1-4,4H104v44a4,4,0,0,1-8,0V164H84a4,4,0,0,1,0-8h32A4,4,0,0,1,120,160Zm72,0v48a4,4,0,0,1-8,0V172l-16.8,22.4a4,4,0,0,1-6.4,0L144,172v36a4,4,0,0,1-8,0V160a4,4,0,0,1,7.2-2.4L164,185.33l20.8-27.73A4,4,0,0,1,192,160Zm56,48a4,4,0,0,1-4,4H216a4,4,0,0,1-4-4V160a4,4,0,0,1,8,0v44h24A4,4,0,0,1,248,208Z"}))]]),YP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M120,140H104a12,12,0,0,0-12,12v56a12,12,0,0,0,24,0v-4h4a32,32,0,0,0,0-64Zm0,40h-4V164h4a8,8,0,0,1,0,16Zm104,20.87a12,12,0,0,1-3.33,8.3A34,34,0,0,1,196,220c-19.85,0-36-17.94-36-40s16.15-40,36-40a33.39,33.39,0,0,1,18.71,5.8,12,12,0,1,1-13.42,19.89A9.39,9.39,0,0,0,196,164c-6.5,0-12,7.33-12,16s5.5,16,12,16a9,9,0,0,0,2.7-.42A12,12,0,0,1,208,176h4a12,12,0,0,1,12,12ZM80,152v38a30,30,0,0,1-60,0,12,12,0,0,1,24,0,6,6,0,0,0,12,0V152a12,12,0,0,1,24,0ZM48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.48l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM160,57l23,23H160Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M120,144H104a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40h-8V160h8a12,12,0,0,1,0,24Zm96,0v16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.38,29.38,0,0,1,16.48,5.12,8,8,0,0,1-9,13.26A13.21,13.21,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.63,13.63,0,0,0,8-2.71V192a8,8,0,0,1,0-16h8A8,8,0,0,1,216,184ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,80V51.31L188.69,80Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M44,120H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76A4,4,0,0,0,44,120ZM152,44l44,44H152ZM120,144H104a8,8,0,0,0-8,8v55.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8v-8h7.4c15.24,0,28.13-11.92,28.59-27.15A28,28,0,0,0,120,144Zm-.35,40H112V160h8a12,12,0,0,1,11.94,13.16A12.23,12.23,0,0,1,119.65,184ZM216,200.87a8,8,0,0,1-2.26,5.57A30,30,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.36,29.36,0,0,1,16.09,4.86,8.21,8.21,0,0,1,3,10.64,8,8,0,0,1-11.55,2.88A13.21,13.21,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.63,13.63,0,0,0,8-2.71V192a8,8,0,0,1-8-8.53,8.17,8.17,0,0,1,8.25-7.47H208a8,8,0,0,1,8,8ZM80,152v37.41c0,14.22-11.18,26.26-25.41,26.58A26,26,0,0,1,28,190.37,8.17,8.17,0,0,1,35.31,182,8,8,0,0,1,44,190.22a8.89,8.89,0,0,0,4,8c7.85,4.82,16-.75,16-8.2V152.27A8.17,8.17,0,0,1,71.47,144,8,8,0,0,1,80,152Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M120,146H104a6,6,0,0,0-6,6v56a6,6,0,0,0,12,0V198h10a26,26,0,0,0,0-52Zm0,40H110V158h10a14,14,0,0,1,0,28Zm94-2v16.87a6,6,0,0,1-1.67,4.15A28.06,28.06,0,0,1,192,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a27.43,27.43,0,0,1,15.36,4.77,6,6,0,0,1-6.72,9.95A15.25,15.25,0,0,0,192,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a15.75,15.75,0,0,0,10-3.73V190h-2a6,6,0,0,1,0-12h8A6,6,0,0,1,214,184ZM78,152v38a24,24,0,0,1-48,0,6,6,0,0,1,12,0,12,12,0,0,0,24,0V152a6,6,0,0,1,12,0ZM212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88A6,6,0,0,0,212.24,83.76ZM158,82V46.48L193.52,82Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M120,144H104a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40h-8V160h8a12,12,0,0,1,0,24Zm96,0v16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,192,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a29.38,29.38,0,0,1,16.48,5.12,8,8,0,0,1-9,13.26A13.21,13.21,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.63,13.63,0,0,0,8-2.71V192a8,8,0,0,1,0-16h8A8,8,0,0,1,216,184ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,80V51.31L188.69,80Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M120,148H104a4,4,0,0,0-4,4v56a4,4,0,0,0,8,0V196h12a24,24,0,0,0,0-48Zm0,40H108V156h12a16,16,0,0,1,0,32Zm92-4v16.87a4,4,0,0,1-1.11,2.77A26.11,26.11,0,0,1,192,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a25.41,25.41,0,0,1,14.24,4.43,4,4,0,1,1-4.48,6.63A17.45,17.45,0,0,0,192,156c-11,0-20,10.77-20,24s9,24,20,24a17.87,17.87,0,0,0,12-4.82V188h-4a4,4,0,0,1,0-8h8A4,4,0,0,1,212,184ZM76,152v38a22,22,0,0,1-44,0,4,4,0,0,1,8,0,14,14,0,0,0,28,0V152a4,4,0,0,1,8,0ZM210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52v20a4,4,0,0,0,8,0V88A4,4,0,0,0,210.83,85.17ZM156,84V41.65L198.34,84Z"}))]]),IP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68a12,12,0,0,0,24,0V44h76V92a12,12,0,0,0,12,12h48V212H180a12,12,0,0,0,0,24h20a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160Zm-4.22,139.85a24.75,24.75,0,0,1-10.95,18.06c-6,4-13.27,5.15-19.73,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,0,1,6.46-23.12c6.81,1.86,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.83-2.64-9.88-3.52-5.39-1.56-11-3.18-15.75-6.27-7.62-4.92-11.21-12.45-10.11-21.2a24.45,24.45,0,0,1,10.69-17.75c6.06-4.09,14.17-5.84,24.1-5.18A68.53,68.53,0,0,1,143,142a12,12,0,0,1-6.1,23.21c-6.36-1.63-13.62-1.51-16.07-.33a79.5,79.5,0,0,0,7.91,2.59c5.48,1.58,11.68,3.37,16.8,6.82C153.33,179.55,157,187.55,155.78,196.82ZM84,152v38a30,30,0,0,1-60,0,12,12,0,0,1,24,0,6,6,0,0,0,12,0V152a12,12,0,0,1,24,0Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H176a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-12.19,145a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A61.14,61.14,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H164a4,4,0,0,1,4,4V228a4,4,0,0,0,4,4h28a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-4.19,108.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.58,20.58,0,0,1,9-14.95c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.57,4.57,0,0,0-2,3.67c-.11.9-.13,1.09,1.12,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM80,152v37.41c0,14.22-11.18,26.26-25.41,26.58A26,26,0,0,1,28,190.37,8.17,8.17,0,0,1,35.31,182,8,8,0,0,1,44,190.22a8.89,8.89,0,0,0,4,8c7.85,4.82,16-.75,16-8.2V152.27A8.17,8.17,0,0,1,71.47,144,8,8,0,0,1,80,152Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2H176a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM145.83,196.06a18.89,18.89,0,0,1-8.31,13.81c-4.82,3.19-10.87,4.14-16.36,4.14a58.89,58.89,0,0,1-14.68-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.58-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.21-2.48a6,6,0,0,1-3.06,11.6c-3.78-1-15.85-3-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C132.92,176.09,147.84,180.4,145.83,196.06ZM78,152v38a24,24,0,0,1-48,0,6,6,0,0,1,12,0,12,12,0,0,0,24,0V152a6,6,0,0,1,12,0Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H176a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-12.19,145a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM80,152v38a26,26,0,0,1-52,0,8,8,0,0,1,16,0,10,10,0,0,0,20,0V152a8,8,0,0,1,16,0Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216a4,4,0,0,1-4,4H176a4,4,0,0,0,0,8h24a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM143.84,195.8a17,17,0,0,1-7.43,12.41c-4.39,2.91-10,3.77-15.22,3.77A57.89,57.89,0,0,1,107,210.11a4,4,0,0,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.33,61.33,0,0,1,10.48,1.61,4,4,0,0,1-2.05,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C132.26,178,145.64,181.84,143.84,195.8ZM76,152v38a22,22,0,0,1-44,0,4,4,0,0,1,8,0,14,14,0,0,0,28,0V152a4,4,0,0,1,8,0Z"}))]]),qP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M151.78,196.8a24.73,24.73,0,0,1-10.95,18c-6,4-13.27,5.15-19.73,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,1,1,6.46-23.11c6.81,1.85,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.83-2.64-9.88-3.53-5.39-1.56-11-3.17-15.75-6.26-7.63-4.92-11.21-12.45-10.11-21.19a24.45,24.45,0,0,1,10.69-17.76c6.06-4.09,14.17-5.83,24.1-5.17A69,69,0,0,1,139,142a12,12,0,0,1-6.1,23.21c-6.36-1.63-13.62-1.51-16.07-.33a79.5,79.5,0,0,0,7.91,2.59c5.47,1.58,11.68,3.37,16.8,6.82C149.33,179.53,153,187.53,151.78,196.8ZM68,140a12,12,0,0,0-12,12v38a6,6,0,0,1-12,0,12,12,0,0,0-24,0,30,30,0,0,0,60,0V152A12,12,0,0,0,68,140Zm138.75,40,15-21a12,12,0,0,0-19.53-14L192,159.34,181.76,145a12,12,0,0,0-19.53,14l15,21-15,21A12,12,0,1,0,181.76,215L192,200.62,202.23,215A12,12,0,0,0,221.76,201ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A60.43,60.43,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58,20.58,0,0,1,9-14.94c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.08,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM72,144a8,8,0,0,0-8,8v38a10,10,0,0,1-20,0,8,8,0,0,0-16,0,26,26,0,0,0,52,0V152A8,8,0,0,0,72,144Zm140.65,1.49a8,8,0,0,0-11.16,1.86L188,166.24l-13.49-18.89a8,8,0,0,0-13,9.3L178.17,180l-16.68,23.35a8,8,0,0,0,13,9.3L188,193.76l13.49,18.89a8,8,0,0,0,13-9.3L197.83,180l16.68-23.35A8,8,0,0,0,212.65,145.49ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-4.19,108.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a60.63,60.63,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58,20.58,0,0,1,9-14.94c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.57,4.57,0,0,0-2,3.67c-.11.9-.13,1.08,1.12,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM80,152v37.4c0,14.23-11.18,26.27-25.41,26.59A26,26,0,0,1,28,190.37,8.17,8.17,0,0,1,35.31,182,8,8,0,0,1,44,190.22a8.89,8.89,0,0,0,4,8c7.85,4.82,16-.76,16-8.2V152.27A8.17,8.17,0,0,1,71.47,144,8,8,0,0,1,80,152Zm134.51,4.65L197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,13-9.3L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M145.83,196.05a18.89,18.89,0,0,1-8.31,13.81c-4.82,3.19-10.87,4.14-16.36,4.14a59.41,59.41,0,0,1-14.68-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.58-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.21-2.48a6,6,0,0,1-3.06,11.6c-3.79-1-15.85-2.95-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C132.92,176.08,147.84,180.39,145.83,196.05ZM72,146a6,6,0,0,0-6,6v38a12,12,0,0,1-24,0,6,6,0,0,0-12,0,24,24,0,0,0,48,0V152A6,6,0,0,0,72,146Zm139.49,1.12a6,6,0,0,0-8.37,1.39L188,169.67,172.88,148.5a6,6,0,0,0-9.76,7L180.63,180,163.12,204.5a6,6,0,1,0,9.76,7L188,190.31l15.12,21.16a6,6,0,1,0,9.76-7L195.37,180l17.51-24.51A6,6,0,0,0,211.49,147.11ZM214,88v24a6,6,0,1,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-20.49-6L158,46.48V82Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a60.63,60.63,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.58,20.58,0,0,1,9-14.95c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.08,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM72,144a8,8,0,0,0-8,8v38a10,10,0,0,1-20,0,8,8,0,0,0-16,0,26,26,0,0,0,52,0V152A8,8,0,0,0,72,144Zm140.65,1.49a8,8,0,0,0-11.16,1.86L188,166.24l-13.49-18.89a8,8,0,0,0-13,9.3L178.17,180l-16.68,23.35a8,8,0,0,0,13,9.3L188,193.76l13.49,18.89a8,8,0,0,0,13-9.3L197.83,180l16.68-23.35A8,8,0,0,0,212.65,145.49ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M143.84,195.8a17,17,0,0,1-7.43,12.41c-4.39,2.91-10,3.77-15.22,3.77A57.89,57.89,0,0,1,107,210.11a4,4,0,1,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.33,61.33,0,0,1,10.48,1.61,4,4,0,0,1-2.05,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C132.26,178,145.64,181.84,143.84,195.8ZM72,148a4,4,0,0,0-4,4v38a14,14,0,0,1-28,0,4,4,0,0,0-8,0,22,22,0,0,0,44,0V152A4,4,0,0,0,72,148Zm138.32.75a4,4,0,0,0-5.58.92L188,173.12l-16.75-23.45a4,4,0,0,0-6.51,4.66L183.08,180l-18.34,25.67a4,4,0,0,0,.93,5.58,4,4,0,0,0,5.58-.92L188,186.88l16.74,23.45A4,4,0,0,0,208,212a3.91,3.91,0,0,0,2.32-.75,4,4,0,0,0,.93-5.58L192.92,180l18.33-25.67A4,4,0,0,0,210.32,148.75ZM212,88v24a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-13.66-4L156,41.65V84Z"}))]]),GP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M100,152v56a12,12,0,0,1-24,0V190.07l-6.17,8.81a12,12,0,0,1-19.66,0L44,190.07V208a12,12,0,0,1-24,0V152a12,12,0,0,1,21.83-6.88L60,171.07l18.17-25.95A12,12,0,0,1,100,152Zm84,28a40,40,0,0,1-40,40H128a12,12,0,0,1-12-12V152a12,12,0,0,1,12-12h16A40,40,0,0,1,184,180Zm-24,0a16,16,0,0,0-16-16h-4v32h4A16,16,0,0,0,160,180Zm60-92V224a12,12,0,0,1-24,0V104H148a12,12,0,0,1-12-12V44H60v64a12,12,0,0,1-24,0V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88Zm-60-8h23L160,57Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V224a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM144,144H128a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h16a36,36,0,0,0,0-72Zm0,56h-8V160h8a20,20,0,0,1,0,40Zm-40-48v56a8,8,0,0,1-16,0V177.38L74.55,196.59a8,8,0,0,1-13.1,0L48,177.38V208a8,8,0,0,1-16,0V152a8,8,0,0,1,14.55-4.59L68,178.05l21.45-30.64A8,8,0,0,1,104,152Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H196a4,4,0,0,1,4,4V224a8,8,0,0,0,9.19,7.91,8.15,8.15,0,0,0,6.81-8.16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-8,56H128a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h15.32c19.66,0,36.21-15.48,36.67-35.13A36,36,0,0,0,144,144Zm-.49,56H136V160h8a20,20,0,0,1,20,20.77C163.58,191.59,154.34,200,143.51,200ZM104,152v55.73A8.17,8.17,0,0,1,96.53,216,8,8,0,0,1,88,208V177.38l-13.32,19a8.3,8.3,0,0,1-4.2,3.2,8,8,0,0,1-9-3L48,177.38v30.35A8.17,8.17,0,0,1,40.53,216,8,8,0,0,1,32,208V152.31a8.27,8.27,0,0,1,4.56-7.53,8,8,0,0,1,10,2.63L68,178.05l21.27-30.39a8.28,8.28,0,0,1,8.06-3.55A8,8,0,0,1,104,152Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V224a6,6,0,0,0,12,0V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM144,146H128a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6h16a34,34,0,0,0,0-68Zm0,56H134V158h10a22,22,0,0,1,0,44Zm-42-50v56a6,6,0,0,1-12,0V171L72.92,195.44a6,6,0,0,1-9.84,0L46,171v37a6,6,0,0,1-12,0V152a6,6,0,0,1,10.92-3.44l23.08,33,23.08-33A6,6,0,0,1,102,152Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V224a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM144,144H128a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h16a36,36,0,0,0,0-72Zm0,56h-8V160h8a20,20,0,0,1,0,40Zm-40-48v56a8,8,0,0,1-16,0V177.38L74.55,196.59a8,8,0,0,1-13.1,0L48,177.38V208a8,8,0,0,1-16,0V152a8,8,0,0,1,14.55-4.59L68,178.05l21.45-30.64A8,8,0,0,1,104,152Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V224a4,4,0,0,0,8,0V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM144,148H128a4,4,0,0,0-4,4v56a4,4,0,0,0,4,4h16a32,32,0,0,0,0-64Zm0,56H132V156h12a24,24,0,0,1,0,48Zm-44-52v56a4,4,0,0,1-8,0V164.69l-20.72,29.6a4,4,0,0,1-6.56,0L44,164.69V208a4,4,0,0,1-8,0V152a4,4,0,0,1,7.28-2.29L68,185l24.72-35.31A4,4,0,0,1,100,152Z"}))]]),UP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm104-60a12,12,0,0,1-12,12H140v12a12,12,0,0,1-24,0V164H104a12,12,0,0,1,0-24h12V128a12,12,0,0,1,24,0v12h12A12,12,0,0,1,164,152Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-40-64a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,152Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,160H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16a8,8,0,0,1,0,16Zm0-72V43.31L196.69,88Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-42-66a6,6,0,0,1-6,6H134v18a6,6,0,0,1-12,0V158H104a6,6,0,0,1,0-12h18V128a6,6,0,0,1,12,0v18h18A6,6,0,0,1,158,152Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-40-64a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V160H104a8,8,0,0,1,0-16h16V128a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,152Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-44-68a4,4,0,0,1-4,4H132v20a4,4,0,0,1-8,0V156H104a4,4,0,0,1,0-8h20V128a4,4,0,0,1,8,0v20h20A4,4,0,0,1,156,152Z"}))]]),WP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M56,140H40a12,12,0,0,0-12,12v56a12,12,0,0,0,24,0v-4h4a32,32,0,0,0,0-64Zm0,40H52V164h4a8,8,0,0,1,0,16Zm176,20.87a12,12,0,0,1-3.33,8.3A34,34,0,0,1,204,220c-19.85,0-36-17.95-36-40s16.15-40,36-40a33.39,33.39,0,0,1,18.71,5.8,12,12,0,1,1-13.42,19.89A9.39,9.39,0,0,0,204,164c-6.5,0-12,7.33-12,16s5.5,16,12,16a9,9,0,0,0,2.7-.42A12,12,0,0,1,216,176h4a12,12,0,0,1,12,12ZM160,152v56a12,12,0,0,1-8.34,11.43A12.15,12.15,0,0,1,148,220a12,12,0,0,1-9.76-5L120,189.44V208a12,12,0,0,1-24,0V152a12,12,0,0,1,21.76-7L136,170.55V152a12,12,0,0,1,24,0ZM48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.49l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM160,57l23,23H160Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M60,144H44a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40H52V160h8a12,12,0,0,1,0,24Zm164,16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,200,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.45,29.45,0,0,1,16.48,5.11,8,8,0,0,1-9,13.27A13.21,13.21,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.57,13.57,0,0,0,8-2.72V192a8,8,0,0,1,0-16h8a8,8,0,0,1,8,8ZM156,152v56a8,8,0,0,1-5.56,7.62A7.91,7.91,0,0,1,148,216a8,8,0,0,1-6.51-3.35L116,177v31a8,8,0,0,1-16,0V152a8,8,0,0,1,14.51-4.65L140,183V152a8,8,0,0,1,16,0ZM48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M44,120H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76A4,4,0,0,0,44,120ZM152,44l44,44H152ZM60,144H44a8,8,0,0,0-8,8v55.72A8.17,8.17,0,0,0,43.47,216,8,8,0,0,0,52,208v-8h7.4c15.24,0,28.14-11.92,28.59-27.15A28,28,0,0,0,60,144Zm-.35,40H52V160h8a12,12,0,0,1,12,13.16A12.25,12.25,0,0,1,59.65,184ZM224,200.87a8,8,0,0,1-2.26,5.57A30.07,30.07,0,0,1,200,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.36,29.36,0,0,1,16.09,4.86,8.21,8.21,0,0,1,3,10.64,8,8,0,0,1-11.55,2.88A13.21,13.21,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.57,13.57,0,0,0,8-2.72V192a8,8,0,0,1-8-8.53,8.17,8.17,0,0,1,8.25-7.47H216a8,8,0,0,1,8,8ZM156,152v55.76a8.22,8.22,0,0,1-4.12,7.24,8,8,0,0,1-10.39-2.35L116,177v30.76a8.17,8.17,0,0,1-7.47,8.26,8,8,0,0,1-8.53-8V152.31a8.27,8.27,0,0,1,4.53-7.52,8,8,0,0,1,10,2.56L140,183V152.27a8.17,8.17,0,0,1,7.47-8.25A8,8,0,0,1,156,152Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M60,146H44a6,6,0,0,0-6,6v56a6,6,0,0,0,12,0V198H60a26,26,0,0,0,0-52Zm0,40H50V158H60a14,14,0,0,1,0,28Zm162,14.87a6,6,0,0,1-1.67,4.15A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a27.43,27.43,0,0,1,15.36,4.77,6,6,0,0,1-6.72,9.95A15.25,15.25,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a15.75,15.75,0,0,0,10-3.73V190h-2a6,6,0,0,1,0-12h8a6,6,0,0,1,6,6ZM154,152v56a6,6,0,0,1-4.17,5.71A5.78,5.78,0,0,1,148,214a6,6,0,0,1-4.88-2.51L114,170.72V208a6,6,0,0,1-12,0V152a6,6,0,0,1,10.88-3.49L142,189.28V152a6,6,0,0,1,12,0ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M60,144H44a8,8,0,0,0-8,8v56a8,8,0,0,0,16,0v-8h8a28,28,0,0,0,0-56Zm0,40H52V160h8a12,12,0,0,1,0,24Zm164,16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,200,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a29.45,29.45,0,0,1,16.48,5.11,8,8,0,0,1-9,13.27A13.21,13.21,0,0,0,200,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.57,13.57,0,0,0,8-2.72V192a8,8,0,0,1,0-16h8a8,8,0,0,1,8,8ZM156,152v56a8,8,0,0,1-5.56,7.62A7.91,7.91,0,0,1,148,216a8,8,0,0,1-6.51-3.35L116,177v31a8,8,0,0,1-16,0V152a8,8,0,0,1,14.51-4.65L140,183V152a8,8,0,0,1,16,0ZM48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M60,148H44a4,4,0,0,0-4,4v56a4,4,0,0,0,8,0V196H60a24,24,0,0,0,0-48Zm0,40H48V156H60a16,16,0,0,1,0,32Zm160,12.87a4,4,0,0,1-1.11,2.77A26.11,26.11,0,0,1,200,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a25.41,25.41,0,0,1,14.24,4.43,4,4,0,1,1-4.48,6.63A17.45,17.45,0,0,0,200,156c-11,0-20,10.77-20,24s9,24,20,24a17.87,17.87,0,0,0,12-4.82V188h-4a4,4,0,0,1,0-8h8a4,4,0,0,1,4,4ZM152,152v56a4,4,0,0,1-2.78,3.81A3.93,3.93,0,0,1,148,212a4,4,0,0,1-3.25-1.67L112,164.48V208a4,4,0,0,1-8,0V152a4,4,0,0,1,7.25-2.33L144,195.52V152a4,4,0,0,1,8,0Zm52-40a4,4,0,0,0,8,0V88a4,4,0,0,0-1.17-2.83l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52ZM156,84V41.65L198.34,84Z"}))]]),KP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,1,0,24,0V88a12,12,0,0,0-3.51-8.48l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM183,80H160V57ZM87.78,196.8a24.72,24.72,0,0,1-10.94,18c-6,4-13.27,5.15-19.74,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,1,1,6.46-23.11c6.82,1.85,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.82-2.64-9.88-3.53-5.39-1.56-11-3.17-15.75-6.26-7.62-4.92-11.21-12.45-10.1-21.19a24.44,24.44,0,0,1,10.68-17.76c6.07-4.09,14.17-5.82,24.1-5.17A69,69,0,0,1,75,142a12,12,0,0,1-6.1,23.21c-6.35-1.63-13.61-1.51-16.07-.33a79.69,79.69,0,0,0,7.92,2.59c5.47,1.58,11.67,3.37,16.8,6.82C85.33,179.53,89,187.53,87.78,196.8ZM155.3,156l-20,56a12,12,0,0,1-22.6,0l-20-56A12,12,0,1,1,115.3,148L124,172.3,132.7,148A12,12,0,1,1,155.3,156ZM224,188v12.87a12,12,0,0,1-3.33,8.3A34,34,0,0,1,196,220c-19.85,0-36-17.94-36-40s16.15-40,36-40a33.39,33.39,0,0,1,18.71,5.8,12,12,0,1,1-13.42,19.89A9.39,9.39,0,0,0,196,164c-6.5,0-12,7.33-12,16s5.5,16,12,16a9,9,0,0,0,2.7-.42A12,12,0,0,1,208,176h4A12,12,0,0,1,224,188Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,1,0,16,0V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-72.18,145a20.82,20.82,0,0,1-9.19,15.23C73.44,215,67,216,61.14,216A61.23,61.23,0,0,1,46,214a8,8,0,0,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.55,20.55,0,0,1,9-14.95c11.84-8,30.72-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.48-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.11.9-.14,1.09,1.12,1.9,2.31,1.49,6.44,2.68,10.45,3.84C73.5,174.17,90.06,179,87.82,196.31Zm63.72-41.62-20,56a8,8,0,0,1-15.07,0l-20-56a8,8,0,1,1,15.06-5.38L124,184.21l12.46-34.9a8,8,0,0,1,15.07,5.38ZM216,184v16.87a8,8,0,0,1-2.22,5.53A30.06,30.06,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.38,29.38,0,0,1,16.48,5.12,8,8,0,0,1-8.95,13.26A13.27,13.27,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.38,13.38,0,0,0,8-2.71V192a8,8,0,0,1,0-16h8A8,8,0,0,1,216,184Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44ZM87.82,196.31a20.82,20.82,0,0,1-9.19,15.23C73.44,215,67,216,61.14,216A61.23,61.23,0,0,1,46,214a8,8,0,0,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.55,20.55,0,0,1,9-14.95c11.84-8,30.72-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.48-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.11.9-.14,1.09,1.12,1.9,2.31,1.49,6.44,2.68,10.45,3.84C73.5,174.17,90.06,179,87.82,196.31Zm63.72-41.62-19.9,55.72a8.25,8.25,0,0,1-6.5,5.51,8,8,0,0,1-8.67-5.23L96.59,155a8.21,8.21,0,0,1,4.5-10.45,8,8,0,0,1,10.45,4.76L124,184.21l12.46-34.9a8,8,0,0,1,15.07,5.38ZM216,184v16.87a8,8,0,0,1-2.26,5.57A30,30,0,0,1,192,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a29.36,29.36,0,0,1,16.09,4.86,8.22,8.22,0,0,1,3,10.64,8,8,0,0,1-11.54,2.88A13.27,13.27,0,0,0,192,160c-8.82,0-16,9-16,20s7.18,20,16,20a13.38,13.38,0,0,0,8-2.71V192a8,8,0,0,1-8-8.53,8.18,8.18,0,0,1,8.26-7.47H208A8,8,0,0,1,216,184Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,83.75l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,1,0,12,0V88A6,6,0,0,0,212.24,83.75ZM158,46.48,193.52,82H158ZM85.83,196.05a18.85,18.85,0,0,1-8.3,13.81C72.71,213.05,66.66,214,61.16,214a59.38,59.38,0,0,1-14.67-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.57-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.2-2.48a6,6,0,0,1-3,11.6c-3.79-1-15.85-2.95-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C72.93,176.08,87.85,180.39,85.83,196.05Zm63.82-42-20,56a6,6,0,0,1-11.3,0l-20-56a6,6,0,1,1,11.3-4L124,190.15,138.35,150a6,6,0,0,1,11.3,4ZM214,184v16.87a6,6,0,0,1-1.67,4.15A28.06,28.06,0,0,1,192,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a27.43,27.43,0,0,1,15.36,4.77,6,6,0,0,1-6.72,10A15.25,15.25,0,0,0,192,158c-9.92,0-18,9.87-18,22s8.08,22,18,22a15.7,15.7,0,0,0,10-3.74V190h-2a6,6,0,0,1,0-12h8A6,6,0,0,1,214,184Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M87.82,196.31a20.82,20.82,0,0,1-9.19,15.23C73.44,215,67,216,61.14,216A61.23,61.23,0,0,1,46,214a8,8,0,0,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.55,20.55,0,0,1,9-14.95c11.84-8,30.72-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.48-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.11.9-.14,1.09,1.12,1.9,2.31,1.49,6.44,2.68,10.45,3.84C73.5,174.17,90.06,179,87.82,196.31ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,1,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.65,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm-13.3,64.47a8,8,0,0,0-10.23,4.84L124,184.21l-12.47-34.9a8,8,0,1,0-15.06,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,146.7,144.47ZM208,176h-8a8,8,0,0,0,0,16v5.29a13.38,13.38,0,0,1-8,2.71c-8.82,0-16-9-16-20s7.18-20,16-20a13.27,13.27,0,0,1,7.53,2.38,8,8,0,0,0,8.95-13.26A29.38,29.38,0,0,0,192,144c-17.64,0-32,16.15-32,36s14.36,36,32,36a30.06,30.06,0,0,0,21.78-9.6,8,8,0,0,0,2.22-5.53V184A8,8,0,0,0,208,176Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,1,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52v20a4,4,0,0,0,8,0V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM83.85,195.8a17,17,0,0,1-7.43,12.41C72,211.12,66.38,212,61.2,212A57.89,57.89,0,0,1,47,210.11a4,4,0,1,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.11,61.11,0,0,1,10.47,1.61,4,4,0,0,1-2,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C72.27,178,85.65,181.84,83.85,195.8Zm63.92-42.45-20,56a4,4,0,0,1-7.53,0l-20-56a4,4,0,1,1,7.53-2.7L124,196.11l16.23-45.46a4,4,0,1,1,7.53,2.7ZM212,184v16.87a4,4,0,0,1-1.11,2.77A26.11,26.11,0,0,1,192,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a25.41,25.41,0,0,1,14.24,4.43,4,4,0,1,1-4.48,6.63A17.43,17.43,0,0,0,192,156c-11,0-20,10.77-20,24s9,24,20,24a17.87,17.87,0,0,0,12-4.82V188h-4a4,4,0,0,1,0-8h8A4,4,0,0,1,212,184Z"}))]]),JP=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68a12,12,0,0,0,24,0V44h76V92a12,12,0,0,0,12,12h48V212H180a12,12,0,0,0,0,24h20a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160Zm-4.22,139.85a24.75,24.75,0,0,1-10.95,18.06c-6,4-13.27,5.15-19.73,5.15a63.75,63.75,0,0,1-16.23-2.21,12,12,0,0,1,6.46-23.12c6.81,1.86,15,1.61,16.39.06a2.48,2.48,0,0,0,.21-.71c-1.94-1.23-6.83-2.64-9.88-3.52-5.39-1.56-11-3.18-15.75-6.27-7.62-4.92-11.21-12.45-10.11-21.2a24.45,24.45,0,0,1,10.69-17.75c6.06-4.09,14.17-5.83,24.1-5.18A68.53,68.53,0,0,1,143,142a12,12,0,0,1-6.1,23.21c-6.36-1.63-13.62-1.51-16.07-.33a79.5,79.5,0,0,0,7.91,2.59c5.48,1.58,11.68,3.37,16.8,6.82C153.33,179.55,157,187.55,155.78,196.82ZM92,152a12,12,0,0,1-12,12H72v44a12,12,0,0,1-24,0V164H40a12,12,0,0,1,0-24H80A12,12,0,0,1,92,152Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216H176a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160Zm-12.19,145a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A61.14,61.14,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM88,152a8,8,0,0,1-8,8H68v48a8,8,0,0,1-16,0V160H40a8,8,0,0,1,0-16H80A8,8,0,0,1,88,152Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H164a4,4,0,0,1,4,4V228a4,4,0,0,0,4,4h28a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm-4.19,108.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A61.14,61.14,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM88,152.53A8.17,8.17,0,0,1,79.73,160H68v47.73A8.17,8.17,0,0,1,60.53,216,8,8,0,0,1,52,208V160H40.27A8.17,8.17,0,0,1,32,152.53,8,8,0,0,1,40,144H80A8,8,0,0,1,88,152.53Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2H176a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM145.83,196.06a18.89,18.89,0,0,1-8.31,13.81c-4.82,3.19-10.87,4.14-16.36,4.14a58.89,58.89,0,0,1-14.68-2,6,6,0,0,1,3.23-11.56c3.71,1,15.58,3.11,21.19-.62a6.85,6.85,0,0,0,3-5.34c.58-4.43-2.08-6.26-14.2-9.76-9.31-2.69-23.37-6.75-21.57-20.94a18.61,18.61,0,0,1,8.08-13.54c11.11-7.49,29.18-3,31.21-2.48a6,6,0,0,1-3.06,11.6c-3.78-1-15.85-3-21.45.84a6.59,6.59,0,0,0-2.88,5.08c-.41,3.22,2.14,4.78,13,7.91C132.92,176.09,147.84,180.4,145.83,196.06ZM86,152a6,6,0,0,1-6,6H66v50a6,6,0,0,1-12,0V158H40a6,6,0,0,1,0-12H80A6,6,0,0,1,86,152Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M147.81,196.31a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216a61.34,61.34,0,0,1-15.19-2,8,8,0,0,1,4.31-15.41c4.38,1.2,15,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.34-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150.05,179,147.81,196.31ZM216,88V216a16,16,0,0,1-16,16H176a8,8,0,0,1,0-16h24V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216a4,4,0,0,1-4,4H176a4,4,0,0,0,0,8h24a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM143.84,195.8a17,17,0,0,1-7.43,12.41c-4.39,2.91-10,3.77-15.22,3.77A57.89,57.89,0,0,1,107,210.11a4,4,0,0,1,2.15-7.7c4.22,1.17,16.56,3.29,22.83-.88a8.94,8.94,0,0,0,3.91-6.75c.83-6.45-4.38-8.69-15.64-11.94-9.68-2.8-21.72-6.28-20.14-18.77a16.66,16.66,0,0,1,7.22-12.13c4.56-3.07,11-4.36,19.1-3.82a61.33,61.33,0,0,1,10.48,1.61,4,4,0,0,1-2.05,7.74c-4.29-1.13-16.81-3.12-23.06,1.11a8.51,8.51,0,0,0-3.75,6.49c-.66,5.17,3.89,7,14.42,10.08C132.26,178,145.64,181.84,143.84,195.8ZM84,152a4,4,0,0,1-4,4H64v52a4,4,0,0,1-8,0V156H40a4,4,0,0,1,0-8H80A4,4,0,0,1,84,152Z"}))]]),eQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M221.76,201A12,12,0,1,1,202.23,215L192,200.62,181.76,215A12,12,0,1,1,162.23,201l15-21-15-21a12,12,0,0,1,19.53-14L192,159.34,202.23,145a12,12,0,0,1,19.53,14l-15,21Zm-80.25-26.73c-5.12-3.45-11.33-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,139,142a69,69,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.48,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2.48,2.48,0,0,1-.21.71c-1.37,1.55-9.58,1.79-16.39-.06a12,12,0,1,0-6.46,23.11A63.75,63.75,0,0,0,121.1,220c6.46,0,13.73-1.17,19.73-5.15a24.73,24.73,0,0,0,10.95-18C153,187.53,149.33,179.53,141.51,174.27ZM76,140H36a12,12,0,0,0,0,24h8v44a12,12,0,0,0,24,0V164h8a12,12,0,0,0,0-24ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M214.51,156.65,197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,13-9.3L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM123.6,171.31c-4-1.16-8.14-2.35-10.45-3.84-1.25-.82-1.23-1-1.11-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56A8,8,0,0,0,138,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.94c-2,15.89,13.65,20.42,23,23.12,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.33-2.14,3.93-4.6,3.06-15.17,1.56-19.55.35A8,8,0,1,0,106,214a60.43,60.43,0,0,0,15.18,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C150,179,133.49,174.17,123.6,171.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Zm62.51,68.65L197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,2.3-11.46,8.19,8.19,0,0,1,10.88,2.38L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3Zm-66.7,39.66a20.82,20.82,0,0,1-9.19,15.23C133.43,215,127,216,121.13,216A60.43,60.43,0,0,1,106,214a8,8,0,1,1,4.3-15.41c4.38,1.21,15,2.71,19.55-.35.88-.6,1.83-1.52,2.14-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58,20.58,0,0,1,9-14.94c11.85-8,30.72-3.31,32.84-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.08,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C133.49,174.17,150,179,147.81,196.31ZM88,152.53A8.18,8.18,0,0,1,79.73,160H68v47.72A8.18,8.18,0,0,1,60.53,216,8,8,0,0,1,52,208V160H40.27A8.18,8.18,0,0,1,32,152.53,8,8,0,0,1,40,144H80A8,8,0,0,1,88,152.53Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.88,155.48,195.37,180l17.51,24.51a6,6,0,1,1-9.76,7L188,190.31l-15.12,21.16a6,6,0,1,1-9.76-7L180.63,180l-17.51-24.51a6,6,0,0,1,9.76-7L188,169.67l15.12-21.17a6,6,0,1,1,9.76,7Zm-89.83,17.74c-10.86-3.13-13.41-4.69-13-7.91a6.59,6.59,0,0,1,2.88-5.08c5.6-3.79,17.66-1.83,21.45-.84a6,6,0,0,0,3.06-11.6c-2-.53-20.1-5-31.21,2.48a18.61,18.61,0,0,0-8.08,13.54c-1.8,14.19,12.26,18.25,21.57,20.94,12.12,3.5,14.78,5.33,14.2,9.76a6.85,6.85,0,0,1-3,5.34c-5.61,3.73-17.48,1.64-21.19.62A6,6,0,0,0,106.48,212a59.41,59.41,0,0,0,14.68,2c5.49,0,11.54-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C147.84,180.39,132.92,176.08,123.05,173.22ZM80,146H40a6,6,0,0,0,0,12H54v50a6,6,0,0,0,12,0V158H80a6,6,0,0,0,0-12ZM214,88v24a6,6,0,1,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-20.49-6L158,46.48V82Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M214.51,156.65,197.83,180l16.68,23.35a8,8,0,0,1-13,9.3L188,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L178.17,180l-16.68-23.35a8,8,0,0,1,13-9.3L188,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM123.6,171.31c-4-1.16-8.14-2.35-10.45-3.84-1.25-.82-1.23-1-1.11-1.9a4.54,4.54,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56A8,8,0,0,0,138,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.33-2.14,3.93-4.6,3.06-15.17,1.56-19.55.35A8,8,0,0,0,105.94,214a60.63,60.63,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C150,179,133.49,174.17,123.6,171.31ZM80,144H40a8,8,0,0,0,0,16H52v48a8,8,0,0,0,16,0V160H80a8,8,0,0,0,0-16ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M211.25,154.33,192.92,180l18.33,25.67a4,4,0,0,1-.93,5.58A3.91,3.91,0,0,1,208,212a4,4,0,0,1-3.26-1.67L188,186.88l-16.75,23.45a4,4,0,0,1-6.51-4.66L183.08,180l-18.34-25.67a4,4,0,0,1,6.51-4.66L188,173.12l16.74-23.45a4,4,0,0,1,6.51,4.66Zm-88.76,20.82c-10.53-3-15.08-4.91-14.42-10.08a8.51,8.51,0,0,1,3.75-6.49c6.25-4.23,18.77-2.24,23.06-1.11a4,4,0,0,0,2.05-7.74,61.33,61.33,0,0,0-10.48-1.61c-8.12-.54-14.54.75-19.1,3.82a16.66,16.66,0,0,0-7.22,12.13c-1.58,12.49,10.46,16,20.14,18.77,11.26,3.25,16.47,5.49,15.64,11.94a8.94,8.94,0,0,1-3.91,6.75c-6.27,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.89,57.89,0,0,0,121.19,212c5.18,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C145.64,181.84,132.26,178,122.49,175.15ZM80,148H40a4,4,0,0,0,0,8H56v52a4,4,0,0,0,8,0V156H80a4,4,0,0,0,0-8ZM212,88v24a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-13.66-4L156,41.65V84Z"}))]]),tQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,120a12,12,0,0,0,12-12V44h76V92a12,12,0,0,0,12,12h48v4a12,12,0,0,0,24,0V88a12,12,0,0,0-3.51-8.49l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68A12,12,0,0,0,48,120ZM183,80H160V57Zm-25.27,79-15,21,15,21A12,12,0,1,1,138.24,215L128,200.65,117.76,215A12,12,0,1,1,98.24,201l15-21-15-21A12,12,0,1,1,117.76,145L128,159.35,138.24,145A12,12,0,1,1,157.76,159ZM92,152a12,12,0,0,1-12,12H72v44a12,12,0,0,1-24,0V164H40a12,12,0,0,1,0-24H80A12,12,0,0,1,92,152Zm136,0a12,12,0,0,1-12,12h-8v44a12,12,0,0,1-24,0V164h-8a12,12,0,0,1,0-24h40A12,12,0,0,1,228,152Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),d.createElement("path",{d:"M48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Zm-5.49,105.34L137.83,180l16.68,23.35a8,8,0,0,1-13,9.3L128,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L118.17,180l-16.68-23.35a8,8,0,1,1,13-9.3L128,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM92,152a8,8,0,0,1-8,8H72v48a8,8,0,0,1-16,0V160H44a8,8,0,0,1,0-16H84A8,8,0,0,1,92,152Zm128,0a8,8,0,0,1-8,8H200v48a8,8,0,0,1-16,0V160H172a8,8,0,0,1,0-16h40A8,8,0,0,1,220,152Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M154.31,156.92,137.83,180l16.53,23.14a8.18,8.18,0,0,1-1.22,11,8,8,0,0,1-11.65-1.48L128,193.76l-13.49,18.89a8,8,0,0,1-11.64,1.49,8.17,8.17,0,0,1-1.23-11L118.17,180l-16.48-23.08a8.22,8.22,0,0,1,1.46-11.28,8,8,0,0,1,11.36,1.71L128,166.24l13.49-18.89a8,8,0,0,1,11.36-1.71A8.22,8.22,0,0,1,154.31,156.92ZM84,144H44.27A8.18,8.18,0,0,0,36,151.47,8,8,0,0,0,44,160H56v47.73A8.17,8.17,0,0,0,63.47,216,8,8,0,0,0,72,208V160H83.73A8.18,8.18,0,0,0,92,152.53,8,8,0,0,0,84,144Zm128,0H172.27a8.18,8.18,0,0,0-8.25,7.47,8,8,0,0,0,8,8.53h12v47.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V160h11.73a8.18,8.18,0,0,0,8.25-7.47A8,8,0,0,0,212,144ZM40,116V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v28a4,4,0,0,1-4,4H44A4,4,0,0,1,40,116ZM152,88h44L152,44Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Zm-5.12,109L135.37,180l17.51,24.51a6,6,0,1,1-9.76,7L128,190.32l-15.12,21.17a6,6,0,0,1-9.76-7L120.63,180l-17.51-24.51a6,6,0,1,1,9.76-7L128,169.68l15.12-21.17a6,6,0,0,1,9.76,7ZM90,152a6,6,0,0,1-6,6H70v50a6,6,0,0,1-12,0V158H44a6,6,0,0,1,0-12H84A6,6,0,0,1,90,152Zm128,0a6,6,0,0,1-6,6H198v50a6,6,0,0,1-12,0V158H172a6,6,0,0,1,0-12h40A6,6,0,0,1,218,152Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M48,120a8,8,0,0,0,8-8V40h88V88a8,8,0,0,0,8,8h48v16a8,8,0,0,0,16,0V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72A8,8,0,0,0,48,120ZM160,51.31,188.69,80H160Zm-5.49,105.34L137.83,180l16.68,23.35a8,8,0,0,1-13,9.3L128,193.76l-13.49,18.89a8,8,0,1,1-13-9.3L118.17,180l-16.68-23.35a8,8,0,1,1,13-9.3L128,166.24l13.49-18.89a8,8,0,0,1,13,9.3ZM92,152a8,8,0,0,1-8,8H72v48a8,8,0,0,1-16,0V160H44a8,8,0,0,1,0-16H84A8,8,0,0,1,92,152Zm128,0a8,8,0,0,1-8,8H200v48a8,8,0,0,1-16,0V160H172a8,8,0,0,1,0-16h40A8,8,0,0,1,220,152Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M204,112a4,4,0,0,0,8,0V88a4,4,0,0,0-1.17-2.83l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52ZM156,41.65,198.34,84H156Zm-4.75,112.67L132.92,180l18.33,25.67a4,4,0,1,1-6.5,4.65L128,186.88l-16.75,23.44a4,4,0,1,1-6.5-4.65L123.08,180l-18.33-25.68a4,4,0,1,1,6.5-4.65L128,173.12l16.75-23.45a4,4,0,1,1,6.5,4.65ZM88,152a4,4,0,0,1-4,4H68v52a4,4,0,0,1-8,0V156H44a4,4,0,0,1,0-8H84A4,4,0,0,1,88,152Zm128,0a4,4,0,0,1-4,4H196v52a4,4,0,0,1-8,0V156H172a4,4,0,0,1,0-8h40A4,4,0,0,1,216,152Z"}))]]),nQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216.49,79.51l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40v68a12,12,0,0,0,24,0V44h76V92a12,12,0,0,0,12,12h48V212a12,12,0,0,0,0,24h4a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.51ZM160,57l23,23H160Zm-1.91,84.69a12,12,0,0,0-11.92-.15L126.5,152.44A20,20,0,0,0,108,140H48a20,20,0,0,0-20,20v48a20,20,0,0,0,20,20h60a20,20,0,0,0,18.5-12.44l19.67,10.93A12,12,0,0,0,164,216V152A12,12,0,0,0,158.09,141.66ZM104,204H52V164h52Zm36-8.39-12-6.67v-9.88l12-6.67Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,88H152V32Zm-88,72a8,8,0,0,0-8-8H48a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V196l32,20V152l-32,20Z",opacity:"0.2"}),d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM155.88,145a8,8,0,0,0-8.12.22l-19.95,12.46A16,16,0,0,0,112,144H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h64a16,16,0,0,0,15.81-13.68l19.95,12.46A8,8,0,0,0,160,216V152A8,8,0,0,0,155.88,145ZM112,208H48V160h64v48Zm32-6.43-16-10V176.43l16-10Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM155.88,145a8,8,0,0,0-8.12.22l-19.95,12.46A16,16,0,0,0,112,144H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h64a16,16,0,0,0,15.81-13.68l19.95,12.46A8,8,0,0,0,160,216V152A8,8,0,0,0,155.88,145ZM144,201.57l-16-10V176.43l16-10Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216a2,2,0,0,1-2,2h-8a6,6,0,0,0,0,12h8a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158Zm-3.09,100.27a6,6,0,0,0-6.09.16L126,161.17V160a14,14,0,0,0-14-14H48a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h64a14,14,0,0,0,14-14v-1.17l22.82,14.26A6,6,0,0,0,158,216V152A6,6,0,0,0,154.91,146.75ZM114,208a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V160a2,2,0,0,1,2-2h64a2,2,0,0,1,2,2Zm32-2.83-20-12.5V175.33l20-12.5Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v72a8,8,0,0,0,16,0V40h88V88a8,8,0,0,0,8,8h48V216h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM155.88,145a8,8,0,0,0-8.12.22l-19.95,12.46A16,16,0,0,0,112,144H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h64a16,16,0,0,0,15.81-13.68l19.95,12.46A8,8,0,0,0,160,216V152A8,8,0,0,0,155.88,145ZM112,208H48V160h64v48Zm32-6.43-16-10V176.43l16-10Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40v72a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216a4,4,0,0,1-4,4h-8a4,4,0,0,0,0,8h8a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM153.94,148.5a4,4,0,0,0-4.06.11L124,164.78V160a12,12,0,0,0-12-12H48a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h64a12,12,0,0,0,12-12v-4.78l25.88,16.17A4,4,0,0,0,152,220a4.06,4.06,0,0,0,1.94-.5A4,4,0,0,0,156,216V152A4,4,0,0,0,153.94,148.5ZM116,208a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V160a4,4,0,0,1,4-4h64a4,4,0,0,1,4,4Zm32,.78-24-15V174.22l24-15Z"}))]]),rQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,100h72v56H44Zm96-24V60h24V76Zm-24,0H92V60h24Zm0,104v16H92V180Zm24,0h24v16H140Zm0-24V100h72v56Zm72-80H188V60h24ZM68,60V76H44V60ZM44,180H68v16H44Zm144,16V180h24v16Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M32,176H224v24a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8ZM216,48H40a8,8,0,0,0-8,8V80H224V56A8,8,0,0,0,216,48Z",opacity:"0.2"}),d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,88h80v80H40Zm96-16V56h32V72Zm-16,0H88V56h32Zm0,112v16H88V184Zm16,0h32v16H136Zm0-16V88h80v80Zm80-96H184V56h32ZM72,56V72H40V56ZM40,184H72v16H40Zm176,16H184V184h32v16Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM184,56h32V72H184ZM72,200H40V184H72ZM72,72H40V56H72Zm48,128H88V184h32Zm0-128H88V56h32Zm48,128H136V184h32Zm0-128H136V56h32Zm48,128H184V184h32v16Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,86h84v84H38Zm96-12V54h36V74Zm-12,0H86V54h36Zm0,108v20H86V182Zm12,0h36v20H134Zm0-12V86h84v84ZM218,56V74H182V54h34A2,2,0,0,1,218,56ZM40,54H74V74H38V56A2,2,0,0,1,40,54ZM38,200V182H74v20H40A2,2,0,0,1,38,200Zm178,2H182V182h36v18A2,2,0,0,1,216,202Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,88h80v80H40Zm96-16V56h32V72Zm-16,0H88V56h32Zm0,112v16H88V184Zm16,0h32v16H136Zm0-16V88h80v80Zm80-96H184V56h32ZM72,56V72H40V56ZM40,184H72v16H40Zm176,16H184V184h32v16Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,84h88v88H36Zm96-8V52h40V76Zm-8,0H84V52h40Zm0,104v24H84V180Zm8,0h40v24H132Zm0-8V84h88v88ZM220,56V76H180V52h36A4,4,0,0,1,220,56ZM40,52H76V76H36V56A4,4,0,0,1,40,52ZM36,200V180H76v24H40A4,4,0,0,1,36,200Zm180,4H180V180h40v20A4,4,0,0,1,216,204Z"}))]]),iQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),d.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),aQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Zm-84-88a12,12,0,0,1,12,12v12h12a12,12,0,0,1,0,24H140v12a12,12,0,0,1-24,0V156H104a12,12,0,0,1,0-24h12V120A12,12,0,0,1,128,108Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),d.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V152H104a8,8,0,0,1,0-16h16V120a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,144Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm-64,80H136v16a8,8,0,0,1-16,0V152H104a8,8,0,0,1,0-16h16V120a8,8,0,0,1,16,0v16h16a8,8,0,0,1,0,16Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2ZM158,144a6,6,0,0,1-6,6H134v18a6,6,0,0,1-12,0V150H104a6,6,0,0,1,0-12h18V120a6,6,0,0,1,12,0v18h18A6,6,0,0,1,158,144Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Zm-56-56a8,8,0,0,1-8,8H136v16a8,8,0,0,1-16,0V152H104a8,8,0,0,1,0-16h16V120a8,8,0,0,1,16,0v16h16A8,8,0,0,1,160,144Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4ZM156,144a4,4,0,0,1-4,4H132v20a4,4,0,0,1-8,0V148H104a4,4,0,0,1,0-8h20V120a4,4,0,0,1,8,0v20h20A4,4,0,0,1,156,144Z"}))]]),lQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm92-27.21v-1.58l14-17.51a12,12,0,0,0,2.23-10.59A111.75,111.75,0,0,0,225,71.89,12,12,0,0,0,215.89,66L193.61,63.5l-1.11-1.11L190,40.1A12,12,0,0,0,184.11,31a111.67,111.67,0,0,0-27.23-11.27A12,12,0,0,0,146.3,22L128.79,36h-1.58L109.7,22a12,12,0,0,0-10.59-2.23A111.75,111.75,0,0,0,71.89,31.05,12,12,0,0,0,66,40.11L63.5,62.39,62.39,63.5,40.1,66A12,12,0,0,0,31,71.89,111.67,111.67,0,0,0,19.77,99.12,12,12,0,0,0,22,109.7l14,17.51v1.58L22,146.3a12,12,0,0,0-2.23,10.59,111.75,111.75,0,0,0,11.29,27.22A12,12,0,0,0,40.11,190l22.28,2.48,1.11,1.11L66,215.9A12,12,0,0,0,71.89,225a111.67,111.67,0,0,0,27.23,11.27A12,12,0,0,0,109.7,234l17.51-14h1.58l17.51,14a12,12,0,0,0,10.59,2.23A111.75,111.75,0,0,0,184.11,225a12,12,0,0,0,5.91-9.06l2.48-22.28,1.11-1.11L215.9,190a12,12,0,0,0,9.06-5.91,111.67,111.67,0,0,0,11.27-27.23A12,12,0,0,0,234,146.3Zm-24.12-4.89a70.1,70.1,0,0,1,0,8.2,12,12,0,0,0,2.61,8.22l12.84,16.05A86.47,86.47,0,0,1,207,166.86l-20.43,2.27a12,12,0,0,0-7.65,4,69,69,0,0,1-5.8,5.8,12,12,0,0,0-4,7.65L166.86,207a86.47,86.47,0,0,1-10.49,4.35l-16.05-12.85a12,12,0,0,0-7.5-2.62c-.24,0-.48,0-.72,0a70.1,70.1,0,0,1-8.2,0,12.06,12.06,0,0,0-8.22,2.6L99.63,211.33A86.47,86.47,0,0,1,89.14,207l-2.27-20.43a12,12,0,0,0-4-7.65,69,69,0,0,1-5.8-5.8,12,12,0,0,0-7.65-4L49,166.86a86.47,86.47,0,0,1-4.35-10.49l12.84-16.05a12,12,0,0,0,2.61-8.22,70.1,70.1,0,0,1,0-8.2,12,12,0,0,0-2.61-8.22L44.67,99.63A86.47,86.47,0,0,1,49,89.14l20.43-2.27a12,12,0,0,0,7.65-4,69,69,0,0,1,5.8-5.8,12,12,0,0,0,4-7.65L89.14,49a86.47,86.47,0,0,1,10.49-4.35l16.05,12.85a12.06,12.06,0,0,0,8.22,2.6,70.1,70.1,0,0,1,8.2,0,12,12,0,0,0,8.22-2.6l16.05-12.85A86.47,86.47,0,0,1,166.86,49l2.27,20.43a12,12,0,0,0,4,7.65,69,69,0,0,1,5.8,5.8,12,12,0,0,0,7.65,4L207,89.14a86.47,86.47,0,0,1,4.35,10.49l-12.84,16.05A12,12,0,0,0,195.88,123.9Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M207.86,123.18l16.78-21a99.14,99.14,0,0,0-10.07-24.29l-26.7-3a81,81,0,0,0-6.81-6.81l-3-26.71a99.43,99.43,0,0,0-24.3-10l-21,16.77a81.59,81.59,0,0,0-9.64,0l-21-16.78A99.14,99.14,0,0,0,77.91,41.43l-3,26.7a81,81,0,0,0-6.81,6.81l-26.71,3a99.43,99.43,0,0,0-10,24.3l16.77,21a81.59,81.59,0,0,0,0,9.64l-16.78,21a99.14,99.14,0,0,0,10.07,24.29l26.7,3a81,81,0,0,0,6.81,6.81l3,26.71a99.43,99.43,0,0,0,24.3,10l21-16.77a81.59,81.59,0,0,0,9.64,0l21,16.78a99.14,99.14,0,0,0,24.29-10.07l3-26.7a81,81,0,0,0,6.81-6.81l26.71-3a99.43,99.43,0,0,0,10-24.3l-16.77-21A81.59,81.59,0,0,0,207.86,123.18ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",opacity:"0.2"}),d.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8.06,8.06,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8.06,8.06,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,130.16q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.6,107.6,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.29,107.29,0,0,0-26.25-10.86,8,8,0,0,0-7.06,1.48L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.6,107.6,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Zm83.93-32.49q.13-3.51,0-7l15.83-19.79a4,4,0,0,0,.75-3.53A103.64,103.64,0,0,0,218,75.9a4,4,0,0,0-3-2l-25.19-2.8c-1.58-1.71-3.24-3.37-4.95-4.95L182.07,41a4,4,0,0,0-2-3A104,104,0,0,0,154.82,27.5a4,4,0,0,0-3.53.74L131.51,44.07q-3.51-.14-7,0L104.7,28.24a4,4,0,0,0-3.53-.75A103.64,103.64,0,0,0,75.9,38a4,4,0,0,0-2,3l-2.8,25.19c-1.71,1.58-3.37,3.24-4.95,4.95L41,73.93a4,4,0,0,0-3,2A104,104,0,0,0,27.5,101.18a4,4,0,0,0,.74,3.53l15.83,19.78q-.14,3.51,0,7L28.24,151.3a4,4,0,0,0-.75,3.53A103.64,103.64,0,0,0,38,180.1a4,4,0,0,0,3,2l25.19,2.8c1.58,1.71,3.24,3.37,4.95,4.95l2.8,25.2a4,4,0,0,0,2,3,104,104,0,0,0,25.28,10.46,4,4,0,0,0,3.53-.74l19.78-15.83q3.51.13,7,0l19.79,15.83a4,4,0,0,0,2.5.88,4,4,0,0,0,1-.13A103.64,103.64,0,0,0,180.1,218a4,4,0,0,0,2-3l2.8-25.19c1.71-1.58,3.37-3.24,4.95-4.95l25.2-2.8a4,4,0,0,0,3-2,104,104,0,0,0,10.46-25.28,4,4,0,0,0-.74-3.53Zm.17,42.83-24.67,2.74a4,4,0,0,0-2.55,1.32,76.2,76.2,0,0,1-6.48,6.48,4,4,0,0,0-1.32,2.55l-2.74,24.66a95.45,95.45,0,0,1-19.64,8.15l-19.38-15.51a4,4,0,0,0-2.5-.87h-.24a73.67,73.67,0,0,1-9.16,0,4,4,0,0,0-2.74.87l-19.37,15.5a95.33,95.33,0,0,1-19.65-8.13l-2.74-24.67a4,4,0,0,0-1.32-2.55,76.2,76.2,0,0,1-6.48-6.48,4,4,0,0,0-2.55-1.32l-24.66-2.74a95.45,95.45,0,0,1-8.15-19.64l15.51-19.38a4,4,0,0,0,.87-2.74,77.76,77.76,0,0,1,0-9.16,4,4,0,0,0-.87-2.74l-15.5-19.37A95.33,95.33,0,0,1,43.9,81.66l24.67-2.74a4,4,0,0,0,2.55-1.32,76.2,76.2,0,0,1,6.48-6.48,4,4,0,0,0,1.32-2.55l2.74-24.66a95.45,95.45,0,0,1,19.64-8.15l19.38,15.51a4,4,0,0,0,2.74.87,73.67,73.67,0,0,1,9.16,0,4,4,0,0,0,2.74-.87l19.37-15.5a95.33,95.33,0,0,1,19.65,8.13l2.74,24.67a4,4,0,0,0,1.32,2.55,76.2,76.2,0,0,1,6.48,6.48,4,4,0,0,0,2.55,1.32l24.66,2.74a95.45,95.45,0,0,1,8.15,19.64l-15.51,19.38a4,4,0,0,0-.87,2.74,77.76,77.76,0,0,1,0,9.16,4,4,0,0,0,.87,2.74l15.5,19.37A95.33,95.33,0,0,1,212.1,174.34Z"}))]]),sQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),oQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),cQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),d.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]),uQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,36H160a20,20,0,0,0-20,20v88a12,12,0,0,1-24,0V56A20,20,0,0,0,96,36H56A20,20,0,0,0,36,56v88a92,92,0,0,0,92,92h.71c50.34-.38,91.3-42.1,91.3-93V56A20,20,0,0,0,200,36Zm-4,24V84H164V60ZM92,60V84H60V60Zm36.52,152H128a68,68,0,0,1-68-68V108H92v36a36,36,0,0,0,72,0V108h32v35C196,180.77,165.73,211.72,128.52,212Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M104,56V96H48V56a8,8,0,0,1,8-8H96A8,8,0,0,1,104,56Zm96-8H160a8,8,0,0,0-8,8V96h56V56A8,8,0,0,0,200,48Z",opacity:"0.2"}),d.createElement("path",{d:"M200,40H160a16,16,0,0,0-16,16v88a16,16,0,0,1-32,0V56A16,16,0,0,0,96,40H56A16,16,0,0,0,40,56v88a88,88,0,0,0,88,88h.67c48.15-.36,87.33-40.29,87.33-89V56A16,16,0,0,0,200,40Zm0,16V88H160V56ZM96,56V88H56V56Zm32.55,160A72,72,0,0,1,56,144V104H96v40a32,32,0,0,0,64,0V104h40v39C200,183,168,215.71,128.55,216Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,40H160a16,16,0,0,0-16,16v88a16,16,0,0,1-32,0V56A16,16,0,0,0,96,40H56A16,16,0,0,0,40,56v88a88,88,0,0,0,88,88h.67c48.15-.36,87.33-40.29,87.33-89V56A16,16,0,0,0,200,40Zm0,16V96H160V56ZM96,56V96H56V56Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,42H160a14,14,0,0,0-14,14v88a18,18,0,0,1-36,0V56A14,14,0,0,0,96,42H56A14,14,0,0,0,42,56v88a86,86,0,0,0,86,86h.65c47.06-.35,85.35-39.38,85.35-87V56A14,14,0,0,0,200,42ZM160,54h40a2,2,0,0,1,2,2V90H158V56A2,2,0,0,1,160,54ZM56,54H96a2,2,0,0,1,2,2V90H54V56A2,2,0,0,1,56,54Zm72.56,164H128a74,74,0,0,1-74-74V102H98v42a30,30,0,0,0,60,0V102h44v41C202,184.05,169.06,217.7,128.56,218Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,40H160a16,16,0,0,0-16,16v88a16,16,0,0,1-32,0V56A16,16,0,0,0,96,40H56A16,16,0,0,0,40,56v88a88,88,0,0,0,88,88h.67c48.15-.36,87.33-40.29,87.33-89V56A16,16,0,0,0,200,40Zm0,16V88H160V56ZM96,56V88H56V56Zm32.55,160A72,72,0,0,1,56,144V104H96v40a32,32,0,0,0,64,0V104h40v39C200,183,168,215.71,128.55,216Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,44H160a12,12,0,0,0-12,12v88a20,20,0,0,1-40,0V56A12,12,0,0,0,96,44H56A12,12,0,0,0,44,56v88a84,84,0,0,0,84,84h.64c46-.34,83.36-38.47,83.36-85V56A12,12,0,0,0,200,44Zm-40,8h40a4,4,0,0,1,4,4V92H156V56A4,4,0,0,1,160,52ZM56,52H96a4,4,0,0,1,4,4V92H52V56A4,4,0,0,1,56,52Zm72.58,168H128a76,76,0,0,1-76-76V100h48v44a28,28,0,0,0,56,0V100h48v43C204,185.15,170.17,219.69,128.58,220Z"}))]]),fQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M211.45,52.51l-80-24A12,12,0,0,0,116,40V140.22A52,52,0,1,0,140,184V104.13l64.55,19.36A12,12,0,0,0,220,112V64A12,12,0,0,0,211.45,52.51ZM88,212a28,28,0,1,1,28-28A28,28,0,0,1,88,212ZM196,95.87l-56-16.8V56.13l56,16.8Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M128,184a40,40,0,1,1-40-40A40,40,0,0,1,128,184Z",opacity:"0.2"}),d.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34ZM88,216a32,32,0,1,1,32-32A32,32,0,0,1,88,216ZM200,101.25l-64-19.2V50.75L200,70Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M209.72,58.25l-80-24A6,6,0,0,0,122,40V153.05A46,46,0,1,0,134,184V96.06l72.28,21.69A6,6,0,0,0,214,112V64A6,6,0,0,0,209.72,58.25ZM88,218a34,34,0,1,1,34-34A34,34,0,0,1,88,218ZM202,103.94l-68-20.4V48.06l68,20.4Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M210.3,56.34l-80-24A8,8,0,0,0,120,40V148.26A48,48,0,1,0,136,184V98.75l69.7,20.91A8,8,0,0,0,216,112V64A8,8,0,0,0,210.3,56.34ZM88,216a32,32,0,1,1,32-32A32,32,0,0,1,88,216ZM200,101.25l-64-19.2V50.75L200,70Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M209.15,60.17l-80-24A4,4,0,0,0,124,40V158.75A44,44,0,1,0,132,184V93.38l74.85,22.45A4,4,0,0,0,212,112V64A4,4,0,0,0,209.15,60.17ZM88,220a36,36,0,1,1,36-36A36,36,0,0,1,88,220ZM204,106.62,132,85V45.38L204,67Z"}))]]),dQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),d.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),hQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),mQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),d.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),pQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M238.78,183.79,98.28,87.65A40.18,40.18,0,0,0,100,76a40,40,0,1,0-15.29,31.45l30,20.56-30,20.56a40,40,0,1,0,3.57,59.74h0A39.73,39.73,0,0,0,100,180a40.18,40.18,0,0,0-1.72-11.66L136,142.54l89.22,61.06a12,12,0,0,0,13.56-19.81ZM71.31,191.33h0A16,16,0,1,1,76,180,16,16,0,0,1,71.31,191.33ZM48.69,87.3a16,16,0,1,1,22.62,0h0A16,16,0,0,1,48.69,87.3Zm112.82,23.24a12,12,0,0,1,3.13-16.68L225.22,52.4a12,12,0,0,1,13.56,19.81l-60.59,41.46a12,12,0,0,1-16.68-3.13Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M40.2,95.8a28,28,0,1,1,39.6,0A28,28,0,0,1,40.2,95.8Zm0,64.4a28,28,0,1,0,39.6,0A28,28,0,0,0,40.2,160.2Z",opacity:"0.2"}),d.createElement("path",{d:"M157.73,113.13A8,8,0,0,1,159.82,102L227.48,55.7a8,8,0,0,1,9,13.21l-67.67,46.3a7.92,7.92,0,0,1-4.51,1.4A8,8,0,0,1,157.73,113.13Zm80.87,85.09a8,8,0,0,1-11.12,2.08L136,137.7,93.49,166.78a36,36,0,1,1-9-13.19L121.83,128,84.44,102.41a35.86,35.86,0,1,1,9-13.19l143,97.87A8,8,0,0,1,238.6,198.22ZM80,180a20,20,0,1,0-5.86,14.14A19.85,19.85,0,0,0,80,180ZM74.14,90.13a20,20,0,1,0-28.28,0A19.85,19.85,0,0,0,74.14,90.13Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M236.52,187.09l-143-97.87a36,36,0,1,0-14.38,17.27l21.39,21.69L79.15,149.54l0,0a35.91,35.91,0,1,0,14.38,17.27l26.91-18.41L170,198.64a32.26,32.26,0,0,0,22.7,9.37,31.52,31.52,0,0,0,4.11-.27l.28,0,36.27-6.11a8,8,0,0,0,3.19-14.5Zm-162.38-97A20,20,0,1,1,80,76,20,20,0,0,1,74.14,90.13Zm0,104A20,20,0,1,1,80,180,20,20,0,0,1,74.14,194.15Zm61-101.5L169.94,57.4a32.19,32.19,0,0,1,26.84-9.14l.28,0,36,6.07a8.21,8.21,0,0,1,6.09,4.42,8,8,0,0,1-2.67,10.12l-69.93,47.85a4,4,0,0,1-4.51,0l-26.31-18A4,4,0,0,1,135.18,92.65Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M159.38,112a6,6,0,0,1,1.57-8.34l67.66-46.31a6,6,0,0,1,6.78,9.91l-67.67,46.3a6,6,0,0,1-8.34-1.56ZM237,197.09a6,6,0,0,1-8.34,1.56L136,135.27,91,166.06A34,34,0,1,1,84,156a1.8,1.8,0,0,0,.19.2L125.37,128,84.23,99.84,84,100a34,34,0,1,1,7-10.1l144.38,98.8A6,6,0,0,1,237,197.09ZM75.56,91.55a22,22,0,1,0-31.12,0,21.88,21.88,0,0,0,31.12,0ZM82,180a22,22,0,1,0-6.44,15.56h0A21.88,21.88,0,0,0,82,180Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M157.73,113.13A8,8,0,0,1,159.82,102L227.48,55.7a8,8,0,0,1,9,13.21l-67.67,46.3a7.92,7.92,0,0,1-4.51,1.4A8,8,0,0,1,157.73,113.13Zm80.87,85.09a8,8,0,0,1-11.12,2.08L136,137.7,93.49,166.78a36,36,0,1,1-9-13.19L121.83,128,84.44,102.41a35.86,35.86,0,1,1,9-13.19l143,97.87A8,8,0,0,1,238.6,198.22ZM80,180a20,20,0,1,0-5.86,14.14A19.85,19.85,0,0,0,80,180ZM74.14,90.13a20,20,0,1,0-28.28,0A19.85,19.85,0,0,0,74.14,90.13Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M161,110.87a4,4,0,0,1,1.05-5.56L229.74,59a4,4,0,0,1,4.52,6.61l-67.67,46.3a4,4,0,0,1-5.56-1ZM235.3,196a4,4,0,0,1-5.56,1L136,132.85,88.47,165.38a32,32,0,1,1-5.84-8c.45.45.89.92,1.31,1.4l45-30.78-45-30.78c-.42.48-.86,1-1.31,1.4a31.86,31.86,0,1,1,5.84-8l49.69,34h0l96.09,65.76A4,4,0,0,1,235.3,196ZM77,93a24.42,24.42,0,0,0,2.82-3.38s0,0,0,0l0,0A24,24,0,1,0,77,93ZM84,180a23.75,23.75,0,0,0-4.15-13.49l0-.06,0,0A24.5,24.5,0,0,0,77,163,24,24,0,1,0,77,197h0A23.85,23.85,0,0,0,84,180Z"}))]]),gQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,176H52V52H204Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,48V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34Zm2,174a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V48H208V208Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z"}))]]),OQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M234.36,170A12,12,0,0,1,230,186.37l-96,56a12,12,0,0,1-12.1,0l-96-56a12,12,0,0,1,12.09-20.74l90,52.48L218,165.63A12,12,0,0,1,234.36,170ZM218,117.63,128,170.11,38.05,117.63A12,12,0,0,0,26,138.37l96,56a12,12,0,0,0,12.1,0l96-56A12,12,0,0,0,218,117.63ZM20,80a12,12,0,0,1,6-10.37l96-56a12.06,12.06,0,0,1,12.1,0l96,56a12,12,0,0,1,0,20.74l-96,56a12,12,0,0,1-12.1,0l-96-56A12,12,0,0,1,20,80Zm35.82,0L128,122.11,200.18,80,128,37.89Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M224,80l-96,56L32,80l96-56Z",opacity:"0.2"}),d.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M220,169.09l-92,53.65L36,169.09A8,8,0,0,0,28,182.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,169.09Z"}),d.createElement("path",{d:"M220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09Z"}),d.createElement("path",{d:"M28,86.91l96,56a8,8,0,0,0,8.06,0l96-56a8,8,0,0,0,0-13.82l-96-56a8,8,0,0,0-8.06,0l-96,56a8,8,0,0,0,0,13.82Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M229.18,173a6,6,0,0,1-2.16,8.2l-96,56a6,6,0,0,1-6,0l-96-56a6,6,0,0,1,6-10.36l93,54.23,93-54.23A6,6,0,0,1,229.18,173ZM221,122.82l-93,54.23L35,122.82a6,6,0,0,0-6,10.36l96,56a6,6,0,0,0,6,0l96-56a6,6,0,0,0-6-10.36ZM26,80a6,6,0,0,1,3-5.18l96-56a6,6,0,0,1,6,0l96,56a6,6,0,0,1,0,10.36l-96,56a6,6,0,0,1-6,0l-96-56A6,6,0,0,1,26,80Zm17.91,0L128,129.05,212.09,80,128,31Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M230.91,172A8,8,0,0,1,228,182.91l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,36,169.09l92,53.65,92-53.65A8,8,0,0,1,230.91,172ZM220,121.09l-92,53.65L36,121.09A8,8,0,0,0,28,134.91l96,56a8,8,0,0,0,8.06,0l96-56A8,8,0,1,0,220,121.09ZM24,80a8,8,0,0,1,4-6.91l96-56a8,8,0,0,1,8.06,0l96,56a8,8,0,0,1,0,13.82l-96,56a8,8,0,0,1-8.06,0l-96-56A8,8,0,0,1,24,80Zm23.88,0L128,126.74,208.12,80,128,33.26Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M227.45,174a4,4,0,0,1-1.44,5.48l-96,56a4,4,0,0,1-4,0l-96-56a4,4,0,0,1,4-6.92l94,54.83,94-54.83A4,4,0,0,1,227.45,174ZM222,124.54l-94,54.83L34,124.54a4,4,0,0,0-4,6.92l96,56a4,4,0,0,0,4,0l96-56a4,4,0,0,0-4-6.92ZM28,80a4,4,0,0,1,2-3.46l96-56a4,4,0,0,1,4,0l96,56a4,4,0,0,1,0,6.92l-96,56a4,4,0,0,1-4,0l-96-56A4,4,0,0,1,28,80Zm11.94,0L128,131.37,216.06,80,128,28.63Z"}))]]),xQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M90.86,50.89a12,12,0,0,0-21.72,0l-64,136a12,12,0,0,0,21.71,10.22L42.44,164h75.12l15.58,33.11a12,12,0,0,0,21.72-10.22ZM53.74,140,80,84.18,106.27,140ZM200,84c-13.85,0-24.77,3.86-32.45,11.48a12,12,0,1,0,16.9,17c3-3,8.26-4.52,15.55-4.52,11,0,20,7.18,20,16v4.39A47.28,47.28,0,0,0,200,124c-24.26,0-44,17.94-44,40s19.74,40,44,40a47.18,47.18,0,0,0,22-5.38A12,12,0,0,0,244,192V124C244,101.94,224.26,84,200,84Zm0,96c-11,0-20-7.18-20-16s9-16,20-16,20,7.18,20,16S211,180,200,180Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M232,164c0,15.46-14.33,28-32,28s-32-12.54-32-28,14.33-28,32-28S232,148.54,232,164ZM34.82,152h90.36L80,56Z",opacity:"0.2"}),d.createElement("path",{d:"M87.24,52.59a8,8,0,0,0-14.48,0l-64,136a8,8,0,1,0,14.48,6.81L39.9,160h80.2l16.66,35.4a8,8,0,1,0,14.48-6.81ZM47.43,144,80,74.79,112.57,144ZM200,96c-12.76,0-22.73,3.47-29.63,10.32a8,8,0,0,0,11.26,11.36c3.8-3.77,10-5.68,18.37-5.68,13.23,0,24,9,24,20v3.22A42.76,42.76,0,0,0,200,128c-22.06,0-40,16.15-40,36s17.94,36,40,36a42.73,42.73,0,0,0,24-7.25,8,8,0,0,0,16-.75V132C240,112.15,222.06,96,200,96Zm0,88c-13.23,0-24-9-24-20s10.77-20,24-20,24,9,24,20S213.23,184,200,184Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,156c0,6.5-7.33,12-16,12s-16-5.5-16-12,7.33-12,16-12S200,149.5,200,156ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM143.37,172.88l-44-104a8,8,0,0,0-14.74,0l-44,104a8,8,0,0,0,14.74,6.24L66.84,152h50.32l11.47,27.12a8,8,0,0,0,14.74-6.24ZM216,124c0-15.44-14.36-28-32-28a34.86,34.86,0,0,0-20.78,6.68,8,8,0,0,0,9.56,12.83A18.84,18.84,0,0,1,184,112c8.56,0,15.8,5.36,16,11.76v8A35.24,35.24,0,0,0,184,128c-17.64,0-32,12.56-32,28s14.36,28,32,28a35.13,35.13,0,0,0,16.93-4.26A8,8,0,0,0,216,176ZM73.61,136h36.78L92,92.53Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M85.43,53.45a6,6,0,0,0-10.86,0l-64,136a6,6,0,1,0,10.86,5.11L38.63,158h82.74l17.2,36.55a6,6,0,1,0,10.86-5.11ZM44.28,146,80,70.09,115.72,146ZM200,98c-12.21,0-21.71,3.28-28.23,9.74a6,6,0,0,0,8.46,8.52c4.18-4.15,10.84-6.26,19.77-6.26,14.34,0,26,9.87,26,22v7.24A40.36,40.36,0,0,0,200,130c-20.95,0-38,15.25-38,34s17.05,34,38,34a40.36,40.36,0,0,0,26-9.24V192a6,6,0,0,0,12,0V132C238,113.25,221,98,200,98Zm0,88c-14.34,0-26-9.87-26-22s11.66-22,26-22,26,9.87,26,22S214.34,186,200,186Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M87.24,52.59a8,8,0,0,0-14.48,0l-64,136a8,8,0,1,0,14.48,6.81L39.9,160h80.2l16.66,35.4a8,8,0,1,0,14.48-6.81ZM47.43,144,80,74.79,112.57,144ZM200,96c-12.76,0-22.73,3.47-29.63,10.32a8,8,0,0,0,11.26,11.36c3.8-3.77,10-5.68,18.37-5.68,13.23,0,24,9,24,20v3.22A42.76,42.76,0,0,0,200,128c-22.06,0-40,16.15-40,36s17.94,36,40,36a42.73,42.73,0,0,0,24-7.25,8,8,0,0,0,16-.75V132C240,112.15,222.06,96,200,96Zm0,88c-13.23,0-24-9-24-20s10.77-20,24-20,24,9,24,20S213.23,184,200,184Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M83.62,54.3a4,4,0,0,0-7.24,0l-64,136a4,4,0,0,0,7.24,3.4L37.36,156h85.28l17.74,37.7a4,4,0,1,0,7.24-3.4ZM41.13,148,80,65.39,118.87,148ZM200,100c-11.67,0-20.69,3.08-26.82,9.16a4,4,0,1,0,5.64,5.68c4.57-4.54,11.7-6.84,21.18-6.84,15.44,0,28,10.77,28,24v11.92A37.78,37.78,0,0,0,200,132c-19.85,0-36,14.35-36,32s16.15,32,36,32a37.78,37.78,0,0,0,28-11.92V192a4,4,0,0,0,8,0V132C236,114.36,219.85,100,200,100Zm0,88c-15.44,0-28-10.77-28-24s12.56-24,28-24,28,10.77,28,24S215.44,188,200,188Z"}))]]),yQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M212,56V88a12,12,0,0,1-24,0V68H140V188h20a12,12,0,0,1,0,24H96a12,12,0,0,1,0-24h20V68H68V88a12,12,0,0,1-24,0V56A12,12,0,0,1,56,44H200A12,12,0,0,1,212,56Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,56V184a16,16,0,0,1-16,16H72a16,16,0,0,1-16-16V56Z",opacity:"0.2"}),d.createElement("path",{d:"M208,56V88a8,8,0,0,1-16,0V64H136V192h24a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16h24V64H64V88a8,8,0,0,1-16,0V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,96a8,8,0,0,1-16,0V88H136v88h12a8,8,0,0,1,0,16H108a8,8,0,0,1,0-16h12V88H88v8a8,8,0,0,1-16,0V80a8,8,0,0,1,8-8h96a8,8,0,0,1,8,8Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M206,56V88a6,6,0,0,1-12,0V62H134V194h26a6,6,0,0,1,0,12H96a6,6,0,0,1,0-12h26V62H62V88a6,6,0,0,1-12,0V56a6,6,0,0,1,6-6H200A6,6,0,0,1,206,56Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,56V88a8,8,0,0,1-16,0V64H136V192h24a8,8,0,0,1,0,16H96a8,8,0,0,1,0-16h24V64H64V88a8,8,0,0,1-16,0V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M204,56V88a4,4,0,0,1-8,0V60H132V196h28a4,4,0,0,1,0,8H96a4,4,0,0,1,0-8h28V60H60V88a4,4,0,0,1-8,0V56a4,4,0,0,1,4-4H200A4,4,0,0,1,204,56Z"}))]]),bQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),d.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),vQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z",opacity:"0.2"}),d.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"}))]]),SQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M60,96v64a12,12,0,0,1-24,0V96a12,12,0,0,1,24,0ZM88,20A12,12,0,0,0,76,32V224a12,12,0,0,0,24,0V32A12,12,0,0,0,88,20Zm40,32a12,12,0,0,0-12,12V192a12,12,0,0,0,24,0V64A12,12,0,0,0,128,52Zm40,32a12,12,0,0,0-12,12v64a12,12,0,0,0,24,0V96A12,12,0,0,0,168,84Zm40-16a12,12,0,0,0-12,12v96a12,12,0,0,0,24,0V80A12,12,0,0,0,208,68Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,96v64H48V96Z",opacity:"0.2"}),d.createElement("path",{d:"M56,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0ZM88,24a8,8,0,0,0-8,8V224a8,8,0,0,0,16,0V32A8,8,0,0,0,88,24Zm40,32a8,8,0,0,0-8,8V192a8,8,0,0,0,16,0V64A8,8,0,0,0,128,56Zm40,32a8,8,0,0,0-8,8v64a8,8,0,0,0,16,0V96A8,8,0,0,0,168,88Zm40-16a8,8,0,0,0-8,8v96a8,8,0,0,0,16,0V80A8,8,0,0,0,208,72Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM72,152a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm32,32a8,8,0,0,1-16,0V72a8,8,0,0,1,16,0Zm32-16a8,8,0,0,1-16,0V88a8,8,0,0,1,16,0Zm32-16a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm32,8a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M54,96v64a6,6,0,0,1-12,0V96a6,6,0,0,1,12,0ZM88,26a6,6,0,0,0-6,6V224a6,6,0,0,0,12,0V32A6,6,0,0,0,88,26Zm40,32a6,6,0,0,0-6,6V192a6,6,0,0,0,12,0V64A6,6,0,0,0,128,58Zm40,32a6,6,0,0,0-6,6v64a6,6,0,0,0,12,0V96A6,6,0,0,0,168,90Zm40-16a6,6,0,0,0-6,6v96a6,6,0,0,0,12,0V80A6,6,0,0,0,208,74Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M56,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0ZM88,24a8,8,0,0,0-8,8V224a8,8,0,0,0,16,0V32A8,8,0,0,0,88,24Zm40,32a8,8,0,0,0-8,8V192a8,8,0,0,0,16,0V64A8,8,0,0,0,128,56Zm40,32a8,8,0,0,0-8,8v64a8,8,0,0,0,16,0V96A8,8,0,0,0,168,88Zm40-16a8,8,0,0,0-8,8v96a8,8,0,0,0,16,0V80A8,8,0,0,0,208,72Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M52,96v64a4,4,0,0,1-8,0V96a4,4,0,0,1,8,0ZM88,28a4,4,0,0,0-4,4V224a4,4,0,0,0,8,0V32A4,4,0,0,0,88,28Zm40,32a4,4,0,0,0-4,4V192a4,4,0,0,0,8,0V64A4,4,0,0,0,128,60Zm40,32a4,4,0,0,0-4,4v64a4,4,0,0,0,8,0V96A4,4,0,0,0,168,92Zm40-16a4,4,0,0,0-4,4v96a4,4,0,0,0,8,0V80A4,4,0,0,0,208,76Z"}))]]),wQ=new Map([["bold",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",d.createElement(d.Fragment,null,d.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),d.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",d.createElement(d.Fragment,null,d.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",d.createElement(d.Fragment,null,d.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",d.createElement(d.Fragment,null,d.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",d.createElement(d.Fragment,null,d.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),kQ=d.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Xe=d.forwardRef((t,e)=>{const{alt:n,color:r,size:i,weight:l,mirrored:s,children:c,weights:u,...h}=t,{color:g="currentColor",size:O,weight:x="regular",mirrored:y=!1,...v}=d.useContext(kQ);return d.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:i??O,height:i??O,fill:r??g,viewBox:"0 0 256 256",transform:s||y?"scale(-1, 1)":void 0,...v,...h},!!n&&d.createElement("title",null,n),c,u.get(l??x))});Xe.displayName="IconBase";const o7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:EP}));o7.displayName="ArrowClockwiseIcon";const AQ=o7,c7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:TP}));c7.displayName="ArrowCounterClockwiseIcon";const MQ=c7,u7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:$P}));u7.displayName="ArrowLeftIcon";const CQ=u7,f7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:jP}));f7.displayName="ArrowsOutCardinalIcon";const EQ=f7,d7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:PP}));d7.displayName="CameraIcon";const TQ=d7,h7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:QP}));h7.displayName="CaretDownIcon";const $Q=h7,Zf=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:ZP}));Zf.displayName="CaretRightIcon";const m7=Zf,p7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:NP}));p7.displayName="ChatCenteredTextIcon";const jQ=p7,g7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:RP}));g7.displayName="CheckIcon";const PQ=g7,O7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:VP}));O7.displayName="CheckCircleIcon";const x7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:LP}));x7.displayName="ClipboardTextIcon";const QQ=x7,y7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:_P}));y7.displayName="ClockIcon";const ZQ=y7,b7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:DP}));b7.displayName="CopyIcon";const NQ=b7,v7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:HP}));v7.displayName="EyeIcon";const RQ=v7,S7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:XP}));S7.displayName="FileIcon";const VQ=S7,w7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:zP}));w7.displayName="FileCodeIcon";const LQ=w7,k7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:FP}));k7.displayName="FileCssIcon";const _Q=k7,A7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:BP}));A7.displayName="FileHtmlIcon";const DQ=A7,M7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:YP}));M7.displayName="FileJpgIcon";const HQ=M7,C7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:IP}));C7.displayName="FileJsIcon";const XQ=C7,E7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:qP}));E7.displayName="FileJsxIcon";const zQ=E7,T7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:GP}));T7.displayName="FileMdIcon";const FQ=T7,$7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:UP}));$7.displayName="FilePlusIcon";const Ay=$7,j7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:WP}));j7.displayName="FilePngIcon";const BQ=j7,P7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:KP}));P7.displayName="FileSvgIcon";const YQ=P7,Q7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:JP}));Q7.displayName="FileTsIcon";const IQ=Q7,Z7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:eQ}));Z7.displayName="FileTsxIcon";const qQ=Z7,N7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:tQ}));N7.displayName="FileTxtIcon";const GQ=N7,R7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:nQ}));R7.displayName="FileVideoIcon";const UQ=R7,V7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:rQ}));V7.displayName="FilmStripIcon";const WQ=V7,L7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:iQ}));L7.displayName="FolderSimpleIcon";const KQ=L7,_7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:aQ}));_7.displayName="FolderSimplePlusIcon";const D7=_7,H7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:lQ}));H7.displayName="GearIcon";const JQ=H7,X7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:sQ}));X7.displayName="GridFourIcon";const eZ=X7,z7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:oQ}));z7.displayName="ImageIcon";const tZ=z7,F7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:cQ}));F7.displayName="LightningIcon";const nZ=F7,B7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:uQ}));B7.displayName="MagnetStraightIcon";const rZ=B7,Y7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:fQ}));Y7.displayName="MusicNoteIcon";const iZ=Y7,I7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:dQ}));I7.displayName="PaletteIcon";const aZ=I7,q7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:hQ}));q7.displayName="PencilSimpleIcon";const lZ=q7,G7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:mQ}));G7.displayName="PlusIcon";const U7=G7,W7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:pQ}));W7.displayName="ScissorsIcon";const sZ=W7,K7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:gQ}));K7.displayName="SquareIcon";const oZ=K7,J7=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:OQ}));J7.displayName="StackIcon";const cZ=J7,ew=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:xQ}));ew.displayName="TextAaIcon";const uZ=ew,tw=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:yQ}));tw.displayName="TextTIcon";const fZ=tw,nw=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:bQ}));nw.displayName="TrashIcon";const dZ=nw,yf=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:vQ}));yf.displayName="WarningIcon";const rw=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:SQ}));rw.displayName="WaveformIcon";const hZ=rw,$8=d.forwardRef((t,e)=>d.createElement(Xe,{ref:e,...t,weights:wQ}));$8.displayName="XIcon";const mZ=$8;function My({findings:t,projectId:e,onClose:n}){const r=t.filter(h=>h.severity==="error"),i=t.filter(h=>h.severity==="warning"),l=t.length>0,[s,c]=d.useState(!1),u=async()=>{const h=t.map(x=>{let y=`[${x.severity}] ${x.message}`;return x.file&&(y+=`
68
- File: ${x.file}`),x.fixHint&&(y+=`
69
- Fix: ${x.fixHint}`),y}),g=`Fix these HyperFrames lint issues for project "${e}":
70
-
71
- Project path: ${window.location.href}
72
-
73
- ${h.join(`
74
-
75
- `)}`;await cu(g)&&(c(!0),setTimeout(()=>c(!1),2e3))};return m.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:n,children:m.jsxs("div",{className:"bg-neutral-950 border border-neutral-800 rounded-xl shadow-2xl w-full max-w-xl max-h-[80vh] flex flex-col overflow-hidden",onClick:h=>h.stopPropagation(),children:[m.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-neutral-800",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[l?m.jsx("div",{className:"w-8 h-8 rounded-full bg-red-500/10 flex items-center justify-center",children:m.jsx(yf,{size:18,className:"text-red-400",weight:"fill"})}):m.jsx("div",{className:"w-8 h-8 rounded-full bg-studio-accent/10 flex items-center justify-center",children:m.jsx(O7,{size:18,className:"text-studio-accent",weight:"fill"})}),m.jsxs("div",{children:[m.jsx("h2",{className:"text-sm font-semibold text-neutral-200",children:l?`${r.length} error${r.length!==1?"s":""}, ${i.length} warning${i.length!==1?"s":""}`:"All checks passed"}),m.jsx("p",{className:"text-xs text-neutral-500",children:"HyperFrame Lint Results"})]})]}),m.jsx("button",{onClick:n,className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800 transition-colors",children:m.jsx($8,{size:16})})]}),l&&m.jsx("div",{className:"flex items-center justify-end px-5 py-2 border-b border-neutral-800/50",children:m.jsx("button",{onClick:u,className:`px-3 py-1 text-xs font-medium rounded-lg transition-colors ${s?"bg-green-600 text-white":"bg-studio-accent hover:bg-studio-accent/80 text-white"}`,children:s?"Copied!":"Copy to Agent"})}),m.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-3",children:[!l&&m.jsx("div",{className:"py-8 text-center text-neutral-500 text-sm",children:"No errors or warnings found. Your composition looks good!"}),r.map((h,g)=>m.jsx("div",{className:"py-3 border-b border-neutral-800/50 last:border-0",children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx(yf,{size:14,className:"text-red-400 flex-shrink-0 mt-0.5",weight:"fill"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"text-sm text-neutral-200",children:h.message}),h.file&&m.jsx("p",{className:"text-xs text-neutral-600 font-mono mt-0.5",children:h.file}),h.fixHint&&m.jsxs("div",{className:"flex items-start gap-1 mt-1.5",children:[m.jsx(Zf,{size:10,className:"text-studio-accent flex-shrink-0 mt-0.5"}),m.jsx("p",{className:"text-xs text-studio-accent",children:h.fixHint})]})]})]})},`e-${g}`)),i.map((h,g)=>m.jsx("div",{className:"py-3 border-b border-neutral-800/50 last:border-0",children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx(yf,{size:14,className:"text-amber-400 flex-shrink-0 mt-0.5"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"text-sm text-neutral-300",children:h.message}),h.file&&m.jsx("p",{className:"text-xs text-neutral-600 font-mono mt-0.5",children:h.file}),h.fixHint&&m.jsxs("div",{className:"flex items-start gap-1 mt-1.5",children:[m.jsx(Zf,{size:10,className:"text-studio-accent flex-shrink-0 mt-0.5"}),m.jsx("p",{className:"text-xs text-studio-accent",children:h.fixHint})]})]})]})},`w-${g}`))]})]})})}function pZ(t){const e=[];let n=0;for(const r of t.groupOrder){const i=t.groups.get(r);if(i)for(const l of i.segmentIds){const s=t.segments.get(l);if(s&&Object.keys(s.style).length>0){const c={wordIndex:n};s.wordId&&(c.wordId=s.wordId);const u=s.style;u.x!==void 0&&(c.x=u.x),u.y!==void 0&&(c.y=u.y),u.scaleX!==void 0&&(c.scale=u.scaleX),u.rotation!==void 0&&(c.rotation=u.rotation),u.activeColor!==void 0&&(c.activeColor=u.activeColor),u.dimColor!==void 0&&(c.dimColor=u.dimColor),u.opacity!==void 0&&(c.opacity=u.opacity),u.fontSize!==void 0&&(c.fontSize=u.fontSize),u.fontWeight!==void 0&&(c.fontWeight=u.fontWeight),u.fontFamily!==void 0&&(c.fontFamily=u.fontFamily),e.push(c)}n++}}return e}function gZ(t){const e=d.useRef(t);e.current=t;const n=d.useRef(null),r=d.useRef(!1),i=d.useCallback(()=>{const s=Ot.getState();if(!s.model||!s.sourceFilePath||!s.isEditMode)return;const c=e.current;if(!c)return;const u=pZ(s.model);fetch(`/api/projects/${c}/files/${encodeURIComponent("caption-overrides.json")}`,{method:"PUT",headers:{"Content-Type":"text/plain"},body:JSON.stringify(u,null,2)}).catch(h=>console.warn("[captions] auto-save failed:",h))},[]);Xt(()=>{let s=Ot.getState().model;const c=Ot.subscribe(u=>{if(!(!u.isEditMode||u.model===s||!u.model)){if(s=u.model,r.current){r.current=!1;return}n.current&&clearTimeout(n.current),n.current=setTimeout(i,800)}});return()=>{c(),n.current&&clearTimeout(n.current)}});const l=d.useCallback(async()=>{const s=Ot.getState();if(!s.model||!s.sourceFilePath)return;const c=e.current;if(c)try{const u=await fetch(`/api/projects/${c}/files/${encodeURIComponent("caption-overrides.json")}`);if(!u.ok)return;const h=await u.json();if(!h.content)return;const g=JSON.parse(h.content);if(!Array.isArray(g))return;const O=s.model,x=[],y=new Map;for(const w of O.groupOrder){const A=O.groups.get(w);if(A)for(const k of A.segmentIds){x.push(k);const M=O.segments.get(k);M!=null&&M.wordId&&y.set(M.wordId,k)}}const v=new Map(O.segments);for(const w of g){const A=(w.wordId?y.get(w.wordId):void 0)??x[w.wordIndex];if(!A)continue;const k=v.get(A);if(!k)continue;const M={...k.style};w.x!==void 0&&(M.x=w.x),w.y!==void 0&&(M.y=w.y),w.scale!==void 0&&(M.scaleX=w.scale,M.scaleY=w.scale),w.rotation!==void 0&&(M.rotation=w.rotation),w.activeColor!==void 0&&(M.activeColor=w.activeColor),w.dimColor!==void 0&&(M.dimColor=w.dimColor),w.opacity!==void 0&&(M.opacity=w.opacity),w.fontSize!==void 0&&(M.fontSize=w.fontSize),w.fontWeight!==void 0&&(M.fontWeight=w.fontWeight),w.fontFamily!==void 0&&(M.fontFamily=w.fontFamily),v.set(A,{...k,style:M})}r.current=!0,Ot.getState().setModel({...O,segments:v})}catch{}},[]);return{save:i,loadOverrides:l}}const OZ=100,xZ=300;function eg(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function tg(t){return{version:1,updatedAt:0,undo:[],redo:[]}}function yZ(t){const e={};for(const[n,r]of Object.entries(t.files))r.before!==r.after&&(e[n]={before:r.before,after:r.after,beforeHash:eg(r.before),afterHash:eg(r.after)});return{id:t.id,projectId:t.projectId,label:t.label,kind:t.kind??"manual",coalesceKey:t.coalesceKey,createdAt:t.now,files:e}}function bZ(t,e,n){if(Object.keys(e.files).length===0)return t;const r=xZ,i=OZ,l=t.undo[t.undo.length-1];let s=t.undo;if(l&&l.coalesceKey&&l.coalesceKey===e.coalesceKey&&e.createdAt-l.createdAt<=r){const c={};for(const[u,h]of Object.entries(e.files)){const g=l.files[u];c[u]=g?{before:g.before,after:h.after,beforeHash:g.beforeHash,afterHash:h.afterHash}:h}s=[...t.undo.slice(0,-1),{...e,files:c}]}else s=[...t.undo,e];return{version:1,updatedAt:e.createdAt,undo:s.slice(Math.max(0,s.length-i)),redo:[]}}function iw(t,e,n){for(const[r,i]of Object.entries(t.files)){const l=e==="undo"?i.afterHash:i.beforeHash;if(n[r]!==l)return{ok:!1,reason:"content-mismatch",path:r}}return{ok:!0}}function vZ(t,e,n){const r=t.undo[t.undo.length-1];if(!r)return{ok:!1,reason:"empty",state:t,filesToWrite:{}};const i=iw(r,"undo",e);return i.ok?{ok:!0,entry:r,filesToWrite:Object.fromEntries(Object.entries(r.files).map(([l,s])=>[l,s.before])),state:{version:1,updatedAt:n,undo:t.undo.slice(0,-1),redo:[...t.redo,r]}}:{ok:!1,reason:i.reason,path:i.path,state:t,filesToWrite:{}}}function SZ(t,e,n){const r=t.redo[t.redo.length-1];if(!r)return{ok:!1,reason:"empty",state:t,filesToWrite:{}};const i=iw(r,"redo",e);return i.ok?{ok:!0,entry:r,filesToWrite:Object.fromEntries(Object.entries(r.files).map(([l,s])=>[l,s.after])),state:{version:1,updatedAt:n,undo:[...t.undo,r],redo:t.redo.slice(0,-1)}}:{ok:!1,reason:i.reason,path:i.path,state:t,filesToWrite:{}}}const wZ="hyperframes-studio-edit-history",kZ=1,Nf="project-history";function AZ(){return new Promise((t,e)=>{if(!globalThis.indexedDB){e(new Error("IndexedDB is not available"));return}const n=globalThis.indexedDB.open(wZ,kZ);n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(Nf)||r.createObjectStore(Nf)},n.onerror=()=>e(n.error??new Error("Failed to open edit history db")),n.onsuccess=()=>t(n.result)})}function yp(t,e){return AZ().then(n=>new Promise((r,i)=>{const l=n.transaction(Nf,t),s=e(l.objectStore(Nf));s.onerror=()=>i(s.error??new Error("IndexedDB request failed")),s.onsuccess=()=>r(s.result),l.oncomplete=()=>n.close(),l.onerror=()=>{n.close(),i(l.error??new Error("IndexedDB transaction failed"))}}))}function MZ(){return{async get(t){return await yp("readonly",e=>e.get(t))??null},async set(t,e){await yp("readwrite",n=>n.put(e,t))},async delete(t){await yp("readwrite",e=>e.delete(t))}}}async function CZ(t,e){return await t.get(e)??tg()}async function EZ(t,e,n){await t.set(e,n)}function TZ(t){return`edit-${t.toString(36)}-${Math.random().toString(36).slice(2,10)}`}function aw(t){const e=t.undo[t.undo.length-1]??null,n=t.redo[t.redo.length-1]??null;return{canUndo:!!e,canRedo:!!n,undoLabel:(e==null?void 0:e.label)??null,redoLabel:(n==null?void 0:n.label)??null,undoPaths:e?Object.keys(e.files):[],redoPaths:n?Object.keys(n.files):[],state:t}}async function Cy(t,e){const n={},r={};for(const i of t){const l=await e(i);n[i]=l,r[i]=eg(l)}return{currentFiles:n,currentHashes:r}}async function Ey({files:t,rollbackFiles:e,writeFile:n}){const r=[];try{for(const[i,l]of Object.entries(t))await n(i,l),r.push(i)}catch(i){try{for(const l of r.reverse())await n(l,e[l])}catch(l){throw new AggregateError([i,l],"Failed to apply edit history and rollback did not complete")}throw i}}function Ty({projectId:t,storage:e,initialState:n,now:r=Date.now,onChange:i}){let l=n,s=Promise.resolve();const c=async h=>{l=h,i(h);try{await EZ(e,t,h)}catch{}},u=async h=>{const g=s.then(async()=>{const{state:O,result:x}=await h(l);return O!==l&&await c(O),x});return s=g.then(()=>{},()=>{}),g};return{snapshot:()=>aw(l),async recordEdit(h){await u(async g=>{const O=r(),x=yZ({...h,id:TZ(O),projectId:t,now:O});return{state:bZ(g,x),result:void 0}})},async undo(h){return u(async g=>{const O=g.undo[g.undo.length-1];if(!O)return{state:g,result:{ok:!1,reason:"empty"}};const{currentFiles:x,currentHashes:y}=await Cy(Object.keys(O.files),h.readFile),v=vZ(g,y,r());return v.ok?(await Ey({files:v.filesToWrite,rollbackFiles:x,writeFile:h.writeFile}),{state:v.state,result:{ok:!0,label:v.entry.label,paths:Object.keys(v.entry.files)}}):{state:g,result:{ok:!1,reason:v.reason}}})},async redo(h){return u(async g=>{const O=g.redo[g.redo.length-1];if(!O)return{state:g,result:{ok:!1,reason:"empty"}};const{currentFiles:x,currentHashes:y}=await Cy(Object.keys(O.files),h.readFile),v=SZ(g,y,r());return v.ok?(await Ey({files:v.filesToWrite,rollbackFiles:x,writeFile:h.writeFile}),{state:v.state,result:{ok:!0,label:v.entry.label,paths:Object.keys(v.entry.files)}}):{state:g,result:{ok:!1,reason:v.reason}}})}}}function $Z(t){const e=d.useMemo(()=>t.storage??MZ(),[t.storage]),n=t.now??Date.now,[r,i]=d.useState(()=>tg()),[l,s]=d.useState(!1),c=t.projectId,u=d.useRef(null);d.useEffect(()=>{let x=!1;const y=tg();if(u.current=null,i(y),s(!1),!c){s(!0);return}return CZ(e,c).then(v=>{x||(u.current=Ty({projectId:c,storage:e,initialState:v,now:n,onChange:i}),i(v))}).catch(()=>{x||(u.current=Ty({projectId:c,storage:e,initialState:y,now:n,onChange:i}),i(y))}).finally(()=>{x||s(!0)}),()=>{x=!0}},[n,c,e]);const h=d.useCallback(async x=>{var y;await((y=u.current)==null?void 0:y.recordEdit(x))},[]),g=d.useCallback(async x=>{var y;return((y=u.current)==null?void 0:y.undo(x))??{ok:!1,reason:"empty"}},[]),O=d.useCallback(async x=>{var y;return((y=u.current)==null?void 0:y.redo(x))??{ok:!1,reason:"empty"}},[]);return{loaded:l,...aw(r),recordEdit:h,undo:g,redo:O}}function jZ(t){const[e,n]=d.useState(240),[r,i]=d.useState(400),[l,s]=d.useState(()=>ul().leftCollapsed??!1),[c,u]=d.useState((t==null?void 0:t.rightCollapsed)??!0),[h,g]=d.useState((t==null?void 0:t.rightPanelTab)??"renders"),O=d.useRef(null),x=d.useCallback(()=>{s(k=>(ho({leftCollapsed:!k}),Lt("panel_toggle",{panel:"left_sidebar",collapsed:!k}),!k))},[]),y=d.useCallback((k,M)=>{M.preventDefault(),M.target.setPointerCapture(M.pointerId),O.current={side:k,startX:M.clientX,startW:k==="left"?e:r}},[e,r]),v=d.useCallback(k=>{const M=O.current;if(!M)return;const E=k.clientX-M.startX,$=Math.floor(window.innerWidth*.5),C=Math.max(160,Math.min(M.side==="left"?$:600,M.startW+(M.side==="left"?E:-E)));M.side==="left"?n(C):i(C)},[]),w=d.useCallback(()=>{O.current=null},[]),A=d.useCallback(k=>{g(k),Lt("tab_switch",{panel:"right_panel",tab:k})},[g]);return{leftWidth:e,setLeftWidth:n,rightWidth:r,leftCollapsed:l,setLeftCollapsed:s,rightCollapsed:c,setRightCollapsed:u,rightPanelTab:h,setRightPanelTab:A,toggleLeftSidebar:x,handlePanelResizeStart:y,handlePanelResizeMove:v,handlePanelResizeEnd:w}}const PZ=/\.(eot|otf|ttc|ttf|woff2?)$/i,$y=/\s+(thin|extralight|extra light|light|regular|roman|medium|semibold|semi bold|bold|extrabold|extra bold|black|italic|oblique|variable)$/i;function jy(t){return JSON.stringify(t)}function go(t){const e=decodeURIComponent(t.split(/[\\/]/).pop()??t).replace(PZ,"");let n=e.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\s+/g," ").trim();for(;$y.test(n);)n=n.replace($y,"").trim();return n||e}function j8(t,e=t.url){return`@font-face { font-family: ${jy(t.family)}; src: url(${jy(e)}); font-display: swap; }`}async function ol({label:t,kind:e,coalesceKey:n,files:r,readFile:i,writeFile:l,recordEdit:s}){const c={};for(const[g,O]of Object.entries(r)){const x=await i(g);x!==O&&(c[g]={before:x,after:O})}const u=Object.keys(c);if(u.length===0)return[];const h=[];try{for(const g of u)await l(g,c[g].after),h.push(g);await s({label:t,kind:e,coalesceKey:n,files:c})}catch(g){try{for(const O of h.reverse())await l(O,c[O].before)}catch(O){throw new AggregateError([g,O],"Failed to save project files and rollback did not complete")}throw g}return u}function Gn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Py(t,e){return e==='"'?t.replace(/"/g,"&quot;"):t.replace(/'/g,"&#39;")}function P8(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function QZ(t){return t.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function ZZ(t){const e=[];let n="",r=null,i=!1,l=0;for(const s of t){if(i){n+=s,s===";"&&(i=!1);continue}if(s==="&"){i=!0,n+=s;continue}if(r){n+=s,s===r&&(r=null);continue}if(s==='"'||s==="'"){r=s,n+=s;continue}if(s==="("){l+=1,n+=s;continue}if(s===")"){l=Math.max(0,l-1),n+=s;continue}if(s===";"&&l===0){e.push(n),n="";continue}n+=s}return n&&e.push(n),e}function NZ(t,e,n,r){const l=new RegExp(`(<[^>]*\\bid=(["'])${Gn(e)}\\2[^>]*)>`,"i").exec(t);if(!l)return t;const s=l[1];return lw(t,s,n,r)}function lw(t,e,n,r){if(!e)return t;const i=/\bstyle=(["'])([\s\S]*?)\1/.exec(e);if(i){const l=i[2],s=i[1],c=new Map;for(const g of ZZ(l)){const O=g.indexOf(":");if(O<0)continue;const x=g.slice(0,O).trim(),y=g.slice(O+1).trim();x&&c.set(x,y)}r===null?c.delete(n):c.set(n,r);const u=Array.from(c.entries()).map(([g,O])=>`${g}: ${Py(O,s)}`).join("; "),h=e.replace(i[0],`style=${s}${u}${s}`);return t.replace(e,h)}else{if(r===null)return t;const l=/\s*\/$/.test(e),c=`${l?e.replace(/\s*\/$/,""):e} style="${n}: ${Py(r,'"')}"${l?" /":""}`;return t.replace(e,c)}}function RZ(t,e,n,r){const i=dl(t,e);if(!i)return t;const l=lw(i.tag,i.tag,n,r);return Gc(t,i,l)}function Gc(t,e,n){return`${t.slice(0,e.start)}${n}${t.slice(e.end)}`}function bp(t,e,n){const i=new RegExp(`(<[^>]*\\b${e}=(["'])${Gn(n)}\\2[^>]*)>`,"i").exec(t);if((i==null?void 0:i.index)==null)return null;const l=t.match(new RegExp(`<[^>]*\\b${e}=(["'])${Gn(n)}\\1[^>]*>`,"gi"));return l&&l.length>1&&console.warn(`sourcePatcher: ${e}="${n}" matched ${l.length} elements; patching the first. ids/attrs must be unique per document.`),{tag:i[1],start:i.index,end:i.index+i[1].length}}function VZ(t,e){var u;const n=(u=e.selector)==null?void 0:u.match(/^\.([a-zA-Z0-9_-]+)$/);if(!n)return null;const r=n[1],i=new RegExp(`(<[^>]*\\bclass=(["'])[^"']*\\b${Gn(r)}\\b[^"']*\\2[^>]*)>`,"gi"),l=e.selectorIndex??0;let s,c=0;for(;(s=i.exec(t))!==null;){if(c===l&&s.index!=null)return{tag:s[1],start:s.index,end:s.index+s[1].length};c+=1}return null}function dl(t,e){if(e.hfId){const r=bp(t,"data-hf-id",e.hfId);if(r)return r}if(e.id){const r=bp(t,"id",e.id);if(r)return r}if(!e.selector)return null;const n=e.selector.match(/^\[data-composition-id="([^"]+)"\]$/);if(n){const r=bp(t,"data-composition-id",n[1]);if(r)return r}return VZ(t,e)}function Qy(t,e,n){const r=dl(t,e);if(!r)return;const i=n.startsWith("data-")?n:`data-${n}`,l=new RegExp(`\\b${i}=(["'])([^"']*)\\1`).exec(r.tag);return(l==null?void 0:l[2])!=null?QZ(l[2]):void 0}function LZ(t,e){const n=dl(t,e);return n==null?void 0:n.tag}function _Z(t,e,n,r){const i=dl(t,e);if(!i)return t;const l=n.startsWith("data-")?n:`data-${n}`,s=new RegExp(`\\b${Gn(l)}=(["'])([^"']*)\\1`),c=i.tag;if(r===null){if(!s.test(c))return t;const g=new RegExp(`\\s+${Gn(l)}=(["'])[^"']*\\1`),O=c.replace(g,"");return Gc(t,i,O)}const u=P8(r);if(s.test(c)){const g=c.replace(s,`${l}="${u}"`);return Gc(t,i,g)}const h=c+` ${l}="${u}"`;return Gc(t,i,h)}function DZ(t,e,n,r){const l=new RegExp(`(<[^>]*\\bid=(["'])${Gn(e)}\\2[^>]*)>`,"i").exec(t);if(!l)return t;const s=l[1],c=n.startsWith("data-")?n:`data-${n}`,u=new RegExp(`\\b${Gn(c)}=(["'])([^"']*)\\1`);if(r===null){if(!u.test(s))return t;const g=new RegExp(`\\s+${Gn(c)}=(["'])[^"']*\\1`),O=s.replace(g,"");return t.replace(s,O)}const h=P8(r);if(u.test(s)){const g=s.replace(u,`${c}="${h}"`);return t.replace(s,g)}else{const g=s+` ${c}="${h}"`;return t.replace(s,g)}}function HZ(t,e,n){const i=new RegExp(`(<([a-z0-9-]+)[^>]*\\bid=(["'])${Gn(e)}\\3[^>]*>)`,"i").exec(t);if(!i||i.index==null)return t;const l=i[1],s=i[2],c=i.index+l.length,u=sw(t,s,c);return u<0?t:`${t.slice(0,c)}${n}${t.slice(u)}`}function sw(t,e,n){const r=new RegExp(`</?${Gn(e)}\\b[^>]*>`,"gi");r.lastIndex=n;let i=1,l;for(;(l=r.exec(t))!==null;){const s=l[0];if(s.startsWith("</")){if(i-=1,i===0)return l.index;continue}s.endsWith("/>")||(i+=1)}return-1}const XZ=new Set(["loop","muted","autoplay","playsinline","controls","default","defer","disabled","hidden","nomodule","open","readonly","required","reversed","selected"]);function ow(t,e,n,r){if(!e)return t;if(XZ.has(n)){const u=Gn(n),h=new RegExp(`(?:^|\\s)${u}(?:\\s|=|$)`).test(e);if(r===null||r===""||r==="false"){if(!h)return t;const O=new RegExp(`\\s+${u}(?:=(["'])[^"']*\\1)?`),x=e.replace(O,"");return t.replace(e,x)}if(h)return t;const g=e+` ${n}`;return t.replace(e,g)}const l=new RegExp(`\\b${Gn(n)}=(["'])([^"']*)\\1`);if(r===null){if(!l.test(e))return t;const u=new RegExp(`\\s+${Gn(n)}=(["'])[^"']*\\1`),h=e.replace(u,"");return t.replace(e,h)}const s=P8(r);if(l.test(e)){const u=e.replace(l,`${n}="${s}"`);return t.replace(e,u)}const c=e+` ${n}="${s}"`;return t.replace(e,c)}function zZ(t,e,n,r){const l=new RegExp(`(<[^>]*\\bid=(["'])${Gn(e)}\\2[^>]*)>`,"i").exec(t);return l?ow(t,l[1],n,r):t}function FZ(t,e,n,r){const i=dl(t,e);if(!i)return t;const l=ow(i.tag,i.tag,n,r);return Gc(t,i,l)}function BZ(t,e,n){const r=dl(t,e);if(!r)return t;const i=/^<([a-z0-9-]+)/i.exec(r.tag),l=i==null?void 0:i[1];if(!l)return t;const s=sw(t,l,r.end+1);return s<0?t:`${t.slice(0,r.end+1)}${n}${t.slice(s)}`}function YZ(t,e,n){switch(n.type){case"inline-style":return NZ(t,e,n.property,n.value);case"attribute":return DZ(t,e,n.property,n.value);case"html-attribute":return zZ(t,e,n.property,n.value);case"text-content":return n.value!==null?HZ(t,e,n.value):t;default:return t}}function jc(t,e,n){if(e.id){const r=YZ(t,e.id,n);if(r!==t||!e.selector)return r}switch(n.type){case"inline-style":return RZ(t,e,n.property,n.value);case"attribute":return _Z(t,e,n.property,n.value);case"html-attribute":return FZ(t,e,n.property,n.value);case"text-content":return n.value!==null?BZ(t,e,n.value):t;default:return t}}function IZ({projectId:t,showToast:e,recordEdit:n,domEditSaveTimestampRef:r,setRefreshKey:i}){const[l,s]=d.useState(null),[c,u]=d.useState(null),[h,g]=d.useState([]),[O,x]=d.useState([]),[y,v]=d.useState(!1),[w,A]=d.useState(null),k=d.useRef(l==null?void 0:l.path);k.current=l==null?void 0:l.path;const M=d.useRef(t);M.current=t;const E=d.useRef(null),$=d.useRef(null),C=d.useRef([]);d.useEffect(()=>{if(!t){v(!1);return}let Y=!1;return v(!1),fetch(`/api/projects/${t}`).then(re=>re.json()).then(re=>{!Y&&re.files&&g(re.files),!Y&&re.compositions&&x(re.compositions),Y||u(typeof re.dir=="string"?re.dir:null)}).catch(()=>{Y||u(null)}).finally(()=>{Y||v(!0)}),()=>{Y=!0}},[t]);const j=d.useCallback(async Y=>{const re=M.current;if(!re)throw new Error("No active project");const ae=await fetch(`/api/projects/${re}/files/${encodeURIComponent(Y)}`);if(!ae.ok)throw new Error(`Failed to read ${Y}`);const ue=await ae.json();if(typeof ue.content!="string")throw new Error(`Missing file contents for ${Y}`);return ue.content},[]),T=d.useCallback(async(Y,re)=>{const ae=M.current;if(!ae)throw new Error("No active project");if(!(await fetch(`/api/projects/${ae}/files/${encodeURIComponent(Y)}`,{method:"PUT",headers:{"Content-Type":"text/plain"},body:re})).ok)throw new Error(`Failed to save ${Y}`);k.current===Y&&s({path:Y,content:re})},[]),N=d.useCallback(async Y=>{const re=M.current;if(!re)throw new Error("No active project");const ae=await fetch(`/api/projects/${re}/files/${encodeURIComponent(Y)}?optional=1`);if(!ae.ok)throw new Error(`Failed to read ${Y}`);const ue=await ae.json();return typeof ue.content=="string"?ue.content:""},[]),R=d.useCallback(Y=>{var ae;const re=M.current;if(re){if((ae=z.current)==null||ae.abort(),z.current=null,V.current++,WS(Y)){s({path:Y,content:null});return}fetch(`/api/projects/${re}/files/${encodeURIComponent(Y)}`).then(ue=>ue.json()).then(ue=>{ue.content!=null&&s({path:Y,content:ue.content})}).catch(()=>{})}},[]),D=d.useCallback(Y=>{const re=M.current;if(!re)return;const ae=k.current;ae&&(E.current!=null&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(()=>{r.current=Date.now(),ol({projectId:re,label:"Edit source",kind:"source",coalesceKey:`source:${ae}`,files:{[ae]:Y},readFile:j,writeFile:T,recordEdit:n}).then(()=>{$.current!=null&&cancelAnimationFrame($.current),$.current=requestAnimationFrame(()=>i(ue=>ue+1))}).catch(ue=>{Lt("save_failure",{source:"code_editor",error_message:ue instanceof Error?ue.message:"unknown"})})}))},[r,j,n,i,T]),V=d.useRef(0),z=d.useRef(null),I=d.useCallback((Y,re)=>{var ye;const ae=M.current;if(!ae||!Y)return;if((ye=z.current)==null||ye.abort(),z.current=null,k.current===Y&&(l==null?void 0:l.content)!=null){const Oe=dl(l.content,re);A(Oe?Oe.start:null);return}const ue=++V.current,me=new AbortController;z.current=me,fetch(`/api/projects/${ae}/files/${encodeURIComponent(Y)}`,{signal:me.signal}).then(Oe=>Oe.json()).then(Oe=>{if(ue===V.current&&Oe.content!=null){s({path:Y,content:Oe.content});const Se=dl(Oe.content,re);A(Se?Se.start:null)}}).catch(()=>{})},[l==null?void 0:l.content]),U=d.useCallback(async()=>{const Y=M.current;if(!Y)return;const ae=await(await fetch(`/api/projects/${Y}`)).json();ae.files&&g(ae.files)},[]),K=d.useCallback(async(Y,re)=>{var Oe,Se;const ae=M.current,ue=Array.from(Y);if(!ae||ue.length===0)return[];const me=new FormData;for(const Ae of ue)me.append("file",Ae);const ye=re?`?dir=${encodeURIComponent(re)}`:"";try{const Ae=await fetch(`/api/projects/${ae}/upload${ye}`,{method:"POST",body:me});if(Ae.ok){const Me=await Ae.json();if((Oe=Me.skipped)!=null&&Oe.length&&e(`Skipped (too large): ${Me.skipped.join(", ")}`),(Se=Me.invalid)!=null&&Se.length){const Ve=Me.invalid.map(Pe=>Pe.name).join(", ");e(`Unsupported media skipped: ${Ve}`)}return await U(),i(Ve=>Ve+1),Array.isArray(Me.files)?Me.files:[]}else Ae.status===413?e("Upload rejected: payload too large"):e(`Upload failed (${Ae.status})`)}catch{e("Upload failed: network error")}return[]},[U,i,e]),H=d.useCallback(async Y=>{const re=M.current;if(!re)return;let ae="";Y.endsWith(".html")&&(ae=`<!DOCTYPE html>
76
- <html>
77
- <head>
78
- <meta charset="UTF-8">
79
- </head>
80
- <body>
81
-
82
- </body>
83
- </html>
84
- `);const ue=await fetch(`/api/projects/${re}/files/${encodeURIComponent(Y)}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:ae});if(ue.ok)await U(),R(Y);else{const me=await ue.json().catch(()=>({error:"unknown"}));console.error(`Create file failed: ${me.error}`)}},[U,R]),q=d.useCallback(async Y=>{const re=M.current;if(!re)return;const ae=await fetch(`/api/projects/${re}/files/${encodeURIComponent(Y+"/.gitkeep")}`,{method:"POST",headers:{"Content-Type":"text/plain"},body:""});if(ae.ok)await U();else{const ue=await ae.json().catch(()=>({error:"unknown"}));console.error(`Create folder failed: ${ue.error}`)}},[U]),X=d.useCallback(async Y=>{const re=M.current;if(!re)return;const ae=await fetch(`/api/projects/${re}/files/${encodeURIComponent(Y)}`,{method:"DELETE"});if(ae.ok)k.current===Y&&s(null),await U();else{const ue=await ae.json().catch(()=>({error:"unknown"}));console.error(`Delete failed: ${ue.error}`)}},[U]),G=d.useCallback(async(Y,re)=>{const ae=M.current;if(!ae)return;const ue=await fetch(`/api/projects/${ae}/files/${encodeURIComponent(Y)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newPath:re})});if(ue.ok)k.current===Y&&R(re),await U(),i(me=>me+1);else{const me=await ue.json().catch(()=>({error:"unknown"}));console.error(`Rename failed: ${me.error}`)}},[U,R,i]),F=d.useCallback(async Y=>{const re=M.current;if(!re)return;const ae=await fetch(`/api/projects/${re}/duplicate-file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:Y})});if(ae.ok){const ue=await ae.json();await U(),ue.path&&R(ue.path)}else{const ue=await ae.json().catch(()=>({error:"unknown"}));console.error(`Duplicate failed: ${ue.error}`)}},[U,R]),P=G,Z=d.useCallback(async(Y,re)=>K(Array.from(Y),re),[K]),L=d.useCallback(async Y=>{const re=await K(Array.from(Y).filter(me=>xf.test(me.name)),"assets/fonts"),ae=M.current,ue=re.filter(me=>xf.test(me)).map(me=>({family:go(me),path:me,url:`/api/projects/${ae}/preview/${me}`}));return C.current=[...ue,...C.current.filter(me=>!ue.some(ye=>ye.family.toLowerCase()===me.family.toLowerCase()))],ue},[K]),B=O,J=d.useMemo(()=>h.filter(Y=>!Y.endsWith(".html")&&!Y.endsWith(".md")&&!Y.endsWith(".json")),[h]),te=d.useMemo(()=>J.filter(Y=>xf.test(Y)).map(Y=>({family:go(Y),path:Y,url:`/api/projects/${t}/preview/${Y}`})),[J,t]);return{editingFile:l,setEditingFile:s,projectDir:c,fileTree:h,fileTreeLoaded:y,setFileTree:g,editingPathRef:k,projectIdRef:M,saveRafRef:E,importedFontAssetsRef:C,readProjectFile:j,writeProjectFile:T,readOptionalProjectFile:N,revealSourceOffset:w,openSourceForSelection:I,handleFileSelect:R,handleContentChange:D,refreshFileTree:U,uploadProjectFiles:K,handleCreateFile:H,handleCreateFolder:q,handleDeleteFile:X,handleRenameFile:G,handleDuplicateFile:F,handleMoveFile:P,handleImportFiles:Z,handleImportFonts:L,compositions:B,assets:J,fontAssets:te}}const Ir="--hf-studio-offset-x",qr="--hf-studio-offset-y",ya="--hf-studio-width",ba="--hf-studio-height",Oo="data-hf-studio-manual-edit-gesture",ci="--hf-studio-rotation",ca="data-hf-studio-path-offset",ua="data-hf-studio-box-size",fa="data-hf-studio-rotation",da="data-hf-studio-original-translate",ha="data-hf-studio-original-inline-translate",Ru="data-hf-studio-original-width",Vu="data-hf-studio-original-height",Lu="data-hf-studio-original-min-width",_u="data-hf-studio-original-min-height",Du="data-hf-studio-original-max-width",Hu="data-hf-studio-original-max-height",Xu="data-hf-studio-original-flex-basis",zu="data-hf-studio-original-flex-grow",Fu="data-hf-studio-original-flex-shrink",Bu="data-hf-studio-original-box-sizing",aa="data-hf-studio-original-scale",Wl="data-hf-studio-original-transform-origin",Yu="data-hf-studio-original-display",ma="data-hf-studio-original-rotate",pa="data-hf-studio-original-inline-rotate",Pi="data-hf-studio-original-rotation-transform-origin",ns="data-hf-studio-rotation-draft",ga="data-hf-studio-original-transform-display",qZ="__hfStudioManualEditsApply",ng="__hfStudioManualEditsWrapped",k1="__hfStudioManualEditsPlaybackFrame",GZ="center center";function UZ(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function cw(t){return Math.round(t*10)/10}function A1(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\//,"")}function rg(t){if(typeof t=="string"){const n=t.trim();if(!n)return null;if(n.startsWith("{"))try{return rg(JSON.parse(n))}catch{return A1(n)}return A1(n)}if(!t||typeof t!="object")return null;const e=t;return typeof e.path=="string"?A1(e.path):typeof e.filePath=="string"?A1(e.filePath):"data"in e?rg(e.data):null}function WZ(t){return rg(t)}function pu(t,e,n){for(const r of e){const i=t.style.getPropertyValue(r);i&&n.push({type:"inline-style",property:r,value:i})}}function gu(t,e,n){for(const r of e){const i=t.getAttribute(r);i!==null&&n.push({type:"attribute",property:r,value:i})}}function uw(t,e){const n=t.getAttribute(ga);n!==null&&(e.push({type:"inline-style",property:"display",value:n||null}),e.push({type:"attribute",property:ga,value:null}))}function Zy(t){const e=[];return pu(t,[Ir,qr,"translate"],e),e.push({type:"attribute",property:ca,value:"true"}),gu(t,[da,ha],e),pu(t,["display"],e),gu(t,[ga],e),e}function KZ(t){const e=t.getAttribute(ha),n=[{type:"inline-style",property:Ir,value:null},{type:"inline-style",property:qr,value:null},{type:"inline-style",property:"translate",value:e||null},{type:"attribute",property:ca,value:null},{type:"attribute",property:da,value:null},{type:"attribute",property:ha,value:null}];return uw(t,n),n}const JZ=["width","height","min-width","min-height","max-width","max-height","flex-basis","flex-grow","flex-shrink","box-sizing","scale","transform-origin","display"],fw=[[Ru,"width"],[Vu,"height"],[Lu,"min-width"],[_u,"min-height"],[Du,"max-width"],[Hu,"max-height"],[Xu,"flex-basis"],[zu,"flex-grow"],[Fu,"flex-shrink"],[Bu,"box-sizing"],[aa,"scale"],[Wl,"transform-origin"],[Yu,"display"],[ga,""]];function eN(t){const e=[];return pu(t,[ya,ba],e),pu(t,JZ,e),e.push({type:"attribute",property:ua,value:"true"}),gu(t,fw.map(([n])=>n),e),e}function tN(t){const e=[{type:"inline-style",property:ya,value:null},{type:"inline-style",property:ba,value:null},{type:"attribute",property:ua,value:null}];for(const[n,r]of fw){const i=t.getAttribute(n);i!==null&&r&&e.push({type:"inline-style",property:r,value:i||null}),e.push({type:"attribute",property:n,value:null})}return e}const nN=[ci,"rotate","transform-origin","display"],rN=[ma,pa,Pi,ga];function iN(t){const e=[];return pu(t,nN,e),e.push({type:"attribute",property:fa,value:"true"}),gu(t,rN,e),e}function aN(t){const e=t.getAttribute(pa),n=t.getAttribute(Pi),r=[{type:"inline-style",property:ci,value:null},{type:"inline-style",property:"rotate",value:e||null},{type:"inline-style",property:"transform-origin",value:n!==null&&n||null},{type:"attribute",property:fa,value:null},{type:"attribute",property:ns,value:null},{type:"attribute",property:ma,value:null},{type:"attribute",property:pa,value:null},{type:"attribute",property:Pi,value:null}];return uw(t,r),r}const lN=[po,fu,du];function sN(t){const e=t.getAttribute(fl);if(!e)return[];const n=[{type:"attribute",property:fl,value:e}];return gu(t,lN,n),n}function oN(t){return[{type:"attribute",property:fl,value:null},{type:"attribute",property:po,value:null},{type:"attribute",property:fu,value:null},{type:"attribute",property:du,value:null}]}let Ny=0;function dw(t){Ny+=1;const e=`gesture-${Ny}`;return t.setAttribute(Oo,e),e}function vi(t,e){e&&t.getAttribute(Oo)!==e||t.removeAttribute(Oo)}function hw(t){return t.hasAttribute(Oo)}function M1(t,e){return t.getAttribute(Oo)===e}function xo(t,e){const n=Number.parseFloat(t.style.getPropertyValue(e));return Number.isFinite(n)?n:0}function ig(t){return{x:xo(t,Ir),y:xo(t,qr)}}function Rf(t){return{width:xo(t,ya),height:xo(t,ba)}}function mw(t){const e=Number.parseFloat(t.style.getPropertyValue(ci));return{angle:Number.isFinite(e)?e:0}}function Q8(t,e){var n;try{return((n=t.ownerDocument.defaultView)==null?void 0:n.getComputedStyle(t).getPropertyValue(e))??""}catch{return""}}function ag(t,e){return t.style.getPropertyValue(e)||Q8(t,e)}function pw(t,e){const n=ag(t,e).trim();return n==="none"?"":n}function lg(t){return t.includes(Ir)||t.includes(qr)}function Ry(t){return t.includes(ya)||t.includes(ba)}function sg(t){return t.includes(ci)}function Vy(t){return t.replace(/\s+/g,"").toLowerCase()}function cN(t,e){if(!t.hasAttribute(ns))return!1;const n=t.style.getPropertyValue(ci).trim();return!n||!e.trim()?!1:Vy(e)===Vy(R8(t,n))}function Zo(t){Q8(t,"display")==="inline"&&(t.hasAttribute(ga)||t.setAttribute(ga,t.style.getPropertyValue("display")),t.style.setProperty("display","inline-block"))}function Z8(t){const e=t.getAttribute(ga);e!=null&&(e===""?t.style.removeProperty("display"):t.style.setProperty("display",e),t.removeAttribute(ga))}function uN(t){const e=[];let n=0,r="";for(const i of t.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\s/.test(i)&&n===0?(r&&e.push(r),r=""):r+=i;return r&&e.push(r),e}function gw(t,e,n){var l;const r=(l=t.getAttribute(da))==null?void 0:l.trim();if(!r||r==="none")return`${e} ${n}`;const i=uN(r);return i.length===1?`calc(${i[0]} + ${e}) ${n}`:i.length===2?`calc(${i[0]} + ${e}) calc(${i[1]} + ${n})`:i.length===3?`calc(${i[0]} + ${e}) calc(${i[1]} + ${n}) ${i[2]}`:`${e} ${n}`}function fN(t,e){const n=t.style.getPropertyValue("translate"),r=pw(t,"translate"),i=t.hasAttribute(ca),l=!lg(r);i?e&&l&&!hw(t)&&t.setAttribute(da,r):(t.setAttribute(ha,lg(n)?"":n),t.setAttribute(da,l?r:""))}function Ow(t,e,n={}){fN(t,n.updateBase??!0),t.setAttribute(ca,"true"),t.style.setProperty(Ir,`${Math.round(e.x)}px`),t.style.setProperty(qr,`${Math.round(e.y)}px`)}function dN(t){return t.is2D&&t.a===1&&t.b===0&&t.c===0&&t.d===1}function xw(t){var r;if(t.hasAttribute(Oo))return;const e=t.style.getPropertyValue("transform");if(!e||e==="none")return;const n=(r=t.ownerDocument.defaultView)==null?void 0:r.DOMMatrix;if(n)try{const i=new n(e);if(i.m41===0&&i.m42===0)return;const l=xo(t,Ir),s=xo(t,qr),c=Math.atan2(i.b,i.a),u=Math.cos(c),h=Math.sin(c);i.m41-=l*u-s*h,i.m42-=l*h+s*u,Math.abs(i.m41)<.01&&Math.abs(i.m42)<.01&&dN(i)?t.style.removeProperty("transform"):t.style.setProperty("transform",i.toString())}catch{}}function Vf(t,e,n={}){Zo(t),Ow(t,e,{updateBase:n.updateBase??!0}),t.style.setProperty("translate",gw(t,`var(${Ir}, 0px)`,`var(${qr}, 0px)`)),xw(t)}function bf(t,e){Zo(t),Ow(t,e,{updateBase:!1}),t.style.setProperty("translate",gw(t,`${Math.round(e.x)}px`,`${Math.round(e.y)}px`)),xw(t)}function hN(t,e){const n=t.parentElement;if(!n)return null;const r=ag(n,"display").trim();if(r!=="flex"&&r!=="inline-flex")return null;const i=ag(n,"flex-direction").trim();return Math.round(Math.max(1,i.startsWith("column")?e.height:e.width))}function mN(t){if(!t.hasAttribute(aa))return;const e=t.getAttribute(aa);e==null||e===""?t.style.removeProperty("scale"):t.style.setProperty("scale",e),t.removeAttribute(aa);const n=t.getAttribute(Wl);n==null||n===""?t.style.removeProperty("transform-origin"):t.style.setProperty("transform-origin",n),t.removeAttribute(Wl)}function pN(t,e){t.hasAttribute(ua)||(t.setAttribute(Ru,t.style.getPropertyValue("width")),t.setAttribute(Vu,t.style.getPropertyValue("height")),t.setAttribute(Lu,t.style.getPropertyValue("min-width")),t.setAttribute(_u,t.style.getPropertyValue("min-height")),t.setAttribute(Du,t.style.getPropertyValue("max-width")),t.setAttribute(Hu,t.style.getPropertyValue("max-height")),t.setAttribute(Xu,t.style.getPropertyValue("flex-basis")),t.setAttribute(zu,t.style.getPropertyValue("flex-grow")),t.setAttribute(Fu,t.style.getPropertyValue("flex-shrink")),t.setAttribute(Bu,t.style.getPropertyValue("box-sizing")),t.setAttribute(aa,t.style.getPropertyValue("scale")),t.setAttribute(Wl,t.style.getPropertyValue("transform-origin")),t.setAttribute(Yu,t.style.getPropertyValue("display"))),t.setAttribute(ua,"true"),t.style.setProperty(ya,`${Math.round(Math.max(1,e.width))}px`),t.style.setProperty(ba,`${Math.round(Math.max(1,e.height))}px`)}function yw(t,e){pN(t,e),mN(t);const n=Math.round(Math.max(1,e.width)),r=Math.round(Math.max(1,e.height));t.style.setProperty("box-sizing","border-box"),t.style.setProperty("width",`${n}px`),t.style.setProperty("height",`${r}px`),t.style.setProperty("min-width","0px"),t.style.setProperty("min-height","0px"),t.style.setProperty("max-width","none"),t.style.setProperty("max-height","none");const i=hN(t,e);i!=null&&(t.style.setProperty("flex-basis",`${i}px`),t.style.setProperty("flex-grow","0"),t.style.setProperty("flex-shrink","0")),Q8(t,"display")==="inline"&&t.style.setProperty("display","inline-block")}function N8(t,e){Zo(t),yw(t,e)}function gN(t,e){Zo(t),yw(t,e)}function ON(t){return/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:deg|rad|turn|grad)$/.test(t.trim())}function R8(t,e){var r;const n=(r=t.getAttribute(ma))==null?void 0:r.trim();return!n||n==="none"||!ON(n)?e:`calc(${n} + ${e})`}function xN(t,e){const n=t.style.getPropertyValue("rotate"),r=pw(t,"rotate"),i=t.hasAttribute(fa),l=!sg(r)&&!cN(t,r);i?e&&l&&!hw(t)&&t.setAttribute(ma,r):(t.setAttribute(pa,sg(n)?"":n),t.setAttribute(ma,l?r:"")),t.hasAttribute(Pi)||t.setAttribute(Pi,t.style.getPropertyValue("transform-origin"))}function bw(t,e,n={}){xN(t,n.updateBase??!0),t.setAttribute(fa,"true"),t.style.setProperty(ci,`${cw(e.angle)}deg`),t.style.setProperty("transform-origin",GZ)}function V8(t,e){Zo(t),bw(t,e),t.removeAttribute(ns),t.style.setProperty("rotate",R8(t,`var(${ci}, 0deg)`))}function yN(t,e){Zo(t),bw(t,e,{updateBase:!1}),t.setAttribute(ns,"true"),t.style.setProperty("rotate",R8(t,`${cw(e.angle)}deg`))}function L8(t,e){var l;const n=(l=t.defaultView)==null?void 0:l.HTMLElement;if(!n)return[];const r=Array.from(t.querySelectorAll(`[${e}="true"]`)).filter(s=>s instanceof n),i=`data-${e}`;for(const s of t.querySelectorAll(`[${i}="true"]`))s instanceof n&&!s.hasAttribute(e)&&(s.setAttribute(e,"true"),s.removeAttribute(i),r.push(s));return r}function bN(t){for(const e of L8(t,ca)){const n=e.style.getPropertyValue(Ir),r=e.style.getPropertyValue(qr);(n||r)&&Vf(e,{x:Number.parseFloat(n)||0,y:Number.parseFloat(r)||0})}}function vN(t,...e){const n=t.ownerDocument.defaultView;if(!(n!=null&&n.__timelines))return!1;const r=new Set(e);for(const i of Object.values(n.__timelines))if(i!=null&&i.getChildren)try{for(const l of i.getChildren(!0)){if(!l.targets||!l.vars)continue;let s=!1;for(const u of l.targets())if(u===t||t.id&&u.id===t.id){s=!0;break}if(!s)continue;const c=l.vars;for(const u of r)if(u in c)return!0;if(c.keyframes&&typeof c.keyframes=="object"){for(const u of Object.values(c.keyframes))if(u&&typeof u=="object"){for(const h of r)if(h in u)return!0}}}}catch{}return!1}function SN(t){for(const e of L8(t,ua)){if(vN(e,"width","height"))continue;const n=Number.parseFloat(e.style.getPropertyValue(ya)),r=Number.parseFloat(e.style.getPropertyValue(ba));Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0&&N8(e,{width:n,height:r})}}function wN(t){for(const e of L8(t,fa)){const n=Number.parseFloat(e.style.getPropertyValue(ci));Number.isFinite(n)&&V8(e,{angle:n})}}function Uc(t){bN(t),SN(t),wN(t),K2(t)}function kN(t){return{width:t.style.getPropertyValue("width"),height:t.style.getPropertyValue("height"),minWidth:t.style.getPropertyValue("min-width"),minHeight:t.style.getPropertyValue("min-height"),maxWidth:t.style.getPropertyValue("max-width"),maxHeight:t.style.getPropertyValue("max-height"),flexBasis:t.style.getPropertyValue("flex-basis"),flexGrow:t.style.getPropertyValue("flex-grow"),flexShrink:t.style.getPropertyValue("flex-shrink"),boxSizing:t.style.getPropertyValue("box-sizing"),scale:t.style.getPropertyValue("scale"),transformOrigin:t.style.getPropertyValue("transform-origin"),display:t.style.getPropertyValue("display"),studioWidth:t.style.getPropertyValue(ya),studioHeight:t.style.getPropertyValue(ba),marker:t.getAttribute(ua),originalWidth:t.getAttribute(Ru),originalHeight:t.getAttribute(Vu),originalMinWidth:t.getAttribute(Lu),originalMinHeight:t.getAttribute(_u),originalMaxWidth:t.getAttribute(Du),originalMaxHeight:t.getAttribute(Hu),originalFlexBasis:t.getAttribute(Xu),originalFlexGrow:t.getAttribute(zu),originalFlexShrink:t.getAttribute(Fu),originalBoxSizing:t.getAttribute(Bu),originalScale:t.getAttribute(aa),originalTransformOrigin:t.getAttribute(Wl),originalDisplay:t.getAttribute(Yu)}}function AN(t){return{rotate:t.style.getPropertyValue("rotate"),transformOrigin:t.style.getPropertyValue("transform-origin"),studioRotation:t.style.getPropertyValue(ci),marker:t.getAttribute(fa),draftMarker:t.getAttribute(ns),originalRotate:t.getAttribute(ma),originalInlineRotate:t.getAttribute(pa),originalTransformOrigin:t.getAttribute(Pi)}}function _8(t){return{translate:t.style.getPropertyValue("translate"),x:t.style.getPropertyValue(Ir),y:t.style.getPropertyValue(qr),marker:t.getAttribute(ca),originalTranslate:t.getAttribute(da),originalInlineTranslate:t.getAttribute(ha)}}function Wt(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function wn(t,e,n){n?t.style.setProperty(e,n):t.style.removeProperty(e)}function vp(t,e){wn(t,"width",e.width),wn(t,"height",e.height),wn(t,"min-width",e.minWidth),wn(t,"min-height",e.minHeight),wn(t,"max-width",e.maxWidth),wn(t,"max-height",e.maxHeight),wn(t,"flex-basis",e.flexBasis),wn(t,"flex-grow",e.flexGrow),wn(t,"flex-shrink",e.flexShrink),wn(t,"box-sizing",e.boxSizing),wn(t,"scale",e.scale),wn(t,"transform-origin",e.transformOrigin),wn(t,"display",e.display),wn(t,ya,e.studioWidth),wn(t,ba,e.studioHeight),Wt(t,ua,e.marker),Wt(t,Ru,e.originalWidth),Wt(t,Vu,e.originalHeight),Wt(t,Lu,e.originalMinWidth),Wt(t,_u,e.originalMinHeight),Wt(t,Du,e.originalMaxWidth),Wt(t,Hu,e.originalMaxHeight),Wt(t,Xu,e.originalFlexBasis),Wt(t,zu,e.originalFlexGrow),Wt(t,Fu,e.originalFlexShrink),Wt(t,Bu,e.originalBoxSizing),Wt(t,aa,e.originalScale),Wt(t,Wl,e.originalTransformOrigin),Wt(t,Yu,e.originalDisplay)}function Sp(t,e){wn(t,"rotate",e.rotate),wn(t,"transform-origin",e.transformOrigin),wn(t,ci,e.studioRotation),Wt(t,fa,e.marker),Wt(t,ns,e.draftMarker),Wt(t,ma,e.originalRotate),Wt(t,pa,e.originalInlineRotate),Wt(t,Pi,e.originalTransformOrigin)}function Gs(t,e){e.translate?t.style.setProperty("translate",e.translate):t.style.removeProperty("translate"),e.x?t.style.setProperty(Ir,e.x):t.style.removeProperty(Ir),e.y?t.style.setProperty(qr,e.y):t.style.removeProperty(qr),Wt(t,ca,e.marker),Wt(t,da,e.originalTranslate),Wt(t,ha,e.originalInlineTranslate)}function Sr(t,e,n){const r=t.getAttribute(n);r==null||r===""?t.style.removeProperty(e):t.style.setProperty(e,r),t.removeAttribute(n)}function MN(t){const e=t.getAttribute(pa);e==null||e===""?t.style.removeProperty("rotate"):t.style.setProperty("rotate",e),t.removeAttribute(pa),t.removeAttribute(ma);const n=t.getAttribute(Pi);n!=null&&(n===""?t.style.removeProperty("transform-origin"):t.style.setProperty("transform-origin",n)),t.removeAttribute(Pi)}function CN(t){const e=t.getAttribute(ha);e==null||e===""?t.style.removeProperty("translate"):t.style.setProperty("translate",e),t.removeAttribute(ha),t.removeAttribute(da)}function vw(t){(t.hasAttribute(ca)||lg(t.style.getPropertyValue("translate")))&&CN(t),Z8(t),t.style.removeProperty(Ir),t.style.removeProperty(qr),t.removeAttribute(ca),t.removeAttribute(da),t.removeAttribute(ha)}function EN(t){(t.hasAttribute(fa)||sg(t.style.getPropertyValue("rotate")))&&MN(t),Z8(t),t.style.removeProperty(ci),t.removeAttribute(fa),t.removeAttribute(ns),t.removeAttribute(ma),t.removeAttribute(pa),t.removeAttribute(Pi)}function TN(t){(t.hasAttribute(ua)||Ry(t.style.getPropertyValue("width"))||Ry(t.style.getPropertyValue("height"))||t.hasAttribute(aa))&&(Sr(t,"width",Ru),Sr(t,"height",Vu),Sr(t,"min-width",Lu),Sr(t,"min-height",_u),Sr(t,"max-width",Du),Sr(t,"max-height",Hu),Sr(t,"flex-basis",Xu),Sr(t,"flex-grow",zu),Sr(t,"flex-shrink",Fu),Sr(t,"box-sizing",Bu),Sr(t,"scale",aa),Sr(t,"transform-origin",Wl),Sr(t,"display",Yu)),Z8(t),t.style.removeProperty(ya),t.style.removeProperty(ba),t.removeAttribute(ua)}function D8(t){try{Object.defineProperty(t,ng,{configurable:!1,enumerable:!1,value:!0})}catch{try{t[ng]=!0}catch{}}}function H8(t){return!!t[ng]}function Xs(t,e,n){const r=e==null?void 0:e[n];if(!e||typeof r!="function")return!1;const i=r;if(H8(i))return!0;const l=function(...s){var u;const c=i.apply(this,s);return(u=t.__hfStudioManualEditsApply)==null||u.call(t),c};D8(l);try{e[n]=l}catch{return!1}return!0}function Pc(t,e){const n=t[e];if(typeof n!="function")return null;try{return UZ(n.call(t))}catch{return null}}function $N(t){const e=Pc(t,"duration")??Pc(t,"getDuration");if(e==null)return!0;if(e<=0)return!1;const n=Pc(t,"time")??Pc(t,"totalTime")??Pc(t,"getTime");return n==null?!0:n<e}function wp(t){if(!t)return!1;const e=t.isPlaying;if(typeof e=="function")try{return!!e.call(t)}catch{return!1}const n=t.paused;if(typeof n=="function"){try{if(n.call(t))return!1}catch{return!1}const i=t.isActive;if(typeof i=="function")try{if(i.call(t))return!0}catch{return!1}return $N(t)}const r=t.isActive;if(typeof r=="function")try{return!!r.call(t)}catch{return!1}return!1}function Sw(t){return wp(t.__player)||wp(t.__timeline)?!0:Object.values(t.__timelines??{}).some(wp)}function ww(t){var n;if((n=t.__hfStudioManualEditsApply)==null||n.call(t),t[k1]!=null)return;const e=()=>{var r;if((r=t.__hfStudioManualEditsApply)==null||r.call(t),!Sw(t)){t[k1]=null;return}t[k1]=t.requestAnimationFrame(e)};t[k1]=t.requestAnimationFrame(e)}function C1(t,e,n){const r=e==null?void 0:e[n];if(!e||typeof r!="function")return!1;const i=r;if(H8(i))return!0;const l=function(...s){const c=i.apply(this,s);return ww(t),c};D8(l);try{e[n]=l}catch{return!1}return!0}function E1(t,e,n){const r=e==null?void 0:e[n];if(!e||typeof r!="function")return!1;const i=r;if(H8(i))return!0;const l=function(...s){var u;const c=i.apply(this,s);return(u=t.__hfStudioManualEditsApply)==null||u.call(t),c};D8(l);try{e[n]=l}catch{return!1}return!0}function jN(t,e){const n=t;n[qZ]=e;const r=Xs(n,n.__hf,"seek"),i=Xs(n,n.__player,"seek"),l=Xs(n,n.__player,"renderSeek"),s=Xs(n,n.__timeline,"seek"),c=C1(n,n.__player,"play"),u=C1(n,n.__timeline,"play"),h=E1(n,n.__player,"pause"),g=E1(n,n.__timeline,"pause");let O=!1,x=!1,y=!1;for(const v of Object.values(n.__timelines??{}))O=Xs(n,v,"seek")||O,x=C1(n,v,"play")||x,y=E1(n,v,"pause")||y;if(n.__timelines&&!n.__timelines.__proxied){const v=n.__timelines;n.__timelines=new Proxy(v,{set(w,A,k){var M;if(w[A]=k,typeof k=="object"&&k!==null){const E=k;Xs(n,E,"seek"),C1(n,E,"play"),E1(n,E,"pause"),(M=n.__hfStudioManualEditsApply)==null||M.call(n)}return!0}}),n.__timelines.__proxied=!0}return Sw(n)&&ww(n),r||i||l||s||c||u||h||g||O||x||y}function PN({projectId:t,showToast:e,readOptionalProjectFile:n,writeProjectFile:r,recordEdit:i,previewIframeRef:l,activeCompPathRef:s,domEditSaveTimestampRef:c,reloadPreview:u,pendingTimelineEditPathRef:h}){const g=d.useRef(0),O=d.useRef(Promise.resolve()),x=d.useRef(async()=>{}),y=d.useRef(t);y.current=t;const v=d.useCallback(E=>{const $=O.current.catch(()=>{}).then(E);return O.current=$.then(()=>{},()=>{}),$},[]),w=d.useCallback(async()=>{await O.current.catch(()=>{})},[]),A=d.useCallback((E=l.current)=>{var N,R,D,V,z,I;if(!E)return;let $=null;try{$=E.contentDocument}catch{return}if(!$)return;const C=()=>{let U=null;try{U=E.contentDocument}catch{return}U&&Uc(U)},j=()=>{C(),E.contentWindow&&jN(E.contentWindow,C)},T=E.contentWindow;j(),(N=T==null?void 0:T.requestAnimationFrame)==null||N.call(T,j),(R=T==null?void 0:T.setTimeout)==null||R.call(T,j,80),(D=T==null?void 0:T.setTimeout)==null||D.call(T,j,250),(V=T==null?void 0:T.setTimeout)==null||V.call(T,j,500),(z=T==null?void 0:T.setTimeout)==null||z.call(T,j,1e3),(I=T==null?void 0:T.setTimeout)==null||I.call(T,j,2e3)},[l]),k=d.useCallback(async(E=l.current)=>{A(E)},[A,l]);x.current=k;const M=d.useCallback(async E=>{u()},[u]);return Xt(()=>{n(U2).then(E=>{if(E){try{const $=JSON.parse(E);if(!Array.isArray($.motions)||$.motions.length===0)return}catch{return}return r(U2,JSON.stringify({version:1,motions:[]}))}}).catch(()=>{})}),Xt(()=>{const E=C=>{const j=WZ(C);if(!j)return;const T=Date.now()-c.current<4e3;if(h!=null&&h.current.has(j)){h.current.delete(j);return}T||u()},$=new EventSource("/api/events");return $.addEventListener("file-change",E),()=>$.close()}),{domTextCommitVersionRef:g,domEditSaveQueueRef:O,applyStudioManualEditsToPreviewRef:x,queueDomEditSave:v,waitForPendingDomEditSaves:w,applyCurrentStudioManualEditsToPreview:A,applyStudioManualEditsToPreview:k,syncHistoryPreviewAfterApply:M}}function Hl(t){return t.label||t.id||t.tag}function Ly(t){const e=t.trim(),n=/^[a-z]+:\/\//i.test(e)?new URL(e).pathname:e;return decodeURIComponent(n).replace(/\\/g,"/").replace(/^\.?\//,"")}function QN(t,e){const n=Ly(t).split("/").filter(Boolean),r=Ly(e).split("/").filter(Boolean);for(n.pop();n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>".."),...r].join("/")||e}function ZN(t){return/^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(t)}function NN(t,e){const n=e.trim();if(!n)return;const r=n.replace(/\\/g,"/");if(ZN(r))return r;const i=t==null?void 0:t.trim().replace(/\\/g,"/").replace(/\/+$/,"");if(i)return`${i}/${r.replace(/^\.?\//,"")}`}function kp(t,e){const n=e.trim();return n&&(["border-radius","border-width","font-size","letter-spacing"].includes(t)&&/^-?\d+(\.\d+)?$/.test(n)?`${n}px`:n)}function _y(t){return/^url\(/i.test(t.trim())}function RN(t){return t==="left"||t==="top"||t==="width"||t==="height"}function X8(t){if(!t||typeof t!="object")return null;const e=t;return e.nodeType===1?t:e.nodeType===3&&e.parentElement?e.parentElement:null}function Dy(t){const e=X8(t);return e?!!e.closest("input, textarea, select, [contenteditable='true'], [role='textbox'], .cm-editor"):!1}function T1(t){const n=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform)?"Cmd":"Ctrl";return t==="undo"?`${n}+Z`:`${n}+Shift+Z`}function og(t,e){const n=t.sourceFile||"index.html";for(const r of e){const i=r.sourceFile||"index.html";if(t.id&&r.domId===t.id&&i===n||t.isCompositionHost&&t.compositionSrc&&r.compositionSrc===t.compositionSrc||t.selector&&r.selector===t.selector&&(r.selectorIndex??0)===(t.selectorIndex??0)&&(r.sourceFile??"index.html")===t.sourceFile)return r.key??r.id}return null}function VN(t,e){if(!e||!Number.isFinite(e.start)||!Number.isFinite(e.duration))return null;const n=Math.max(0,e.start),r=Math.max(n,n+Math.max(0,e.duration)),i=Number.isFinite(t)?t:n;return Ou(i,n,r)}function Ou(t,e,n){return n<e?e:Math.min(Math.max(t,e),n)}function Lf(t){return Array.from(t.matchAll(/\bid="([^"]+)"/g),e=>e[1]??"")}const $1={image:3,video:5,audio:5};async function Hy(t,e,n){if(n==="image")return $1.image;const r=document.createElement(n==="video"?"video":"audio");r.preload="metadata",r.src=`/api/projects/${t}/preview/${e}`;const i=await new Promise(l=>{const s=window.setTimeout(()=>l($1[n]),3e3),c=u=>{window.clearTimeout(s),l(u)};r.addEventListener("loadedmetadata",()=>{const u=Number(r.duration);c(Number.isFinite(u)&&u>0?Math.round(u*100)/100:$1[n])},{once:!0}),r.addEventListener("error",()=>c($1[n]),{once:!0})});return r.src="",r.load(),i}function cg(t){return t.domId?{id:t.domId,selector:t.selector,selectorIndex:t.selectorIndex}:t.selector?{selector:t.selector,selectorIndex:t.selectorIndex}:null}function Xy(t,e,n){try{const r=t==null?void 0:t.contentDocument;if(!r)return;const i=e.domId?r.getElementById(e.domId):e.selector?r.querySelectorAll(e.selector)[e.selectorIndex??0]??null:null;if(!i)return;for(const[l,s]of n)i.setAttribute(l,s)}catch{}}function LN(t,e,n,r){if(r.playbackStart!=null)return{attrName:n.playbackStartAttr==="playback-start"?"playback-start":"media-start",value:r.playbackStart};const i=r.start-n.start;if(i===0)return null;const l=Qy(t,e,"playback-start")??Qy(t,e,"media-start"),s=l!=null?parseFloat(l):void 0;return s==null||!Number.isFinite(s)?null:{attrName:n.playbackStartAttr==="playback-start"?"playback-start":"media-start",value:Math.max(0,s+i*Math.max(n.playbackRate??1,.1))}}async function _N(t){const e=t.element.sourceFile||t.activeCompPath||"index.html",n=await vf(t.projectId,e),r=cg(t.element);if(!r)throw new Error(`Timeline element ${t.element.id} is missing a patchable target`);const i=t.buildPatches(n,r);if(i===n)throw new Error(`Unable to patch timeline element ${t.element.id} in ${e}`);t.pendingTimelineEditPathRef.current.add(e),t.domEditSaveTimestampRef.current=Date.now(),await ol({projectId:t.projectId,label:t.label,kind:"timeline",files:{[e]:i},readFile:async()=>n,writeFile:t.writeProjectFile,recordEdit:t.recordEdit}),t.domEditSaveTimestampRef.current=Date.now()}async function vf(t,e){const n=await fetch(`/api/projects/${t}/files/${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read ${e}`);const r=await n.json();if(typeof r.content!="string")throw new Error(`Missing file contents for ${e}`);return r.content}function DN({projectId:t,activeCompPath:e,timelineElements:n,showToast:r,writeProjectFile:i,recordEdit:l,domEditSaveTimestampRef:s,reloadPreview:c,previewIframeRef:u,pendingTimelineEditPathRef:h,uploadProjectFiles:g}){const O=d.useRef(t);O.current=t;const x=d.useRef(Promise.resolve()),y=d.useRef(0),v=d.useCallback((j,T,N)=>{const R=O.current;if(!R)return Promise.resolve();const D=x.current.then(()=>_N({projectId:R,element:j,activeCompPath:e,label:T,buildPatches:N,writeProjectFile:i,recordEdit:l,domEditSaveTimestampRef:s,pendingTimelineEditPathRef:h}));return x.current=D.catch(V=>{console.error(`[Timeline] Failed to persist: ${T}`,V)}),D},[e,l,i,s,h]),w=d.useCallback((j,T)=>(Xy(u.current,j,[["data-start",Dn(T.start)],["data-track-index",String(T.track)]]),v(j,"Move timeline clip",(N,R)=>{let D=jc(N,R,{type:"attribute",property:"start",value:Dn(T.start)});return jc(D,R,{type:"attribute",property:"track-index",value:String(T.track)})})),[u,v]),A=d.useCallback((j,T)=>(Xy(u.current,j,[["data-start",Dn(T.start)],["data-duration",Dn(T.duration)]]),v(j,"Resize timeline clip",(N,R)=>{const D=LN(N,R,j,T);let V=jc(N,R,{type:"attribute",property:"start",value:Dn(T.start)});return V=jc(V,R,{type:"attribute",property:"duration",value:Dn(T.duration)}),D&&(V=jc(V,R,{type:"attribute",property:D.attrName,value:Dn(D.value)})),V})),[u,v]),k=d.useCallback(async j=>{const T=O.current;if(!T)throw new Error("No active project");const N=Hl(j),R=j.sourceFile||e||"index.html";try{const D=await vf(T,R),V=cg(j);if(!V)throw new Error(`Timeline element ${j.id} is missing a patchable target`);const z=await fetch(`/api/projects/${T}/file-mutations/remove-element/${encodeURIComponent(R)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:V})});if(!z.ok)throw new Error(`Failed to delete ${j.id} from ${R}`);const I=await z.json(),U=typeof I.content=="string"?I.content:D;s.current=Date.now(),await ol({projectId:T,label:"Delete timeline clip",kind:"timeline",files:{[R]:U},readFile:async()=>D,writeFile:i,recordEdit:l}),fe.getState().setElements(n.filter(K=>(K.key??K.id)!==(j.key??j.id))),fe.getState().setSelectedElementId(null),c(),r(`Deleted ${N}. Use Undo to restore it.`,"info")}catch(D){const V=D instanceof Error?D.message:"Failed to delete timeline clip";r(V)}},[e,l,r,n,i,s,c]),M=d.useCallback(async(j,T,N)=>{const R=O.current;if(!R)throw new Error("No active project");const D=my(j);if(!D){r("Only image, video, and audio assets can be dropped onto the timeline.");return}const V=e||"index.html";try{const z=await vf(R,V),I=Number(Dn(T.start)),U=Number.isFinite(N)&&N!=null&&N>0?N:await Hy(R,j,D),K=Number(Dn(U)),H=vj(j,Lf(z)),q=Sj(V,j),X=V||"index.html",G=n.filter(Z=>(Z.sourceFile||e||"index.html")===X),F=Math.max(1,G.length+1),P=C8(z,kj({id:H,assetPath:q,kind:D,start:I,duration:K,track:T.track,zIndex:F,geometry:KS(z)}));s.current=Date.now(),await ol({projectId:R,label:"Add timeline asset",kind:"timeline",files:{[V]:P},readFile:async()=>z,writeFile:i,recordEdit:l}),c()}catch(z){const I=z instanceof Error?z.message:"Failed to drop asset onto timeline";r(I)}},[e,l,r,n,i,s,c]),E=d.useCallback(async(j,T)=>{const N=O.current;if(!N)return;const R=await g(j);if(R.length===0)return;const D=[];for(const z of R){const I=my(z),U=I?await Hy(N,z,I):0;D.push(Number(Dn(U)))}const V=wj(T??{start:0,track:0},D,n.filter(z=>(z.sourceFile||e||"index.html")===(e||"index.html")).map(z=>({start:z.start,duration:z.duration,track:z.track})));for(const[z,I]of R.entries())await M(I,V[z]??V[0],D[z])},[e,M,n,g]),$=d.useCallback(j=>{const T=Date.now();T-y.current<1500||(y.current=T,r("This clip can't be moved or resized from the timeline yet.","info"))},[r]),C=d.useCallback(async(j,T)=>{const N=O.current;if(!N)return;const R=new Set(["video","audio","img"]);if(j.timelineLocked||j.timingSource==="implicit"||j.compositionSrc||!R.has(j.tag)||!j.duration||!Number.isFinite(j.duration))return;if(T<=j.start||T>=j.start+j.duration){r("Playhead must be inside the clip to split.","error");return}const D=cg(j);if(!D){r("Clip is missing a patchable target.","error");return}const V=j.sourceFile||e||"index.html";try{const z=await vf(N,V),I=Lf(z),U=j.domId||"clip";let K=`${U}-split`,H=2;for(;I.includes(K);)K=`${U}-split-${H++}`;const q=await fetch(`/api/projects/${N}/file-mutations/split-element/${encodeURIComponent(V)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:D,splitTime:T,newId:K})});if(!q.ok)throw new Error("Split request failed");const X=await q.json();if(!X.ok||!X.changed){r("Failed to split clip — playhead may be outside the clip.","error");return}const G=typeof X.content=="string"?X.content:z;s.current=Date.now(),await ol({projectId:N,label:"Split timeline clip",kind:"timeline",files:{[V]:G},readFile:async()=>z,writeFile:i,recordEdit:l}),c();const F=Hl(j);r(`Split ${F} at ${T.toFixed(2)}s`,"info")}catch(z){const I=z instanceof Error?z.message:"Failed to split timeline clip";r(I,"error")}},[e,l,r,i,s,c]);return{handleTimelineElementMove:w,handleTimelineElementResize:A,handleTimelineElementDelete:k,handleTimelineElementSplit:C,handleTimelineAssetDrop:M,handleTimelineFileDrop:E,handleBlockedTimelineEdit:$}}function HN(t){try{const e=t==null?void 0:t.contentDocument;if(!e)return 0;let n=0;for(const r of e.body.querySelectorAll("*")){const i=parseInt(getComputedStyle(r).zIndex,10);Number.isFinite(i)&&i>n&&(n=i)}return n}catch{return 0}}function XN(t,e){const n=new Set(e);if(!n.has(t))return t;let r=2;for(;n.has(`${t}_${r}`);)r++;return`${t}_${r}`}async function Ap(t){const{projectId:e,blockName:n,activeCompPath:r,placement:i,visualPosition:l,timelineElements:s,readProjectFile:c,writeProjectFile:u,recordEdit:h,refreshFileTree:g,reloadPreview:O,showToast:x}=t;try{const y=await fetch(`/api/projects/${e}/registry/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blockName:n})});if(!y.ok){const k=await y.json().catch(()=>({error:"Install failed"}));return x(k.error||"Failed to install block"),null}const{written:v,block:w}=await y.json(),A=v.find(k=>k.endsWith(".html"))??v[0];if(!A)return x("Installed but no composition file was written"),null;if(w.type==="hyperframes:component"){const k=await c(A),M=k.replace(/background:\s*(?:#(?:0a0a0a|000000|000|0a0805)|rgba?\([^)]*\))\s*;/g,"background: transparent;");M!==k&&await u(A,M)}{const k=r||"index.html",M=await c(k),E=Lf(M),$=XN(w.name,E),C=k||"index.html",j=s.filter(L=>(L.sourceFile||r||"index.html")===C),T=w.type==="hyperframes:block",N=KS(M),R=t.currentTime??0,D=Number(Dn(i?i.start:R)),z=("duration"in w?w.duration:void 0)??j.reduce((L,B)=>Math.max(L,(B.start??0)+(B.duration??0)),10),I=(i==null?void 0:i.track)??(T?0:j.length>0?Math.max(...j.map(L=>L.track))+1:1),U=HN(t.previewIframe??null)+1,K=N.width,H=N.height,q=l?Math.round(l.left):0,X=l?Math.round(l.top):0,G=["<div",` data-composition-id="${$}"`,` data-composition-src="${A}"`,` data-start="${Dn(D)}"`,` data-duration="${Dn(z)}"`,` data-track-index="${I}"`,` data-width="${K}"`,` data-height="${H}"`,` style="position: absolute; left: ${q}px; top: ${X}px; width: ${K}px; height: ${H}px; z-index: ${U}"`,"></div>"].join(`
85
- `);let F=C8(M,G);const P=D+z,Z=F.match(/(<[^>]*data-composition-id="[^"]*"[^>]*data-duration=")([^"]*)(")/);if(Z){const L=parseFloat(Z[2]);P>L&&(F=F.replace(Z[0],`${Z[1]}${Dn(P)}${Z[3]}`))}await ol({projectId:e,label:`Add ${T?"block":"component"}: ${w.title}`,kind:"timeline",files:{[k]:F},readFile:async()=>M,writeFile:u,recordEdit:h})}return await g(),O(),{block:w,compositionPath:A}}catch(y){const v=y instanceof Error?y.message:"Failed to add block";return x(v),null}}const kw=["position","display","top","left","right","bottom","inset","width","height","gap","justify-content","align-items","flex-direction","font-size","font-style","font-weight","font-family","line-height","letter-spacing","text-align","text-transform","color","background-color","background-image","opacity","mix-blend-mode","border-radius","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","outline-color","overflow","clip-path","box-shadow","filter","backdrop-filter","z-index","transform","object-fit","object-position"];function si(t){return typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeType=="number"&&t.nodeType===1}function Ka(t){if(!t)return null;const e=t.trim();if(!e.endsWith("px"))return null;const n=parseFloat(e);return Number.isFinite(n)?n:null}function zN(t){const e=(t??"none").trim();if(!e||e==="none")return!0;const n=e.match(/^matrix\(([^)]+)\)$/i);if(n){const s=n[1].split(",").map(c=>Number.parseFloat(c.trim()));return s.length!==6||s.some(c=>!Number.isFinite(c))?!1:Math.abs(s[0]-1)<1e-4&&Math.abs(s[1])<1e-4&&Math.abs(s[2])<1e-4&&Math.abs(s[3]-1)<1e-4&&Math.abs(s[4])<1e-4&&Math.abs(s[5])<1e-4}const r=e.match(/^matrix3d\(([^)]+)\)$/i);if(!r)return!1;const i=r[1].split(",").map(s=>Number.parseFloat(s.trim()));if(i.length!==16||i.some(s=>!Number.isFinite(s)))return!1;const l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return i.every((s,c)=>Math.abs(s-l[c])<1e-4)}function FN(t){return["div","span","p","strong","h1","h2","h3","h4","h5","h6"].includes(t)}function Aw(t){var r;const e={},n=(r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t);if(!n)return e;for(const i of kw){const l=n.getPropertyValue(i);l&&(e[i]=l)}return e}function Mw(t){const e={};for(const n of kw){const r=t.style.getPropertyValue(n);r&&(e[n]=r)}return e}function BN(t){const e={};for(const n of t.attributes)n.name.startsWith("data-")&&(e[n.name.slice(5)]=n.value);return e}function ug(t,e){let n=t;for(;n;){const r=n;if(e.some(i=>r.hasAttribute(i)))return r;n=n.parentElement}return null}function Gl(t,e){const n=ug(t,["data-composition-file","data-composition-src"]),r=ug(t,["data-composition-id"]),i=(n==null?void 0:n.getAttribute("data-composition-file"))??(n==null?void 0:n.getAttribute("data-composition-src"))??(r==null?void 0:r.getAttribute("data-composition-file"))??(r==null?void 0:r.getAttribute("data-composition-src"))??e??"index.html";return{sourceFile:i,compositionPath:i}}function zy(t){const e=t==null?void 0:t.trim();if(!e)return;let n=e;try{n=new URL(e,"http://studio.local").pathname}catch{n=e}for(const r of["/preview/comp/","/preview/"]){const i=n.indexOf(r);if(i<0)continue;return n.slice(i+r.length).replace(/^\/+/,"")||e}return e}function Cw(t){const e=globalThis.CSS;if(typeof(e==null?void 0:e.escape)=="function")return e.escape(t);if(t==="-")return"\\-";let n="";for(let r=0;r<t.length;r+=1){const i=t[r]??"",l=i.charCodeAt(0);if(l===0){n+="�";continue}const s=l>=48&&l<=57,c=l>=65&&l<=90,u=l>=97&&l<=122,h=l>=1&&l<=31||l===127,g=r===0&&s,O=r===1&&t.startsWith("-")&&s;if(h||g||O){n+=`\\${l.toString(16)} `;continue}if(c||u||s||i==="-"||i==="_"||l>=128){n+=i;continue}n+=`\\${i}`}return n}function fg(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\a ").replace(/\r/g,"\\d ").replace(/\f/g,"\\c ")}function dg(t,e){try{return Array.from(t.querySelectorAll(e))}catch{return[]}}function j1(t){var e;return((e=t.replace(/\.html$/i,"").replace(/^compositions\//i,"").split("/").at(-1))==null?void 0:e.replace(/[-_]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()))??t}function Ew(t){if(t.id)return`#${Cw(t.id)}`;const e=t.getAttribute("data-composition-id");return e?`[data-composition-id="${fg(e)}"]`:Tw(t)}function Tw(t){const e=Array.from(t.classList).map(r=>r.trim()).filter(Boolean);if(e.length===0)return;const n=e.find(r=>r!=="clip"&&!r.startsWith("__hf-"))??e[0];return n?`.${Cw(n)}`:void 0}function $w(t,e,n,r,i){if(!(n!=null&&n.startsWith(".")))return;const s=dg(t,n).filter(c=>si(c)&&Gl(c,i).sourceFile===r).indexOf(e);return s>=0?s:void 0}function Ad(t){const e=t.ownerDocument.defaultView;if(!e)return!0;let n=t;for(;n;){const r=e.getComputedStyle(n);if(r.display==="none"||r.visibility==="hidden")return!1;const i=Number.parseFloat(r.opacity);if(Number.isFinite(i)&&i<=.01)return!1;n=n.parentElement}return!0}const Fy=new Set(["img","video","canvas","svg","audio"]);function YN(t){const e=t.tagName.toLowerCase();if(Fy.has(e))return!1;const{children:n}=t;if(n.length===0)return(t.textContent??"").trim().length===0;for(let r=0;r<n.length;r+=1){const i=n[r];if(si(i)&&(Fy.has(i.tagName.toLowerCase())||Ad(i)))return!1}return!0}function IN(t){const e=t.getBoundingClientRect();return!(e.width<=1||e.height<=1||!Ad(t)||YN(t))}const qN=new Set(["base","br","canvas","link","meta","script","source","style","template","track","wbr"]);function GN(t){var r;const e=t.tagName.toLowerCase();if(qN.has(e))return!1;const n=(r=t.ownerDocument.defaultView)==null?void 0:r.getComputedStyle(t);return!((n==null?void 0:n.display)==="none"||(n==null?void 0:n.visibility)==="hidden")}function Iu(t,e){if(!GN(t)||t.hasAttribute("data-composition-id"))return null;const n=Ew(t);if(!n)return null;const{sourceFile:r}=Gl(t,e);return{id:t.id||void 0,selector:n,selectorIndex:$w(t.ownerDocument,t,n,r,e),sourceFile:r}}function UN(t){let e=t;for(;e;){if(e.classList.contains("clip")&&(!(e.hasAttribute("data-composition-src")||e.hasAttribute("data-composition-file"))||e===t))return e;e=e.parentElement}return null}function WN(t,e){if(e.preferClipAncestor){const n=UN(t);if(n)return n}return t}function KN(t,e){return jw(t,e)[0]??null}function jw(t,e){const n=[];for(const l of t)si(l)&&IN(l)&&Iu(l,e.activeCompositionPath)&&n.push(l);if(n.length===0)return[];const r=[];let i=n[0];for(let l=1;l<n.length;l++){const s=n[l];i.contains(s)||r.push(i),i=s}return r.push(i),r}function or(t,e,n=null){if(e.id){const i=t.getElementById(e.id);if(si(i)&&(!e.sourceFile||Gl(i,n).sourceFile===e.sourceFile))return i}return e.selector?e.selector.startsWith(".")&&e.selectorIndex!=null?dg(t,e.selector).filter(l=>si(l)&&(!e.sourceFile||Gl(l,n).sourceFile===e.sourceFile))[e.selectorIndex]??null:dg(t,e.selector).filter(i=>si(i)&&(!e.sourceFile||Gl(i,n).sourceFile===e.sourceFile))[0]??null:null}function JN(t,e,n){var O;const r=typeof e.id=="string"?e.id:"",i=zy(e.compositionSrc)??((O=n.compIdToSrc)==null?void 0:O.get(r)),l=i??zy(e.sourceFile)??n.activeCompositionPath??"index.html",s=fg(r),c=i?fg(i):null,u=e.selector??(i?`[data-composition-src="${c}"],[data-composition-file="${c}"],[data-composition-id="${s}"]`:s?`[data-composition-id="${s}"]`:void 0);if(u||e.domId){const x=or(t,{id:e.domId??void 0,selector:u,selectorIndex:e.selectorIndex,sourceFile:l},n.activeCompositionPath);if(x)return x}const h=!!(e.domId||e.selector||i);if(n.isMasterView||h||!n.activeCompositionPath)return null;const g=t.querySelector("[data-composition-id]");return si(g)&&Gl(g,n.activeCompositionPath).sourceFile===l?g:null}function eR(t,e){return Array.from(t.children).filter(n=>si(n)&&Iu(n,e.activeCompositionPath)!==null)}function Mp(t){return FN(t.tagName.toLowerCase())&&t.children.length===0}function tR(t,e,n,r){return r==="self"||n===1?"Content":`Text ${e+1}`}function Cp(t,e,n,r){const i=t.tagName.toLowerCase();return{key:t.getAttribute("data-hf-text-key")??`${r}:${e}:${i}`,label:tR(i,e,n,r),value:t.textContent??"",tagName:i,attributes:Array.from(t.attributes).filter(s=>s.name!=="style").map(s=>({name:s.name,value:s.value})),inlineStyles:Mw(t),computedStyles:Aw(t),source:r}}function nR(t){const e=Array.from(t.children).filter(si).filter(Mp);if(e.length>0){if(Array.from(t.childNodes).some(r=>{var i;return r.nodeType===3&&((i=r.textContent)==null?void 0:i.trim())})){const r=[];let i=0;for(const l of t.childNodes)if(l.nodeType===3){const s=l.textContent??"";if(!s.trim())continue;r.push({key:`text-node:${i}`,label:`Text ${i+1}`,value:s,tagName:"#text",attributes:[],inlineStyles:{},computedStyles:{},source:"text-node"}),i++}else si(l)&&Mp(l)&&(r.push(Cp(l,i,e.length,"child")),i++);return r}return e.map((r,i)=>Cp(r,i,e.length,"child"))}return Mp(t)?[Cp(t,0,1,"self")]:[]}function By(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rR(t){const e=Object.entries(t.inlineStyles).filter(([,n])=>!!n);return e.length===0?"":e.map(([n,r])=>`${n}: ${r}`).join("; ")}function Yy(t){return t.filter(e=>e.source==="child"||e.source==="text-node").map(e=>{if(e.source==="text-node")return By(e.value);const n=[...e.attributes.filter(l=>l.name!=="data-hf-text-key"),{name:"data-hf-text-key",value:e.key}].map(l=>` ${l.name}="${l.value.replace(/"/g,"&quot;")}"`).join(""),r=rR(e),i=r?` style="${r.replace(/"/g,"&quot;")}"`:"";return`<${e.tagName}${n}${i}>${By(e.value)}</${e.tagName}>`}).join("")}function iR(t){var e,n,r,i;return{key:`child:new:${Date.now()}`,label:"Text",value:"New text",tagName:"span",attributes:[],inlineStyles:{"font-family":((e=t==null?void 0:t.computedStyles)==null?void 0:e["font-family"])??"inherit","font-size":((n=t==null?void 0:t.computedStyles)==null?void 0:n["font-size"])??"16px","font-weight":((r=t==null?void 0:t.computedStyles)==null?void 0:r["font-weight"])??"400",color:((i=t==null?void 0:t.computedStyles)==null?void 0:i.color)??"inherit"},computedStyles:{},source:"child"}}function aR(t){if(!t.selector||t.isInsideLockedComposition)return{canSelect:!t.isInsideLockedComposition,canEditStyles:!1,canMove:!1,canResize:!1,canApplyManualOffset:!1,canApplyManualSize:!1,canApplyManualRotation:!1,reasonIfDisabled:t.isInsideLockedComposition?"This element belongs to a locked composition.":"Studio could not resolve a stable patch target for this element."};if(t.existsInSource===!1)return{canSelect:!0,canEditStyles:!1,canMove:!1,canResize:!1,canApplyManualOffset:!1,canApplyManualSize:!1,canApplyManualRotation:!1,reasonIfDisabled:"This element is generated by a script and cannot be edited visually."};const e=t.computedStyles.position,n=Ka(t.inlineStyles.left)??Ka(t.computedStyles.left),r=Ka(t.inlineStyles.top)??Ka(t.computedStyles.top),i=Ka(t.inlineStyles.width)??Ka(t.computedStyles.width),l=Ka(t.inlineStyles.height)??Ka(t.computedStyles.height),s=!zN(t.computedStyles.transform),c=(e==="absolute"||e==="fixed")&&n!=null&&r!=null&&!s,u=c&&(i!=null||l!=null),h=!t.isCompositionHost,g=h,O=h,x=h,y=h?void 0:"Select an internal layer to transform it.";return t.isCompositionHost&&t.isMasterView?{canSelect:!0,canEditStyles:!1,canMove:c,canResize:u,canApplyManualOffset:g,canApplyManualSize:O,canApplyManualRotation:x,reasonIfDisabled:y}:{canSelect:!0,canEditStyles:!0,canMove:c,canResize:u,canApplyManualOffset:g,canApplyManualSize:O,canApplyManualRotation:x,reasonIfDisabled:y}}function Pw(t){const e=t.getAttribute("data-composition-id");if(e&&e!=="main")return j1(e);const n=t.getAttribute("data-composition-src")??t.getAttribute("data-composition-file");if(n)return j1(n);if(t.id)return j1(t.id);const r=Tw(t);if(r)return j1(r.replace(/^\./,""));const i=(t.textContent??"").trim().replace(/\s+/g," ");return i?i.length>40?`${i.slice(0,39)}…`:i:t.tagName.toLowerCase()}async function lR(t,e,n){try{const r=await fetch(`/api/projects/${t}/file-mutations/probe-element/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:n})});return r.ok?(await r.json()).exists!==!1:!0}catch{return!0}}async function Qw(t,e){var i;if(!t)return null;const n=t.ownerDocument;let r=WN(t,e);for(;r&&r!==n.body&&r!==n.documentElement;){const l=Ew(r);if(!l){r=r.parentElement;continue}const{sourceFile:s,compositionPath:c}=Gl(r,e.activeCompositionPath),u=$w(n,r,l,s,e.activeCompositionPath),h=r.getAttribute("data-composition-src")??r.getAttribute("data-composition-file")??void 0,g=Mw(r),O=Aw(r),x=nR(r),y=!!ug(r,["data-timeline-locked"]);let v;if(!e.skipSourceProbe&&e.projectId&&(r.id||l)){const k={};r.id&&(k.id=r.id),l&&(k.selector=l),u!=null&&(k.selectorIndex=u),v=await lR(e.projectId,s,k)}const w=aR({selector:l,tagName:r.tagName.toLowerCase(),className:r.className,inlineStyles:g,computedStyles:O,isCompositionHost:!!h,isInsideLockedComposition:y,isMasterView:e.isMasterView,existsInSource:v}),A=r.getBoundingClientRect();return{element:r,id:r.id||void 0,selector:l,selectorIndex:u,sourceFile:s,compositionPath:c,compositionSrc:h,isCompositionHost:!!h,isInsideLockedComposition:y,label:Pw(r),tagName:r.tagName.toLowerCase(),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:((i=r.textContent)==null?void 0:i.trim())||null,dataAttributes:BN(r),inlineStyles:g,computedStyles:O,textFields:x,capabilities:w}}return null}function Zw(t){const e=t.selectorIndex??0;return`${t.sourceFile}:${t.id??t.selector??"layer"}:${e}`}function sR(t,e,n=80){if(!t)return[];const r=[],i=(l,s)=>{if(r.length>=n)return;const c=Iu(l,e.activeCompositionPath);c&&r.push({key:Zw(c),element:l,label:Pw(l),tagName:l.tagName.toLowerCase(),depth:s,childCount:eR(l,e).length,id:c.id??void 0,selector:c.selector??void 0,selectorIndex:c.selectorIndex,sourceFile:c.sourceFile});const u=c?s+1:s;for(const h of Array.from(l.children))if(si(h)&&(i(h,u),r.length>=n))return};return i(t,0),r}function P1(t,e){return{type:"inline-style",property:t,value:e}}function Iy(t){return{type:"text-content",property:"text",value:t}}function ni(t){return[t.sourceFile||"index.html",t.id??"",t.selector??"",t.selectorIndex??""].join("|")}function z8(t){return t.textFields.length>0&&!t.isCompositionHost&&!t.isInsideLockedComposition}function oR(t){return`x=${Math.round(t.x)}, y=${Math.round(t.y)}, width=${Math.round(t.width)}, height=${Math.round(t.height)}`}function qy(t){return Object.entries(t).filter(([,e])=>e&&e!=="initial").map(([e,n])=>`${e}: ${n}`).join(`
86
- `)}function cR(t){return t.map(e=>`- key=${e.key}; tag=<${e.tagName}>; source=${e.source}; text=${JSON.stringify(e.value)}`).join(`
87
- `)}function uR({selection:t,currentTime:e,tagSnippet:n,selectionContext:r,userInstruction:i,sourceFilePath:l}){const s=(l==null?void 0:l.trim())||t.sourceFile,c=["## HyperFrames element edit request v1","Schema version: 1","",(i==null?void 0:i.trim())||"Edit this selected HyperFrames element.","",`Composition: ${t.compositionPath}`,`Playback time: ${yn(e)}`,`Source file: ${s}`,`DOM id: ${t.id??"(none)"}`,`Selector: ${t.selector??"(none)"}`,`Selector index: ${t.selectorIndex??0}`,`Tag: <${t.tagName}>`,`Bounds: ${oR(t.boundingBox)}`];t.textContent&&c.push(`Text: ${t.textContent}`);const u=r==null?void 0:r.trim();u&&c.push("","Selection context:",u);const h=cR(t.textFields);h&&c.push("","Text fields:",h);const g=qy(t.inlineStyles);g&&c.push("","Inline styles:",g);const O=qy(t.computedStyles);return O&&c.push("","Computed styles (browser-resolved):",O),n&&c.push("","Target HTML:",n),c.push("","Guardrails:","- Make a targeted change to this element only.","- Preserve the rest of the composition and its timing.","- Do not modify other elements' data-* attributes or positioning.","- Prefer existing inline styles or existing CSS rules for this element over adding unrelated selectors."),c.join(`
88
- `)}function fR(t,e){return[`Composition: ${t.compositionPath}`,`Source: ${t.sourceFile||e||"index.html"}`,`Selector: ${t.selector??"(none)"} Tag: <${t.tagName}>`,t.textContent?`Text: ${t.textContent}`:""].filter(Boolean).join(`
89
- `)}function dR({activeCompPath:t,projectDir:e,projectIdRef:n,currentTime:r,showToast:i,domEditSelectionRef:l,domEditSelection:s}){const[c,u]=d.useState(),[h,g]=d.useState(),[O,x]=d.useState(null),[y,v]=d.useState(!1),[w,A]=d.useState(!1),k=d.useRef(null),M=d.useCallback(async C=>{const j=n.current;if(!j)return;const T=C.sourceFile||t||"index.html";try{const N=await fetch(`/api/projects/${j}/files/${encodeURIComponent(T)}`);if(!N.ok)return;const D=(await N.json()).content,V=typeof D=="string"?LZ(D,C):void 0;u(z=>l.current!==C?z:V)}catch{}},[t,l,n]),E=d.useCallback(()=>{s&&(u(void 0),g(void 0),x(null),M(s),A(!0))},[s,M]),$=d.useCallback(async C=>{if(!s)return;const j=s.sourceFile||t||"index.html",T=c??s.element.outerHTML,N=uR({selection:s,currentTime:r,tagSnippet:T,selectionContext:h,userInstruction:C,sourceFilePath:NN(e,j)});if(!await cu(N)){i("Could not copy prompt to clipboard.","error");return}A(!1),g(void 0),x(null),k.current&&clearTimeout(k.current),v(!0),k.current=setTimeout(()=>v(!1),1600)},[t,h,c,r,s,e,i]);return d.useEffect(()=>{u(void 0),g(void 0),x(null),v(!1)},[s]),d.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]),{agentModalOpen:w,agentModalAnchorPoint:O,copiedAgentPrompt:y,agentPromptSelectionContext:h,setAgentModalOpen:A,setAgentPromptSelectionContext:g,setAgentModalAnchorPoint:x,preloadAgentPromptSnippet:M,handleAskAgent:E,handleAgentModalSubmit:$}}function Nw(t,e,n,r,i){const l=t.getBoundingClientRect(),s=e.querySelector("[data-composition-id]")??e.documentElement??null,c=s==null?void 0:s.getBoundingClientRect(),u=(c==null?void 0:c.width)||n.innerWidth,h=(c==null?void 0:c.height)||n.innerHeight;if(!u||!h)return null;const g=l.width/u,O=l.height/h;return{x:(r-l.left)/g,y:(i-l.top)/O,viewport:{width:u,height:h}}}const hR="__hf_studio_pointer_events_override__";function Rw(t){try{const e=t.createElement("style");return e.id=hR,e.textContent="* { pointer-events: auto !important; }",t.head.appendChild(e),e}catch{return null}}function Vw(t){try{t==null||t.remove()}catch{}}function mR(t,e,n,r){let i=null,l=null;try{i=t.contentDocument,l=t.contentWindow}catch{return null}if(!i||!l)return null;const s=Nw(t,i,l,e,n);if(!s)return null;const c=Rw(i);try{if(typeof i.elementsFromPoint=="function"){const h=KN(i.elementsFromPoint(s.x,s.y),{activeCompositionPath:r});if(h)return h}const u=X8(i.elementFromPoint(s.x,s.y));return!u||!Iu(u,r)||!Ad(u)?null:u}finally{Vw(c)}}function pR(t,e,n,r){let i=null,l=null;try{i=t.contentDocument,l=t.contentWindow}catch{return[]}if(!i||!l)return[];const s=Nw(t,i,l,e,n);if(!s)return[];const c=Rw(i);try{if(typeof i.elementsFromPoint=="function")return jw(i.elementsFromPoint(s.x,s.y),{activeCompositionPath:r});const u=X8(i.elementFromPoint(s.x,s.y));return!u||!Iu(u,r)?[]:Ad(u)?[u]:[]}finally{Vw(c)}}function Q1(t){return t&&(typeof t=="object"||typeof t=="function")?t:null}function Ep(t,e){const n=t?Reflect.get(t,e):null;if(typeof n=="function")try{n.call(t)}catch{}}function Tp(t,e){const n=t?Reflect.get(t,e):null;if(typeof n!="function")return null;try{const r=n.call(t);return typeof r=="number"&&Number.isFinite(r)?r:null}catch{return null}}function gR(t){const e=t==null?void 0:t.contentWindow;if(!e)return null;try{const n=Q1(Reflect.get(e,"__player")),r=Tp(n,"getTime");if(typeof(n?Reflect.get(n,"pause"):null)=="function")return Ep(n,"pause"),r;let l=null;const s=Q1(Reflect.get(e,"__timeline"));l=l??Tp(s,"time"),Ep(s,"pause");const c=Q1(Reflect.get(e,"__timelines"));if(c)for(const u of Object.values(c)){const h=Q1(u);l=l??Tp(h,"time"),Ep(h,"pause")}return l}catch{return null}}function Fl(t,e){return t===e?!0:!t||!e?!1:ni(t)===ni(e)}function Wc(t,e){return e?t.some(n=>Fl(n,e)):!1}function OR(t,e){return Wc(t,e)?t.filter(n=>!Fl(n,e)):[...t,e]}function xR(t,e){let n=!1;const r=t.map(i=>Fl(i,e)?(n=!0,e):i);return n?r:[...t,e]}function yR(t,e){return!e||Wc(t,e)?t:[e,...t]}function bR({projectId:t,activeCompPath:e,isMasterView:n,compIdToSrc:r,captionEditMode:i,previewIframeRef:l,timelineElements:s,setSelectedTimelineElementId:c,setRightCollapsed:u,setRightPanelTab:h,previewIframe:g,refreshKey:O,rightPanelTab:x}){const[y,v]=d.useState(null),[w,A]=d.useState([]),[k,M]=d.useState(null),E=d.useRef(y),$=d.useRef(w),C=d.useRef(k);E.current=y,$.current=w,C.current=k;const j=d.useCallback((H,q)=>{if(!H){E.current=null,$.current=[],v(null),A([]),c(null);return}if(!Mn){E.current=null,$.current=[],v(null),A([]),c(null);return}const X=!!(q!=null&&q.additive),G=E.current,F=$.current,P=X?yR(F,G):F,Z=Wc(P,H),L=q!=null&&q.preserveGroup?xR(P,H):X?OR(P,H):[H],B=q!=null&&q.preserveGroup?H:X&&Z?Fl(G,H)?L[0]??null:Wc(L,G)?G:L[0]??null:H;if(E.current=B,$.current=L,v(B),A(L),B){(q==null?void 0:q.revealPanel)!==!1&&(u(!1),x!=="layers"&&h("design"));const J=og(B,s);c(J);return}c(null)},[c,s,u,h,x]),T=d.useCallback(()=>{j(null,{revealPanel:!1})},[j]),N=d.useCallback((H,q)=>Qw(H,{activeCompositionPath:e,isMasterView:n,preferClipAncestor:q==null?void 0:q.preferClipAncestor,skipSourceProbe:q==null?void 0:q.skipSourceProbe,projectId:t}),[e,n,t]),R=d.useCallback(async(H,q,X)=>{const G=l.current;if(!G||i)return null;try{G.contentDocument&&Uc(G.contentDocument)}catch{}const F=mR(G,H,q,e);return F?N(F,{preferClipAncestor:X==null?void 0:X.preferClipAncestor,skipSourceProbe:X==null?void 0:X.skipSourceProbe}):null},[e,N,i,l]),D=d.useCallback(async(H,q)=>{const X=l.current;if(!X||i)return[];try{X.contentDocument&&Uc(X.contentDocument)}catch{}const G=pR(X,H,q,e),F=[];for(const P of G){const Z=await N(P,{skipSourceProbe:!0});Z&&F.push(Z)}return F},[e,N,i,l]),V=d.useCallback(H=>{Fl(C.current,H)||(C.current=H,M(H))},[]),z=d.useCallback(async H=>{const q=l.current;let X=null;try{X=(q==null?void 0:q.contentDocument)??null}catch{return null}if(!X)return null;Uc(X);const G=JN(X,H,{activeCompositionPath:e,compIdToSrc:r,isMasterView:n});return G?N(G,{preferClipAncestor:!1}):null},[e,N,r,n,l]),I=d.useCallback(async H=>{if(!Mn)return;if(!H){j(null,{revealPanel:!1});return}const q=await z(H);q&&j(q)},[j,z]),U=d.useCallback(async H=>{const q=l.current;let X=null;try{X=(q==null?void 0:q.contentDocument)??null}catch{return}if(!X)return;const G=or(X,H,e);if(!G)return;const F=await N(G);F&&j(F,{revealPanel:!1,preserveGroup:!0})},[e,j,N,l]),K=d.useCallback(async H=>{const q=l.current;let X=null;try{X=(q==null?void 0:q.contentDocument)??null}catch{return}if(!X)return;const G=[];for(const Z of H){const L=or(X,Z,e);if(!L)continue;const B=await N(L);B&&G.push(B)}if(G.length===0)return;const F=E.current,P=G.find(Z=>Fl(Z,F))??G[0]??null;E.current=P,$.current=G,v(P),A(G),c(P?og(P,s):null)},[e,N,c,s,l]);return d.useEffect(()=>{i&&V(null)},[i,V]),d.useEffect(()=>{V(null)},[e,t,g,O,V]),d.useEffect(()=>{if(!k)return;const H=Fl(k,y),q=Wc(w,k);!H&&!q||V(null)},[w,k,y,V]),d.useEffect(()=>{k&&(k.element.isConnected||V(null))},[k,V]),d.useEffect(()=>{i&&j(null,{revealPanel:!1})},[j,i]),d.useEffect(()=>{Mn||(V(null),j(null,{revealPanel:!1}),x!=="renders"&&h("renders"))},[j,x,V,h]),{domEditSelection:y,domEditGroupSelections:w,domEditHoverSelection:k,domEditSelectionRef:E,domEditGroupSelectionsRef:$,domEditHoverSelectionRef:C,setDomEditSelection:v,setDomEditGroupSelections:A,applyDomSelection:j,clearDomSelection:T,buildDomSelectionFromTarget:N,resolveDomSelectionFromPreviewPoint:R,resolveAllDomSelectionsFromPreviewPoint:D,updateDomEditHoverSelection:V,buildDomSelectionForTimelineElement:z,handleTimelineElementSelect:I,refreshDomEditSelectionFromPreview:U,refreshDomEditGroupSelectionsFromPreview:K}}const vR=6,SR=600;function wR({captionEditMode:t,compositionLoading:e,previewIframeRef:n,showToast:r,applyDomSelection:i,resolveDomSelectionFromPreviewPoint:l,resolveAllDomSelectionsFromPreviewPoint:s,updateDomEditHoverSelection:c,onClickToSource:u}){const h=d.useRef(null),g=d.useCallback(async(w,A)=>{if(!G2||t||e)return;const k=Date.now(),M=h.current,E=M?w.clientX-M.x:1/0,$=M?w.clientY-M.y:1/0,C=M!==null&&Math.sqrt(E*E+$*$)<vR&&k-M.at<SR;if(w.shiftKey){h.current=null;const N=await l(w.clientX,w.clientY,{preferClipAncestor:(A==null?void 0:A.preferClipAncestor)??!1});if(!N)return;w.preventDefault(),w.stopPropagation(),i(N,{additive:!0});return}if(C&&M){const N=(M.index+1)%M.candidates.length,R=M.candidates[N];h.current={...M,index:N,at:k},w.preventDefault(),w.stopPropagation(),i(R);return}const j=await l(w.clientX,w.clientY,{preferClipAncestor:(A==null?void 0:A.preferClipAncestor)??!1});if(!j){h.current=null,i(null,{revealPanel:!1});return}w.preventDefault(),w.stopPropagation(),i(j),!w.shiftKey&&w.altKey&&u&&u(j);const T=await s(w.clientX,w.clientY);h.current=T.length>1?{x:w.clientX,y:w.clientY,candidates:T,index:0,at:k}:null},[i,t,e,u,s,l]),O=d.useCallback(async(w,A)=>{if(!G2||t||e)return c(null),null;const k=await l(w.clientX,w.clientY,{preferClipAncestor:(A==null?void 0:A.preferClipAncestor)??!1,skipSourceProbe:!0});return c(k),k},[t,e,l,c]),x=d.useCallback(()=>{c(null)},[c]),y=d.useCallback(w=>{r(w.capabilities.reasonIfDisabled??"This element can't be adjusted directly from the preview.","info")},[r]),v=d.useCallback(()=>{const w=gR(n.current),A=fe.getState();A.setIsPlaying(!1),w!=null&&(A.setCurrentTime(w),zr.notify(w))},[n]);return{handlePreviewCanvasMouseDown:g,handlePreviewCanvasPointerMove:O,handlePreviewCanvasPointerLeave:x,handleBlockedDomMove:y,handleDomManualDragStart:v}}const Lw={inter:"inter",montserrat:"montserrat",outfit:"outfit",nunito:"nunito",oswald:"oswald","league gothic":"league-gothic","archivo black":"archivo-black","space mono":"space-mono","ibm plex mono":"ibm-plex-mono","jetbrains mono":"jetbrains-mono","eb garamond":"eb-garamond","playfair display":"playfair-display","source code pro":"source-code-pro","noto sans jp":"noto-sans-jp",roboto:"roboto","open sans":"open-sans",lato:"lato",poppins:"poppins","helvetica neue":"inter",helvetica:"inter",arial:"inter","helvetica bold":"inter",futura:"montserrat","din alternate":"montserrat","arial black":"montserrat","bebas neue":"league-gothic","courier new":"jetbrains-mono",courier:"jetbrains-mono",garamond:"eb-garamond","noto sans japanese":"noto-sans-jp","segoe ui":"roboto","sf pro":"inter","sf pro display":"inter","sf pro text":"inter","sf pro rounded":"inter",avenir:"inter","avenir next":"inter","lucida grande":"inter",geneva:"inter",optima:"inter",verdana:"inter",tahoma:"inter","trebuchet ms":"inter",calibri:"inter",candara:"inter",corbel:"inter","lucida sans":"inter","lucida sans unicode":"inter","noto sans":"inter","dejavu sans":"inter","liberation sans":"inter","sf mono":"jetbrains-mono",menlo:"jetbrains-mono",monaco:"jetbrains-mono",consolas:"jetbrains-mono","lucida console":"jetbrains-mono","lucida sans typewriter":"jetbrains-mono","andale mono":"jetbrains-mono","dejavu sans mono":"jetbrains-mono","liberation mono":"jetbrains-mono",georgia:"eb-garamond",palatino:"eb-garamond","palatino linotype":"eb-garamond","book antiqua":"eb-garamond",cambria:"eb-garamond",times:"eb-garamond","times new roman":"eb-garamond","dejavu serif":"eb-garamond","liberation serif":"eb-garamond"};new Set(Object.keys(Lw));const kR={inter:"Inter",montserrat:"Montserrat",outfit:"Outfit",nunito:"Nunito",oswald:"Oswald","league-gothic":"League Gothic","archivo-black":"Archivo Black","space-mono":"Space Mono","ibm-plex-mono":"IBM Plex Mono","jetbrains-mono":"JetBrains Mono","eb-garamond":"EB Garamond","playfair-display":"Playfair Display","source-code-pro":"Source Code Pro","noto-sans-jp":"Noto Sans JP",roboto:"Roboto","open-sans":"Open Sans",lato:"Lato",poppins:"Poppins"};function AR(t){const e=Lw[t.toLowerCase()];if(e)return kR[e]}const Gy=["ABeeZee","Abel","Abril Fatface","Alegreya","Alegreya Sans","Anton","Archivo","Archivo Black","Arimo","Assistant","Barlow","Barlow Condensed","Bebas Neue","Bitter","Bricolage Grotesque","Cabin","Cardo","Catamaran","Caveat","Chivo","Cormorant Garamond","Crimson Text","Dancing Script","DM Sans","DM Serif Display","Domine","EB Garamond","Exo 2","Figtree","Fira Code","Fira Sans","Fraunces","Fredoka","IBM Plex Mono","IBM Plex Sans","IBM Plex Serif","Inconsolata","Instrument Sans","Instrument Serif","Inter","JetBrains Mono","Josefin Sans","Jost","Kanit","Karla","Lato","League Gothic","Lexend","Libre Baskerville","Libre Franklin","Lora","Manrope","Merriweather","Montserrat","Mukta","Mulish","Newsreader","Noto Sans","Noto Sans JP","Noto Serif","Nunito","Nunito Sans","Open Sans","Oswald","Outfit","Overpass","Pacifico","Pathway Extreme","Permanent Marker","Playfair Display","Plus Jakarta Sans","Poppins","Prata","PT Sans","PT Serif","Public Sans","Quicksand","Raleway","Red Hat Display","Roboto","Roboto Condensed","Roboto Mono","Roboto Serif","Rubik","Schibsted Grotesk","Signika","Source Code Pro","Source Sans 3","Source Serif 4","Space Grotesk","Space Mono","Spectral","Sora","Syne","Teko","Titillium Web","Ubuntu","Ubuntu Mono","Unbounded","Urbanist","Varela Round","Work Sans","Young Serif","Zilla Slab"],hg=["TT Norms Pro","SF Pro Display","SF Pro Text","Avenir","Avenir Next","Menlo","Monaco"];function Uy(t){const e=AR(t);if(!(!e||e.toLowerCase()===t.toLowerCase()))return e}function _w(t){return`https://fonts.googleapis.com/css2?family=${encodeURIComponent(t.trim()).replace(/%20/g,"+")}:wght@300;400;500;600;700;800;900&display=swap`}const MR=new Set(["inherit","initial","revert","revert-layer","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-sans-serif","ui-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function CR(t){return(t.split(",")[0]??"").trim().replace(/^["']|["']$/g,"")}function ER(t){var e;return((e=t.split(",")[0])==null?void 0:e.trim().replace(/^["']|["']$/g,"").trim())??""}function Wy(t,e){const n=CR(e);if(!n||MR.has(n.toLowerCase()))return;const r=`studio-preview-google-font-${n.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(t.getElementById(r))return;const i=t.createElement("link");i.id=r,i.rel="stylesheet",i.href=_w(n),t.head.appendChild(i)}function Ky(t,e){const n=`studio-imported-font-${e.family.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(t.getElementById(n))return;const r=t.createElement("style");r.id=n,r.textContent=j8(e),t.head.appendChild(r)}function Jy(t,e,n){const r=j8(e,QN(n,e.path));if(t.includes(r))return t;const l=/<style\b[^>]*data-hf-studio-fonts=(["'])true\1[^>]*>([\s\S]*?)<\/style>/i.exec(t);if(l){const c=`${l[2].trim()}
90
- ${r}`.trim();return t.replace(l[0],`<style data-hf-studio-fonts="true">
91
- ${c}
92
- </style>`)}const s=`<style data-hf-studio-fonts="true">
93
- ${r}
94
- </style>`;return/<\/head>/i.test(t)?t.replace(/<\/head>/i,` ${s}
95
- </head>`):`${s}
96
- ${t}`}function TR({activeCompPath:t,previewIframeRef:e,domEditSelection:n,applyDomSelection:r,refreshDomEditSelectionFromPreview:i,buildDomSelectionFromTarget:l,persistDomEditOperations:s,resolveImportedFontAsset:c}){const u=d.useRef(0),h=d.useCallback(async(k,M)=>{if(!n||RN(k)||!n.capabilities.canEditStyles)return;const E=k==="font-family"?c(M):null,$=e.current,C=$==null?void 0:$.contentDocument;if(C){const N=or(C,n,t);N&&(N.style.setProperty(k,kp(k,M)),k==="font-family"&&(Wy(C,M),E&&Ky(C,E)),k==="background-image"&&_y(M)&&(N.style.setProperty("background-position","center"),N.style.setProperty("background-repeat","no-repeat"),N.style.setProperty("background-size","contain")))}const j=[P1(k,kp(k,M))];k==="background-image"&&_y(M)&&j.push(P1("background-position","center"),P1("background-repeat","no-repeat"),P1("background-size","contain"));const T=k!=="z-index";try{await s(n,j,{label:"Edit layer style",skipRefresh:T,prepareContent:E?(N,R)=>Jy(N,E,R):void 0})}catch(N){console.warn("[Studio] Style persist failed:",N instanceof Error?N.message:N)}i(n)},[t,n,s,i,c,e]),g=d.useCallback(async(k,M)=>{if(!n)return;const E=e.current,$=E==null?void 0:E.contentDocument;if($){const j=or($,n,t);j&&j.setAttribute(`data-${k}`,M)}const C={type:"attribute",property:k,value:M};try{await s(n,[C],{label:`Edit ${k.replace(/-/g," ")}`,coalesceKey:`attr:${k}:${ni(n)}`,skipRefresh:!1})}catch(j){console.warn("[Studio] Attribute persist failed:",j instanceof Error?j.message:j)}i(n)},[t,n,s,i,e]),O=d.useCallback(async(k,M)=>{if(!n)return;const E=e.current,$=E==null?void 0:E.contentDocument;if($){const j=or($,n,t);j&&(M===null||M===""||M==="false"?j.removeAttribute(k):j.setAttribute(k,M))}const C={type:"html-attribute",property:k,value:M};try{await s(n,[C],{label:`Edit ${k}`,coalesceKey:`html-attr:${k}:${ni(n)}`,skipRefresh:!1})}catch(j){console.warn("[Studio] HTML attribute persist failed:",j instanceof Error?j.message:j)}i(n)},[t,n,s,i,e]),x=d.useCallback(async(k,M)=>{if(!n||!z8(n))return;const E=u.current+1;u.current=E;const $=n.textFields.length>0?n.textFields.map(N=>N.key===M?{...N,value:k}:N):[],C=$.length>1||$.some(N=>N.source==="child")?Yy($):k,j=e.current,T=j==null?void 0:j.contentDocument;if(T){const N=or(T,n,t);N&&($.length>1||$.some(R=>R.source==="child")?N.innerHTML=C:N.textContent=k)}if(await s(n,[Iy(C)],{label:"Edit text",skipRefresh:!0,shouldSave:()=>u.current===E}),u.current===E&&T){const N=or(T,n,t);if(N){const R=await l(N);R&&r(R,{revealPanel:!1,preserveGroup:!0})}}},[t,r,l,n,s,e]),y=d.useCallback(async(k,M,E)=>{var N;const $=M.length>1||M.some(R=>R.source==="child")?Yy(M):((N=M[0])==null?void 0:N.value)??"",C=e.current,j=C==null?void 0:C.contentDocument;if(j){const R=or(j,k,t);R&&(M.length>1||M.some(D=>D.source==="child")?R.innerHTML=$:R.textContent=$)}const T=(E==null?void 0:E.importedFont)??null;if(await s(k,[Iy($)],{label:"Edit text",skipRefresh:!0,prepareContent:T?(R,D)=>Jy(R,T,D):void 0}),j){const R=or(j,k,t);if(R){const D=await l(R);D&&r(D,{revealPanel:!1,preserveGroup:!0})}}},[t,r,l,s,e]),v=d.useCallback(async(k,M,E)=>{var N;if(!n)return;const $=n.textFields.find(R=>R.key===k);if(!$)return;if($.source==="self"){await h(M,E);return}const C=kp(M,E),j=M==="font-family"?c(E):null;if(M==="font-family"){const R=(N=e.current)==null?void 0:N.contentDocument;R&&(Wy(R,C),j&&Ky(R,j))}const T=n.textFields.map(R=>R.key===k?{...R,inlineStyles:{...R.inlineStyles,[M]:C},computedStyles:{...R.computedStyles,[M]:C}}:R);await y(n,T,{importedFont:j})},[y,n,h,c,e]),w=d.useCallback(async k=>{if(!n||!n.textFields.some(j=>j.source==="child"))return null;const M=n.textFields.findIndex(j=>j.key===k),E=n.textFields[M>=0?M:0]??n.textFields[0],$=iR(E),C=[...n.textFields];return C.splice(M>=0?M+1:C.length,0,$),await y(n,C),$.key},[y,n]),A=d.useCallback(async k=>{if(!n)return;const M=n.textFields.find($=>$.key===k);if(!M)return;if(M.source==="self"){await x("",k);return}const E=n.textFields.filter($=>$.key!==k);await y(n,E)},[y,n,x]);return{handleDomStyleCommit:h,handleDomAttributeCommit:g,handleDomHtmlAttributeCommit:O,handleDomTextCommit:x,commitDomTextFields:y,handleDomTextFieldStyleCommit:v,handleDomAddTextField:w,handleDomRemoveTextField:A}}function Z1(t,e){if(!(t!=null&&t.contentWindow))return!1;let n;try{n=t.contentWindow.__timelines}catch{return!1}if(!n)return!1;const r=e.id;for(const i of Object.values(n))if(i!=null&&i.getChildren)try{for(const l of i.getChildren(!0))if(l.targets){for(const s of l.targets())if(s===e||r&&s.id===r)return!0}}catch{continue}return!1}function $R({activeCompPath:t,previewIframeRef:e,showToast:n,queueDomEditSave:r,writeProjectFile:i,domEditSaveTimestampRef:l,editHistory:s,fileTree:c,importedFontAssetsRef:u,projectId:h,projectIdRef:g,reloadPreview:O,domEditSelection:x,applyDomSelection:y,clearDomSelection:v,refreshDomEditSelectionFromPreview:w,buildDomSelectionFromTarget:A}){const k=d.useCallback(Z=>{const L=ER(Z);if(!L)return null;const B=u.current.find(te=>te.family.toLowerCase()===L.toLowerCase());if(B)return B;const J=c.find(te=>xf.test(te)&&go(te).toLowerCase()===L.toLowerCase());return J?{family:go(J),path:J,url:`/api/projects/${h}/preview/${J}`}:null},[c,h,u]),M=d.useRef(new Set),E=d.useCallback(async(Z,L,B)=>{const J=g.current;if(!J)throw new Error("No active project");if(B!=null&&B.shouldSave&&!B.shouldSave())return;const te=Z.sourceFile||t||"index.html",Y=await fetch(`/api/projects/${J}/files/${encodeURIComponent(te)}`);if(!Y.ok)throw new Error(`Failed to read ${te}`);const ae=(await Y.json()).content;if(typeof ae!="string")throw new Error(`Missing file contents for ${te}`);if(B!=null&&B.shouldSave&&!B.shouldSave())return;const ue={id:Z.id,selector:Z.selector,selectorIndex:Z.selectorIndex};l.current=Date.now();const me=await fetch(`/api/projects/${J}/file-mutations/patch-element/${encodeURIComponent(te)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:ue,operations:L})});if(!me.ok)throw new Error(`Failed to patch ${te}`);const ye=await me.json();if(!ye.changed){if(ye.matched===!1){const Ae=Z.selector??Z.id??"selection";M.current.has(Ae)||(M.current.add(Ae),Lt("save_skipped_unresolvable",{target_id:Z.id??void 0,target_selector:Z.selector??void 0,target_source_file:Z.sourceFile??void 0,composition:t??void 0}),console.warn(`[studio] Element not found in source: ${Ae}. This element may be generated at runtime and cannot be persisted.`))}return}const Oe=typeof ye.content=="string"?ye.content:ae;let Se=Oe;B!=null&&B.prepareContent&&(Se=B.prepareContent(Oe,te),Se!==Oe&&await i(te,Se)),await s.recordEdit({label:(B==null?void 0:B.label)??"Edit layer",kind:"manual",coalesceKey:B==null?void 0:B.coalesceKey,files:{[te]:{before:ae,after:Se}}}),B!=null&&B.skipRefresh||O()},[t,s,i,g,l,O]),{handleDomStyleCommit:$,handleDomAttributeCommit:C,handleDomHtmlAttributeCommit:j,handleDomTextCommit:T,commitDomTextFields:N,handleDomTextFieldStyleCommit:R,handleDomAddTextField:D,handleDomRemoveTextField:V}=TR({activeCompPath:t,previewIframeRef:e,domEditSelection:x,applyDomSelection:y,refreshDomEditSelectionFromPreview:w,buildDomSelectionFromTarget:A,persistDomEditOperations:E,resolveImportedFontAsset:k}),z=d.useCallback((Z,L,B)=>{r(async()=>{await E(Z,L,{label:B.label,coalesceKey:B.coalesceKey,skipRefresh:B.skipRefresh??!0})}).catch(J=>{const te=J instanceof Error?J.message:"Failed to save position";n(te),Lt("save_failure",{source:"dom_edit",label:B.label,error_message:te,target_id:Z.id??void 0,target_selector:Z.selector??void 0,target_source_file:Z.sourceFile??void 0})})},[E,r,n]),I=d.useCallback((Z,L)=>{Vf(Z.element,L),!Z1(e.current,Z.element)&&z(Z,Zy(Z.element),{label:"Move layer",coalesceKey:`path-offset:${ni(Z)}`})},[z,e]),U=d.useCallback(Z=>{if(Z.length===0)return;const L=Z.map(B=>ni(B.selection)).sort().join(":");for(const{selection:B,next:J}of Z)Vf(B.element,J),!Z1(e.current,B.element)&&z(B,Zy(B.element),{label:`Move ${Z.length} layers`,coalesceKey:`group-path-offset:${L}`})},[z,e]),K=d.useCallback((Z,L)=>{N8(Z.element,L),!Z1(e.current,Z.element)&&z(Z,eN(Z.element),{label:"Resize layer box",coalesceKey:`box-size:${ni(Z)}`})},[z,e]),H=d.useCallback((Z,L)=>{V8(Z.element,L),!Z1(e.current,Z.element)&&z(Z,iN(Z.element),{label:"Rotate layer",coalesceKey:`rotation:${ni(Z)}`})},[z,e]),q=d.useCallback(Z=>{const L=Z.element,B=[...KZ(L),...tN(L),...aN(L)];vw(L),TN(L),EN(L),z(Z,B,{label:"Reset layer edits",coalesceKey:`manual-reset:${ni(Z)}`,skipRefresh:!1})},[z]),X=d.useCallback((Z,L)=>{var te;Bj(Z.element,L);let B=null;try{B=((te=e.current)==null?void 0:te.contentDocument)??null}catch{}B&&K2(B);const J=sN(Z.element);z(Z,J,{label:"Set GSAP motion",coalesceKey:`motion:${ni(Z)}`}),w(Z)},[z,e,w]),G=d.useCallback(Z=>{var te,Y,re;const L=oN(Z.element);let B;try{B=(Y=(te=e.current)==null?void 0:te.contentWindow)==null?void 0:Y.gsap}catch{}Yj(Z.element,B);let J=null;try{J=((re=e.current)==null?void 0:re.contentDocument)??null}catch{}J&&K2(J),z(Z,L,{label:"Clear GSAP motion",coalesceKey:`motion:${ni(Z)}`,skipRefresh:!1}),w(Z)},[z,e,w]),F=d.useCallback(async Z=>{const L=g.current;if(!L)return;const B=Z.label||Z.id||Z.selector||Z.tagName,J=Z.sourceFile||t||"index.html";try{const te=await fetch(`/api/projects/${L}/files/${encodeURIComponent(J)}`);if(!te.ok)throw new Error(`Failed to read ${J}`);const re=(await te.json()).content;if(typeof re!="string")throw new Error(`Missing file contents for ${J}`);const ae=Z.id?{id:Z.id,selector:Z.selector,selectorIndex:Z.selectorIndex}:Z.selector?{selector:Z.selector,selectorIndex:Z.selectorIndex}:{};if(!ae.id&&!ae.selector)throw new Error("Selected element has no patchable target");l.current=Date.now();const ue=await fetch(`/api/projects/${L}/file-mutations/remove-element/${encodeURIComponent(J)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:ae})});if(!ue.ok)throw new Error(`Failed to delete element from ${J}`);const me=await ue.json(),ye=typeof me.content=="string"?me.content:re;await ol({projectId:L,label:"Delete element",kind:"timeline",files:{[J]:ye},readFile:async()=>re,writeFile:i,recordEdit:s.recordEdit}),v(),fe.getState().setSelectedElementId(null),O(),n(`Deleted ${B}. Use Undo to restore it.`,"info")}catch(te){const Y=te instanceof Error?te.message:"Failed to delete element";n(Y)}},[t,v,l,s.recordEdit,g,O,n,i]),P=d.useCallback(Z=>{var B;if(Z.length===0)return;const L=`z-reorder:${Z.map(J=>J.id??J.selector??"el").join(":")}`;for(let J=0;J<Z.length;J++){const te=Z[J];te.element.style.zIndex=String(te.zIndex);const Y=[{type:"inline-style",property:"z-index",value:String(te.zIndex)}];try{const re=(B=te.element.ownerDocument)==null?void 0:B.defaultView;re&&re.getComputedStyle(te.element).position==="static"&&(te.element.style.position="relative",Y.push({type:"inline-style",property:"position",value:"relative"}))}catch{}z({element:te.element,id:te.id??null,selector:te.selector,selectorIndex:te.selectorIndex,sourceFile:te.sourceFile},Y,{label:"Reorder layers",coalesceKey:L,skipRefresh:J<Z.length-1})}},[z]);return{resolveImportedFontAsset:k,handleDomStyleCommit:$,handleDomAttributeCommit:C,handleDomHtmlAttributeCommit:j,handleDomTextCommit:T,commitDomTextFields:N,handleDomTextFieldStyleCommit:R,handleDomAddTextField:D,handleDomRemoveTextField:V,handleDomPathOffsetCommit:I,handleDomGroupPathOffsetCommit:U,handleDomBoxSizeCommit:K,handleDomRotationCommit:H,handleDomManualEditsReset:q,handleDomMotionCommit:X,handleDomMotionClear:G,handleDomEditElementDelete:F,handleDomZIndexReorderCommit:P}}function jR(t){return t.includes("gsap.timeline")||t.includes("__timelines")||t.includes(".to(")||t.includes(".set(")}function PR(t){const e=[],n=t.querySelectorAll("script:not([src])");for(const r of n)jR(r.textContent||"")&&e.push(r);return e}function QR(t,e){var u,h;if(!t||!e)return!1;const n=t.contentWindow,r=t.contentDocument;if(!n||!r||!n.gsap||!n.__hfForceTimelineRebind)return!1;const i=PR(r);if(i.length!==1)return!1;const l=i[0],s=((h=(u=n.__player)==null?void 0:u.getTime)==null?void 0:h.call(u))??0,c=()=>{var x,y,v,w,A,k;const g=n.__timelines;if(g)for(const M of Object.keys(g)){try{(y=(x=g[M])==null?void 0:x.kill)==null||y.call(x)}catch{}delete g[M]}l.remove();const O=r.createElement("script");O.textContent=`(function(){${e}
97
- })();`,r.body.appendChild(O),(v=n.__hfForceTimelineRebind)==null||v.call(n),(A=(w=n.__player)==null?void 0:w.seek)==null||A.call(w,s),(k=n.__hfStudioManualEditsApply)==null||k.call(n)};try{return n.__hfSuppressSceneMutations?n.__hfSuppressSceneMutations(c):c(),!0}catch{return!1}}async function eb(t){const e=t.apply();try{await t.persist()}catch(n){t.rollback(e),console.warn("[optimistic] Mutation failed, rolled back:",n)}}const tb={opacity:1,x:0,y:0,scale:1,scaleX:1,scaleY:1,rotation:0,width:100,height:100};function ZR(t){if(t.id)return{selector:`#${t.id}`};if(t.selector)return{selector:t.selector};const e=t.element,n=e.ownerDocument,r=e.tagName.toLowerCase();let i=r,l=1;for(;n.getElementById(i);)l+=1,i=`${r}-${l}`;return e.setAttribute("id",i),{selector:`#${i}`,autoId:i}}async function NR(t,e,n){try{const r=await fetch(`/api/projects/${encodeURIComponent(t)}/gsap-mutations/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});return r.ok?await r.json():null}catch{return null}}function Dw(t,e){return`${t}#${e}`}function nb(t,e){if(e)return fe.getState().keyframeCache.get(Dw(t,e))}function N1(t,e,n){e&&fe.getState().setKeyframeCache(Dw(t,e),n)}const RR=150;function VR({projectIdRef:t,activeCompPath:e,previewIframeRef:n,editHistory:r,domEditSaveTimestampRef:i,reloadPreview:l,onCacheInvalidate:s}){const c=d.useRef(null),u=d.useRef(null),h=d.useCallback(async(N,R,D)=>{var U,K,H;const V=t.current;if(!V)return;const z=N.sourceFile||e||"index.html",I=await NR(V,z,R);if(I!=null&&I.ok){if(i.current=Date.now(),I.before!=null&&I.after!=null&&await r.recordEdit({label:D.label,kind:"manual",coalesceKey:D.coalesceKey,files:{[z]:{before:I.before,after:I.after}}}),s(),(U=I.parsed)!=null&&U.animations){const{setKeyframeCache:q}=fe.getState();for(const X of I.parsed.animations){if(!X.keyframes)continue;const G=(K=X.targetSelector.match(/^#([\w-]+)/))==null?void 0:K[1];G&&(q(`${z}#${G}`,X.keyframes),z!=="index.html"&&q(`index.html#${G}`,X.keyframes))}}D.skipReload||((H=D.beforeReload)==null||H.call(D),D.softReload&&I.scriptText&&QR(n.current,I.scriptText)||l())}},[t,e,n,r,i,l,s]),g=d.useCallback(()=>{const N=c.current;if(!N)return;c.current=null;const{selection:R,animationId:D,property:V,value:z}=N;h(R,{type:"update-property",animationId:D,property:V,value:z},{label:`Edit GSAP ${V}`,coalesceKey:`gsap:${D}:${V}`,softReload:!0})},[h]),O=d.useCallback((N,R,D,V)=>{c.current={selection:N,animationId:R,property:D,value:V},u.current&&clearTimeout(u.current),u.current=setTimeout(g,RR)},[g]);d.useEffect(()=>()=>{u.current&&clearTimeout(u.current),g()},[g]);const x=d.useCallback((N,R,D)=>{h(N,{type:"update-meta",animationId:R,updates:D},{label:"Edit GSAP animation",coalesceKey:`gsap:${R}:meta`})},[h]),y=d.useCallback((N,R)=>{h(N,{type:"delete",animationId:R},{label:"Delete GSAP animation"})},[h]),v=d.useCallback(async(N,R,D)=>{var X,G;const{selector:V,autoId:z}=ZR(N);if(z){const F=t.current,P=N.sourceFile||e||"index.html";if(!F)return;const Z=await fetch(`/api/projects/${encodeURIComponent(F)}/file-mutations/patch-element/${encodeURIComponent(P)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:{id:N.id,selector:N.selector,selectorIndex:N.selectorIndex},operations:[{type:"html-attribute",property:"id",value:z}]})});if(!Z.ok||!(await Z.json()).changed)return}const I=Number.parseFloat(((X=N.dataAttributes)==null?void 0:X.start)??"0")||0,U=Number.parseFloat(((G=N.dataAttributes)==null?void 0:G.duration)??"1")||1,K=Math.round(I*1e3)/1e3,H=Math.round(U*1e3)/1e3;await h(N,{type:"add",targetSelector:V,method:R,position:K,duration:R==="set"?void 0:H,ease:R==="set"?void 0:"power2.out",properties:{from:{opacity:0},to:{x:0,y:0,opacity:1},set:{opacity:1},fromTo:{x:0,y:0,opacity:1}}[R]??{opacity:1},fromProperties:R==="fromTo"?{opacity:0}:void 0},{label:`Add GSAP ${R} animation`})},[h,t,e]),w=d.useCallback((N,R,D)=>{var I;let V=tb[D]??0;const z=N.element;if(D==="width"||D==="height"){const U=z.getBoundingClientRect();V=Math.round(D==="width"?U.width:U.height)}else if(D==="opacity"||D==="autoAlpha"){const U=(I=z.ownerDocument.defaultView)==null?void 0:I.getComputedStyle(z);V=U&&Number.parseFloat(U.opacity)||1}h(N,{type:"add-property",animationId:R,property:D,defaultValue:V},{label:`Add GSAP ${D}`})},[h]),A=d.useCallback((N,R,D)=>{h(N,{type:"remove-property",animationId:R,property:D},{label:`Remove GSAP ${D}`})},[h]),k=d.useCallback((N,R,D,V)=>{h(N,{type:"update-from-property",animationId:R,property:D,value:V},{label:`Edit GSAP from-${D}`,coalesceKey:`gsap:${R}:from:${D}`})},[h]),M=d.useCallback((N,R,D)=>{const V=tb[D]??0;h(N,{type:"add-from-property",animationId:R,property:D,defaultValue:V},{label:`Add GSAP from-${D}`})},[h]),E=d.useCallback((N,R,D)=>{h(N,{type:"remove-from-property",animationId:R,property:D},{label:`Remove GSAP from-${D}`})},[h]),$=d.useCallback((N,R,D,V,z)=>{const I=N.sourceFile||e||"index.html",U=N.id;eb({apply:()=>{const K=nb(I,U);if(K){const H=[...K.keyframes,{percentage:D,properties:{[V]:z}}].sort((q,X)=>q.percentage-X.percentage);N1(I,U,{...K,keyframes:H})}return K},persist:()=>h(N,{type:"add-keyframe",animationId:R,percentage:D,properties:{[V]:z}},{label:`Add keyframe at ${D}%`,softReload:!0}),rollback:K=>{N1(I,U,K)}})},[h,e]),C=d.useCallback((N,R,D)=>{const V=N.sourceFile||e||"index.html",z=N.id;eb({apply:()=>{const I=nb(V,z);if(I){const U=I.keyframes.filter(K=>K.percentage!==D);N1(V,z,{...I,keyframes:U})}return I},persist:()=>h(N,{type:"remove-keyframe",animationId:R,percentage:D},{label:`Remove keyframe at ${D}%`,softReload:!0}),rollback:I=>{N1(V,z,I)}})},[h,e]),j=d.useCallback((N,R)=>{h(N,{type:"convert-to-keyframes",animationId:R},{label:"Convert to keyframes"})},[h]),T=d.useCallback((N,R)=>{h(N,{type:"remove-all-keyframes",animationId:R},{label:"Remove all keyframes",softReload:!0})},[h]);return{commitMutation:h,updateGsapProperty:O,updateGsapMeta:x,deleteGsapAnimation:y,addGsapAnimation:v,addGsapProperty:w,removeGsapProperty:A,updateGsapFromProperty:k,addGsapFromProperty:M,removeGsapFromProperty:E,addKeyframe:$,removeKeyframe:C,convertToKeyframes:j,removeAllKeyframes:T}}function LR(t,e,n){if(!(t!=null&&t.contentWindow))return null;let r;try{r=t.contentWindow.__timelines}catch{return null}if(!r)return null;const i=Object.keys(r)[0];if(!i)return null;const l=r[i];if(!(l!=null&&l.getChildren))return null;let s=null;try{s=t.contentDocument}catch{return null}if(!s)return null;const c=s.querySelector(e);if(!c)return null;for(const u of l.getChildren(!0)){if(!u.targets||!u.vars)continue;let h=!1;for(const v of u.targets())if(v===c||c.id&&v.id===c.id){h=!0;break}if(!h)continue;const g=u.vars;if(!g.keyframes||typeof g.keyframes!="object")continue;const O=g.keyframes,x=[];let y;for(const[v,w]of Object.entries(O)){if(v==="easeEach"){typeof w=="string"&&(y=w);continue}const A=v.match(/^(\d+(?:\.\d+)?)%$/);if(!A||!w||typeof w!="object")continue;const k=parseFloat(A[1]),M={};for(const[E,$]of Object.entries(w))E!=="ease"&&(typeof $=="number"?M[E]=Math.round($*1e3)/1e3:typeof $=="string"&&(M[E]=$));Object.keys(M).length>0&&x.push({percentage:k,properties:M})}if(x.length>0)return x.sort((v,w)=>v.percentage-w.percentage),{keyframes:x,easeEach:y}}return null}function _R(t){const e=new Map;if(!(t!=null&&t.contentWindow))return e;let n;try{n=t.contentWindow.__timelines}catch{return e}if(!n)return e;for(const r of Object.values(n))if(r!=null&&r.getChildren)for(const i of r.getChildren(!0)){if(!i.targets||!i.vars)continue;const l=i.vars;if(!l.keyframes||typeof l.keyframes!="object")continue;const s=l.keyframes,c=[];let u;for(const[h,g]of Object.entries(s)){if(h==="easeEach"){typeof g=="string"&&(u=g);continue}const O=h.match(/^(\d+(?:\.\d+)?)%$/);if(!O||!g||typeof g!="object")continue;const x=parseFloat(O[1]),y={};for(const[v,w]of Object.entries(g))v!=="ease"&&(typeof w=="number"?y[v]=Math.round(w*1e3)/1e3:typeof w=="string"&&(y[v]=w));Object.keys(y).length>0&&c.push({percentage:x,properties:y})}if(c.length!==0){c.sort((h,g)=>h.percentage-g.percentage);for(const h of i.targets()){const g=h.id;g&&!e.has(g)&&e.set(g,{keyframes:c,easeEach:u})}}}return e}function DR(t,e){if(!(t!=null&&t.contentWindow))return null;let n;try{n=t.contentWindow.gsap}catch{return null}if(!(n!=null&&n.getProperty))return null;let r=null;try{r=t.contentDocument}catch{return null}if(!r)return null;const i=r.querySelector(e);if(!i)return null;const l=Number(n.getProperty(i,"x"))||0,s=Number(n.getProperty(i,"y"))||0;return{x:l,y:s}}function rb(t){for(const e of t){if(e.keyframes&&e.keyframes.keyframes.some(l=>"x"in l.properties||"y"in l.properties))return e;const n=e.properties,r=e.fromProperties;if(e.method==="fromTo"){if("x"in n||"y"in n||r&&("x"in r||"y"in r))return e}else if("x"in n||"y"in n)return e}for(const e of t)if(e.keyframes)return e;return t[0]??null}function F8(t){return t.id?`#${t.id}`:t.selector?t.selector:null}function Md(t){var i,l;const e=Number.parseFloat(((i=t.dataAttributes)==null?void 0:i.start)??"0")||0,n=Number.parseFloat(((l=t.dataAttributes)==null?void 0:l.duration)??"1")||1,r=fe.getState().currentTime;return n>0?Math.max(0,Math.min(100,Math.round((r-e)/n*1e3)/10)):0}async function B8(t,e,n,r){var l;if(!t.hasUnresolvedKeyframes&&!t.hasUnresolvedSelector)return;if(t.hasUnresolvedSelector){const s=_R(e);if(s.size===0)return;const c=Array.from(s.entries()).map(([u,h])=>({selector:`#${u}`,keyframes:h.keyframes,easeEach:h.easeEach}));return await n(r,{type:"materialize-keyframes",animationId:t.id,keyframes:((l=s.get(r.id??""))==null?void 0:l.keyframes)??[],allElements:c},{label:"Unroll dynamic animations",skipReload:!0}),`${t.targetSelector}-to-0`}const i=LR(e,t.targetSelector);!i||i.keyframes.length===0||await n(r,{type:"materialize-keyframes",animationId:t.id,keyframes:i.keyframes,easeEach:i.easeEach},{label:"Materialize dynamic keyframes",skipReload:!0})}async function HR(t,e,n,r,i,l){let s=rb(n);if(!s&&l){const h=await l();s=rb(h)}if(!s)return!1;const c=F8(t);if(!c)return!1;const u=DR(r,c);return u?(await XR(t,s,e,u,r,c,{commitMutation:i}),!0):!1}async function XR(t,e,n,r,i,l,s){const c=t.element.style.getPropertyValue("--hf-studio-rotation"),h=-(Number.parseFloat(c)||0)*Math.PI/180,g=Math.cos(h),O=Math.sin(h),x=n.x*g-n.y*O,y=n.x*O+n.y*g,v=Math.round(r.x+x),w=Math.round(r.y+y),A=()=>vw(t.element);if(e.keyframes){const k=await B8(e,i,s.commitMutation,t),M=k?{...e,id:k}:e,E=xu(i,l,e);await zR(t,M,{...E,x:v,y:w},s,A)}else if(e.method==="from")await BR(t,e,n,s,A);else if(e.method==="fromTo")await YR(t,e,n,s,A);else{const k=xu(i,l,e);await FR(t,e,{...k,x:v,y:w},s,A)}}async function zR(t,e,n,r,i){const l=Md(t);await r.commitMutation(t,{type:"add-keyframe",animationId:e.id,percentage:l,properties:n},{label:`Move layer (keyframe ${l}%)`,softReload:!0,beforeReload:i})}async function FR(t,e,n,r,i){await r.commitMutation(t,{type:"convert-to-keyframes",animationId:e.id},{label:"Convert to keyframes for drag",skipReload:!0});const l=Md(t);await r.commitMutation(t,{type:"add-keyframe",animationId:e.id,percentage:l,properties:n},{label:`Move layer (keyframe ${l}%)`,softReload:!0,beforeReload:i})}async function BR(t,e,n,r,i){const l=Math.round(Number(e.properties.x??0)+n.x),s=Math.round(Number(e.properties.y??0)+n.y);await r.commitMutation(t,{type:"update-property",animationId:e.id,property:"x",value:l},{label:"Move layer (GSAP from x)",skipReload:!0}),await r.commitMutation(t,{type:"update-property",animationId:e.id,property:"y",value:s},{label:"Move layer (GSAP from y)",softReload:!0,beforeReload:i})}async function YR(t,e,n,r,i){if(e.fromProperties){const c=Math.round(Number(e.fromProperties.x??0)+n.x),u=Math.round(Number(e.fromProperties.y??0)+n.y);await r.commitMutation(t,{type:"update-from-property",animationId:e.id,property:"x",value:c},{label:"Move (GSAP from x)",skipReload:!0}),await r.commitMutation(t,{type:"update-from-property",animationId:e.id,property:"y",value:u},{label:"Move (GSAP from y)",skipReload:!0})}const l=Math.round(Number(e.properties.x??0)+n.x),s=Math.round(Number(e.properties.y??0)+n.y);await r.commitMutation(t,{type:"update-property",animationId:e.id,property:"x",value:l},{label:"Move (GSAP to x)",skipReload:!0}),await r.commitMutation(t,{type:"update-property",animationId:e.id,property:"y",value:s},{label:"Move (GSAP to y)",softReload:!0,beforeReload:i})}function _f(t,e,n){var r;if(!(t!=null&&t.contentWindow)||!e)return null;try{const i=t.contentWindow.gsap;if(!(i!=null&&i.getProperty))return null;const l=(r=t.contentDocument)==null?void 0:r.querySelector(e);if(!l)return null;const s=Number(i.getProperty(l,n));return Number.isFinite(s)?Math.round(s):null}catch{return null}}function xu(t,e,n){const r={};if(!(t!=null&&t.contentWindow))return r;let i;try{i=t.contentWindow.gsap}catch{return r}if(!(i!=null&&i.getProperty))return r;let l=null;try{l=t.contentDocument}catch{return r}const s=l==null?void 0:l.querySelector(e);if(!s)return r;const c=new Set;if(n.keyframes)for(const u of n.keyframes.keyframes)for(const h of Object.keys(u.properties))typeof u.properties[h]=="number"&&c.add(h);else for(const u of Object.keys(n.properties))c.add(u);for(const u of c){const h=Number(i.getProperty(s,u));Number.isFinite(h)&&(r[u]=Math.round(h))}return r}async function IR(t,e,n,r,i,l){let s=n.find(x=>"width"in x.properties||"height"in x.properties||x.keyframes);if(!s&&l&&(s=(await l()).find(y=>"width"in y.properties||"height"in y.properties||y.keyframes)),!s)return!1;const c=Md(t);if(s.hasUnresolvedKeyframes||s.hasUnresolvedSelector){const x=await B8(s,r,i,t);x&&(s={...s,id:x})}else s.keyframes||await i(t,{type:"convert-to-keyframes",animationId:s.id},{label:"Convert to keyframes for resize",skipReload:!0});const u=F8(t),h=u?xu(r,u,s):{},g={...h};if(!("width"in h)){const x=_f(r,u,"width");g.width=x??Math.round(e.width)}if(!("height"in h)){const x=_f(r,u,"height");g.height=x??Math.round(e.height)}const O={...h,width:Math.round(e.width),height:Math.round(e.height)};return await i(t,{type:"add-keyframe",animationId:s.id,percentage:c,properties:O,backfillDefaults:g},{label:`Resize (keyframe ${c}%)`,softReload:!0}),!0}async function qR(t,e,n,r,i,l){let s=n.find(v=>"rotation"in v.properties||v.keyframes);if(!s&&l&&(s=(await l()).find(w=>"rotation"in w.properties||w.keyframes)),!s)return!1;const c=F8(t);if(!c)return!1;let u=0;if(r!=null&&r.contentWindow)try{const v=r.contentWindow.gsap,w=r.contentDocument,A=w==null?void 0:w.querySelector(c);v!=null&&v.getProperty&&A&&(u=Number(v.getProperty(A,"rotation"))||0)}catch{}const h=Md(t),g=Math.round(u+e);if(s.hasUnresolvedKeyframes||s.hasUnresolvedSelector){const v=await B8(s,r,i,t);v&&(s={...s,id:v})}else s.keyframes||await i(t,{type:"convert-to-keyframes",animationId:s.id},{label:"Convert to keyframes for rotation",skipReload:!0});const O=xu(r,c,s),x={...O};"rotation"in O||(x.rotation=_f(r,c,"rotation")??0);const y={...O,rotation:g};return await i(t,{type:"add-keyframe",animationId:s.id,percentage:h,properties:y,backfillDefaults:x},{label:`Rotate (keyframe ${h}%)`,softReload:!0}),!0}function GR(t){const e=t.match(/^#([\w-]+)/);return e?e[1]:null}function mg(t,e){const n=new Set;return e.id&&n.add(`#${e.id}`),e.selector&&n.add(e.selector),n.size===0?[]:t.filter(r=>r.targetSelector.split(",").some(i=>n.has(i.trim())))}async function yu(t,e){try{const n=await fetch(`/api/projects/${encodeURIComponent(t)}/gsap-animations/${encodeURIComponent(e)}`);return n.ok?await n.json():null}catch{return null}}function UR(t,e,n,r,i){const[l,s]=d.useState([]),[c,u]=d.useState(!1),[h,g]=d.useState(!1),O=d.useRef("");d.useEffect(()=>{const k=`${t}:${e}:${r}`;if(k===O.current)return;if(O.current=k,!t){s([]),u(!1),g(!1);return}let M=!1;return yu(t,e).then(E=>{if(!M){if(!E){s([]),u(!1),g(!1);return}s(E.animations),u(E.multipleTimelines===!0),g(E.unsupportedTimelinePattern===!0)}}),()=>{M=!0}},[t,e,r]),d.useEffect(()=>{if(!t||!n||l.length>0)return;const k=setTimeout(()=>{yu(t,e).then(M=>{M&&M.animations.length>0&&s(M.animations)})},800);return()=>clearTimeout(k)},[t,e,n,l.length]);const x=(n==null?void 0:n.id)??null,y=(n==null?void 0:n.selector)??null,v=d.useMemo(()=>x||y?mg(l,{id:x,selector:y}):[],[l,x,y]),w=d.useMemo(()=>v,[v,l,i,x]),A=(n==null?void 0:n.id)??null;return d.useEffect(()=>{if(!A)return;const{setKeyframeCache:k}=fe.getState(),M=w.find(E=>E.keyframes);k(`${e}#${A}`,(M==null?void 0:M.keyframes)??void 0)},[A,e,w]),{animations:w,multipleTimelines:c,unsupportedTimelinePattern:h}}function WR(){const[t,e]=d.useState(0),n=d.useCallback(()=>e(r=>r+1),[]);return{version:t,bump:n}}function KR(t,e,n,r){const i=d.useRef(""),l=d.useRef("");d.useEffect(()=>{const s=`kf-cache:${t}:${e}:${n}`;if(s===i.current||(i.current=s,l.current="",!t))return;const c=e;yu(t,c).then(u=>{if(!u)return;const{setKeyframeCache:h}=fe.getState();for(const g of u.animations){const O=GR(g.targetSelector);!O||!g.keyframes||(h(`${c}#${O}`,g.keyframes),c!=="index.html"&&h(`index.html#${O}`,g.keyframes))}l.current=s})},[t,e,n]),d.useEffect(()=>{if(!t)return;const s=e;let c=0;const u=10,h=()=>l.current===`kf-cache:${t}:${s}:${n}`;if(h())return;const g=setInterval(()=>{c++,(h()||c>=u)&&clearInterval(g)},500);return()=>clearInterval(g)},[t,e,n,r])}function JR(t){var i,l;const e=Number.parseFloat(((i=t.dataAttributes)==null?void 0:i.start)??"0")||0,n=Number.parseFloat(((l=t.dataAttributes)==null?void 0:l.duration)??"1")||1,r=fe.getState().currentTime;return n>0?Math.max(0,Math.min(100,Math.round((r-e)/n*1e3)/10)):0}function eV(t){return t.id?`#${t.id}`:t.selector?t.selector:null}function tV(t){const{selectedGsapAnimations:e,gsapCommitMutation:n,addGsapAnimation:r,previewIframeRef:i,bumpGsapCache:l}=t;return d.useCallback(async(c,u,h)=>{if(!n)return;const g=i.current,O=eV(c),x=JR(c);let y=e.find(k=>k.keyframes)??e[0];if(!y){r(c,"to"),await new Promise(k=>setTimeout(k,500)),l();return}y.keyframes||await n(c,{type:"convert-to-keyframes",animationId:y.id},{label:"Convert to keyframes",skipReload:!0});const v=O?xu(g,O,y):{},w={...v};w[u]=h;const A={...v};if(!(u in v)&&O){const k=_f(g,O,u);k!=null&&(A[u]=k)}A[u]=h,await n(c,{type:"add-keyframe",animationId:y.id,percentage:x,properties:w,backfillDefaults:A},{label:`Edit ${u} (keyframe ${x}%)`,softReload:!0})},[e,n,r,i,l])}function nV({domEditSelection:t,updateGsapProperty:e,updateGsapMeta:n,deleteGsapAnimation:r,addGsapAnimation:i,addGsapProperty:l,removeGsapProperty:s,updateGsapFromProperty:c,addGsapFromProperty:u,removeGsapFromProperty:h,addKeyframe:g,removeKeyframe:O,convertToKeyframes:x,removeAllKeyframes:y,currentTime:v,handleDomManualEditsReset:w,selectedGsapAnimations:A}){const k=d.useCallback((K,H,q)=>{t&&e(t,K,H,q)},[t,e]),M=d.useCallback((K,H)=>{t&&n(t,K,H)},[t,n]),E=d.useCallback(K=>{t&&r(t,K)},[t,r]),$=d.useCallback(K=>{t&&(i(t,K,v),t.element.hasAttribute("data-hf-studio-path-offset")&&w(t))},[t,i,v,w]),C=d.useCallback((K,H)=>{t&&l(t,K,H)},[t,l]),j=d.useCallback((K,H)=>{t&&s(t,K,H)},[t,s]),T=d.useCallback((K,H,q)=>{t&&c(t,K,H,q)},[t,c]),N=d.useCallback((K,H)=>{t&&u(t,K,H)},[t,u]),R=d.useCallback((K,H)=>{t&&h(t,K,H)},[t,h]),D=d.useCallback((K,H,q,X)=>{t&&g(t,K,H,q,X)},[t,g]),V=d.useCallback((K,H)=>{t&&O(t,K,H)},[t,O]),z=d.useCallback(K=>{t&&x(t,K)},[t,x]),I=d.useCallback(K=>{t&&y(t,K)},[t,y]),U=d.useCallback(()=>{if(!t)return!1;const K=A.find(H=>H.keyframes);return K?(y(t,K.id),!0):!1},[t,A,y]);return{handleGsapUpdateProperty:k,handleGsapUpdateMeta:M,handleGsapDeleteAnimation:E,handleGsapAddAnimation:$,handleGsapAddProperty:C,handleGsapRemoveProperty:j,handleGsapUpdateFromProperty:T,handleGsapAddFromProperty:N,handleGsapRemoveFromProperty:R,handleGsapAddKeyframe:D,handleGsapRemoveKeyframe:V,handleGsapConvertToKeyframes:z,handleGsapRemoveAllKeyframes:I,handleResetSelectedElementKeyframes:U}}function rV({projectId:t,activeCompPath:e,isMasterView:n,compIdToSrc:r,captionEditMode:i,compositionLoading:l,previewIframeRef:s,timelineElements:c,currentTime:u,setSelectedTimelineElementId:h,setRightCollapsed:g,setRightPanelTab:O,showToast:x,refreshPreviewDocumentVersion:y,queueDomEditSave:v,readProjectFile:w,writeProjectFile:A,domEditSaveTimestampRef:k,editHistory:M,fileTree:E,importedFontAssetsRef:$,projectDir:C,projectIdRef:j,previewIframe:T,refreshKey:N,rightPanelTab:R,applyStudioManualEditsToPreviewRef:D,syncPreviewHistoryHotkey:V,reloadPreview:z,setRefreshKey:I,openSourceForSelection:U,selectSidebarTab:K,getSidebarTab:H}){const q=d.useCallback(pt=>{!U||!K||pt.sourceFile&&(K("code"),U(pt.sourceFile,{id:pt.id,selector:pt.selector,selectorIndex:pt.selectorIndex}))},[U,K]),{domEditSelection:X,domEditGroupSelections:G,domEditHoverSelection:F,domEditSelectionRef:P,applyDomSelection:Z,clearDomSelection:L,buildDomSelectionFromTarget:B,resolveDomSelectionFromPreviewPoint:J,resolveAllDomSelectionsFromPreviewPoint:te,updateDomEditHoverSelection:Y,buildDomSelectionForTimelineElement:re,handleTimelineElementSelect:ae,refreshDomEditSelectionFromPreview:ue}=bR({projectId:t,activeCompPath:e,isMasterView:n,compIdToSrc:r,captionEditMode:i,previewIframeRef:s,timelineElements:c,setSelectedTimelineElementId:h,setRightCollapsed:g,setRightPanelTab:O,previewIframe:T,refreshKey:N,rightPanelTab:R}),{agentModalOpen:me,agentModalAnchorPoint:ye,copiedAgentPrompt:Oe,agentPromptSelectionContext:Se,setAgentModalOpen:Ae,setAgentPromptSelectionContext:Me,setAgentModalAnchorPoint:Ve,handleAskAgent:Pe,handleAgentModalSubmit:ft}=dR({activeCompPath:e,projectDir:C,projectIdRef:j,currentTime:u,showToast:x,domEditSelectionRef:P,domEditSelection:X}),{handlePreviewCanvasMouseDown:yt,handlePreviewCanvasPointerMove:Le,handlePreviewCanvasPointerLeave:Ye,handleBlockedDomMove:_e,handleDomManualDragStart:be}=wR({captionEditMode:i,compositionLoading:l,previewIframeRef:s,showToast:x,applyDomSelection:Z,resolveDomSelectionFromPreviewPoint:J,resolveAllDomSelectionsFromPreviewPoint:te,updateDomEditHoverSelection:Y,onClickToSource:q});d.useEffect(()=>{if(!(X!=null&&X.id))return;const{selectedElementId:pt,elements:$t,setSelectedElementId:_t}=fe.getState(),Jn=$t.find(Kr=>Kr.domId===X.id||Kr.id===X.id),Wr=Jn?Jn.key??Jn.id:null;Wr&&Wr!==pt&&_t(Wr)},[X==null?void 0:X.id]);const{version:dt,bump:Ue}=WR(),bt=(X==null?void 0:X.sourceFile)||e||"index.html";KR(q2?t??null:null,bt,dt);const{animations:Re,multipleTimelines:on,unsupportedTimelinePattern:Rt}=UR(q2?t??null:null,bt,X?{id:X.id??null,selector:X.selector??null}:null,dt),{commitMutation:we,updateGsapProperty:ht,updateGsapMeta:Mt,deleteGsapAnimation:ot,addGsapAnimation:ve,addGsapProperty:ze,removeGsapProperty:Ze,updateGsapFromProperty:Be,addGsapFromProperty:vt,removeGsapFromProperty:lt,addKeyframe:Je,removeKeyframe:mt,convertToKeyframes:Tt,removeAllKeyframes:cn}=VR({projectIdRef:j,activeCompPath:e,previewIframeRef:s,editHistory:M,domEditSaveTimestampRef:k,reloadPreview:z,onCacheInvalidate:Ue}),{resolveImportedFontAsset:Bn,handleDomStyleCommit:bl,handleDomAttributeCommit:Sa,handleDomHtmlAttributeCommit:Zi,handleDomTextCommit:En,handleDomTextFieldStyleCommit:di,handleDomAddTextField:wa,handleDomRemoveTextField:ka,handleDomPathOffsetCommit:Ce,handleDomGroupPathOffsetCommit:rt,handleDomBoxSizeCommit:bn,handleDomRotationCommit:mr,handleDomManualEditsReset:vl,handleDomMotionCommit:jr,handleDomMotionClear:tn,handleDomEditElementDelete:vn,handleDomZIndexReorderCommit:Ur}=$R({activeCompPath:e,previewIframeRef:s,showToast:x,queueDomEditSave:v,writeProjectFile:A,domEditSaveTimestampRef:k,editHistory:M,fileTree:E,importedFontAssetsRef:$,projectId:t,projectIdRef:j,reloadPreview:z,domEditSelection:X,applyDomSelection:Z,clearDomSelection:L,refreshDomEditSelectionFromPreview:ue,buildDomSelectionFromTarget:B}),Aa=d.useCallback(async(pt,$t)=>{we&&await HR(pt,$t,Re,s.current,we,async()=>{const Jn=t;if(!Jn)return[];const Wr=await yu(Jn,bt);if(!Wr)return[];const Kr={id:pt.id??null,selector:pt.selector??null};return mg(Wr.animations,Kr)})||Ce(pt,$t)},[Ce,Re,we,s,t,bt]),Ni=d.useCallback(pt=>async()=>{const $t=t;if(!$t)return[];const _t=await yu($t,bt);return _t?mg(_t.animations,{id:pt.id??null,selector:pt.selector??null}):[]},[t,bt]),xe=d.useCallback(async(pt,$t)=>{we&&await IR(pt,$t,Re,s.current,we,Ni(pt))||bn(pt,$t)},[bn,Re,we,s,Ni]),Fe=d.useCallback(async(pt,$t)=>{we&&await qR(pt,$t.angle,Re,s.current,we,Ni(pt))||mr(pt,$t)},[mr,Re,we,s,Ni]),{handleGsapUpdateProperty:ct,handleGsapUpdateMeta:zt,handleGsapDeleteAnimation:Tn,handleGsapAddAnimation:Pr,handleGsapAddProperty:Kn,handleGsapRemoveProperty:Ma,handleGsapUpdateFromProperty:un,handleGsapAddFromProperty:r0,handleGsapRemoveFromProperty:i0,handleGsapAddKeyframe:Ri,handleGsapRemoveKeyframe:Ca,handleGsapConvertToKeyframes:Ud,handleGsapRemoveAllKeyframes:a0,handleResetSelectedElementKeyframes:l0}=nV({domEditSelection:X,updateGsapProperty:ht,updateGsapMeta:Mt,deleteGsapAnimation:ot,addGsapAnimation:ve,addGsapProperty:ze,removeGsapProperty:Ze,updateGsapFromProperty:Be,addGsapFromProperty:vt,removeGsapFromProperty:lt,addKeyframe:Je,removeKeyframe:mt,convertToKeyframes:Tt,removeAllKeyframes:cn,currentTime:u,handleDomManualEditsReset:vl,selectedGsapAnimations:Re}),Wd=tV({selectedGsapAnimations:Re,gsapCommitMutation:we,addGsapAnimation:(pt,$t,_t)=>ve(pt,$t,_t),previewIframeRef:s,bumpGsapCache:Ue});d.useEffect(()=>{if(!T)return;const pt=async()=>{if(!Mn||i)return;const _t=P.current;if(!_t)return;let Jn=null;try{Jn=T.contentDocument}catch{return}if(!Jn)return;Uc(Jn);const Wr=or(Jn,_t,e);if(!Wr){Z(null,{revealPanel:!1});return}const Kr=await B(Wr);Kr&&Z(Kr,{revealPanel:!1,preserveGroup:!0})};V(T),D.current(T),pt(),y();const $t=()=>{V(T),D.current(T),pt(),y()};return T.addEventListener("load",$t),()=>{T.removeEventListener("load",$t)}},[e,Z,B,i,P,T,y,V,D]);const Ea=d.useRef(U);return Ea.current=U,d.useEffect(()=>{!X||!Ea.current||!H||X.sourceFile&&H()==="code"&&Ea.current(X.sourceFile,{id:X.id,selector:X.selector,selectorIndex:X.selectorIndex})},[X,H]),{domEditSelection:X,domEditGroupSelections:G,domEditHoverSelection:F,agentModalOpen:me,agentModalAnchorPoint:ye,copiedAgentPrompt:Oe,agentPromptSelectionContext:Se,domEditSelectionRef:P,handleTimelineElementSelect:ae,handlePreviewCanvasMouseDown:yt,handlePreviewCanvasPointerMove:Le,handlePreviewCanvasPointerLeave:Ye,applyDomSelection:Z,clearDomSelection:L,handleDomStyleCommit:bl,handleDomAttributeCommit:Sa,handleDomHtmlAttributeCommit:Zi,handleDomPathOffsetCommit:Aa,handleDomGroupPathOffsetCommit:rt,handleDomZIndexReorderCommit:Ur,handleDomBoxSizeCommit:xe,handleDomRotationCommit:Fe,handleDomManualEditsReset:vl,handleDomMotionCommit:jr,handleDomMotionClear:tn,handleDomTextCommit:En,handleDomTextFieldStyleCommit:di,handleDomAddTextField:wa,handleDomRemoveTextField:ka,handleAskAgent:Pe,handleAgentModalSubmit:ft,handleBlockedDomMove:_e,handleDomManualDragStart:be,handleDomEditElementDelete:vn,buildDomSelectionFromTarget:B,buildDomSelectionForTimelineElement:re,updateDomEditHoverSelection:Y,resolveImportedFontAsset:Bn,setAgentModalOpen:Ae,setAgentPromptSelectionContext:Me,setAgentModalAnchorPoint:Ve,selectedGsapAnimations:Re,gsapMultipleTimelines:on,gsapUnsupportedTimelinePattern:Rt,handleGsapUpdateProperty:ct,handleGsapUpdateMeta:zt,handleGsapDeleteAnimation:Tn,handleGsapAddAnimation:Pr,handleGsapAddProperty:Kn,handleGsapRemoveProperty:Ma,handleGsapUpdateFromProperty:un,handleGsapAddFromProperty:r0,handleGsapRemoveFromProperty:i0,handleGsapAddKeyframe:Ri,handleGsapRemoveKeyframe:Ca,handleGsapConvertToKeyframes:Ud,handleGsapRemoveAllKeyframes:a0,handleResetSelectedElementKeyframes:l0,commitAnimatedProperty:Wd,invalidateGsapCache:Ue,previewIframeRef:s}}const Hw="Shift+T";function _l(t){var i,l,s;if(!t||typeof t!="object")return!1;const e=t,n=(i=e.tagName)==null?void 0:i.toLowerCase();if(n==="input"||n==="textarea"||n==="select"||e.isContentEditable)return!0;const r=(l=e.getAttribute)==null?void 0:l.call(e,"role");return r==="textbox"||r==="searchbox"||r==="combobox"?!0:!!((s=e.closest)!=null&&s.call(e,"input, textarea, select, [contenteditable='true'], [role='textbox'], .cm-editor"))}function iV(t){return t.metaKey||t.ctrlKey||t.altKey||!t.shiftKey||t.key.toLowerCase()!=="t"?!1:!_l(t.target)}function Xw(t){return`${t?"Hide":"Show"} timeline editor (${Hw})`}function ib(t){try{return(t==null?void 0:t.contentWindow)??null}catch{return null}}function ab(t,e,n){const r=t.key.toLowerCase();return r==="z"&&!t.shiftKey?(t.preventDefault(),e(),!0):r==="z"&&t.shiftKey||t.ctrlKey&&!t.metaKey&&r==="y"?(t.preventDefault(),n(),!0):!1}function aV({toggleTimelineVisibility:t,handleTimelineElementDelete:e,handleTimelineElementSplit:n,handleDomEditElementDelete:r,domEditSelectionRef:i,editHistory:l,readOptionalProjectFile:s,readProjectFile:c,writeProjectFile:u,domEditSaveTimestampRef:h,showToast:g,syncHistoryPreviewAfterApply:O,waitForPendingDomEditSaves:x,leftSidebarRef:y,handleCopy:v,handlePaste:w,handleCut:A,onResetKeyframes:k,onDeleteSelectedKeyframes:M,onAfterUndoRedo:E}){const $=d.useRef(null),C=d.useRef(void 0),j=d.useRef(null),T=d.useCallback(Y=>{iV(Y)&&(Y.preventDefault(),t())},[t]),N=d.useCallback(async Y=>Y===U2?s(Y):c(Y),[s,c]),R=d.useCallback(async(Y,re)=>{h.current=Date.now(),await u(Y,re)},[h,u]),D=d.useCallback(async()=>{await x();const Y=await l.undo({readFile:N,writeFile:R});if(!Y.ok&&Y.reason==="content-mismatch"){g("File changed outside Studio. Undo history was not applied.","info");return}Y.ok&&Y.label&&(E==null||E(),await O(Y.paths),g(`Undid ${Y.label}`,"info"))},[l,N,g,O,x,R,E]),V=d.useCallback(async()=>{await x();const Y=await l.redo({readFile:N,writeFile:R});if(!Y.ok&&Y.reason==="content-mismatch"){g("File changed outside Studio. Redo history was not applied.","info");return}Y.ok&&Y.label&&(E==null||E(),await O(Y.paths),g(`Redid ${Y.label}`,"info"))},[l,N,g,O,x,R,E]),z=d.useRef(T);z.current=T;const I=d.useRef(e);I.current=e;const U=d.useRef(n);U.current=n;const K=d.useRef(r);K.current=r;const H=d.useRef(D);H.current=D;const q=d.useRef(V);q.current=V;const X=d.useRef(v);X.current=v;const G=d.useRef(w);G.current=w;const F=d.useRef(A);F.current=A;const P=d.useRef(k);P.current=k;const Z=d.useRef(M);Z.current=M,C.current=Y=>{var re,ae,ue;if(z.current(Y),Y.metaKey||Y.ctrlKey){if(!Dy(Y.target)&&ab(Y,()=>void H.current(),()=>void q.current()))return;if(Y.key==="1"){Y.preventDefault(),(re=y.current)==null||re.selectTab("compositions");return}if(Y.key==="2"){Y.preventDefault(),(ae=y.current)==null||ae.selectTab("assets");return}const me=Y.key.toLowerCase();if(me==="c"&&!Y.shiftKey&&!Y.altKey&&!_l(Y.target)){X.current()&&Y.preventDefault();return}if(me==="v"&&!Y.shiftKey&&!Y.altKey&&!_l(Y.target)){Y.preventDefault(),G.current();return}if(me==="x"&&!Y.shiftKey&&!Y.altKey&&!_l(Y.target)){(!!fe.getState().selectedElementId||!!i.current)&&(Y.preventDefault(),F.current());return}}if(Y.key.toLowerCase()==="f"&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!Y.shiftKey&&!_l(Y.target)){Y.preventDefault(),document.fullscreenElement?document.exitFullscreen():(ue=document.querySelector("[data-studio-fullscreen-target]"))==null||ue.requestFullscreen();return}if(Y.key==="s"&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!_l(Y.target)){const{selectedElementId:me,elements:ye,currentTime:Oe}=fe.getState();if(me){const Se=ye.find(Ae=>(Ae.key??Ae.id)===me);if(Se&&["video","audio","img"].includes(Se.tag)&&Oe>Se.start&&Oe<Se.start+Se.duration){Y.preventDefault(),U.current(Se,Oe);return}}}if((Y.key==="Delete"||Y.key==="Backspace")&&!Y.metaKey&&!Y.ctrlKey&&!Y.altKey&&!_l(Y.target)){const{selectedKeyframes:me}=fe.getState();if(me.size>0){Z.current(),fe.getState().clearSelectedKeyframes(),Y.preventDefault();return}if(Y.key==="Backspace"){const{selectedElementId:Ae,keyframeCache:Me}=fe.getState();if(Ae&&Me.has(Ae)&&P.current()){Y.preventDefault();return}}const{selectedElementId:ye,elements:Oe}=fe.getState();if(ye){const Ae=Oe.find(Me=>(Me.key??Me.id)===ye);if(Ae){Y.preventDefault(),I.current(Ae);return}}const Se=i.current;Se&&(Y.preventDefault(),K.current(Se))}},d.useEffect(()=>{function Y(re){var ae;(ae=C.current)==null||ae.call(C,re)}return window.addEventListener("keydown",Y,!0),()=>window.removeEventListener("keydown",Y,!0)},[]);const L=d.useCallback(Y=>{var re;(re=C.current)==null||re.call(C,Y)},[]),B=d.useCallback(Y=>{const re=ib(Y);if($.current!==re){if($.current)try{$.current.removeEventListener("keydown",L)}catch{}$.current=re;try{re==null||re.addEventListener("keydown",L,!0)}catch{}}},[L]);d.useEffect(()=>()=>{if($.current){try{$.current.removeEventListener("keydown",L)}catch{}$.current=null}},[L]);const J=d.useCallback(Y=>{(Y.metaKey||Y.ctrlKey)&&(Dy(Y.target)||ab(Y,()=>void H.current(),()=>void q.current()))},[]),te=d.useCallback(Y=>{var ue;(ue=j.current)==null||ue.call(j),j.current=null;const re=ib(Y);let ae=null;try{ae=(Y==null?void 0:Y.contentDocument)??null}catch{ae=null}if(!(!re&&!ae)){try{re==null||re.addEventListener("keydown",J,!0)}catch{}ae==null||ae.addEventListener("keydown",J,!0),j.current=()=>{try{re==null||re.removeEventListener("keydown",J,!0)}catch{}ae==null||ae.removeEventListener("keydown",J,!0)}}},[J]);return d.useEffect(()=>()=>{var Y;(Y=j.current)==null||Y.call(j),j.current=null},[]),{handleUndo:D,handleRedo:V,syncPreviewTimelineHotkey:B,syncPreviewHistoryHotkey:te,handleTimelineToggleHotkey:T}}function lV(t,e,n,r){if(n){const s=r??0;let c=0,u=null;if(n.startsWith("#")){const h=n.slice(1);u=new RegExp(`<[a-z][^>]*\\bid="${h}"[^>]*>`,"gi")}else if(n.startsWith(".")){const h=n.slice(1);u=new RegExp(`<[a-z][^>]*\\bclass="[^"]*\\b${h}\\b[^"]*"[^>]*>`,"gi")}else if(n.startsWith("[")){const h=n.slice(1,-1);u=new RegExp(`<[a-z][^>]*\\b${h}[^>]*>`,"gi")}if(u){let h;for(;(h=u.exec(t))!==null;){if(c===s){const g=sV(t,h.index);if(g>0)return t.slice(0,g)+`
98
- `+e+t.slice(g)}c++}}}const l=/<[^>]*data-composition-id="[^"]+"[^>]*>/i.exec(t);if(l&&l.index!=null){const s=l.index+l[0].length;return t.slice(0,s)+e+t.slice(s)}return t+e}function sV(t,e){const n=t.indexOf(">",e);if(n<0)return-1;if(t[n-1]==="/")return n+1;const r=t.slice(e).match(/^<([a-z][a-z0-9]*)/i);if(!r)return-1;const i=r[1];let l=1,s=n+1;const c=new RegExp(`<${i}(?:\\s|>|/>)`,"gi"),u=new RegExp(`</${i}\\s*>`,"gi");for(;l>0&&s<t.length;){c.lastIndex=s,u.lastIndex=s;const h=c.exec(t),g=u.exec(t);if(!g)return-1;if(h&&h.index<g.index)t.lastIndexOf("/",t.indexOf(">",h.index))>h.index||l++,s=t.indexOf(">",h.index)+1;else{if(l--,l===0)return g.index+g[0].length;s=g.index+g[0].length}}return-1}function oV(t,e){const n=new Set(e);return t.replace(new RegExp('(?<=\\s)id="([^"]+)"',"g"),(r,i)=>{if(!n.has(i))return r;let l=2;for(;n.has(`${i}-${l}`);)l++;const s=`${i}-${l}`;return n.add(s),`id="${s}"`})}async function cV(t,e){const n=await fetch(`/api/projects/${t}/files/${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read ${e}`);const r=await n.json();if(typeof r.content!="string")throw new Error(`Missing file contents for ${e}`);return r.content}function uV(t,e){var i;let n=null;try{n=((i=t.current)==null?void 0:i.contentDocument)??null}catch{return null}if(!n)return null;let r=null;return e.id&&(r=n.getElementById(e.id)),!r&&e.selector&&(r=n.querySelectorAll(e.selector)[e.selectorIndex??0]??null),r&&"outerHTML"in r?r.outerHTML:null}function fV({projectId:t,activeCompPath:e,domEditSelectionRef:n,showToast:r,writeProjectFile:i,recordEdit:l,domEditSaveTimestampRef:s,reloadPreview:c,handleTimelineElementDelete:u,handleDomEditElementDelete:h,previewIframeRef:g}){const O=d.useRef(null),x=d.useRef(t);x.current=t;const y=d.useCallback(()=>{var E;const{selectedElementId:A,elements:k}=fe.getState();if(A){const $=k.find(N=>(N.key??N.id)===A);if(!$)return!1;const C=$.sourceFile||e||"index.html";let j=null;try{const N=(E=g.current)==null?void 0:E.contentDocument;if(N){let R=null;$.domId&&(R=N.getElementById($.domId)),!R&&$.selector&&(R=N.querySelectorAll($.selector)[$.selectorIndex??0]??null),R&&"outerHTML"in R&&(j=R.outerHTML)}}catch{}if(!j)return r("Unable to copy this element.","info"),!1;const T={kind:"timeline-clip",html:j,sourceFile:C};return O.current=T,r("Copied clip","info"),!0}const M=n.current;if(M){const $=uV(g,M);if(!$)return r("Unable to copy this element.","info"),!1;const C=M.sourceFile||e||"index.html",j={kind:"dom-element",html:$,sourceFile:C,originSelector:M.selector,originSelectorIndex:M.selectorIndex};return O.current=j,r("Copied element","info"),!0}return!1},[e,n,g,r]),v=d.useCallback(async()=>{const A=O.current;if(!A){r("Nothing to paste.","info");return}const k=x.current;if(!k)return;const M=e||"index.html";try{const E=await cV(k,M),$=Lf(E),C=oV(A.html,$);let j;if(A.kind==="timeline-clip"){const{currentTime:T}=fe.getState(),N=C.indexOf(">"),V=(N>=0?C.slice(0,N+1):C).replace(/data-start="[^"]*"/,`data-start="${Dn(T)}"`)+C.slice(N+1);j=C8(E,V)}else j=lV(E,C,A.originSelector,A.originSelectorIndex);s.current=Date.now(),await ol({projectId:k,label:A.kind==="timeline-clip"?"Paste clip":"Paste element",kind:"timeline",files:{[M]:j},readFile:async()=>E,writeFile:i,recordEdit:l}),c(),r(A.kind==="timeline-clip"?"Pasted clip":"Pasted element","info")}catch(E){const $=E instanceof Error?E.message:"Failed to paste";r($)}},[e,s,l,c,r,i]),w=d.useCallback(async()=>{if(!y())return!1;const{selectedElementId:k,elements:M}=fe.getState();if(k){const $=M.find(C=>(C.key??C.id)===k);if($)return await u($),!0}const E=n.current;return E&&await h(E),!0},[y,n,u,h]);return{handleCopy:y,handlePaste:v,handleCut:w}}const zw={fontFamily:"sans-serif",fontSize:48,fontWeight:700,fontStyle:"normal",textDecoration:"none",textTransform:"none",letterSpacing:0,lineHeight:1.2,color:"#ffffff",activeColor:"#ffffff",dimColor:"rgba(255, 255, 255, 0.3)",opacity:1,gradientFill:null,strokeWidth:0,strokeColor:"#000000",shadows:[],glow:null,x:0,y:0,rotation:0,scaleX:1,scaleY:1,skewX:0,skewY:0,transformOrigin:"center center",blendMode:"normal"},dV={backgroundColor:"transparent",backgroundOpacity:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,borderRadius:0,borderWidth:0,borderColor:"transparent",borderStyle:"solid",boxShadow:"none"},lb={preset:"fade",duration:.2,ease:"power2.out",stagger:0,staggerDirection:"start",intensity:1},zs={entrance:lb,highlight:null,exit:{...lb}};function hV(t,e){const{width:n,height:r,duration:i,wordsPerGroup:l=5}=e,s=new Map,c=new Map,u=[];for(let h=0;h<t.length;h+=l){const g=t.slice(h,h+l),O=`group-${h/l}`,x=[];g.forEach((v,w)=>{const A=`segment-${h+w}`,k={id:A,wordId:v.id??`w${h+w}`,text:v.text,start:v.start,end:v.end,groupIndex:w,style:{},animation:{}};s.set(A,k),x.push(A)});const y={id:O,segmentIds:x,style:{...zw},animation:{entrance:{...zs.entrance},highlight:zs.highlight,exit:{...zs.exit}},containerStyle:{...dV}};c.set(O,y),u.push(O)}return{width:n,height:r,duration:i,segments:s,groups:c,groupOrder:u,defaultAnimation:{entrance:{...zs.entrance},highlight:zs.highlight,exit:{...zs.exit}}}}function mV(t){const e=/(?:const|let|var)\s+(?:TRANSCRIPT|script)\s*=\s*(\[[\s\S]*?\]);/,n=t.match(e);if(!n)return[];const r=n[1];try{return gV(r)}catch{return[]}}function pV(t,e,n,r,i,l){const s=mV(n);if(s.length===0)return null;const c=t.querySelectorAll(".caption-group, .caption-line, .caption-block"),u=t.querySelectorAll(".word, .caption-word");let h=5;c.length>0&&u.length>0&&(h=Math.round(u.length/c.length),h<1&&(h=1));const g=hV(s,{width:r,height:i,duration:l,wordsPerGroup:h}),O=u.item(0),x=c.item(0),y=O??x;if(y){const v=e.getComputedStyle(y),w={},A=parseFloat(v.fontSize);!isNaN(A)&&A>0&&(w.fontSize=A);const k=v.fontWeight;if(k){const T=parseInt(k,10);w.fontWeight=isNaN(T)?k:T}const M=v.fontFamily;M&&(w.fontFamily=M);const E=v.color;E&&(w.color=E);const $=v.textTransform;($==="none"||$==="uppercase"||$==="lowercase"||$==="capitalize")&&(w.textTransform=$);const C=v.letterSpacing;if(C&&C!=="normal"){const T=parseFloat(C),N=w.fontSize??zw.fontSize;!isNaN(T)&&N>0&&(w.letterSpacing=T/N)}const j={};if(x){const T=e.getComputedStyle(x),N=T.backgroundColor;N&&N!=="rgba(0, 0, 0, 0)"&&N!=="transparent"&&(j.backgroundColor=N,j.backgroundOpacity=1);const R=parseFloat(T.borderRadius);!isNaN(R)&&R>0&&(j.borderRadius=R);const D=parseFloat(T.paddingTop),V=parseFloat(T.paddingRight),z=parseFloat(T.paddingBottom),I=parseFloat(T.paddingLeft);isNaN(D)||(j.paddingTop=D),isNaN(V)||(j.paddingRight=V),isNaN(z)||(j.paddingBottom=z),isNaN(I)||(j.paddingLeft=I)}for(const T of g.groupOrder){const N=g.groups.get(T);N&&(N.style={...N.style,...w},N.containerStyle={...N.containerStyle,...j})}}return g}function gV(t){let e;try{e=JSON.parse(t)}catch{let r=t;r=r.replace(/'((?:[^'\\]|\\.)*)'/g,(i,l)=>`"${l.replace(/\\'/g,"'").replace(/"/g,'\\"')}"`),r=r.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g,'$1"$2":'),r=r.replace(/,(\s*[}\]])/g,"$1"),e=JSON.parse(r)}if(!Array.isArray(e))return[];const n=[];for(const r of e)if(r!==null&&typeof r=="object"&&typeof r.text=="string"&&typeof r.start=="number"&&typeof r.end=="number"){const i=r;n.push({...typeof i.id=="string"?{id:i.id}:{},text:i.text,start:i.start,end:i.end})}return n}function OV({projectId:t,activeCompPath:e,compIdToSrc:n,captionEditMode:r,captionHasSelection:i,previewIframeRef:l,captionSync:s,setRightCollapsed:c}){d.useEffect(()=>{if(!t)return;let u=!1;const h=()=>{if(Ot.getState().isEditMode||u)return;const O=l.current;let x=null,y=null;try{x=(O==null?void 0:O.contentDocument)??null,y=(O==null?void 0:O.contentWindow)??null}catch{return}if(!x||!y||x.querySelectorAll(".caption-group").length===0)return;let w=null;const A=x.querySelectorAll("[data-composition-src], [data-composition-file]");for(const M of A){const E=M.getAttribute("data-composition-src")||M.getAttribute("data-composition-file");if(E&&E.includes("captions")){w=E;break}}if(!w){for(const[M,E]of n)if(M.includes("caption")||E.includes("caption")){w=E;break}}if(!w&&(e!=null&&e.includes("captions"))&&(w=e),!w){const M=x.querySelector('[data-composition-id*="caption"]');if(M){const E=M.getAttribute("data-composition-id")||"";w=n.get(E)||null}}if(!w)return;u=!0;const k=w;fetch(`/api/projects/${t}/files/${encodeURIComponent(k)}`).then(M=>M.json()).then(M=>{if(!M.content||!x||!y||Ot.getState().isEditMode)return;const E=x.querySelector("[data-composition-id]"),$=parseInt((E==null?void 0:E.getAttribute("data-width"))??"1920",10),C=parseInt((E==null?void 0:E.getAttribute("data-height"))??"1080",10),j=parseFloat((E==null?void 0:E.getAttribute("data-duration"))??"0"),T=pV(x,y,M.content,$,C,j);if(!T)return;const N=Ot.getState();N.setModel(T),N.setSourceFilePath(k),N.setEditMode(!0),s.loadOverrides()}).catch(()=>{}).finally(()=>{u=!1})},g=O=>{const x=O.data;(x==null?void 0:x.source)==="hf-preview"&&((x==null?void 0:x.type)==="state"||(x==null?void 0:x.type)==="timeline")&&h()};return window.addEventListener("message",g),h(),()=>{window.removeEventListener("message",g)}},[e,t,n,s,l]),d.useEffect(()=>{r&&c(!i)},[i,r,c])}const Fw=2,xV=1,sb=Fw+xV;function yV(t,e){const n=[],r=Math.floor(t.length/e);if(r===0)return Array(e).fill(0);for(let l=0;l<e;l++){let s=0;const c=l*r,u=Math.min(c+r,t.length);for(let h=c;h<u;h++){const g=Math.abs(t[h]??0);g>s&&(s=g)}n.push(s)}const i=Math.max(...n,.001);return n.map(l=>l/i)}function bV(t,e){let n=0;for(let l=0;l<t.length;l++)n=(n<<5)-n+t.charCodeAt(l)|0;n=Math.abs(n)||42;const r=()=>(n=n*16807%2147483647,(n&2147483647)/2147483647),i=[];for(let l=0;l<e;l++){const s=l/e,c=.3+.3*Math.sin(s*Math.PI*3.2)+.2*Math.sin(s*Math.PI*7.1);i.push(Math.max(.05,Math.min(1,c*(.4+.6*r()))))}return i}const ob=new Map,$p=new Map,vV=d.memo(function({audioUrl:e,waveformUrl:n,label:r,labelColor:i}){const l=d.useRef(null),s=d.useRef(null),c=d.useRef(null),u=n??e,[h,g]=d.useState(ob.get(u)??null);d.useEffect(()=>{if(h||!u)return;let y=!1,v=$p.get(u);return v||(v=(n?fetch(n).then(w=>w.json()).then(w=>{if(!Array.isArray(w.peaks))throw new Error("bad response");return w.peaks}):fetch(e).then(w=>w.arrayBuffer()).then(w=>{const A=new AudioContext;return A.decodeAudioData(w).finally(()=>A.close())}).then(w=>yV(w.getChannelData(0),4e3))).catch(()=>bV(u,4e3)).then(w=>(ob.set(u,w),w)).finally(()=>$p.delete(u)),$p.set(u,v)),v.then(w=>{y||g(w)}),()=>{y=!0}},[e,n,u,h]);const O=d.useCallback(()=>{const y=l.current,v=s.current;if(!y||!v||!h)return;const w=y.clientWidth||400,A=Math.min(Math.floor(w/sb),h.length);let k="";for(let M=0;M<A;M++){const E=Math.floor(M/A*h.length),$=h[E]??0,C=Math.max(3,Math.round($*100)),j=(.45+$*.4).toFixed(2);k+=`<div style="position:absolute;bottom:0;left:${M*sb}px;width:${Fw}px;height:${C}%;background:rgba(75,163,210,${j})"></div>`}v.innerHTML=k},[h]),x=d.useCallback(y=>{var v;(v=c.current)==null||v.disconnect(),l.current=y,y&&(O(),c.current=new ResizeObserver(()=>O()),c.current.observe(y))},[O]);return d.useEffect(()=>{O()},[O]),d.useEffect(()=>()=>{var y;(y=c.current)==null||y.disconnect()},[]),m.jsxs("div",{ref:x,className:"absolute inset-0 overflow-hidden",children:[m.jsx("div",{ref:s,className:"absolute left-0 right-0 bottom-0",style:{top:16}}),!h&&m.jsx("div",{className:"absolute left-0 right-0 bottom-0 animate-pulse",style:{top:16,background:"linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)"}}),m.jsx("div",{className:"absolute top-0 left-0 right-0 px-1.5 py-0.5 z-10",children:m.jsx("span",{className:"text-[9px] font-semibold truncate block leading-tight",style:{color:i,textShadow:"0 1px 3px rgba(0,0,0,0.9)"},children:r})})]})});function SV(t,e,n){try{const r=new URL(t,n),i=`/api/projects/${e}/preview/`;if(r.pathname.startsWith(i))return r.pathname.slice(i.length)}catch{}return t}function wV({projectIdRef:t,compIdToSrc:e,activePreviewUrl:n,effectiveTimelineDuration:r}){return d.useCallback((i,l)=>{var h;const s=t.current;if(!s)return null;let c=i.compositionSrc;if(c&&(c=SV(c,s,window.location.origin)),c&&e.size>0){const g=e.get(i.id)||e.get(c.replace(/^compositions\//,"").replace(/\.html$/,""));g&&(c=g)}if(c)return d.createElement(Op,{previewUrl:`/api/projects/${s}/preview/comp/${c}`,label:Hl(i),labelColor:l.label,seekTime:0,duration:i.duration});if(n&&i.duration>0)return d.createElement(Op,{previewUrl:n,label:Hl(i),labelColor:l.label,selector:i.selector,selectorIndex:i.selectorIndex,seekTime:i.start,duration:i.duration});const u=i.duration>0&&r>0&&i.duration<r*.92&&!/(backdrop|background|overlay|scrim|mask)/i.test(i.id);if(i.tag==="audio"){const g=`/api/projects/${s}/preview/`,O=(h=i.src)!=null&&h.startsWith("http")?i.src.indexOf(g):-1,x=i.src?O!==-1?decodeURIComponent(i.src.slice(O+g.length)):i.src.startsWith("http")?null:i.src:null,y=x?`/api/projects/${s}/preview/${x}`:i.src??"",v=x?`/api/projects/${s}/waveform/${x}`:void 0;return d.createElement(vV,{audioUrl:y,waveformUrl:v,label:Hl(i),labelColor:l.label})}if((i.tag==="video"||i.tag==="img")&&i.src){const g=i.src.startsWith("http")?i.src:`/api/projects/${s}/preview/${i.src}`;return d.createElement(lP,{videoSrc:g,label:Hl(i),labelColor:l.label,duration:i.duration})}return u?d.createElement(Op,{previewUrl:`/api/projects/${s}/preview`,label:Hl(i),labelColor:l.label,selector:i.selector,selectorIndex:i.selectorIndex,seekTime:i.start,duration:i.duration}):null},[t,e,n,r])}function kV(t){const[e,n]=d.useState(null),r=d.useRef([]),i=d.useCallback(()=>{r.current=[],n(null)},[]);return d.useEffect(()=>{if(!t)return;const l=()=>{try{const c=t.contentWindow;if(!c||c.__hfErrorCapture)return;c.__hfErrorCapture=!0;const u=c.console.error.bind(c.console);c.console.error=function(...h){u(...h);const g=h.map(O=>O instanceof Error?O.message:String(O)).join(" ");g.includes("favicon")||(r.current=[...r.current,{severity:"error",message:g}],n([...r.current]))},c.addEventListener("error",h=>{const g=h.message||String(h);r.current=[...r.current,{severity:"error",message:g}],n([...r.current])})}catch{}};l();const s=()=>{r.current=[],n(null),l()};return t.addEventListener("load",s),()=>t.removeEventListener("load",s)},[t]),{consoleErrors:e,setConsoleErrors:n,resetErrors:i}}const pg="#project/";function AV(t){try{return decodeURIComponent(t)}catch{return t}}function MV(t){if(!t)return new URLSearchParams;if(t instanceof URLSearchParams)return t;const e=new URLSearchParams;for(const[n,r]of Object.entries(t))!n||r==null||r===""||e.set(n,r);return e}function Bw(t){return encodeURIComponent(t)}function Yw(t,e){const n=MV(e).toString();return`${pg}${Bw(t)}${n?`?${n}`:""}`}function Iw(t){if(!t.startsWith(pg))return null;const e=t.slice(pg.length),n=e.indexOf("?"),r=n>=0?e.slice(0,n):e;if(!r||r.includes("/"))return null;const i=n>=0?e.slice(n+1):"";return{projectId:AV(r),params:new URLSearchParams(i)}}function cb(t){var e;return((e=Iw(t))==null?void 0:e.projectId)??null}function CV(t,e=""){const n=e&&!e.startsWith("/")?`/${e}`:e;return`/api/projects/${Bw(t)}${n}`}function qw(t){return t&&t!=="master"?t:"index.html"}function ub({projectId:t,compositionPath:e,currentTime:n,origin:r=window.location.origin}){const i=qw(e),l=new URL(CV(t,`/thumbnail/${encodeURIComponent(i)}`),r);return l.searchParams.set("t",Math.max(0,n).toFixed(3)),l.searchParams.set("format","png"),l.searchParams.set("v",String(Date.now())),l.toString()}function fb(t,e){var l;const r=((l=qw(t).split("/").pop())==null?void 0:l.replace(/\.html$/i,""))||"frame",i=Math.max(0,e).toFixed(3).replace(".","-");return`${r}-${i}s.png`}function EV({projectId:t,activeCompPath:e,showToast:n,waitForPendingDomEditSaves:r}){const[i,l]=d.useState(0);Xt(()=>(l(fe.getState().currentTime),zr.subscribe(l)));const s=d.useCallback(()=>{l(fe.getState().currentTime)},[]),c=d.useCallback(async g=>{if(t){g.preventDefault();try{const O=fe.getState().currentTime;l(O),await Promise.race([r(),new Promise((A,k)=>setTimeout(()=>k(new Error("Save queue timed out")),5e3))]);const x=ub({projectId:t,compositionPath:e,currentTime:O}),y=fb(e,O),v=new AbortController,w=setTimeout(()=>v.abort(),3e4);try{const A=await fetch(x,{cache:"no-store",signal:v.signal});if(clearTimeout(w),!A.ok){let $=`Capture failed (${A.status})`;try{const C=await A.json();C!=null&&C.error&&($=C.error)}catch{}throw new Error($)}const k=await A.blob(),M=URL.createObjectURL(k),E=document.createElement("a");E.href=M,E.download=y,document.body.appendChild(E),E.click(),E.remove(),setTimeout(()=>URL.revokeObjectURL(M),1e3)}catch(A){throw clearTimeout(w),A instanceof DOMException&&A.name==="AbortError"?new Error("Capture timed out — the server took too long to respond"):A}}catch(O){n(O instanceof Error?O.message:"Capture failed","error")}}},[e,t,n,r]),u=t?ub({projectId:t,compositionPath:e,currentTime:i}):"#",h=fb(e,i);return{captureFrameHref:u,captureFrameFilename:h,handleCaptureFrameClick:c,refreshCaptureFrameTime:s}}function TV(t){const[e,n]=d.useState(null),[r,i]=d.useState(!1),l=d.useCallback(async()=>{if(t){i(!0);try{const u=await(await fetch(`/api/projects/${t}/lint`)).json();n((u.findings??[]).map(h=>({severity:h.severity==="error"?"error":"warning",message:h.message??"",file:h.file,fixHint:h.fixHint})))}catch(c){const u=c instanceof Error?c.message:String(c);n([{severity:"error",message:`Failed to run lint: ${u}`}])}finally{i(!1)}}},[t]),s=d.useCallback(()=>n(null),[]);return{lintModal:e,linting:r,handleLint:l,closeLintModal:s}}function $V(){const[t,e]=d.useState(null);return Xt(()=>{const n=r=>{const i=r.data;if((i==null?void 0:i.source)!=="hf-preview"||(i==null?void 0:i.type)!=="stage-size")return;const{width:l,height:s}=i;!(l>0)||!(s>0)||e(c=>c&&c.width===l&&c.height===s?c:{width:l,height:s})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}),t}function jV(){const[t,e]=d.useState(null),n=d.useRef(null),r=d.useCallback((i,l="error")=>{n.current&&clearTimeout(n.current),e({message:i,tone:l}),n.current=setTimeout(()=>e(null),4e3)},[]);return Xt(()=>()=>{n.current&&clearTimeout(n.current)}),{appToast:t,showToast:r}}const Gw=["layers","design","motion","renders"];function PV(t,e={}){if(!t||!Gw.includes(t))return null;const n=e.inspectorPanelsEnabled??Mn,r=e.motionPanelEnabled??E8;return!n&&t!=="renders"?"renders":t==="motion"&&!r?"design":t}function QV(t,e){return!t||t==="index.html"?null:e.includes(t)?t:null}function db(t){return t==="1"?!0:t==="0"?!1:null}function Uw(t){if(t==null||t==="")return null;const e=Number(t);return Number.isFinite(e)?e:null}function ZV(t){return Gw.includes(t)?t:null}function NV(t){const e=t.get("selFile")||void 0,n=t.get("selId")||void 0,r=t.get("selSelector")||void 0,i=Uw(t.get("selIndex"));return!e&&!n&&!r?null:{sourceFile:e,id:n,selector:r,selectorIndex:i!=null?Math.max(0,Math.floor(i)):void 0}}function Ww(){return{activeCompPath:null,currentTime:null,rightPanelTab:null,rightCollapsed:null,timelineVisible:null,selection:null}}function RV(t){const e=Iw(t);if(!e)return Ww();const{params:n}=e;return{activeCompPath:n.get("comp")||null,currentTime:Uw(n.get("t")),rightPanelTab:PV(ZV(n.get("tab"))),rightCollapsed:db(n.get("rc")),timelineVisible:db(n.get("tv")),selection:NV(n)}}function VV(){return typeof window>"u"?Ww():RV(window.location.hash)}function hb(t,e){const n=new URLSearchParams;return n.set("v","1"),e.activeCompPath&&n.set("comp",e.activeCompPath),e.currentTime!=null&&Number.isFinite(e.currentTime)&&n.set("t",String(Math.max(0,Math.round(e.currentTime*1e3)/1e3))),e.rightPanelTab&&n.set("tab",e.rightPanelTab),e.rightCollapsed!=null&&n.set("rc",e.rightCollapsed?"1":"0"),e.timelineVisible!=null&&n.set("tv",e.timelineVisible?"1":"0"),e.selection&&(e.selection.sourceFile&&n.set("selFile",e.selection.sourceFile),e.selection.id&&n.set("selId",e.selection.id),e.selection.selector&&n.set("selSelector",e.selection.selector),typeof e.selection.selectorIndex=="number"&&n.set("selIndex",String(Math.max(0,Math.floor(e.selection.selectorIndex))))),Yw(t,n)}function LV(t){return!t||!t.id&&!t.selector?null:{sourceFile:t.sourceFile||void 0,id:t.id||void 0,selector:t.selector||void 0,selectorIndex:t.selectorIndex??void 0}}function mb(t){typeof window>"u"||window.location.hash!==t&&window.history.replaceState(null,"",t)}function _V({projectId:t,activeCompPath:e,currentTime:n,duration:r,isPlaying:i,compositionLoading:l,refreshKey:s,previewIframeRef:c,rightPanelTab:u,rightCollapsed:h,timelineVisible:g,activeCompPathHydrated:O,domEditSelection:x,buildDomSelectionFromTarget:y,applyDomSelection:v,initialState:w}){const A=d.useRef(w.currentTime==null),k=d.useRef(w.currentTime==null),M=d.useRef(w.selection==null),E=d.useRef(w.selection),$=d.useRef(w.currentTime),C=d.useCallback(()=>({activeCompPath:e,currentTime:$.current,rightPanelTab:u,rightCollapsed:h,timelineVisible:g,selection:M.current?LV(x):E.current}),[e,x,h,u,g]);d.useEffect(()=>{if(!t||A.current||l)return;const j=r>0?Ou(w.currentTime??0,0,r):Math.max(0,w.currentTime??0);fe.getState().requestSeek(j),$.current=j,A.current=!0},[t,l,r,w.currentTime]),d.useEffect(()=>{var D;if(!t||M.current||l||!A.current||w.currentTime!=null&&Math.abs(n-$.current)>.05)return;const T=E.current;if(!T){M.current=!0;return}let N=null;try{N=((D=c.current)==null?void 0:D.contentDocument)??null}catch{return}if(!N)return;const R=or(N,{sourceFile:T.sourceFile??"",id:T.id,selector:T.selector,selectorIndex:T.selectorIndex},e);if(!R){v(null,{revealPanel:!1}),M.current=!0,E.current=null;return}M.current=!0,E.current=null,y(R,{preferClipAncestor:!1}).then(V=>{v(V,{revealPanel:!1})})},[e,v,y,l,n,w.currentTime,c,t,s]),d.useEffect(()=>{if(k.current)return;const j=$.current;if(j==null){k.current=!0;return}Math.abs(n-j)>.05||(k.current=!0)},[n]),d.useEffect(()=>{if(!O||!A.current||!k.current||!t||i)return;const j=window.setTimeout(()=>{$.current=Ou(n,0,Math.max(0,r)),mb(hb(t,C()))},200);return()=>window.clearTimeout(j)},[O,C,n,r,i,t]),d.useEffect(()=>{O&&t&&mb(hb(t,C()))},[O,C,t])}function DV(t){return{projectId:t.projectId,activeCompPath:t.activeCompPath,setActiveCompPath:t.setActiveCompPath,showToast:t.showToast,previewIframeRef:t.previewIframeRef,captionEditMode:t.captionEditMode,compositionLoading:t.compositionLoading,refreshKey:t.refreshKey,setRefreshKey:t.setRefreshKey,currentTime:t.currentTime,timelineElements:t.timelineElements,isPlaying:t.isPlaying,editHistory:t.editHistory,handleUndo:t.handleUndo,handleRedo:t.handleRedo,renderQueue:t.renderQueue,compositionDimensions:t.compositionDimensions,waitForPendingDomEditSaves:t.waitForPendingDomEditSaves,handlePreviewIframeRef:t.handlePreviewIframeRef,refreshPreviewDocumentVersion:t.refreshPreviewDocumentVersion,timelineVisible:t.timelineVisible,toggleTimelineVisibility:t.toggleTimelineVisibility}}function HV(t,e,n,r){return d.useMemo(()=>{const i=Mn&&r?e7(r.element):null,l=Mn&&t==="layers",s=Mn&&t==="design",c=Mn&&E8&&t==="motion",u=l||s||c;return{selectedStudioMotion:i,layersPanelActive:l,designPanelActive:s,motionPanelActive:c,inspectorPanelActive:u,inspectorButtonActive:Mn&&!e&&u,shouldShowSelectedDomBounds:u&&!e&&!n}},[t,e,n,r])}function XV(t){const[e,n]=d.useState(!1),r=d.useRef(0),i=d.useCallback(u=>{u.dataTransfer.types.includes("Files")&&u.preventDefault()},[]),l=d.useCallback(u=>{u.dataTransfer.types.includes("Files")&&(u.preventDefault(),r.current++,n(!0))},[]),s=d.useCallback(()=>{r.current--,r.current===0&&n(!1)},[]),c=d.useCallback(u=>{r.current=0,n(!1),!u.defaultPrevented&&(u.preventDefault(),u.dataTransfer.files.length&&t(u.dataTransfer.files))},[t]);return{active:e,onDragOver:i,onDragEnter:l,onDragLeave:s,onDrop:c}}function zV(t){if(!t||typeof window>"u")return;const e=480,n=270,r=16,i=Ou(t.x,r+e/2,window.innerWidth-r-e/2),l=Ou(t.y+12,r,window.innerHeight-r-n);return{left:i,top:l,transform:"translateX(-50%)"}}function FV({selectionLabel:t,contextPreview:e,anchorPoint:n=null,onSubmit:r,onClose:i}){const[l,s]=d.useState(""),c=d.useRef(null),u=zV(n);Xt(()=>{requestAnimationFrame(()=>{var g;return(g=c.current)==null?void 0:g.focus()})});const h=()=>{l.trim()&&r(l.trim())};return m.jsx("div",{className:n?"fixed inset-0 z-[100] bg-black/60 backdrop-blur-sm":"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:i,children:m.jsxs("div",{className:`w-[480px] rounded-2xl border border-neutral-800 bg-neutral-950 shadow-2xl ${n?"fixed":""}`,style:u,onClick:g=>g.stopPropagation(),children:[m.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-neutral-800/60",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-sm font-medium text-neutral-200",children:"Copy prompt to AI agent"}),m.jsx("p",{className:"text-xs text-neutral-500 mt-0.5",children:t.length>50?`${t.slice(0,49)}…`:t})]}),m.jsx("button",{className:"p-1 rounded-md text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800/50",onClick:i,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),m.jsxs("div",{className:"px-5 py-4 space-y-3",children:[m.jsx("textarea",{ref:c,className:"w-full h-24 px-3 py-2 rounded-lg border border-neutral-800 bg-neutral-900/60 text-sm text-neutral-200 placeholder-neutral-600 resize-none focus:outline-none focus:border-studio-accent/60 focus:ring-1 focus:ring-studio-accent/30",placeholder:"Describe what you want to change…",value:l,onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&h(),g.key==="Escape"&&i()}}),e&&m.jsxs("details",{className:"group",children:[m.jsx("summary",{className:"text-[11px] text-neutral-500 cursor-pointer select-none hover:text-neutral-400",children:"Context included in prompt"}),m.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-lg bg-neutral-900/80 px-3 py-2 text-[11px] leading-relaxed text-neutral-500 whitespace-pre-wrap break-words border border-neutral-800/50",children:e})]})]}),m.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-neutral-800/60",children:[m.jsxs("span",{className:"text-[11px] text-neutral-600",children:[navigator.platform.includes("Mac")?"⌘":"Ctrl","+Enter to copy"]}),m.jsx("button",{className:"px-4 py-1.5 rounded-lg bg-studio-accent/90 text-xs font-medium text-neutral-950 hover:bg-studio-accent disabled:opacity-40 disabled:cursor-not-allowed",disabled:!l.trim(),onClick:h,children:"Copy prompt"})]})]})})}function BV(){return m.jsx("div",{className:"absolute inset-0 z-[90] flex items-center justify-center bg-black/50 backdrop-blur-sm pointer-events-none",children:m.jsxs("div",{className:"flex flex-col items-center gap-3 px-8 py-6 rounded-xl border-2 border-dashed border-studio-accent/60 bg-studio-accent/[0.06]",children:[m.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-studio-accent",children:[m.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),m.jsx("span",{className:"text-sm font-medium text-studio-accent",children:"Drop files to import into project"})]})})}const en=t=>({title:n,...r})=>m.jsx(t,{alt:n,"aria-label":n,"aria-hidden":n?void 0:!0,...r}),YV=en(PQ),IV=en(ZQ),Kw=en(RQ),Jw=en(WQ),Df=en(cZ),qV=en(jQ),GV=en(EQ),UV=en(iZ),WV=en(aZ),Y8=en(U7),KV=en(oZ),pb=en(fZ),Cd=en(mZ),I8=en(nZ),JV=en($Q),eL=en(m7),tL=en(QQ),q8=en(MQ),nL=en(TQ),rL=en(AQ),iL=en(JQ),aL=en(sZ),e9=d.createContext(null);function No(){const t=d.useContext(e9);if(!t)throw new Error("useStudioContext must be used within StudioProvider");return t}function lL({value:t,children:e}){const{projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:l,previewIframeRef:s,captionEditMode:c,compositionLoading:u,refreshKey:h,setRefreshKey:g,currentTime:O,timelineElements:x,isPlaying:y,editHistory:v,handleUndo:w,handleRedo:A,renderQueue:k,compositionDimensions:M,waitForPendingDomEditSaves:E,handlePreviewIframeRef:$,refreshPreviewDocumentVersion:C,timelineVisible:j,toggleTimelineVisibility:T}=t,N=d.useMemo(()=>({projectId:n,activeCompPath:r,setActiveCompPath:i,showToast:l,previewIframeRef:s,captionEditMode:c,compositionLoading:u,refreshKey:h,setRefreshKey:g,currentTime:O,timelineElements:x,isPlaying:y,editHistory:v,handleUndo:w,handleRedo:A,renderQueue:k,compositionDimensions:M,waitForPendingDomEditSaves:E,handlePreviewIframeRef:$,refreshPreviewDocumentVersion:C,timelineVisible:j,toggleTimelineVisibility:T}),[n,r,c,u,h,O,y,M,j,v,x,k,i,l,s,g,w,A,E,$,C,T]);return m.jsx(e9,{value:N,children:e})}const t9=d.createContext(null);function G8(){const t=d.useContext(t9);if(!t)throw new Error("usePanelLayoutContext must be used within PanelLayoutProvider");return t}function sL({value:{leftWidth:t,setLeftWidth:e,rightWidth:n,leftCollapsed:r,setLeftCollapsed:i,rightCollapsed:l,setRightCollapsed:s,rightPanelTab:c,setRightPanelTab:u,toggleLeftSidebar:h,handlePanelResizeStart:g,handlePanelResizeMove:O,handlePanelResizeEnd:x},children:y}){const v=d.useMemo(()=>({leftWidth:t,setLeftWidth:e,rightWidth:n,leftCollapsed:r,setLeftCollapsed:i,rightCollapsed:l,setRightCollapsed:s,rightPanelTab:c,setRightPanelTab:u,toggleLeftSidebar:h,handlePanelResizeStart:g,handlePanelResizeMove:O,handlePanelResizeEnd:x}),[t,e,n,r,i,l,s,c,u,h,g,O,x]);return m.jsx(t9,{value:v,children:y})}const n9=d.createContext(null);function Ed(){const t=d.useContext(n9);if(!t)throw new Error("useDomEditContext must be used within DomEditProvider");return t}function oL({value:{domEditSelection:t,domEditGroupSelections:e,domEditHoverSelection:n,agentModalOpen:r,agentModalAnchorPoint:i,copiedAgentPrompt:l,agentPromptSelectionContext:s,domEditSelectionRef:c,handleTimelineElementSelect:u,handlePreviewCanvasMouseDown:h,handlePreviewCanvasPointerMove:g,handlePreviewCanvasPointerLeave:O,applyDomSelection:x,clearDomSelection:y,handleDomStyleCommit:v,handleDomAttributeCommit:w,handleDomHtmlAttributeCommit:A,handleDomPathOffsetCommit:k,handleDomGroupPathOffsetCommit:M,handleDomZIndexReorderCommit:E,handleDomBoxSizeCommit:$,handleDomRotationCommit:C,handleDomManualEditsReset:j,handleDomMotionCommit:T,handleDomMotionClear:N,handleDomTextCommit:R,handleDomTextFieldStyleCommit:D,handleDomAddTextField:V,handleDomRemoveTextField:z,handleAskAgent:I,handleAgentModalSubmit:U,handleBlockedDomMove:K,handleDomManualDragStart:H,handleDomEditElementDelete:q,buildDomSelectionFromTarget:X,buildDomSelectionForTimelineElement:G,updateDomEditHoverSelection:F,resolveImportedFontAsset:P,setAgentModalOpen:Z,setAgentPromptSelectionContext:L,setAgentModalAnchorPoint:B,selectedGsapAnimations:J,gsapMultipleTimelines:te,gsapUnsupportedTimelinePattern:Y,handleGsapUpdateProperty:re,handleGsapUpdateMeta:ae,handleGsapDeleteAnimation:ue,handleGsapAddAnimation:me,handleGsapAddProperty:ye,handleGsapRemoveProperty:Oe,handleGsapUpdateFromProperty:Se,handleGsapAddFromProperty:Ae,handleGsapRemoveFromProperty:Me,handleGsapAddKeyframe:Ve,handleGsapRemoveKeyframe:Pe,handleGsapConvertToKeyframes:ft,handleGsapRemoveAllKeyframes:yt,handleResetSelectedElementKeyframes:Le,commitAnimatedProperty:Ye,invalidateGsapCache:_e,previewIframeRef:be},children:dt}){const Ue=d.useMemo(()=>({domEditSelection:t,domEditGroupSelections:e,domEditHoverSelection:n,agentModalOpen:r,agentModalAnchorPoint:i,copiedAgentPrompt:l,agentPromptSelectionContext:s,domEditSelectionRef:c,handleTimelineElementSelect:u,handlePreviewCanvasMouseDown:h,handlePreviewCanvasPointerMove:g,handlePreviewCanvasPointerLeave:O,applyDomSelection:x,clearDomSelection:y,handleDomStyleCommit:v,handleDomAttributeCommit:w,handleDomHtmlAttributeCommit:A,handleDomPathOffsetCommit:k,handleDomGroupPathOffsetCommit:M,handleDomZIndexReorderCommit:E,handleDomBoxSizeCommit:$,handleDomRotationCommit:C,handleDomManualEditsReset:j,handleDomMotionCommit:T,handleDomMotionClear:N,handleDomTextCommit:R,handleDomTextFieldStyleCommit:D,handleDomAddTextField:V,handleDomRemoveTextField:z,handleAskAgent:I,handleAgentModalSubmit:U,handleBlockedDomMove:K,handleDomManualDragStart:H,handleDomEditElementDelete:q,buildDomSelectionFromTarget:X,buildDomSelectionForTimelineElement:G,updateDomEditHoverSelection:F,resolveImportedFontAsset:P,setAgentModalOpen:Z,setAgentPromptSelectionContext:L,setAgentModalAnchorPoint:B,selectedGsapAnimations:J,gsapMultipleTimelines:te,gsapUnsupportedTimelinePattern:Y,handleGsapUpdateProperty:re,handleGsapUpdateMeta:ae,handleGsapDeleteAnimation:ue,handleGsapAddAnimation:me,handleGsapAddProperty:ye,handleGsapRemoveProperty:Oe,handleGsapUpdateFromProperty:Se,handleGsapAddFromProperty:Ae,handleGsapRemoveFromProperty:Me,handleGsapAddKeyframe:Ve,handleGsapRemoveKeyframe:Pe,handleGsapConvertToKeyframes:ft,handleGsapRemoveAllKeyframes:yt,handleResetSelectedElementKeyframes:Le,commitAnimatedProperty:Ye,invalidateGsapCache:_e,previewIframeRef:be}),[t,e,n,r,i,l,s,c,u,h,g,O,x,y,v,w,A,k,M,E,$,C,j,T,N,R,D,V,z,I,U,K,H,q,X,G,F,P,Z,L,B,J,te,Y,re,ae,ue,me,ye,Oe,Se,Ae,Me,Ve,Pe,ft,yt,Le,Ye,_e,be]);return m.jsx(n9,{value:Ue,children:dt})}function cL(){const e=Math.round(93.21518987341773);return m.jsxs("svg",{width:e,height:28,viewBox:"0 0 263 79",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hyperframes",children:[m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"hf-g0",x1:"225.869",y1:"0",x2:"222.845",y2:"37.482",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]}),m.jsxs("linearGradient",{id:"hf-g1",x1:"230.87",y1:"39",x2:"244.661",y2:"6.303",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#06E3FA"}),m.jsx("stop",{offset:"1",stopColor:"#4FDB5E"})]})]}),m.jsx("path",{d:"M0 16.6738H4.96V23.3838H11.53V16.6738H16.49V35.4538H11.53V27.6738H4.96V35.4538H0V16.6738Z",fill:"white"}),m.jsx("path",{d:"M17.8899 28.0137C17.8899 23.4237 21.2399 20.0237 25.7999 20.0237C30.0099 20.0237 32.9399 23.0837 32.9399 27.5637C32.9399 28.2037 32.8599 28.8237 32.8299 29.3337H22.6099C23.0399 31.1337 24.6199 32.1237 27.1399 32.1237C28.7199 32.1237 30.2199 31.7237 31.2999 31.0237V34.6737C30.1699 35.3937 28.2999 35.8537 26.3599 35.8537C21.2599 35.8537 17.8799 32.6037 17.8799 28.0237L17.8899 28.0137ZM28.5699 26.1937C28.4899 24.5337 27.3899 23.5637 25.7499 23.5637C24.1099 23.5637 22.9599 24.5337 22.6099 26.1937H28.5699Z",fill:"white"}),m.jsx("path",{d:"M37.85 33.8638L32 20.4238H37.29L40.46 28.1538L43.6 20.4238H48.48L40.33 39.5738H35.26L37.86 33.8638H37.85Z",fill:"white"}),m.jsx("path",{d:"M48.1797 26.1138C48.1797 20.4238 52.7097 16.2438 58.9397 16.2438C61.2997 16.2438 63.5297 16.8038 64.8197 17.7238V21.9338C63.5597 20.9138 61.6797 20.2938 59.7497 20.2938C55.7797 20.2938 53.2597 22.6238 53.2597 26.1438C53.2597 29.6638 55.5697 31.8838 58.8897 31.8838C59.6397 31.8838 60.4997 31.7538 61.1997 31.5038V27.8838H57.4697V24.2338H65.5197V33.7038C63.6697 35.0938 61.1997 35.8738 58.5997 35.8738C52.5397 35.8738 48.1897 31.7438 48.1897 26.1138H48.1797Z",fill:"white"}),m.jsx("path",{d:"M66.6604 28.0137C66.6604 23.4237 70.0104 20.0237 74.5704 20.0237C78.7804 20.0237 81.7104 23.0837 81.7104 27.5637C81.7104 28.2037 81.6304 28.8237 81.6004 29.3337H71.3804C71.8104 31.1337 73.3904 32.1237 75.9104 32.1237C77.4904 32.1237 78.9904 31.7237 80.0704 31.0237V34.6737C78.9404 35.3937 77.0704 35.8537 75.1304 35.8537C70.0304 35.8537 66.6504 32.6037 66.6504 28.0237L66.6604 28.0137ZM77.3404 26.1937C77.2604 24.5337 76.1604 23.5637 74.5204 23.5637C72.8804 23.5637 71.7304 24.5337 71.3804 26.1937H77.3404Z",fill:"white"}),m.jsx("path",{d:"M82.9688 20.4238H87.8488V22.4138C88.7588 20.9638 90.3488 20.1038 92.3288 20.1038C95.4988 20.1038 97.3988 22.3338 97.3988 25.8138V35.4438H92.5188V26.8638C92.5188 25.0438 91.8188 24.1838 90.4788 24.1838C88.9488 24.1838 87.8488 25.3638 87.8488 27.2638V35.4438H82.9688V20.4238Z",fill:"white"}),m.jsx("path",{d:"M195.219 26.1937L213.529 38.9937C216.009 40.7237 220.239 38.7637 221.009 35.5337L228.419 4.33374C229.189 1.10374 225.879 -0.856262 222.589 0.873738L198.199 13.6737C192.649 16.5837 191.059 23.2837 195.219 26.1937Z",fill:"url(#hf-g0)"}),m.jsx("path",{d:"M256.97 25.9638L232.58 38.7638C229.28 40.4938 225.98 38.5338 226.75 35.3038L234.16 4.10376C234.93 0.873757 239.16 -1.08624 241.64 0.643757L259.95 13.4438C264.12 16.3538 262.52 23.0538 256.97 25.9638Z",fill:"url(#hf-g1)"}),m.jsx("path",{d:"M0 71.9996V42.7256H7.7367V53.1806H17.9826V42.7256H25.7193V71.9996H17.9826V59.8718H7.7367V71.9996H0Z",fill:"white"}),m.jsx("path",{d:"M31.9606 78.4405L36.0171 69.5329L26.9004 48.5811H35.1389L40.0737 60.6252L44.9666 48.5811H52.5779L39.8646 78.4405H31.9606Z",fill:"white"}),m.jsx("path",{d:"M53.3711 78.4404V48.5809H60.9823V52.052C62.446 49.501 65.0807 48.0791 68.3008 48.0791C74.3647 48.0791 78.9649 53.3066 78.9649 60.2487C78.9649 67.2745 74.3229 72.4602 68.259 72.4602C65.0807 72.4602 62.446 71.1637 60.9823 68.78V78.4404H53.3711ZM66.1262 66.1872C69.2627 66.1872 71.3119 63.7616 71.3119 60.2905C71.3119 56.8195 69.2627 54.4357 66.1262 54.4357C62.7388 54.4357 60.9823 57.2795 60.9823 59.7051V60.9178C60.9823 63.3434 62.7388 66.1872 66.1262 66.1872Z",fill:"white"}),m.jsx("path",{d:"M93.4397 72.6269C85.4939 72.6269 80.2246 67.5667 80.2246 60.4155C80.2246 53.2643 85.4521 47.9531 92.5615 47.9531C99.1273 47.9531 103.686 52.7206 103.686 59.7045C103.686 60.7082 103.56 61.6701 103.518 62.4647H87.5849C88.2541 65.2666 90.7214 66.8139 94.6525 66.8139C97.1199 66.8139 99.4618 66.1866 101.135 65.0993V70.7868C99.3782 71.916 96.4508 72.6269 93.4397 72.6269ZM87.5849 57.5717H96.869C96.7435 54.9789 95.0289 53.4734 92.4779 53.4734C89.9687 53.4734 88.1286 54.9789 87.5849 57.5717Z",fill:"white"}),m.jsx("path",{d:"M105.645 72V48.5808H113.214V52.9719C114.218 50.0445 116.183 48.2881 118.692 48.2881C119.361 48.2881 119.989 48.4135 120.407 48.6645V55.8993C119.822 55.5648 119.111 55.4393 118.274 55.4393C115.138 55.4393 113.256 57.6558 113.256 61.2941V72H105.645Z",fill:"white"}),m.jsx("path",{d:"M122.643 71.9996V42.7256H139.371V49.124H130.379V54.477H138.911V60.5827H130.379V71.9996H122.643Z",fill:"white"}),m.jsx("path",{d:"M141.258 72V48.5808H148.827V52.9719C149.831 50.0445 151.796 48.2881 154.306 48.2881C154.975 48.2881 155.602 48.4135 156.02 48.6645V55.8993C155.435 55.5648 154.724 55.4393 153.887 55.4393C150.751 55.4393 148.869 57.6558 148.869 61.2941V72H141.258Z",fill:"white"}),m.jsx("path",{d:"M167.26 72.4602C161.154 72.4602 156.596 67.2745 156.596 60.3324C156.596 53.3066 161.196 48.0791 167.302 48.0791C170.438 48.0791 173.031 49.4173 174.536 51.8429V48.5809H182.148V72.0001H174.536V68.4873C173.031 71.0801 170.438 72.4602 167.26 72.4602ZM169.393 66.1872C172.78 66.1872 174.536 63.3434 174.536 60.876V59.6632C174.536 57.2377 172.78 54.4357 169.393 54.4357C166.298 54.4357 164.207 56.7777 164.207 60.2905C164.207 63.7616 166.298 66.1872 169.393 66.1872Z",fill:"white"}),m.jsx("path",{d:"M184.998 72.0001V48.5809H192.609V51.6756C193.989 49.4173 196.373 48.0791 199.426 48.0791C202.521 48.0791 204.779 49.5428 206.075 52.052C207.497 49.5846 210.132 48.0791 213.352 48.0791C218.245 48.0791 221.214 51.592 221.214 57.0286V72.0001H213.603V58.5341C213.603 55.774 212.557 54.4357 210.634 54.4357C208.459 54.4357 206.912 56.234 206.912 59.0778V72.0001H199.3V58.5341C199.3 55.774 198.255 54.4357 196.373 54.4357C194.157 54.4357 192.609 56.234 192.609 59.0778V72.0001H184.998Z",fill:"white"}),m.jsx("path",{d:"M236.338 72.6269C228.392 72.6269 223.123 67.5667 223.123 60.4155C223.123 53.2643 228.351 47.9531 235.46 47.9531C242.026 47.9531 246.584 52.7206 246.584 59.7045C246.584 60.7082 246.459 61.6701 246.417 62.4647H230.483C231.152 65.2666 233.62 66.8139 237.551 66.8139C240.018 66.8139 242.36 66.1866 244.033 65.0993V70.7868C242.277 71.916 239.349 72.6269 236.338 72.6269ZM230.483 57.5717H239.767C239.642 54.9789 237.927 53.4734 235.376 53.4734C232.867 53.4734 231.027 54.9789 230.483 57.5717Z",fill:"white"}),m.jsx("path",{d:"M252.115 72.502C250.192 72.502 248.268 72.0838 246.93 71.3728V65.6853C247.808 66.3126 248.937 66.689 250.066 66.689C251.739 66.689 252.784 65.8526 252.784 64.5562C252.784 63.8452 252.492 63.0925 251.655 62.0888L249.899 59.956C248.728 58.4923 248.226 56.9031 248.226 55.2721C248.226 51.0065 251.864 48.0791 256.883 48.0791C258.723 48.0791 260.438 48.4555 261.65 49.0828V54.7703C260.898 54.2266 259.768 53.8503 258.723 53.8503C257.092 53.8503 256.046 54.6867 256.046 55.8994C256.046 56.6522 256.423 57.405 257.259 58.4086L258.974 60.4996C260.187 62.047 260.73 63.5943 260.73 65.2671C260.73 69.5746 257.05 72.502 252.115 72.502Z",fill:"white"})]})}function uL({captureFrameHref:t,captureFrameFilename:e,handleCaptureFrameClick:n,refreshCaptureFrameTime:r,inspectorButtonActive:i,inspectorPanelActive:l}){const{projectId:s,editHistory:c,handleUndo:u,handleRedo:h}=No(),{rightCollapsed:g,setRightCollapsed:O,setRightPanelTab:x}=G8(),{clearDomSelection:y}=Ed();return m.jsxs("div",{className:"flex items-center justify-between h-10 px-3 bg-neutral-900 border-b border-neutral-800 flex-shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(cL,{}),m.jsx("span",{className:"text-neutral-700 select-none","aria-hidden":"true",children:"|"}),m.jsx("span",{className:"text-[11px] font-medium text-neutral-300",children:s})]}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("button",{type:"button",onClick:()=>{Lt("toolbar_action",{action:"undo"}),u()},disabled:!c.canUndo,className:`h-7 w-7 flex items-center justify-center rounded-md border transition-colors ${c.canUndo?"border-neutral-700 text-neutral-300 hover:border-neutral-500 hover:bg-neutral-800":"border-neutral-900 text-neutral-700"}`,title:c.undoLabel?`Undo ${c.undoLabel} (${T1("undo")})`:`Undo (${T1("undo")})`,"aria-label":"Undo",children:m.jsx(q8,{size:14})}),m.jsx("button",{type:"button",onClick:()=>{Lt("toolbar_action",{action:"redo"}),h()},disabled:!c.canRedo,className:`h-7 w-7 flex items-center justify-center rounded-md border transition-colors ${c.canRedo?"border-neutral-700 text-neutral-300 hover:border-neutral-500 hover:bg-neutral-800":"border-neutral-900 text-neutral-700"}`,title:c.redoLabel?`Redo ${c.redoLabel} (${T1("redo")})`:`Redo (${T1("redo")})`,"aria-label":"Redo",children:m.jsx(rL,{size:14})}),m.jsxs("a",{href:t,download:e,onClick:v=>{Lt("toolbar_action",{action:"capture_frame"}),n(v)},onFocus:r,onPointerDown:r,className:"h-7 flex items-center gap-1.5 px-2.5 rounded-md text-[11px] font-medium border border-neutral-700 text-neutral-300 transition-colors hover:border-neutral-500 hover:bg-neutral-800",title:"Capture current frame","aria-label":"Capture current frame",children:[m.jsx(nL,{size:14}),m.jsx("span",{children:"Capture"})]}),m.jsxs("button",{type:"button",onClick:()=>{if(Mn){if(g||!l){Lt("panel_toggle",{panel:"inspector",collapsed:!1}),x("design"),O(!1);return}Lt("panel_toggle",{panel:"inspector",collapsed:!0}),y(),O(!0)}},disabled:!Mn,className:`h-7 flex items-center gap-1.5 px-2.5 rounded-md text-[11px] font-medium border transition-colors ${i?"text-studio-accent bg-studio-accent/10 border-studio-accent/30":Mn?"text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800 border-transparent":"cursor-not-allowed border-transparent text-neutral-700"}`,title:Mn?"Inspector":gy,"aria-label":Mn?"Inspector":gy,children:[m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("polygon",{points:"10 8 16 12 10 16",fill:"currentColor",stroke:"none"})]}),"Inspector"]})]})]})}let gg=[],r9=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?r9:gg).push(n=n+t[e])})();function fL(t){if(t<768)return!1;for(let e=0,n=gg.length;;){let r=e+n>>1;if(t<gg[r])n=r;else if(t>=r9[r])e=r+1;else return!0;if(e==n)return!1}}function gb(t){return t>=127462&&t<=127487}const Ob=8205;function dL(t,e,n=!0,r=!0){return(n?i9:hL)(t,e,r)}function i9(t,e,n){if(e==t.length)return e;e&&a9(t.charCodeAt(e))&&l9(t.charCodeAt(e-1))&&e--;let r=jp(t,e);for(e+=xb(r);e<t.length;){let i=jp(t,e);if(r==Ob||i==Ob||n&&fL(i))e+=xb(i),r=i;else if(gb(i)){let l=0,s=e-2;for(;s>=0&&gb(jp(t,s));)l++,s-=2;if(l%2==0)break;e+=2}else break}return e}function hL(t,e,n){for(;e>0;){let r=i9(t,e-2,n);if(r<e)return r;e--}return 0}function jp(t,e){let n=t.charCodeAt(e);if(!l9(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return a9(r)?(n-55296<<10)+(r-56320)+65536:n}function a9(t){return t>=56320&&t<57344}function l9(t){return t>=55296&&t<56320}function xb(t){return t<65536?1:2}class ut{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=yo(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),wi.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=yo(this,e,n);let r=[];return this.decompose(e,n,r,0),wi.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Kc(this),l=new Kc(e);for(let s=n,c=n;;){if(i.next(s),l.next(s),s=0,i.lineBreak!=l.lineBreak||i.done!=l.done||i.value!=l.value)return!1;if(c+=i.value.length,i.done||c>=r)return!0}}iter(e=1){return new Kc(this,e)}iterRange(e,n=this.length){return new s9(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new o9(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ut.empty:e.length<=32?new an(e):wi.from(an.split(e,[]))}}class an extends ut{constructor(e,n=mL(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let l=0;;l++){let s=this.text[l],c=i+s.length;if((n?r:c)>=e)return new pL(i,c,r,s);i=c+1,r++}}decompose(e,n,r,i){let l=e<=0&&n>=this.length?this:new an(yb(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),c=Sf(l.text,s.text.slice(),0,l.length);if(c.length<=32)r.push(new an(c,s.length+l.length));else{let u=c.length>>1;r.push(new an(c.slice(0,u)),new an(c.slice(u)))}}else r.push(l)}replace(e,n,r){if(!(r instanceof an))return super.replace(e,n,r);[e,n]=yo(this,e,n);let i=Sf(this.text,Sf(r.text,yb(this.text,0,e)),n),l=this.length+r.length-(n-e);return i.length<=32?new an(i,l):wi.from(an.split(i,[]),l)}sliceString(e,n=this.length,r=`
99
- `){[e,n]=yo(this,e,n);let i="";for(let l=0,s=0;l<=n&&s<this.text.length;s++){let c=this.text[s],u=l+c.length;l>e&&s&&(i+=r),e<u&&n>l&&(i+=c.slice(Math.max(0,e-l),n-l)),l=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let l of e)r.push(l),i+=l.length+1,r.length==32&&(n.push(new an(r,i)),r=[],i=-1);return i>-1&&n.push(new an(r,i)),n}}class wi extends ut{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let l=0;;l++){let s=this.children[l],c=i+s.length,u=r+s.lines-1;if((n?u:c)>=e)return s.lineInner(e,n,r,i);i=c+1,r=u+1}}decompose(e,n,r,i){for(let l=0,s=0;s<=n&&l<this.children.length;l++){let c=this.children[l],u=s+c.length;if(e<=u&&n>=s){let h=i&((s<=e?1:0)|(u>=n?2:0));s>=e&&u<=n&&!h?r.push(c):c.decompose(e-s,n-s,r,h)}s=u+1}}replace(e,n,r){if([e,n]=yo(this,e,n),r.lines<this.lines)for(let i=0,l=0;i<this.children.length;i++){let s=this.children[i],c=l+s.length;if(e>=l&&n<=c){let u=s.replace(e-l,n-l,r),h=this.lines-s.lines+u.lines;if(u.lines<h>>4&&u.lines>h>>6){let g=this.children.slice();return g[i]=u,new wi(g,this.length-(n-e)+r.length)}return super.replace(l,c,u)}l=c+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
100
- `){[e,n]=yo(this,e,n);let i="";for(let l=0,s=0;l<this.children.length&&s<=n;l++){let c=this.children[l],u=s+c.length;s>e&&l&&(i+=r),e<u&&n>s&&(i+=c.sliceString(e-s,n-s,r)),s=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof wi))return 0;let r=0,[i,l,s,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,l+=n){if(i==s||l==c)return r;let u=this.children[i],h=e.children[l];if(u!=h)return r+u.scanIdentical(h,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let y of e)r+=y.lines;if(r<32){let y=[];for(let v of e)v.flatten(y);return new an(y,n)}let i=Math.max(32,r>>5),l=i<<1,s=i>>1,c=[],u=0,h=-1,g=[];function O(y){let v;if(y.lines>l&&y instanceof wi)for(let w of y.children)O(w);else y.lines>s&&(u>s||!u)?(x(),c.push(y)):y instanceof an&&u&&(v=g[g.length-1])instanceof an&&y.lines+v.lines<=32?(u+=y.lines,h+=y.length+1,g[g.length-1]=new an(v.text.concat(y.text),v.length+1+y.length)):(u+y.lines>i&&x(),u+=y.lines,h+=y.length+1,g.push(y))}function x(){u!=0&&(c.push(g.length==1?g[0]:wi.from(g,h)),h=-1,u=g.length=0)}for(let y of e)O(y);return x(),c.length==1?c[0]:new wi(c,n)}}ut.empty=new an([""],0);function mL(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Sf(t,e,n=0,r=1e9){for(let i=0,l=0,s=!0;l<t.length&&i<=r;l++){let c=t[l],u=i+c.length;u>=n&&(u>r&&(c=c.slice(0,r-i)),i<n&&(c=c.slice(n-i)),s?(e[e.length-1]+=c,s=!1):e.push(c)),i=u+1}return e}function yb(t,e,n){return Sf(t,[""],e,n)}class Kc{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof an?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],l=this.offsets[r],s=l>>1,c=i instanceof an?i.text.length:i.children.length;if(s==(n>0?c:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((l&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
101
- `,this;e--}else if(i instanceof an){let u=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[s+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof an?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class s9{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Kc(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class o9{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ut.prototype[Symbol.iterator]=function(){return this.iter()},Kc.prototype[Symbol.iterator]=s9.prototype[Symbol.iterator]=o9.prototype[Symbol.iterator]=function(){return this});class pL{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function yo(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Cn(t,e,n=!0,r=!0){return dL(t,e,n,r)}function gL(t){return t>=56320&&t<57344}function OL(t){return t>=55296&&t<56320}function rs(t,e){let n=t.charCodeAt(e);if(!OL(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return gL(r)?(n-55296<<10)+(r-56320)+65536:n}function c9(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function qu(t){return t<65536?1:2}const Og=/\r\n?|\n/;var Xn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Xn||(Xn={}));class $i{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let l=this.sections[n++],s=this.sections[n++];s<0?(e(r,i,l),i+=l):i+=s,r+=l}}iterChangedRanges(e,n=!1){xg(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new $i(e)}composeDesc(e){return this.empty?e:e.empty?this:u9(this,e)}mapDesc(e,n=!1){return e.empty?this:yg(this,e,n)}mapPos(e,n=-1,r=Xn.Simple){let i=0,l=0;for(let s=0;s<this.sections.length;){let c=this.sections[s++],u=this.sections[s++],h=i+c;if(u<0){if(h>e)return l+(e-i);l+=c}else{if(r!=Xn.Simple&&h>=e&&(r==Xn.TrackDel&&i<e&&h>e||r==Xn.TrackBefore&&i<e||r==Xn.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!c)return e==i||n<0?l:l+u;l+=u}i=h}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return l}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let l=this.sections[r++],s=this.sections[r++],c=i+l;if(s>=0&&i<=n&&c>=e)return i<e&&c>n?"cover":!0;i=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new $i(e)}static create(e){return new $i(e)}}class xn extends $i{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return xg(this,(n,r,i,l,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return yg(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,l=0;i<n.length;i+=2){let s=n[i],c=n[i+1];if(c>=0){n[i]=c,n[i+1]=s;let u=i>>1;for(;r.length<u;)r.push(ut.empty);r.push(s?e.slice(l,l+s):ut.empty)}l+=s}return new xn(n,r)}compose(e){return this.empty?e:e.empty?this:u9(this,e,!0)}map(e,n=!1){return e.empty?this:yg(this,e,n,!0)}iterChanges(e,n=!1){xg(this,e,n)}get desc(){return $i.create(this.sections)}filter(e){let n=[],r=[],i=[],l=new bu(this);e:for(let s=0,c=0;;){let u=s==e.length?1e9:e[s++];for(;c<u||c==u&&l.len==0;){if(l.done)break e;let g=Math.min(l.len,u-c);Hn(i,g,-1);let O=l.ins==-1?-1:l.off==0?l.ins:0;Hn(n,g,O),O>0&&al(r,n,l.text),l.forward(g),c+=g}let h=e[s++];for(;c<h;){if(l.done)break e;let g=Math.min(l.len,h-c);Hn(n,g,-1),Hn(i,g,l.ins==-1?-1:l.off==0?l.ins:0),l.forward(g),c+=g}}return{changes:new xn(n,r),filtered:$i.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],l=[],s=0,c=null;function u(g=!1){if(!g&&!i.length)return;s<n&&Hn(i,n-s,-1);let O=new xn(i,l);c=c?c.compose(O.map(c)):O,i=[],l=[],s=0}function h(g){if(Array.isArray(g))for(let O of g)h(O);else if(g instanceof xn){if(g.length!=n)throw new RangeError(`Mismatched change set length (got ${g.length}, expected ${n})`);u(),c=c?c.compose(g.map(c)):g}else{let{from:O,to:x=O,insert:y}=g;if(O>x||O<0||x>n)throw new RangeError(`Invalid change range ${O} to ${x} (in doc of length ${n})`);let v=y?typeof y=="string"?ut.of(y.split(r||Og)):y:ut.empty,w=v.length;if(O==x&&w==0)return;O<s&&u(),O>s&&Hn(i,O-s,-1),Hn(i,x-O,w),al(l,i,v),s=x}}return h(e),u(!c),c}static empty(e){return new xn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let l=e[i];if(typeof l=="number")n.push(l,-1);else{if(!Array.isArray(l)||typeof l[0]!="number"||l.some((s,c)=>c&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(l.length==1)n.push(l[0],0);else{for(;r.length<i;)r.push(ut.empty);r[i]=ut.of(l.slice(1)),n.push(l[0],r[i].length)}}}return new xn(n,r)}static createSet(e,n){return new xn(e,n)}}function Hn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function al(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(ut.empty);t.push(n)}}function xg(t,e,n){let r=t.inserted;for(let i=0,l=0,s=0;s<t.sections.length;){let c=t.sections[s++],u=t.sections[s++];if(u<0)i+=c,l+=c;else{let h=i,g=l,O=ut.empty;for(;h+=c,g+=u,u&&r&&(O=O.append(r[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)c=t.sections[s++],u=t.sections[s++];e(i,h,l,g,O),i=h,l=g}}}function yg(t,e,n,r=!1){let i=[],l=r?[]:null,s=new bu(t),c=new bu(e);for(let u=-1;;){if(s.done&&c.len||c.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&c.ins==-1){let h=Math.min(s.len,c.len);Hn(i,h,-1),s.forward(h),c.forward(h)}else if(c.ins>=0&&(s.ins<0||u==s.i||s.off==0&&(c.len<s.len||c.len==s.len&&!n))){let h=c.len;for(Hn(i,c.ins,-1);h;){let g=Math.min(s.len,h);s.ins>=0&&u<s.i&&s.len<=g&&(Hn(i,0,s.ins),l&&al(l,i,s.text),u=s.i),s.forward(g),h-=g}c.next()}else if(s.ins>=0){let h=0,g=s.len;for(;g;)if(c.ins==-1){let O=Math.min(g,c.len);h+=O,g-=O,c.forward(O)}else if(c.ins==0&&c.len<g)g-=c.len,c.next();else break;Hn(i,h,u<s.i?s.ins:0),l&&u<s.i&&al(l,i,s.text),u=s.i,s.forward(s.len-g)}else{if(s.done&&c.done)return l?xn.createSet(i,l):$i.create(i);throw new Error("Mismatched change set lengths")}}}function u9(t,e,n=!1){let r=[],i=n?[]:null,l=new bu(t),s=new bu(e);for(let c=!1;;){if(l.done&&s.done)return i?xn.createSet(r,i):$i.create(r);if(l.ins==0)Hn(r,l.len,0,c),l.next();else if(s.len==0&&!s.done)Hn(r,0,s.ins,c),i&&al(i,r,s.text),s.next();else{if(l.done||s.done)throw new Error("Mismatched change set lengths");{let u=Math.min(l.len2,s.len),h=r.length;if(l.ins==-1){let g=s.ins==-1?-1:s.off?0:s.ins;Hn(r,u,g,c),i&&g&&al(i,r,s.text)}else s.ins==-1?(Hn(r,l.off?0:l.len,u,c),i&&al(i,r,l.textBit(u))):(Hn(r,l.off?0:l.len,s.off?0:s.ins,c),i&&!s.off&&al(i,r,s.text));c=(l.ins>u||s.ins>=0&&s.len>u)&&(c||r.length>h),l.forward2(u),s.forward(u)}}}}class bu{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?ut.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?ut.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Bl{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Bl(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return ge.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return ge.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ge.range(e.anchor,e.head)}static create(e,n,r){return new Bl(e,n,r)}}class ge{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:ge.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ge([this.main],0)}addRange(e,n=!0){return ge.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,ge.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ge(e.ranges.map(n=>Bl.fromJSON(n)),e.main)}static single(e,n=e){return new ge([ge.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let l=e[i];if(l.empty?l.from<=r:l.from<r)return ge.normalized(e.slice(),n);r=l.to}return new ge(e,n)}static cursor(e,n=0,r,i){return Bl.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,l){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!l&&e!=n&&(l=n<e?1:-1),n<e?Bl.create(n,e,48|s):Bl.create(e,n,(l?l<0?8:16:0)|s)}static normalized(e,n=0){let r=e[n];e.sort((i,l)=>i.from-l.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let l=e[i],s=e[i-1];if(l.empty?l.from<=s.to:l.from<s.to){let c=s.from,u=Math.max(l.to,s.to);i<=n&&n--,e.splice(--i,2,l.anchor>l.head?ge.range(u,c):ge.range(c,u))}}return new ge(e,n)}}function f9(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let U8=0;class je{constructor(e,n,r,i,l){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=U8++,this.default=e([]),this.extensions=typeof l=="function"?l(this):l}get reader(){return this}static define(e={}){return new je(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:W8),!!e.static,e.enables)}of(e){return new wf([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new wf(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new wf(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function W8(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class wf{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=U8++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,l=this.id,s=e[l]>>1,c=this.type==2,u=!1,h=!1,g=[];for(let O of this.dependencies)O=="doc"?u=!0:O=="selection"?h=!0:(((n=e[O.id])!==null&&n!==void 0?n:1)&1)==0&&g.push(e[O.id]);return{create(O){return O.values[s]=r(O),1},update(O,x){if(u&&x.docChanged||h&&(x.docChanged||x.selection)||bg(O,g)){let y=r(O);if(c?!bb(y,O.values[s],i):!i(y,O.values[s]))return O.values[s]=y,1}return 0},reconfigure:(O,x)=>{let y,v=x.config.address[l];if(v!=null){let w=Xf(x,v);if(this.dependencies.every(A=>A instanceof je?x.facet(A)===O.facet(A):A instanceof Tr?x.field(A,!1)==O.field(A,!1):!0)||(c?bb(y=r(O),w,i):i(y=r(O),w)))return O.values[s]=w,0}else y=r(O);return O.values[s]=y,1}}}}function bb(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function bg(t,e){let n=!1;for(let r of e)Jc(t,r)&1&&(n=!0);return n}function xL(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),l=r.filter(u=>!(u&1)),s=t[e.id]>>1;function c(u){let h=[];for(let g=0;g<r.length;g++){let O=Xf(u,r[g]);if(i[g]==2)for(let x of O)h.push(x);else h.push(O)}return e.combine(h)}return{create(u){for(let h of r)Jc(u,h);return u.values[s]=c(u),1},update(u,h){if(!bg(u,l))return 0;let g=c(u);return e.compare(g,u.values[s])?0:(u.values[s]=g,1)},reconfigure(u,h){let g=bg(u,r),O=h.config.facets[e.id],x=h.facet(e);if(O&&!g&&W8(n,O))return u.values[s]=x,0;let y=c(u);return e.compare(y,x)?(u.values[s]=x,0):(u.values[s]=y,1)}}}const R1=je.define({static:!0});class Tr{constructor(e,n,r,i,l){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=l,this.provides=void 0}static define(e){let n=new Tr(U8++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(R1).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let l=r.values[n],s=this.updateF(l,i);return this.compareF(l,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let l=r.facet(R1),s=i.facet(R1),c;return(c=l.find(u=>u.field==this))&&c!=s.find(u=>u.field==this)?(r.values[n]=c.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,R1.of({field:this,create:e})]}get extension(){return this}}const Xl={lowest:4,low:3,default:2,high:1,highest:0};function Qc(t){return e=>new d9(e,t)}const Gu={highest:Qc(Xl.highest),high:Qc(Xl.high),default:Qc(Xl.default),low:Qc(Xl.low),lowest:Qc(Xl.lowest)};class d9{constructor(e,n){this.inner=e,this.prec=n}}class Td{of(e){return new vg(this,e)}reconfigure(e){return Td.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class vg{constructor(e,n){this.compartment=e,this.inner=n}}class Hf{constructor(e,n,r,i,l,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=l,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],l=Object.create(null),s=new Map;for(let x of yL(e,n,s))x instanceof Tr?i.push(x):(l[x.facet.id]||(l[x.facet.id]=[])).push(x);let c=Object.create(null),u=[],h=[];for(let x of i)c[x.id]=h.length<<1,h.push(y=>x.slot(y));let g=r==null?void 0:r.config.facets;for(let x in l){let y=l[x],v=y[0].facet,w=g&&g[x]||[];if(y.every(A=>A.type==0))if(c[v.id]=u.length<<1|1,W8(w,y))u.push(r.facet(v));else{let A=v.combine(y.map(k=>k.value));u.push(r&&v.compare(A,r.facet(v))?r.facet(v):A)}else{for(let A of y)A.type==0?(c[A.id]=u.length<<1|1,u.push(A.value)):(c[A.id]=h.length<<1,h.push(k=>A.dynamicSlot(k)));c[v.id]=h.length<<1,h.push(A=>xL(A,v,y))}}let O=h.map(x=>x(c));return new Hf(e,s,O,c,u,l)}}function yL(t,e,n){let r=[[],[],[],[],[]],i=new Map;function l(s,c){let u=i.get(s);if(u!=null){if(u<=c)return;let h=r[u].indexOf(s);h>-1&&r[u].splice(h,1),s instanceof vg&&n.delete(s.compartment)}if(i.set(s,c),Array.isArray(s))for(let h of s)l(h,c);else if(s instanceof vg){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(s.compartment)||s.inner;n.set(s.compartment,h),l(h,c)}else if(s instanceof d9)l(s.inner,s.prec);else if(s instanceof Tr)r[c].push(s),s.provides&&l(s.provides,c);else if(s instanceof wf)r[c].push(s),s.facet.extensions&&l(s.facet.extensions,Xl.default);else{let h=s.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);l(h,c)}}return l(t,Xl.default),r.reduce((s,c)=>s.concat(c))}function Jc(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Xf(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const h9=je.define(),Sg=je.define({combine:t=>t.some(e=>e),static:!0}),m9=je.define({combine:t=>t.length?t[0]:void 0,static:!0}),p9=je.define(),g9=je.define(),O9=je.define(),x9=je.define({combine:t=>t.length?t[0]:!1});class va{constructor(e,n){this.type=e,this.value=n}static define(){return new bL}}class bL{of(e){return new va(this,e)}}class vL{constructor(e){this.map=e}of(e){return new xt(this,e)}}class xt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new xt(this.type,n)}is(e){return this.type==e}static define(e={}){return new vL(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let l=i.map(n);l&&r.push(l)}return r}}xt.reconfigure=xt.define();xt.appendConfig=xt.define();class gn{constructor(e,n,r,i,l,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=l,this.scrollIntoView=s,this._doc=null,this._state=null,r&&f9(r,n.newLength),l.some(c=>c.type==gn.time)||(this.annotations=l.concat(gn.time.of(Date.now())))}static create(e,n,r,i,l,s){return new gn(e,n,r,i,l,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(gn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}gn.time=va.define();gn.userEvent=va.define();gn.addToHistory=va.define();gn.remote=va.define();function SL(t,e){let n=[];for(let r=0,i=0;;){let l,s;if(r<t.length&&(i==e.length||e[i]>=t[r]))l=t[r++],s=t[r++];else if(i<e.length)l=e[i++],s=e[i++];else return n;!n.length||n[n.length-1]<l?n.push(l,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function y9(t,e,n){var r;let i,l,s;return n?(i=e.changes,l=xn.empty(e.changes.length),s=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),l=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(i)),{changes:s,selection:e.selection?e.selection.map(l):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:xt.mapEffects(t.effects,i).concat(xt.mapEffects(e.effects,l)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function wg(t,e,n){let r=e.selection,i=ro(e.annotations);return e.userEvent&&(i=i.concat(gn.userEvent.of(e.userEvent))),{changes:e.changes instanceof xn?e.changes:xn.of(e.changes||[],n,t.facet(m9)),selection:r&&(r instanceof ge?r:ge.single(r.anchor,r.head)),effects:ro(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function b9(t,e,n){let r=wg(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let l=1;l<e.length;l++){e[l].filter===!1&&(n=!1);let s=!!e[l].sequential;r=y9(r,wg(t,e[l],s?r.changes.newLength:t.doc.length),s)}let i=gn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return kL(n?wL(i):i)}function wL(t){let e=t.startState,n=!0;for(let i of e.facet(p9)){let l=i(t);if(l===!1){n=!1;break}Array.isArray(l)&&(n=n===!0?l:SL(n,l))}if(n!==!0){let i,l;if(n===!1)l=t.changes.invertedDesc,i=xn.empty(e.doc.length);else{let s=t.changes.filter(n);i=s.changes,l=s.filtered.mapDesc(s.changes).invertedDesc}t=gn.create(e,i,t.selection&&t.selection.map(l),xt.mapEffects(t.effects,l),t.annotations,t.scrollIntoView)}let r=e.facet(g9);for(let i=r.length-1;i>=0;i--){let l=r[i](t);l instanceof gn?t=l:Array.isArray(l)&&l.length==1&&l[0]instanceof gn?t=l[0]:t=b9(e,ro(l),!1)}return t}function kL(t){let e=t.startState,n=e.facet(O9),r=t;for(let i=n.length-1;i>=0;i--){let l=n[i](t);l&&Object.keys(l).length&&(r=y9(r,wg(e,l,t.changes.newLength),!0))}return r==t?t:gn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const AL=[];function ro(t){return t==null?AL:Array.isArray(t)?t:[t]}var It=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(It||(It={}));const ML=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let kg;try{kg=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function CL(t){if(kg)return kg.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||ML.test(n)))return!0}return!1}function EL(t){return e=>{if(!/\S/.test(e))return It.Space;if(CL(e))return It.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return It.Word;return It.Other}}class gt{constructor(e,n,r,i,l,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=l,s&&(s._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)Jc(this,c<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Jc(this,r),Xf(this,r)}update(...e){return b9(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let c of e.effects)c.is(Td.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,h)=>i.set(h,u)),n=null),i.set(c.value.compartment,c.value.extension)):c.is(xt.reconfigure)?(n=null,r=c.value):c.is(xt.appendConfig)&&(n=null,r=ro(r).concat(c.value));let l;n?l=e.startState.values.slice():(n=Hf.resolve(r,i,this),l=new gt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,h)=>h.reconfigure(u,this),null).values);let s=e.startState.facet(Sg)?e.newSelection:e.newSelection.asSingle();new gt(n,e.newDoc,s,l,(c,u)=>u.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:ge.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),l=[r.range],s=ro(r.effects);for(let c=1;c<n.ranges.length;c++){let u=e(n.ranges[c]),h=this.changes(u.changes),g=h.map(i);for(let x=0;x<c;x++)l[x]=l[x].map(g);let O=i.mapDesc(h,!0);l.push(u.range.map(O)),i=i.compose(g),s=xt.mapEffects(s,g).concat(xt.mapEffects(ro(u.effects),O))}return{changes:i,selection:ge.create(l,n.mainIndex),effects:s}}changes(e=[]){return e instanceof xn?e:xn.of(e,this.doc.length,this.facet(gt.lineSeparator))}toText(e){return ut.of(e.split(this.facet(gt.lineSeparator)||Og))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Jc(this,n),Xf(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Tr&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let l in r)if(Object.prototype.hasOwnProperty.call(e,l)){let s=r[l],c=e[l];i.push(s.init(u=>s.spec.fromJSON(c,u)))}}return gt.create({doc:e.doc,selection:ge.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Hf.resolve(e.extensions||[],new Map),r=e.doc instanceof ut?e.doc:ut.of((e.doc||"").split(n.staticFacet(gt.lineSeparator)||Og)),i=e.selection?e.selection instanceof ge?e.selection:ge.single(e.selection.anchor,e.selection.head):ge.single(0);return f9(i,r.length),n.staticFacet(Sg)||(i=i.asSingle()),new gt(n,r,i,n.dynamicSlots.map(()=>null),(l,s)=>s.create(l),null)}get tabSize(){return this.facet(gt.tabSize)}get lineBreak(){return this.facet(gt.lineSeparator)||`
102
- `}get readOnly(){return this.facet(x9)}phrase(e,...n){for(let r of this.facet(gt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let l=+(i||1);return!l||l>n.length?r:n[l-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let l of this.facet(h9))for(let s of l(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return EL(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),l=this.charCategorizer(e),s=e-r,c=e-r;for(;s>0;){let u=Cn(n,s,!1);if(l(n.slice(u,s))!=It.Word)break;s=u}for(;c<i;){let u=Cn(n,c);if(l(n.slice(c,u))!=It.Word)break;c=u}return s==c?null:ge.range(s+r,c+r)}}gt.allowMultipleSelections=Sg;gt.tabSize=je.define({combine:t=>t.length?t[0]:4});gt.lineSeparator=m9;gt.readOnly=x9;gt.phrases=je.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});gt.languageData=h9;gt.changeFilter=p9;gt.transactionFilter=g9;gt.transactionExtender=O9;Td.reconfigure=xt.define();function Ro(t,e,n={}){let r={};for(let i of t)for(let l of Object.keys(i)){let s=i[l],c=r[l];if(c===void 0)r[l]=s;else if(!(c===s||s===void 0))if(Object.hasOwnProperty.call(n,l))r[l]=n[l](c,s);else throw new Error("Config merge conflict for field "+l)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class hl{eq(e){return this==e}range(e,n=e){return Ag.create(e,n,this)}}hl.prototype.startSide=hl.prototype.endSide=0;hl.prototype.point=!1;hl.prototype.mapMode=Xn.TrackDel;function K8(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Ag=class v9{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new v9(e,n,r)}};function Mg(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class J8{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let l=r?this.to:this.from;for(let s=i,c=l.length;;){if(s==c)return s;let u=s+c>>1,h=l[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==s)return h>=0?s:c;h>=0?c=u:s=u+1}}between(e,n,r,i){for(let l=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,l);l<s;l++)if(i(this.from[l]+e,this.to[l]+e,this.value[l])===!1)return!1}map(e,n){let r=[],i=[],l=[],s=-1,c=-1;for(let u=0;u<this.value.length;u++){let h=this.value[u],g=this.from[u]+e,O=this.to[u]+e,x,y;if(g==O){let v=n.mapPos(g,h.startSide,h.mapMode);if(v==null||(x=y=v,h.startSide!=h.endSide&&(y=n.mapPos(g,h.endSide),y<x)))continue}else if(x=n.mapPos(g,h.startSide),y=n.mapPos(O,h.endSide),x>y||x==y&&h.startSide>0&&h.endSide<=0)continue;(y-x||h.endSide-h.startSide)<0||(s<0&&(s=x),h.point&&(c=Math.max(c,y-x)),r.push(h),i.push(x-s),l.push(y-s))}return{mapped:r.length?new J8(i,l,r,c):null,pos:s}}}class nt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new nt(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:l=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(Mg)),this.isEmpty)return n.length?nt.of(n):this;let c=new S9(this,null,-1).goto(0),u=0,h=[],g=new Kl;for(;c.value||u<n.length;)if(u<n.length&&(c.from-n[u].from||c.startSide-n[u].value.startSide)>=0){let O=n[u++];g.addInner(O.from,O.to,O.value)||h.push(O)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(c.chunkIndex)<n[u].from)&&(!s||i>this.chunkEnd(c.chunkIndex)||l<this.chunkPos[c.chunkIndex])&&g.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!s||i>c.to||l<c.from||s(c.from,c.to,c.value))&&(g.addInner(c.from,c.to,c.value)||h.push(Ag.create(c.from,c.to,c.value))),c.next());return g.finishInner(this.nextLayer.isEmpty&&!h.length?nt.empty:this.nextLayer.update({add:h,filter:s,filterFrom:i,filterTo:l}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let s=0;s<this.chunk.length;s++){let c=this.chunkPos[s],u=this.chunk[s],h=e.touchesRange(c,c+u.length);if(h===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(c));else if(h===!0){let{mapped:g,pos:O}=u.map(c,e);g&&(i=Math.max(i,g.maxPoint),n.push(g),r.push(O))}}let l=this.nextLayer.map(e);return n.length==0?l:new nt(r,n,l||nt.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let l=this.chunkPos[i],s=this.chunk[i];if(n>=l&&e<=l+s.length&&s.between(l,e-l,n-l,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return vu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return vu.from(e).goto(n)}static compare(e,n,r,i,l=-1){let s=e.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=l),c=n.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=l),u=vb(s,c,r),h=new Zc(s,u,l),g=new Zc(c,u,l);r.iterGaps((O,x,y)=>Sb(h,O,g,x,y,i)),r.empty&&r.length==0&&Sb(h,0,g,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let l=e.filter(g=>!g.isEmpty&&n.indexOf(g)<0),s=n.filter(g=>!g.isEmpty&&e.indexOf(g)<0);if(l.length!=s.length)return!1;if(!l.length)return!0;let c=vb(l,s),u=new Zc(l,c,0).goto(r),h=new Zc(s,c,0).goto(r);for(;;){if(u.to!=h.to||!Cg(u.active,h.active)||u.point&&(!h.point||!K8(u.point,h.point)))return!1;if(u.to>i)return!0;u.next(),h.next()}}static spans(e,n,r,i,l=-1){let s=new Zc(e,null,l).goto(n),c=n,u=s.openStart;for(;;){let h=Math.min(s.to,r);if(s.point){let g=s.activeForPoint(s.to),O=s.pointFrom<n?g.length+1:s.point.startSide<0?g.length:Math.min(g.length,u);i.point(c,h,s.point,g,O,s.pointRank),u=Math.min(s.openEnd(h),g.length)}else h>c&&(i.span(c,h,s.active,u),u=s.openEnd(h));if(s.to>r)return u+(s.point&&s.to>r?1:0);c=s.to,s.next()}}static of(e,n=!1){let r=new Kl;for(let i of e instanceof Ag?[e]:n?TL(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return nt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=nt.empty;i=i.nextLayer)n=new nt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}nt.empty=new nt([],[],null,-1);function TL(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(Mg(e,r)>0)return t.slice().sort(Mg);e=r}return t}nt.empty.nextLayer=nt.empty;class Kl{finishChunk(e){this.chunks.push(new J8(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Kl)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(nt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=nt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function vb(t,e,n){let r=new Map;for(let l of t)for(let s=0;s<l.chunk.length;s++)l.chunk[s].maxPoint<=0&&r.set(l.chunk[s],l.chunkPos[s]);let i=new Set;for(let l of e)for(let s=0;s<l.chunk.length;s++){let c=r.get(l.chunk[s]);c!=null&&(n?n.mapPos(c):c)==l.chunkPos[s]&&!(n!=null&&n.touchesRange(c,c+l.chunk[s].length))&&i.add(l.chunk[s])}return i}class S9{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class vu{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let l=0;l<e.length;l++)for(let s=e[l];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new S9(s,n,r,l));return i.length==1?i[0]:new vu(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Pp(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Pp(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Pp(this.heap,0)}}}function Pp(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Zc{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=vu.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){V1(this.active,e),V1(this.activeTo,e),V1(this.activeRank,e),this.minActive=wb(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:l}=this.cursor;for(;n<this.activeRank.length&&(l-this.activeRank[n]||i-this.activeTo[n])>0;)n++;L1(this.active,n,r),L1(this.activeTo,n,i),L1(this.activeRank,n,l),e&&L1(e,n,this.cursor.from),this.minActive=wb(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&V1(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let l=this.cursor.value;if(!l.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=l,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=l.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function Sb(t,e,n,r,i,l){t.goto(e),n.goto(r);let s=r+i,c=r,u=r-e,h=!!l.boundChange;for(let g=!1;;){let O=t.to+u-n.to,x=O||t.endSide-n.endSide,y=x<0?t.to+u:n.to,v=Math.min(y,s);if(t.point||n.point?(t.point&&n.point&&K8(t.point,n.point)&&Cg(t.activeForPoint(t.to),n.activeForPoint(n.to))||l.comparePoint(c,v,t.point,n.point),g=!1):(g&&l.boundChange(c),v>c&&!Cg(t.active,n.active)&&l.compareRange(c,v,t.active,n.active),h&&v<s&&(O||t.openEnd(y)!=n.openEnd(y))&&(g=!0)),y>s)break;c=y,x<=0&&t.next(),x>=0&&n.next()}}function Cg(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!K8(t[n],e[n]))return!1;return!0}function V1(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function L1(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function wb(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function $d(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Cn(t,i));return r}function $L(t,e,n,r){for(let i=0,l=0;;){if(l>=e)return i;if(i==t.length)break;l+=t.charCodeAt(i)==9?n-l%n:1,i=Cn(t,i)}return t.length}const Eg="ͼ",kb=typeof Symbol>"u"?"__"+Eg:Symbol.for(Eg),Tg=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Ab=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ml{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function l(s,c,u,h){let g=[],O=/^@(\w+)\b/.exec(s[0]),x=O&&O[1]=="keyframes";if(O&&c==null)return u.push(s[0]+";");for(let y in c){let v=c[y];if(/&/.test(y))l(y.split(/,\s*/).map(w=>s.map(A=>w.replace(/&/,A))).reduce((w,A)=>w.concat(A)),v,u);else if(v&&typeof v=="object"){if(!O)throw new RangeError("The value of a property ("+y+") should be a primitive value.");l(i(y),v,g,x)}else v!=null&&g.push(y.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+v+";")}(g.length||x)&&u.push((r&&!O&&!h?s.map(r):s).join(", ")+" {"+g.join(" ")+"}")}for(let s in e)l(i(s),e[s],this.rules)}getRules(){return this.rules.join(`
103
- `)}static newName(){let e=Ab[kb]||1;return Ab[kb]=e+1,Eg+e.toString(36)}static mount(e,n,r){let i=e[Tg],l=r&&r.nonce;i?l&&i.setNonce(l):i=new jL(e,l),i.mount(Array.isArray(n)?n:[n],e)}}let Mb=new Map;class jL{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let l=Mb.get(r);if(l)return e[Tg]=l;this.sheet=new i.CSSStyleSheet,Mb.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Tg]=this}mount(e,n){let r=this.sheet,i=0,l=0;for(let s=0;s<e.length;s++){let c=e[s],u=this.modules.indexOf(c);if(u<l&&u>-1&&(this.modules.splice(u,1),l--,u=-1),u==-1){if(this.modules.splice(l++,0,c),r)for(let h=0;h<c.rules.length;h++)r.insertRule(c.rules[h],i++)}else{for(;l<u;)i+=this.modules[l++].rules.length;i+=c.rules.length,l++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let u=0;u<this.modules.length;u++)s+=this.modules[u].getRules()+`
104
- `;this.styleTag.textContent=s;let c=n.head||n;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var pl={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Su={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},PL=typeof navigator<"u"&&/Mac/.test(navigator.platform),QL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ln=0;Ln<10;Ln++)pl[48+Ln]=pl[96+Ln]=String(Ln);for(var Ln=1;Ln<=24;Ln++)pl[Ln+111]="F"+Ln;for(var Ln=65;Ln<=90;Ln++)pl[Ln]=String.fromCharCode(Ln+32),Su[Ln]=String.fromCharCode(Ln);for(var Qp in pl)Su.hasOwnProperty(Qp)||(Su[Qp]=pl[Qp]);function ZL(t){var e=PL&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||QL&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Su:pl)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function kn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)w9(t,arguments[e]);return t}function w9(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)w9(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let In=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},$g=typeof document<"u"?document:{documentElement:{style:{}}};const jg=/Edge\/(\d+)/.exec(In.userAgent),k9=/MSIE \d/.test(In.userAgent),Pg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In.userAgent),jd=!!(k9||Pg||jg),Cb=!jd&&/gecko\/(\d+)/i.test(In.userAgent),Zp=!jd&&/Chrome\/(\d+)/.exec(In.userAgent),NL="webkitFontSmoothing"in $g.documentElement.style,Qg=!jd&&/Apple Computer/.test(In.vendor),Eb=Qg&&(/Mobile\/\w+/.test(In.userAgent)||In.maxTouchPoints>2);var Ee={mac:Eb||/Mac/.test(In.platform),windows:/Win/.test(In.platform),linux:/Linux|X11/.test(In.platform),ie:jd,ie_version:k9?$g.documentMode||6:Pg?+Pg[1]:jg?+jg[1]:0,gecko:Cb,gecko_version:Cb?+(/Firefox\/(\d+)/.exec(In.userAgent)||[0,0])[1]:0,chrome:!!Zp,chrome_version:Zp?+Zp[1]:0,ios:Eb,android:/Android\b/.test(In.userAgent),webkit_version:NL?+(/\bAppleWebKit\/(\d+)/.exec(In.userAgent)||[0,0])[1]:0,safari:Qg,safari_version:Qg?+(/\bVersion\/(\d+(\.\d+)?)/.exec(In.userAgent)||[0,0])[1]:0,tabSize:$g.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function e6(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const zf=Object.create(null);function t6(t,e,n){if(t==e)return!0;t||(t=zf),e||(e=zf);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let l of r)if(l!=n&&(i.indexOf(l)==-1||t[l]!==e[l]))return!1;return!0}function RL(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function Tb(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function VL(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class is{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var fr=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(fr||(fr={}));class qe extends hl{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Uu(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Jl(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:l,end:s}=A9(e,n);r=(l?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Jl(e,r,i,n,e.widget||null,!0)}static line(e){return new Wu(e)}static set(e,n=!1){return nt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}qe.none=nt.empty;class Uu extends qe{constructor(e){let{start:n,end:r}=A9(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?e6(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||zf}eq(e){return this==e||e instanceof Uu&&this.tagName==e.tagName&&t6(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Uu.prototype.point=!1;class Wu extends qe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Wu&&this.spec.class==e.spec.class&&t6(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Wu.prototype.mapMode=Xn.TrackBefore;Wu.prototype.point=!0;class Jl extends qe{constructor(e,n,r,i,l,s){super(n,r,l,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?Xn.TrackBefore:Xn.TrackAfter:Xn.TrackDel}get type(){return this.startSide!=this.endSide?fr.WidgetRange:this.startSide<=0?fr.WidgetBefore:fr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Jl&&LL(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Jl.prototype.point=!0;function A9(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function LL(t,e){return t==e||!!(t&&e&&t.compare(e))}function io(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class wu extends hl{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof wu&&this.tagName==e.tagName&&t6(this.attributes,e.attributes)}static create(e){return new wu(e.tagName,e.attributes||zf)}static set(e,n=!1){return nt.of(e,n)}}wu.prototype.startSide=wu.prototype.endSide=-1;function ku(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Zg(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function eu(t,e){if(!e.anchorNode)return!1;try{return Zg(t,e.anchorNode)}catch{return!1}}function kf(t){return t.nodeType==3?Au(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function tu(t,e,n,r){return n?$b(t,e,n,r,-1)||$b(t,e,n,r,1):!1}function gl(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Ff(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function $b(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Oa(t))){if(t.nodeName=="DIV")return!1;let l=t.parentNode;if(!l||l.nodeType!=1)return!1;e=gl(t)+(i<0?0:1),t=l}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Oa(t):0}else return!1}}function Oa(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Bf(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function _L(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function M9(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function DL(t,e,n,r,i,l,s,c){let u=t.ownerDocument,h=u.defaultView||window;for(let g=t,O=!1;g&&!O;)if(g.nodeType==1){let x,y=g==u.body,v=1,w=1;if(y)x=_L(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(g).position)&&(O=!0),g.scrollHeight<=g.clientHeight&&g.scrollWidth<=g.clientWidth){g=g.assignedSlot||g.parentNode;continue}let M=g.getBoundingClientRect();({scaleX:v,scaleY:w}=M9(g,M)),x={left:M.left,right:M.left+g.clientWidth*v,top:M.top,bottom:M.top+g.clientHeight*w}}let A=0,k=0;if(i=="nearest")e.top<x.top?(k=e.top-(x.top+s),n>0&&e.bottom>x.bottom+k&&(k=e.bottom-x.bottom+s)):e.bottom>x.bottom&&(k=e.bottom-x.bottom+s,n<0&&e.top-k<x.top&&(k=e.top-(x.top+s)));else{let M=e.bottom-e.top,E=x.bottom-x.top;k=(i=="center"&&M<=E?e.top+M/2-E/2:i=="start"||i=="center"&&n<0?e.top-s:e.bottom-E+s)-x.top}if(r=="nearest"?e.left<x.left?(A=e.left-(x.left+l),n>0&&e.right>x.right+A&&(A=e.right-x.right+l)):e.right>x.right&&(A=e.right-x.right+l,n<0&&e.left<x.left+A&&(A=e.left-(x.left+l))):A=(r=="center"?e.left+(e.right-e.left)/2-(x.right-x.left)/2:r=="start"==c?e.left-l:e.right-(x.right-x.left)+l)-x.left,A||k)if(y)h.scrollBy(A,k);else{let M=0,E=0;if(k){let $=g.scrollTop;g.scrollTop+=k/w,E=(g.scrollTop-$)*w}if(A){let $=g.scrollLeft;g.scrollLeft+=A/v,M=(g.scrollLeft-$)*v}e={left:e.left-M,top:e.top-E,right:e.right-M,bottom:e.bottom-E},M&&Math.abs(M-A)<1&&(r="nearest"),E&&Math.abs(E-k)<1&&(i="nearest")}if(y)break;(e.top<x.top||e.bottom>x.bottom||e.left<x.left||e.right>x.right)&&(e={left:Math.max(e.left,x.left),right:Math.min(e.right,x.right),top:Math.max(e.top,x.top),bottom:Math.min(e.bottom,x.bottom)}),g=g.assignedSlot||g.parentNode}else if(g.nodeType==11)g=g.host;else break}function C9(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let l=t.parentNode;l&&!(l==n.body||(!e||r)&&i);)if(l.nodeType==1)!i&&l.scrollHeight>l.clientHeight&&(i=l),e&&!r&&l.scrollWidth>l.clientWidth&&(r=l),l=l.assignedSlot||l.parentNode;else if(l.nodeType==11)l=l.host;else break;return{x:r,y:i}}class HL{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Oa(n):0),r,Math.min(e.focusOffset,r?Oa(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Dl=null;Ee.safari&&Ee.safari_version>=26&&(Dl=!1);function E9(t){if(t.setActive)return t.setActive();if(Dl)return t.focus(Dl);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Dl==null?{get preventScroll(){return Dl={preventScroll:!0},!0}}:void 0),!Dl){Dl=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],l=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=l&&(r.scrollLeft=l)}}}let jb;function Au(t,e,n=e){let r=jb||(jb=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function ao(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let l=new KeyboardEvent("keydown",i);l.synthetic=!0,t.dispatchEvent(l);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,t.dispatchEvent(s),l.defaultPrevented||s.defaultPrevented}function XL(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function zL(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,Oa(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Oa(n))}else{if(n==t)return!0;r=gl(n),n=n.parentNode}}function T9(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function $9(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Oa(n)}else if(n.parentNode&&!Ff(n))r=gl(n),n=n.parentNode;else return null}}function j9(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Ff(n))r=gl(n)+1,n=n.parentNode;else return null}}class ai{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new ai(e.parentNode,gl(e),n)}static after(e,n){return new ai(e.parentNode,gl(e)+1,n)}}var ln=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(ln||(ln={}));const es=ln.LTR,n6=ln.RTL;function P9(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const FL=P9("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),BL=P9("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ng=Object.create(null),Oi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Ng[e]=n,Ng[n]=-e}function Q9(t){return t<=247?FL[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?BL[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const YL=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ai{get dir(){return this.level%2?n6:es}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let l=-1;for(let s=0;s<e.length;s++){let c=e[s];if(c.from<=n&&c.to>=n){if(c.level==r)return s;(l<0||(i!=0?i<0?c.from<n:c.to>n:e[l].level>c.level))&&(l=s)}}if(l<0)throw new RangeError("Index out of range");return l}}function Z9(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!Z9(r.inner,i.inner))return!1}return!0}const Nt=[];function IL(t,e,n,r,i){for(let l=0;l<=r.length;l++){let s=l?r[l-1].to:e,c=l<r.length?r[l].from:n,u=l?256:i;for(let h=s,g=u,O=u;h<c;h++){let x=Q9(t.charCodeAt(h));x==512?x=g:x==8&&O==4&&(x=16),Nt[h]=x==4?2:x,x&7&&(O=x),g=x}for(let h=s,g=u,O=u;h<c;h++){let x=Nt[h];if(x==128)h<c-1&&g==Nt[h+1]&&g&24?x=Nt[h]=g:Nt[h]=256;else if(x==64){let y=h+1;for(;y<c&&Nt[y]==64;)y++;let v=h&&g==8||y<n&&Nt[y]==8?O==1?1:8:256;for(let w=h;w<y;w++)Nt[w]=v;h=y-1}else x==8&&O==1&&(Nt[h]=1);g=x,x&7&&(O=x)}}}function qL(t,e,n,r,i){let l=i==1?2:1;for(let s=0,c=0,u=0;s<=r.length;s++){let h=s?r[s-1].to:e,g=s<r.length?r[s].from:n;for(let O=h,x,y,v;O<g;O++)if(y=Ng[x=t.charCodeAt(O)])if(y<0){for(let w=c-3;w>=0;w-=3)if(Oi[w+1]==-y){let A=Oi[w+2],k=A&2?i:A&4?A&1?l:i:0;k&&(Nt[O]=Nt[Oi[w]]=k),c=w;break}}else{if(Oi.length==189)break;Oi[c++]=O,Oi[c++]=x,Oi[c++]=u}else if((v=Nt[O])==2||v==1){let w=v==i;u=w?0:1;for(let A=c-3;A>=0;A-=3){let k=Oi[A+2];if(k&2)break;if(w)Oi[A+2]|=2;else{if(k&4)break;Oi[A+2]|=4}}}}}function GL(t,e,n,r){for(let i=0,l=r;i<=n.length;i++){let s=i?n[i-1].to:t,c=i<n.length?n[i].from:e;for(let u=s;u<c;){let h=Nt[u];if(h==256){let g=u+1;for(;;)if(g==c){if(i==n.length)break;g=n[i++].to,c=i<n.length?n[i].from:e}else if(Nt[g]==256)g++;else break;let O=l==1,x=(g<e?Nt[g]:r)==1,y=O==x?O?1:2:r;for(let v=g,w=i,A=w?n[w-1].to:t;v>u;)v==A&&(v=n[--w].from,A=w?n[w-1].to:t),Nt[--v]=y;u=g}else l=h,u++}}}function Rg(t,e,n,r,i,l,s){let c=r%2?2:1;if(r%2==i%2)for(let u=e,h=0;u<n;){let g=!0,O=!1;if(h==l.length||u<l[h].from){let w=Nt[u];w!=c&&(g=!1,O=w==16)}let x=!g&&c==1?[]:null,y=g?r:r+1,v=u;e:for(;;)if(h<l.length&&v==l[h].from){if(O)break e;let w=l[h];if(!g)for(let A=w.to,k=h+1;;){if(A==n)break e;if(k<l.length&&l[k].from==A)A=l[k++].to;else{if(Nt[A]==c)break e;break}}if(h++,x)x.push(w);else{w.from>u&&s.push(new Ai(u,w.from,y));let A=w.direction==es!=!(y%2);Vg(t,A?r+1:r,i,w.inner,w.from,w.to,s),u=w.to}v=w.to}else{if(v==n||(g?Nt[v]!=c:Nt[v]==c))break;v++}x?Rg(t,u,v,r+1,i,x,s):u<v&&s.push(new Ai(u,v,y)),u=v}else for(let u=n,h=l.length;u>e;){let g=!0,O=!1;if(!h||u>l[h-1].to){let w=Nt[u-1];w!=c&&(g=!1,O=w==16)}let x=!g&&c==1?[]:null,y=g?r:r+1,v=u;e:for(;;)if(h&&v==l[h-1].to){if(O)break e;let w=l[--h];if(!g)for(let A=w.from,k=h;;){if(A==e)break e;if(k&&l[k-1].to==A)A=l[--k].from;else{if(Nt[A-1]==c)break e;break}}if(x)x.push(w);else{w.to<u&&s.push(new Ai(w.to,u,y));let A=w.direction==es!=!(y%2);Vg(t,A?r+1:r,i,w.inner,w.from,w.to,s),u=w.from}v=w.from}else{if(v==e||(g?Nt[v-1]!=c:Nt[v-1]==c))break;v--}x?Rg(t,v,u,r+1,i,x,s):v<u&&s.push(new Ai(v,u,y)),u=v}}function Vg(t,e,n,r,i,l,s){let c=e%2?2:1;IL(t,i,l,r,c),qL(t,i,l,r,c),GL(i,l,r,c),Rg(t,i,l,e,n,r,s)}function UL(t,e,n){if(!t)return[new Ai(0,0,e==n6?1:0)];if(e==es&&!n.length&&!YL.test(t))return N9(t.length);if(n.length)for(;t.length>Nt.length;)Nt[Nt.length]=256;let r=[],i=e==es?0:1;return Vg(t,i,i,n,0,t.length,r),r}function N9(t){return[new Ai(0,t,0)]}let R9="";function WL(t,e,n,r,i){var l;let s=r.head-t.from,c=Ai.find(e,s,(l=r.bidiLevel)!==null&&l!==void 0?l:-1,r.assoc),u=e[c],h=u.side(i,n);if(s==h){let x=c+=i?1:-1;if(x<0||x>=e.length)return null;u=e[c=x],s=u.side(!i,n),h=u.side(i,n)}let g=Cn(t.text,s,u.forward(i,n));(g<u.from||g>u.to)&&(g=h),R9=t.text.slice(Math.min(s,g),Math.max(s,g));let O=c==(i?e.length-1:0)?null:e[c+(i?1:-1)];return O&&g==h&&O.level+(i?0:1)<u.level?ge.cursor(O.side(!i,n)+t.from,O.forward(i,n)?1:-1,O.level):ge.cursor(g+t.from,u.forward(i,n)?-1:1,u.level)}function KL(t,e,n){for(let r=e;r<n;r++){let i=Q9(t.charCodeAt(r));if(i==1)return es;if(i==2||i==4)return n6}return es}const V9=je.define(),L9=je.define(),_9=je.define(),D9=je.define(),Lg=je.define(),H9=je.define(),X9=je.define(),r6=je.define(),i6=je.define(),z9=je.define({combine:t=>t.some(e=>e)}),JL=je.define({combine:t=>t.some(e=>e)}),F9=je.define();class lo{constructor(e,n="nearest",r="nearest",i=5,l=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=l,this.isSnapshot=s}map(e){return e.empty?this:new lo(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new lo(ge.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const _1=xt.define({map:(t,e)=>t.map(e)}),B9=xt.define();function Mi(t,e,n){let r=t.facet(D9);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const ra=je.define({combine:t=>t.length?t[0]:!0});let e_=0;const Us=je.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class dr{constructor(e,n,r,i,l){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=l(this),this.extension=this.baseExtensions.concat(Us.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Us.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:l,decorations:s}=n||{};return new dr(e_++,e,r,i,c=>{let u=[];return s&&u.push(Pd.of(h=>{let g=h.plugin(c);return g?s(g):qe.none})),l&&u.push(l(c)),u})}static fromClass(e,n){return dr.define((r,i)=>new e(r,i),n)}}class Np{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Mi(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Mi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Mi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Y9=je.define(),a6=je.define(),Pd=je.define(),I9=je.define(),l6=je.define(),Ku=je.define(),q9=je.define();function Pb(t,e){let n=t.state.facet(q9);if(!n.length)return n;let r=n.map(l=>l instanceof Function?l(t):l),i=[];return nt.spans(r,e.from,e.to,{point(){},span(l,s,c,u){let h=l-e.from,g=s-e.from,O=i;for(let x=c.length-1;x>=0;x--,u--){let y=c[x].spec.bidiIsolate,v;if(y==null&&(y=KL(e.text,h,g)),u>0&&O.length&&(v=O[O.length-1]).to==h&&v.direction==y)v.to=g,O=v.inner;else{let w={from:h,to:g,direction:y,inner:[]};O.push(w),O=w.inner}}}}),i}const G9=je.define();function U9(t){let e=0,n=0,r=0,i=0;for(let l of t.state.facet(G9)){let s=l(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const zc=je.define();class Fr{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new Fr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,l=0,s=0;;){let c=i<e.length?e[i].fromB:1e9,u=l<n.length?n[l]:1e9,h=Math.min(c,u);if(h==1e9)break;let g=h+s,O=h,x=g;for(;;)if(l<n.length&&n[l]<=O){let y=n[l+1];l+=2,O=Math.max(O,y);for(let v=i;v<e.length&&e[v].fromB<=O;v++)s=e[v].toA-e[v].toB;x=Math.max(x,y+s)}else if(i<e.length&&e[i].fromB<=O){let y=e[i++];O=Math.max(O,y.toB),x=Math.max(x,y.toA),s=y.toA-y.toB}else break;r.push(new Fr(g,x,h,O))}return r}}class Yf{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=xn.empty(this.startState.doc.length);for(let l of r)this.changes=this.changes.compose(l.changes);let i=[];this.changes.iterChangedRanges((l,s,c,u)=>i.push(new Fr(l,s,c,u))),this.changedRanges=i}static create(e,n,r){return new Yf(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const t_=[];class Jt{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return t_}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&RL(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=gl(this.dom),i=this.length?e>0:n>0;return new ai(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Zd)return e;return null}static get(e){return e.cmTile}}class Qd extends Jt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,l=(e==null?void 0:e.node)==n?e:null,s=0;for(let c of this.children){if(c.sync(e),s+=c.length+c.breakAfter,i=r?r.nextSibling:n.firstChild,l&&i!=c.dom&&(l.written=!0),c.dom.parentNode==n)for(;i&&i!=c.dom;)i=Qb(i);else n.insertBefore(c.dom,i);r=c.dom}for(i=r?r.nextSibling:n.firstChild,l&&i&&(l.written=!0);i;)i=Qb(i);this.length=s}}function Qb(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Zd extends Qd{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Jt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,l=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&l++,i=n.pop()}else{let s=r.children[i++];if(s instanceof la)n.push(i),r=s,i=0;else{let c=l+s.length,u=e(s,l);if(u!==void 0)return u;l=c+s.breakAfter}}}resolveBlock(e,n){let r,i=-1,l,s=-1;if(this.blockTiles((c,u)=>{let h=u+c.length;if(e>=u&&e<=h){if(c.isWidget()&&n>=-1&&n<=1){if(c.flags&32)return!0;c.flags&16&&(r=void 0)}(u<e||e==h&&(n<-1?c.length:c.covers(1)))&&(!r||!c.isWidget()&&r.isWidget())&&(r=c,i=e-u),(h>e||e==u&&(n>1?c.length:c.covers(-1)))&&(!l||!c.isWidget()&&l.isWidget())&&(l=c,s=e-u)}}),!r&&!l)throw new Error("No tile at position "+e);return r&&n<0||!l?{tile:r,offset:i}:{tile:l,offset:s}}}class la extends Qd{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new la(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class bo extends Qd{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new bo(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,l=-1,s=null,c=-1;function u(g,O){for(let x=0,y=0;x<g.children.length&&y<=O;x++){let v=g.children[x],w=y+v.length;w>=O&&(v.isComposite()?u(v,O-y):(!s||s.isHidden&&(n>0||r&&r_(s,v)))&&(w>O||v.flags&32)?(s=v,c=O-y):(y<O||v.flags&16&&!v.isHidden)&&(i=v,l=O-y)),y=w}}u(this,e);let h=(n<0?i:s)||i||s;return h?{tile:h,offset:h==i?l:c}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):n_(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:l}=r;if(this.dom.contains(i.dom))return i.isText()?new ai(i.dom,Math.min(i.dom.nodeValue.length,l)):i.domPosFor(l,i.flags&16?1:i.flags&32?-1:n);let s=r.tile.parent,c=!1;for(let u of s.children){if(c)return new ai(u.dom,0);u==r.tile&&(c=!0)}}return new ai(this.dom,0)}}function n_(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=kf(e);return n[n.length-1]||null}function r_(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class cr extends Qd{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new cr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Yl extends Jt{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,l=e,s=0;e==0&&n<0||e==r&&n>=0?Ee.chrome||Ee.gecko||(e?(i--,s=1):l<r&&(l++,s=-1)):n<0?i--:l<r&&l++;let c=Au(this.dom,i,l).getClientRects();if(!c.length)return null;let u=c[(s?s<0:n>=0)?0:c.length-1];return Ee.safari&&!s&&u.width==0&&(u=Array.prototype.find.call(c,h=>h.width)||u),s?Bf(u,s<0):u||null}static of(e,n){let r=new Yl(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class ts extends Jt{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return Bf(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let l=this.dom.getClientRects(),s=null;if(!l.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=c?l.length-1:0;s=l[u],!(e>0?u==0:u==l.length-1||s.top<s.bottom);u+=c?-1:1);return Bf(s,!c)}}get overrideDOMText(){if(!this.length)return ut.empty;let{root:e}=this;if(!e)return ut.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,l){return l||(l=e.toDOM(n),e.editable||(l.contentEditable="false")),new ts(l,r,e,i)}}class If extends Jt{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return ut.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class i_{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:l,beforeBreak:s,parents:c}=this;for(;e||n>0;)if(i.isComposite())if(s){if(!e)break;r&&r.break(),e--,s=!1}else if(l==i.children.length){if(!e&&!c.length)break;r&&r.leave(i),s=!!i.breakAfter,{tile:i,index:l}=c.pop(),l++}else{let u=i.children[l],h=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(s=!!h,l++,e-=u.length):(c.push({tile:i,index:l}),i=u,l=0,r&&u.isComposite()&&r.enter(u))}else if(l==i.length)s=!!i.breakAfter,{tile:i,index:l}=c.pop(),l++;else if(e){let u=Math.min(e,i.length-l);r&&r.skip(i,l,l+u),e-=u,l+=u}else break;return this.tile=i,this.index=l,this.beforeBreak=s,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class a_{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class l_{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var l;this.flushBuffer();let s=this.ensureMarks(n,r),c=s.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let u=s.children[s.children.length-1]=new Yl(c.dom,c.text+e);u.parent=s}else s.append(i||Yl.of(e,(l=this.cache.find(Yl))===null||l===void 0?void 0:l.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?Rp(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let c=n.marks.length-1;c>=0;c--){let u=n.marks[c],h=i.lastChild;if(h instanceof cr&&h.mark.eq(u.mark))h.dom!=u.dom&&h.setDOM(Rp(u.dom)),i=h;else{if(this.cache.reused.get(u)){let O=Jt.get(u.dom);O&&O.setDOM(Rp(u.dom))}let g=cr.of(u.mark,u.dom);i.append(g),i=g}this.cache.reused.set(u,2)}let l=Jt.get(e.text);l&&this.cache.reused.set(l,2);let s=new Yl(e.text,e.text.nodeValue);s.flags|=8,i.append(s)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let l=this.ensureMarks(n,r);!i&&!(e.flags&16)&&l.append(this.getBuffer(1)),l.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=W9);let i=bo.start(e,n||((r=this.cache.find(bo))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let l=e.length-1;l>=0;l--){let s=e[l],c;if(n>0&&(c=i.lastChild)&&c instanceof cr&&c.mark.eq(s))i=c,n--;else{let u=cr.of(s,(r=this.cache.find(cr,h=>h.mark.eq(s)))===null||r===void 0?void 0:r.dom);i.append(u),i=u,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Zb(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ee.ios&&Zb(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Vp,0,32)||new ts(Vp.toDOM(),0,Vp,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new a_(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof la&&i.wrapper.eq(r.wrapper))n=i;else{let l=la.of(r.wrapper,(e=this.cache.find(la,s=>s.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(l),n=l}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(If,void 0,1);return r&&(r.flags=n),r||new If(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class s_{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:l,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=i;let c=this.textOff=Math.min(e,i.length);return l?null:i.slice(0,c)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const qf=[ts,bo,Yl,cr,If,la,Zd];for(let t=0;t<qf.length;t++)qf[t].bucket=t;class o_{constructor(e){this.view=e,this.buckets=qf.map(()=>[]),this.index=qf.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,l=this.buckets[i],s=this.index[i];for(let c=l.length-1;c>=0;c--){let u=(c+s)%l.length,h=l[u];if((!n||n(h))&&!this.reused.has(h))return l.splice(u,1),u<s&&this.index[i]--,this.reused.set(h,r),h}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let l=0,s=0;;l++){if(l==i.length){if(s)return null;s=1,l=0}let c=i[l];if(!this.reused.has(c)&&(s==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view,c.widget)))return i.splice(l,1),l<this.index[0]&&this.index[0]--,c.widget==e&&c.length==n&&(c.flags&497)==r?(this.reused.set(c,1),c):(this.reused.set(c,2),new ts(c.dom,n,e,c.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class c_{constructor(e,n,r,i,l){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=l,this.openWidget=!1,this.openMarks=0,this.cache=new o_(e),this.text=new s_(e.state.doc),this.builder=new l_(this.cache,new Zd(e,e.contentDOM),nt.iter(r)),this.cache.reused.set(n,2),this.old=new i_(n),this.reuseWalker={skip:(s,c,u)=>{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,l=0,s=0;;){let c=s<e.length?e[s++]:null,u=c?c.fromA:this.old.root.length;if(u>i){let h=u-i;this.preserve(h,!s,!c),i=u,l+=h}if(!c)break;n&&c.fromA<=n.range.fromA&&c.toA>=n.range.toA?(this.forward(c.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(l,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,c.toA),this.emit(n.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(l,c.toB)),l=c.toB,i=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=d_(this.old),l=this.openMarks;this.old.advance(e,r?1:-1,{skip:(s,c,u)=>{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(u-c);else{let h=u>0||c<s.length?ts.of(s.widget,this.view,u-c,s.flags&496,this.cache.maybeReuse(s)):this.cache.reuse(s);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,i,l),l=i.length)}else if(s.isText())this.builder.ensureLine(null),!c&&u==s.length&&!this.cache.reused.has(s)?this.builder.addText(s.text,i,l,this.cache.reuse(s)):(this.cache.add(s),this.builder.addText(s.text.slice(c,u),i,l)),l=i.length;else if(s.isLine())s.flags&=-2,this.cache.reused.set(s,1),this.builder.addLine(s);else if(s instanceof If)this.cache.add(s);else if(s instanceof cr)this.builder.ensureLine(null),this.builder.addMark(s,i,l),this.cache.reused.set(s,1),l=i.length;else return!1;this.openWidget=!1},enter:s=>{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof cr&&i.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?i.length&&(i.length=l=0):s instanceof cr&&(i.shift(),l=Math.min(l,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,l=0,s=nt.spans(this.decorations,e,n,{point:(c,u,h,g,O,x)=>{if(h instanceof Jl){if(this.disallowBlockEffectsFor[x]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(l=g.length,O>g.length)i.continueWidget(u-c);else{let y=h.widget||(h.block?vo.block:vo.inline),v=u_(h),w=this.cache.findWidget(y,u-c,v)||ts.of(y,this.view,u-c,v);h.block?(h.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(w)):(i.ensureLine(r),i.addInlineWidget(w,g,O))}r=null}else r=f_(r,h);u>c&&this.text.skip(u-c)},span:(c,u,h,g)=>{for(let O=c;O<u;){let x=this.text.next(Math.min(512,u-O));x==null?(i.addLineStartIfNotCovered(r),i.addBreak(),O++):(i.ensureLine(r),i.addText(x,h,O==c?g:h.length),O+=x.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=s>l,this.openMarks=s}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let l=Jt.get(i);if(i==this.view.contentDOM)break;l instanceof cr?n.push(l):l!=null&&l.isLine()?r=l:l instanceof la||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new bo(i,W9):r||n.push(cr.of(new Uu({tagName:i.nodeName.toLowerCase(),attributes:VL(i)}),i)))}return{line:r,marks:n}}}function Zb(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function u_(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const W9={class:"cm-line"};function f_(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&e6(n,t),r&&(t.class+=" "+r)),t}function d_(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof cr&&e.push(r.mark)}return e}function Rp(t){let e=Jt.get(t);return e&&e.setDOM(t.cloneNode()),t}class vo extends is{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}vo.inline=new vo("span");vo.block=new vo("div");const Vp=new class extends is{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Nb{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=qe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Zd(e,e.contentDOM),this.updateInner([new Fr(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:g,toA:O})=>O<this.minWidthFrom||g>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!v_(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let l=i>-1?m_(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:g,to:O}=this.hasComposition;r=new Fr(g,O,e.changes.mapPos(g,-1),e.changes.mapPos(O,1)).addToSet(r.slice())}this.hasComposition=l?{from:l.range.fromB,to:l.range.toB}:null,(Ee.ie||Ee.chrome)&&!l&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,c=this.blockWrappers;this.updateDeco();let u=O_(s,this.decorations,e.changes);u.length&&(r=Fr.extendWithRanges(r,u));let h=y_(c,this.blockWrappers,e.changes);return h.length&&(r=Fr.extendWithRanges(r,h)),l&&!r.some(g=>g.fromA<=l.range.fromA&&g.toA>=l.range.toA)&&(r=l.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,l),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let s=this.tile,c=new c_(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Jt.get(n.text)&&c.cache.reused.set(Jt.get(n.text),2),this.tile=c.run(e,n),_g(s,c.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=Ee.chrome||Ee.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(l),l&&(l.written||r.selectionRange.focusNode!=l.node||!this.tile.dom.contains(l.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let l of this.tile.children)l.isWidget()&&l.widget instanceof Lp&&i.push(l.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(B9)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,l=i==r,s=!l&&!(this.view.state.facet(ra)||r.tabIndex>-1)&&eu(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(l||n||s))return;let c=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,h,g;if(u.empty?g=h=this.inlineDOMNearPos(u.anchor,u.assoc||1):(g=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),h=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),Ee.gecko&&u.empty&&!this.hasComposition&&h_(h)){let x=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(x,h.node.childNodes[h.offset]||null)),h=g=new ai(x,0),c=!0}let O=this.view.observer.selectionRange;(c||!O.focusNode||(!tu(h.node,h.offset,O.anchorNode,O.anchorOffset)||!tu(g.node,g.offset,O.focusNode,O.focusOffset))&&!this.suppressWidgetCursorChange(O,u))&&(this.view.observer.ignore(()=>{Ee.android&&Ee.chrome&&r.contains(O.focusNode)&&b_(O.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let x=ku(this.view.root);if(x)if(u.empty){if(Ee.gecko){let y=p_(h.node,h.offset);if(y&&y!=3){let v=(y==1?$9:j9)(h.node,h.offset);v&&(h=new ai(v.node,v.offset))}}x.collapse(h.node,h.offset),u.bidiLevel!=null&&x.caretBidiLevel!==void 0&&(x.caretBidiLevel=u.bidiLevel)}else if(x.extend){x.collapse(h.node,h.offset);try{x.extend(g.node,g.offset)}catch{}}else{let y=document.createRange();u.anchor>u.head&&([h,g]=[g,h]),y.setEnd(g.node,g.offset),y.setStart(h.node,h.offset),x.removeAllRanges(),x.addRange(y)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(h,g)),this.impreciseAnchor=h.precise?null:new ai(O.anchorNode,O.anchorOffset),this.impreciseHead=g.precise?null:new ai(O.focusNode,O.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&tu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=ku(e.root),{anchorNode:i,anchorOffset:l}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let c=s.posAtStart;if(n.head==c||n.head==c+s.length)return;let u=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!u||!h||u.bottom>h.top)return;let g=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(g.node,g.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let O=e.observer.selectionRange;e.docView.posFromDOM(O.anchorNode,O.anchorOffset)!=n.from&&r.collapse(i,l)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let l;if(e==r.dom)l=r.dom.childNodes[n];else{let s=Oa(e)==0?0:n==0?-1:1;for(;;){let c=e.parentNode;if(c==r.dom)break;s==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?s=-1:s=1),e=c}s<0?l=e:l=e.nextSibling}if(l==r.dom.firstChild)return i;for(;l&&!Jt.get(l);)l=l.nextSibling;if(!l)return i+r.length;for(let s=0,c=i;;s++){let u=r.children[s];if(u.dom==l)return c;c+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,l=!1,s,c=-1,u=!1;return this.tile.blockTiles((h,g)=>{if(h.isWidget()){if(h.flags&32&&g>=e)return!0;h.flags&16&&(l=!0)}else{let O=g+h.length;if(g<=e&&(r=h,i=e-g,l=O<e),O>=e&&!s&&(s=h,c=e-g,u=g>e),g>e&&s)return!0}}),!r&&!s?this.domAtPos(e,n):(l&&s?r=null:u&&r&&(s=null),r&&n<0||!s?r.domIn(i,n):s.domIn(c,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Lp?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(l,s){if(l.isComposite())for(let c of l.children){if(c.length>=s){let u=i(c,s);if(u)return u}if(s-=c.length,s<0)break}else if(l.isText()&&s<l.length){let c=Cn(l.text,s);if(c==s)return null;let u=Au(l.dom,s,c).getClientRects();for(let h=0;h<u.length;h++){let g=u[h];if(h==u.length-1||g.top<g.bottom&&g.left<g.right)return g}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,l=this.view.contentDOM.clientWidth,s=l>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,u=this.view.textDirection==ln.LTR,h=0,g=(O,x,y)=>{for(let v=0;v<O.children.length&&!(x>i);v++){let w=O.children[v],A=x+w.length,k=w.dom.getBoundingClientRect(),{height:M}=k;if(y&&!v&&(h+=k.top-y.top),w instanceof la)A>r&&g(w,x,k);else if(x>=r&&(h>0&&n.push(-h),n.push(M+h),h=0,s)){let E=w.dom.lastChild,$=E?kf(E):[];if($.length){let C=$[$.length-1],j=u?C.right-k.left:k.right-C.left;j>c&&(c=j,this.minWidth=l,this.minWidthFrom=x,this.minWidthTo=A)}}y&&v==O.children.length-1&&(h+=y.bottom-k.bottom),x=A+w.breakAfter}};return g(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?ln.RTL:ln.LTR}measureTextSize(){let e=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let c=0,u;for(let h of s.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let g=kf(h.dom);if(g.length!=1)return;c+=g[0].width,u=g[0].height}if(c)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:c/s.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),r,i,l;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=kf(n.firstChild)[0];r=n.getBoundingClientRect().height,i=s&&s.width?s.width/27:7,l=s&&s.height?s.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:l}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let l=i==n.viewports.length?null:n.viewports[i],s=l?l.from-1:this.view.state.doc.length;if(s>r){let c=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(qe.replace({widget:new Lp(c),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!l)break;r=l.to+1}return qe.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Pd).map(l=>(this.dynamicDecorationMap[e++]=typeof l=="function")?l(this.view):l),r=!1,i=this.view.state.facet(l6).map((l,s)=>{let c=typeof l=="function";return c&&(r=!0),c?l(this.view):l});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(nt.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(I9).map(l=>typeof l=="function"?l(this.view):l)}scrollIntoView(e){var n;if(e.isSnapshot){let g=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=g.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let g of this.view.state.facet(F9))try{if(g(this.view,e.range,e))return!0}catch(O){Mi(this.view.state,O,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),l;if(!i)return;!r.empty&&(l=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,l.left),top:Math.min(i.top,l.top),right:Math.max(i.right,l.right),bottom:Math.max(i.bottom,l.bottom)});let s=U9(this.view),c={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:u,offsetHeight:h}=this.view.scrollDOM;if(DL(this.view.scrollDOM,c,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==ln.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let g=this.view.docView.lineAt(r.head,1);g&&g.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){_g(this.tile)}}function _g(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)_g(r,e)}}function h_(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function K9(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=$9(n.focusNode,n.focusOffset),i=j9(n.focusNode,n.focusOffset),l=r||i;if(i&&r&&i.node!=r.node){let c=Jt.get(i.node);if(!c||c.isText()&&c.text!=i.node.nodeValue)l=i;else if(t.docView.lastCompositionAfterCursor){let u=Jt.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(l=i)}}if(t.docView.lastCompositionAfterCursor=l!=r,!l)return null;let s=e-l.offset;return{from:s,to:s+l.node.nodeValue.length,node:l.node}}function m_(t,e,n){let r=K9(t,n);if(!r)return null;let{node:i,from:l,to:s}=r,c=i.nodeValue;if(/[\n\r]/.test(c)||t.state.doc.sliceString(r.from,r.to)!=c)return null;let u=e.invertedDesc;return{range:new Fr(u.mapPos(l),u.mapPos(s),l,s),text:i}}function p_(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let g_=class{constructor(){this.changes=[]}compareRange(e,n){io(e,n,this.changes)}comparePoint(e,n){io(e,n,this.changes)}boundChange(e){io(e,e,this.changes)}};function O_(t,e,n){let r=new g_;return nt.compare(t,e,n,r),r.changes}class x_{constructor(){this.changes=[]}compareRange(e,n){io(e,n,this.changes)}comparePoint(){}boundChange(e){io(e,e,this.changes)}}function y_(t,e,n){let r=new x_;return nt.compare(t,e,n,r),r.changes}function b_(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function v_(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class Lp extends is{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function S_(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),l=e-i.from;if(i.length==0)return ge.cursor(e);l==0?n=1:l==i.length&&(n=-1);let s=l,c=l;n<0?s=Cn(i.text,l,!1):c=Cn(i.text,l);let u=r(i.text.slice(s,c));for(;s>0;){let h=Cn(i.text,s,!1);if(r(i.text.slice(h,s))!=u)break;s=h}for(;c<i.length;){let h=Cn(i.text,c);if(r(i.text.slice(c,h))!=u)break;c=h}return ge.range(s+i.from,c+i.from)}function w_(t,e,n,r,i){let l=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let c=t.viewState.heightOracle.textHeight,u=Math.floor((i-n.top-(t.defaultLineHeight-c)*.5)/c);l+=u*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+$L(s,l,t.state.tabSize)}function k_(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let l of r.type){if(l.from>e)break;if(!(l.to<e)){if(l.from<e&&l.to>e)return l;(!i||l.type==fr.Text&&(i.type!=l.type||(n<0?l.from<e:l.to>e)))&&(i=l)}}return i||r}return r}function A_(t,e,n,r){let i=k_(t,e.head,e.assoc||-1),l=!r||i.type!=fr.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(l){let s=t.dom.getBoundingClientRect(),c=t.textDirectionAt(i.from),u=t.posAtCoords({x:n==(c==ln.LTR)?s.right-1:s.left+1,y:(l.top+l.bottom)/2});if(u!=null)return ge.cursor(u,n?-1:1)}return ge.cursor(n?i.to:i.from,n?-1:1)}function Rb(t,e,n,r){let i=t.state.doc.lineAt(e.head),l=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let c=e,u=null;;){let h=WL(i,l,s,c,n),g=R9;if(!h){if(i.number==(n?t.state.doc.lines:1))return c;g=`
105
- `,i=t.state.doc.line(i.number+(n?1:-1)),l=t.bidiSpans(i),h=t.visualLineSide(i,!n)}if(u){if(!u(g))return c}else{if(!r)return h;u=r(g)}c=h}}function M_(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return l=>{let s=r(l);return i==It.Space&&(i=s),i==s}}function C_(t,e,n,r){let i=e.head,l=n?1:-1;if(i==(n?t.state.doc.length:0))return ge.cursor(i,e.assoc);let s=e.goalColumn,c,u=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),g=t.documentTop;if(h)s==null&&(s=h.left-u.left),c=l<0?h.top:h.bottom;else{let v=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(u.right-u.left,t.defaultCharacterWidth*(i-v.from))),c=(l<0?v.top:v.bottom)+g}let O=u.left+s,x=t.viewState.heightOracle.textHeight>>1,y=r??x;for(let v=0;;v+=x){let w=c+(y+v)*l,A=Dg(t,{x:O,y:w},!1,l);if(n?w>u.bottom:w<u.top)return ge.cursor(A.pos,A.assoc);let k=t.coordsAtPos(A.pos,A.assoc),M=k?(k.top+k.bottom)/2:0;if(!k||(n?M>c:M<c))return ge.cursor(A.pos,A.assoc,void 0,s)}}function nu(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(l,s,c)=>{if(e>l&&e<s){let u=r||n||(e-l<s-e?-1:1);e=u<0?l:s,r=u}});if(!r)return e}}function J9(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],l=null;if(i.empty){let s=nu(t,i.from,0);s!=i.from&&(l=ge.cursor(s,-1))}else{let s=nu(t,i.from,-1),c=nu(t,i.to,1);(s!=i.from||c!=i.to)&&(l=ge.range(i.from==i.anchor?s:c,i.from==i.head?s:c))}l&&(n||(n=e.ranges.slice()),n[r]=l)}return n?ge.create(n,e.mainIndex):e}function _p(t,e,n){let r=nu(t.state.facet(Ku).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:ge.cursor(r,r<n.from?1:-1)}class ki{constructor(e,n){this.pos=e,this.assoc=n}}function Dg(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),l=i.top+t.viewState.paddingTop,{x:s,y:c}=e,u=c-l,h;for(;;){if(u<0)return new ki(0,1);if(u>t.viewState.docHeight)return new ki(t.state.doc.length,-1);if(h=t.elementAtHeight(u),r==null)break;if(h.type==fr.Text){if(r<0?h.to<t.viewport.from:h.from>t.viewport.to)break;let x=t.docView.coordsAt(r<0?h.from:h.to,r>0?-1:1);if(x&&(r<0?x.top<=u+l:x.bottom>=u+l))break}let O=t.viewState.heightOracle.textHeight/2;u=r>0?h.bottom+O:h.top-O}if(t.viewport.from>=h.to||t.viewport.to<=h.from){if(n)return null;if(h.type==fr.Text){let O=w_(t,i,h,s,c);return new ki(O,O==h.from?1:-1)}}if(h.type!=fr.Text)return u<(h.top+h.bottom)/2?new ki(h.from,1):new ki(h.to,-1);let g=t.docView.lineAt(h.from,2);return(!g||g.length!=h.length)&&(g=t.docView.lineAt(h.from,-2)),new E_(t,s,c,t.textDirectionAt(h.from)).scanTile(g,h.from)}class E_{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Ai.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Ai.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,l=new Set,s=this.bidiIn(e[0],e[i]),c,u,h=-1,g=1e9,O;e:for(;r<i;){let y=i-r,v=r+i>>1;t:if(l.has(v)){let A=r+Math.floor(Math.random()*y);for(let k=0;k<y;k++){if(!l.has(A)){v=A;break t}A++,A==i&&(A=r)}break e}l.add(v);let w=n(v);if(w)for(let A=0;A<w.length;A++){let k=w[A],M=0;if(!(k.width==0&&w.length>1)){if(k.bottom<this.y)(!c||c.bottom<k.bottom)&&(c=k),M=1;else if(k.top>this.y)(!u||u.top>k.top)&&(u=k),M=-1;else{let E=k.left>this.x?this.x-k.left:k.right<this.x?this.x-k.right:0,$=Math.abs(E);$<g&&(h=v,g=$,O=k),E&&(M=E<0==(this.baseDir==ln.LTR)?-1:1)}M==-1&&(!s||this.baseDirAt(e[v],1))?i=v:M==1&&(!s||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}}if(!O){let y=c&&(!u||this.y-c.bottom<u.top-this.y)?c:u;return this.y=(y.top+y.bottom)/2,this.scan(e,n)}let x=(s?this.dirAt(e[h],1):this.baseDir)==ln.LTR;return{i:h,after:this.x>(O.left+O.right)/2==x}}scanText(e,n){let r=[];for(let l=0;l<e.length;l=Cn(e.text,l))r.push(n+l);r.push(n+e.length);let i=this.scan(r,l=>{let s=r[l]-n,c=r[l+1]-n;return Au(e.dom,s,c).getClientRects()});return i.after?new ki(r[i.i+1],-1):new ki(r[i.i],1)}scanTile(e,n){if(!e.length)return new ki(n,1);if(e.children.length==1){let c=e.children[0];if(c.isText())return this.scanText(c,n);if(c.isComposite())return this.scanTile(c,n)}let r=[n];for(let c=0,u=n;c<e.children.length;c++)r.push(u+=e.children[c].length);let i=this.scan(r,c=>{let u=e.children[c];return u.flags&48?null:(u.dom.nodeType==1?u.dom:Au(u.dom,0,u.length)).getClientRects()}),l=e.children[i.i],s=r[i.i];return l.isText()?this.scanText(l,s):l.isComposite()?this.scanTile(l,s):i.after?new ki(r[i.i+1],-1):new ki(s,1)}}const Bs="￿";class T_{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(gt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Bs}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let l=this.text.length;this.readNode(i);let s=Jt.get(i),c=i.nextSibling;if(c==n){s!=null&&s.breakAfter&&!c&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Jt.get(c);(s&&u?s.breakAfter:(s?s.breakAfter:Ff(i))||Ff(c)&&(i.nodeName!="BR"||s!=null&&s.isWidget())&&this.text.length>l)&&!j_(c,n)&&this.lineBreak(),i=c}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let l=-1,s=1,c;if(this.lineSeparator?(l=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(c=i.exec(n))&&(l=c.index,s=c[0].length),this.append(n.slice(r,l<0?n.length:l)),l<0)break;if(this.lineBreak(),s>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=s-1);r=l+s}}readNode(e){let n=Jt.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+($_(e,r.node,r.offset)?n:0))}}function $_(t,e,n){for(;;){if(!e||n<Oa(e))return!1;if(e==t)return!0;n=gl(e)+1,e=e.parentNode}}function j_(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Jt.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class Vb{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class P_{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:l,impreciseAnchor:s}=e.docView,c=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=ek(e.docView.tile,n,r,0))){let u=l||s?[]:Z_(e),h=new T_(u,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=N_(u,this.bounds.from)}else{let u=e.observer.selectionRange,h=l&&l.node==u.focusNode&&l.offset==u.focusOffset||!Zg(e.contentDOM,u.focusNode)?c.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),g=s&&s.node==u.anchorNode&&s.offset==u.anchorOffset||!Zg(e.contentDOM,u.anchorNode)?c.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),O=e.viewport;if((Ee.ios||Ee.chrome)&&c.main.empty&&h!=g&&(O.from>0||O.to<e.state.doc.length)){let x=Math.min(h,g),y=Math.max(h,g),v=O.from-x,w=O.to-y;(v==0||v==1||x==0)&&(w==0||w==-1||y==e.state.doc.length)&&(h=0,g=e.state.doc.length)}if(e.inputState.composing>-1&&c.ranges.length>1)this.newSel=c.replaceRange(ge.range(g,h));else if(e.lineWrapping&&g==h&&!(c.main.empty&&c.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let x=e.coordsAtPos(h,-1),y=0;x&&(y=e.inputState.lastTouchY<=x.bottom?-1:1),this.newSel=ge.create([ge.cursor(h,y)])}else this.newSel=ge.single(g,h)}}}function ek(t,e,n,r){if(t.isComposite()){let i=-1,l=-1,s=-1,c=-1;for(let u=0,h=r,g=r;u<t.children.length;u++){let O=t.children[u],x=h+O.length;if(h<e&&x>n)return ek(O,e,n,h);if(x>=e&&i==-1&&(i=u,l=h),h>n&&O.dom.parentNode==t.dom){s=u,c=g;break}g=x,h=x+O.breakAfter}return{from:l,to:c<0?r+t.length:c,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s<t.children.length&&s>=0?t.children[s].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function tk(t,e){let n,{newSel:r}=e,{state:i}=t,l=i.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:c,to:u}=e.bounds,h=l.from,g=null;(s===8||Ee.android&&e.text.length<u-c)&&(h=l.to,g="end");let O=i.doc.sliceString(c,u,Bs),x,y;!l.empty&&l.from>=c&&l.to<=u&&(e.typeOver||O!=e.text)&&O.slice(0,l.from-c)==e.text.slice(0,l.from-c)&&O.slice(l.to-c)==e.text.slice(x=e.text.length-(O.length-(l.to-c)))?n={from:l.from,to:l.to,insert:ut.of(e.text.slice(l.from-c,x).split(Bs))}:(y=nk(O,e.text,h-c,g))&&(Ee.chrome&&s==13&&y.toB==y.from+2&&e.text.slice(y.from,y.toB)==Bs+Bs&&y.toB--,n={from:c+y.from,to:c+y.toA,insert:ut.of(e.text.slice(y.from,y.toB).split(Bs))})}else r&&(!t.hasFocus&&i.facet(ra)||Gf(r,l))&&(r=null);if(!n&&!r)return!1;if((Ee.mac||Ee.android)&&n&&n.from==n.to&&n.from==l.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=ge.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:ut.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(l.from).to<l.to&&t.docView.lineHasWidget(l.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:l.from,to:l.to,insert:i.toText(t.inputState.insertingText)}:Ee.chrome&&n&&n.from==n.to&&n.from==l.head&&n.insert.toString()==`
106
- `&&t.lineWrapping&&(r&&(r=ge.single(r.main.anchor-1,r.main.head-1)),n={from:l.from,to:l.to,insert:ut.of([" "])}),n)return s6(t,n,r,s);if(r&&!Gf(r,l)){let c=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(c=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(r=J9(i.facet(Ku).map(h=>h(t)),r))),t.dispatch({selection:r,scrollIntoView:c,userEvent:u}),!0}else return!1}function s6(t,e,n,r=-1){if(Ee.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Ee.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ao(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&ao(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&ao(t.contentDOM,"Delete",46)))return!0;let l=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,c=()=>s||(s=Q_(t,e,n));return t.state.facet(H9).some(u=>u(t,e.from,e.to,l,c))||t.dispatch(c()),!0}function Q_(t,e,n){let r,i=t.state,l=i.selection.main,s=-1;if(e.from==e.to&&e.from<l.from||e.from>l.to){let u=e.from<l.from?-1:1,h=u<0?l.from:l.to,g=nu(i.facet(Ku).map(O=>O(t)),h,u);e.from==g&&(s=g)}if(s>-1)r={changes:e,selection:ge.cursor(e.from+e.insert.length,-1)};else if(e.from>=l.from&&e.to<=l.to&&e.to-e.from>=(l.to-l.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=l.from<e.from?i.sliceDoc(l.from,e.from):"",h=l.to>e.to?i.sliceDoc(e.to,l.to):"";r=i.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let u=i.changes(e),h=n&&n.main.to<=u.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=l.to+10&&e.to>=l.to-10){let g=t.state.sliceDoc(e.from,e.to),O,x=n&&K9(t,n.main.head);if(x){let v=e.insert.length-(e.to-e.from);O={from:x.from,to:x.to-v}}else O=t.state.doc.lineAt(l.head);let y=l.to-e.to;r=i.changeByRange(v=>{if(v.from==l.from&&v.to==l.to)return{changes:u,range:h||v.map(u)};let w=v.to-y,A=w-g.length;if(t.state.sliceDoc(A,w)!=g||w>=O.from&&A<=O.to)return{range:v};let k=i.changes({from:A,to:w,insert:e.insert}),M=v.to-l.to;return{changes:k,range:h?ge.range(Math.max(0,h.anchor+M),Math.max(0,h.head+M)):v.map(k)}})}else r={changes:u,selection:h&&i.selection.replaceRange(h)}}let c="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,c+=".compose",t.inputState.compositionFirstChange&&(c+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:c,scrollIntoView:!0})}function nk(t,e,n,r){let i=Math.min(t.length,e.length),l=0;for(;l<i&&t.charCodeAt(l)==e.charCodeAt(l);)l++;if(l==i&&t.length==e.length)return null;let s=t.length,c=e.length;for(;s>0&&c>0&&t.charCodeAt(s-1)==e.charCodeAt(c-1);)s--,c--;if(r=="end"){let u=Math.max(0,l-Math.min(s,c));n-=s+u-l}if(s<l&&t.length<e.length){let u=n<=l&&n>=s?l-n:0;l-=u,c=l+(c-s),s=l}else if(c<l){let u=n<=l&&n>=c?l-n:0;l-=u,s=l+(s-c),c=l}return{from:l,toA:s,toB:c}}function Z_(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:l}=t.observer.selectionRange;return n&&(e.push(new Vb(n,r)),(i!=n||l!=r)&&e.push(new Vb(i,l))),e}function N_(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?ge.single(n+e,r+e):null}function Gf(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class R_{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ee.safari&&e.contentDOM.addEventListener("input",()=>null),Ee.gecko&&W_(e.contentDOM.ownerDocument)}handleEvent(e){!F_(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=V_(e),r=this.handlers,i=this.view.contentDOM;for(let l in n)if(l!="scroll"){let s=!n[l].handlers.length,c=r[l];c&&s!=!c.handlers.length&&(i.removeEventListener(l,this.handleEvent),c=null),c||i.addEventListener(l,this.handleEvent,{passive:s})}for(let l in r)l!="scroll"&&!n[l]&&i.removeEventListener(l,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&ik.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ee.android&&Ee.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Ee.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=rk.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||L_.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ao(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Ee.safari&&!Ee.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Lb(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Mi(n.state,i)}}}function V_(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,l=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(l)for(let c in l){let u=l[c];u&&n(c).handlers.push(Lb(r.value,u))}if(s)for(let c in s){let u=s[c];u&&n(c).observers.push(Lb(r.value,u))}}for(let r in oi)n(r).handlers.push(oi[r]);for(let r in hr)n(r).observers.push(hr[r]);return e}const rk=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],L_="dthko",ik=[16,17,18,20,91,92,224,225],D1=6;function H1(t){return Math.max(0,t)*.7+8}function __(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class D_{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=C9(e.contentDOM),this.atoms=e.state.facet(Ku).map(s=>s(e));let l=e.contentDOM.ownerDocument;l.addEventListener("mousemove",this.move=this.move.bind(this)),l.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(gt.allowMultipleSelections)&&H_(e,n),this.dragging=z_(e,n)&&sk(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&__(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,l=0,s=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:l,bottom:c}=this.scrollParents.y.getBoundingClientRect());let u=U9(this.view);e.clientX-u.left<=i+D1?n=-H1(i-e.clientX):e.clientX+u.right>=s-D1&&(n=H1(e.clientX-s)),e.clientY-u.top<=l+D1?r=-H1(l-e.clientY):e.clientY+u.bottom>=c-D1&&(r=H1(e.clientY-c)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=J9(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function H_(t,e){let n=t.state.facet(V9);return n.length?n[0](e):Ee.mac?e.metaKey:e.ctrlKey}function X_(t,e){let n=t.state.facet(L9);return n.length?n[0](e):Ee.mac?!e.altKey:!e.ctrlKey}function z_(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=ku(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let l=0;l<i.length;l++){let s=i[l];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function F_(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Jt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const oi=Object.create(null),hr=Object.create(null),ak=Ee.ie&&Ee.ie_version<15||Ee.ios&&Ee.webkit_version<604;function B_(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),lk(t,n.value)},50)}function Nd(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function lk(t,e){e=Nd(t.state,r6,e);let{state:n}=t,r,i=1,l=n.toText(e),s=l.lines==n.selection.ranges.length;if(Hg!=null&&n.selection.ranges.every(u=>u.empty)&&Hg==l.toString()){let u=-1;r=n.changeByRange(h=>{let g=n.doc.lineAt(h.from);if(g.from==u)return{range:h};u=g.from;let O=n.toText((s?l.line(i++).text:e)+n.lineBreak);return{changes:{from:g.from,insert:O},range:ge.cursor(h.from+O.length)}})}else s?r=n.changeByRange(u=>{let h=l.line(i++);return{changes:{from:u.from,to:u.to,insert:h.text},range:ge.cursor(u.from+h.length)}}):r=n.replaceSelection(l);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}hr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};hr.wheel=hr.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};oi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);hr.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};hr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};oi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(_9))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=I_(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new D_(t,e,n,r)),r&&t.observer.ignore(()=>{E9(t.contentDOM);let l=t.root.activeElement;l&&!l.contains(t.contentDOM)&&l.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function _b(t,e,n,r){if(r==1)return ge.cursor(e,n);if(r==2)return S_(t.state,e,n);{let i=t.docView.lineAt(e,n),l=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:l.from,c=i?i.posAtEnd:l.to;return c<t.state.doc.length&&c==l.to&&c++,ge.range(s,c)}}const Y_=Ee.ie&&Ee.ie_version<=11;let Db=null,Hb=0,Xb=0;function sk(t){if(!Y_)return t.detail;let e=Db,n=Xb;return Db=t,Xb=Date.now(),Hb=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Hb+1)%3:1}function I_(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=sk(e),i=t.state.selection;return{update(l){l.docChanged&&(n.pos=l.changes.mapPos(n.pos),i=i.map(l.changes))},get(l,s,c){let u=t.posAndSideAtCoords({x:l.clientX,y:l.clientY},!1),h,g=_b(t,u.pos,u.assoc,r);if(n.pos!=u.pos&&!s){let O=_b(t,n.pos,n.assoc,r),x=Math.min(O.from,g.from),y=Math.max(O.to,g.to);g=x<g.from?ge.range(x,y,g.assoc):ge.range(y,x,g.assoc)}return s?i.replaceRange(i.main.extend(g.from,g.to,g.assoc)):c&&r==1&&i.ranges.length>1&&(h=q_(i,u.pos))?h:c?i.addRange(g):ge.create([g])}}}function q_(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return ge.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}oi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let l=i.posAtStart,s=l+i.length;(l>=n.to||s<=n.from)&&(n=ge.range(l,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Nd(t.state,i6,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};oi.dragend=t=>(t.inputState.draggedContent=null,!1);function zb(t,e,n,r){if(n=Nd(t.state,r6,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:l}=t.inputState,s=r&&l&&X_(t,e)?{from:l.from,to:l.to}:null,c={from:i,insert:n},u=t.state.changes(s?[s,c]:c);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}oi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,l=()=>{++i==n.length&&zb(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let c=new FileReader;c.onerror=l,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(r[s]=c.result),l()},c.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return zb(t,e,r,!0),!0}return!1};oi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=ak?null:e.clipboardData;return n?(lk(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(B_(t),!1)};function G_(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function U_(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:l}of t.selection.ranges){let s=t.doc.lineAt(l);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:Nd(t,i6,e.join(t.lineBreak)),ranges:n,linewise:r}}let Hg=null;oi.copy=oi.cut=(t,e)=>{if(!eu(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=U_(t.state);if(!n&&!i)return!1;Hg=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let l=ak?null:e.clipboardData;return l?(l.clearData(),l.setData("text/plain",n),!0):(G_(t,n),!1)};const ok=va.define();function ck(t,e){let n=[];for(let r of t.facet(X9)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:ok.of(!0)}):null}function uk(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=ck(t.state,e);n?t.dispatch(n):t.update([])}},10)}hr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),uk(t)};hr.blur=t=>{t.observer.clearSelectionRange(),uk(t)};hr.compositionstart=hr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};hr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ee.chrome&&Ee.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};hr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};oi.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let l=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(l&&s.length){let c=s[0],u=t.posAtDOM(c.startContainer,c.startOffset),h=t.posAtDOM(c.endContainer,c.endOffset);return s6(t,{from:u,to:h,insert:t.state.toText(l)},null),!0}}let i;if(Ee.chrome&&Ee.android&&(i=rk.find(l=>l.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let l=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>l+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ee.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ee.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>hr.compositionend(t,e),20),!1};const Fb=new Set;function W_(t){Fb.has(t)||(Fb.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Bb=["pre-wrap","normal","pre-line","break-spaces"];let So=!1;function Yb(){So=!1}class K_{constructor(e){this.lineWrapping=e,this.doc=ut.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Bb.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,l,s){let c=Bb.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=c||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=c,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=l,u){this.heightSamples={};for(let h=0;h<s.length;h++){let g=s[h];g<0?h++:this.heightSamples[Math.floor(g*10)]=!0}}return u}}class J_{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ri{constructor(e,n,r,i,l){this.from=e,this.length=n,this.top=r,this.height=i,this._content=l}get type(){return typeof this._content=="number"?fr.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Jl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ri(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Vt=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Vt||(Vt={}));const Af=.001;class Un{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Af&&(So=!0),this.height=e)}replace(e,n,r){return Un.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let l=this,s=r.doc;for(let c=i.length-1;c>=0;c--){let{fromA:u,toA:h,fromB:g,toB:O}=i[c],x=l.lineAt(u,Vt.ByPosNoHeight,r.setDoc(n),0,0),y=x.to>=h?x:l.lineAt(h,Vt.ByPosNoHeight,r,0,0);for(O+=y.to-h,h=y.to;c>0&&x.from<=i[c-1].toA;)u=i[c-1].fromA,g=i[c-1].fromB,c--,u<x.from&&(x=l.lineAt(u,Vt.ByPosNoHeight,r,0,0));g+=x.from-u,u=x.from;let v=o6.build(r.setDoc(s),e,g,O);l=Uf(l,l.replace(u,h,v))}return l.updateHeight(r,0)}static empty(){return new Mr(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,l=0;for(;;)if(n==r)if(i>l*2){let c=e[n-1];c.break?e.splice(--n,1,c.left,null,c.right):e.splice(--n,1,c.left,c.right),r+=1+c.break,i-=c.size}else if(l>i*2){let c=e[r];c.break?e.splice(r,1,c.left,null,c.right):e.splice(r,1,c.left,c.right),r+=2+c.break,l-=c.size}else break;else if(i<l){let c=e[n++];c&&(i+=c.size)}else{let c=e[--r];c&&(l+=c.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,r++),new tD(Un.of(e.slice(0,n)),s,Un.of(e.slice(r)))}}function Uf(t,e){return t==e?t:(t.constructor!=e.constructor&&(So=!0),e)}Un.prototype.size=1;const eD=qe.replace({});class fk extends Un{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new ri(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new ri(i,0,r,this.spaceAbove,eD):this.mainBlock(r,i)}lineAt(e,n,r,i,l){let s=this.mainBlock(i,l);return this.spaceAbove?this.blockAt(0,r,i,l).join(s):s}forEachLine(e,n,r,i,l,s){e<=l+this.length&&n>=l&&s(this.lineAt(0,Vt.ByPos,r,i,l))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Mr extends fk{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new ri(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Mr||i instanceof Rn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Rn?i=new Mr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Un.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Rn extends Un{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,l=i-r+1,s,c=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*l);s=u/l,this.length>l+1&&(c=(this.height-u)/(this.length-l-1))}else s=this.height/l;return{firstLine:r,lastLine:i,perLine:s,perChar:c}}blockAt(e,n,r,i){let{firstLine:l,lastLine:s,perLine:c,perChar:u}=this.heightMetrics(n,i);if(n.lineWrapping){let h=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),g=n.doc.lineAt(h),O=c+g.length*u,x=Math.max(r,e-O/2);return new ri(g.from,g.length,x,O,0)}else{let h=Math.max(0,Math.min(s-l,Math.floor((e-r)/c))),{from:g,length:O}=n.doc.line(l+h);return new ri(g,O,r+c*h,c,0)}}lineAt(e,n,r,i,l){if(n==Vt.ByHeight)return this.blockAt(e,r,i,l);if(n==Vt.ByPosNoHeight){let{from:y,to:v}=r.doc.lineAt(e);return new ri(y,v-y,0,0,0)}let{firstLine:s,perLine:c,perChar:u}=this.heightMetrics(r,l),h=r.doc.lineAt(e),g=c+h.length*u,O=h.number-s,x=i+c*O+u*(h.from-l-O);return new ri(h.from,h.length,Math.max(i,Math.min(x,i+this.height-g)),g,0)}forEachLine(e,n,r,i,l,s){e=Math.max(e,l),n=Math.min(n,l+this.length);let{firstLine:c,perLine:u,perChar:h}=this.heightMetrics(r,l);for(let g=e,O=i;g<=n;){let x=r.doc.lineAt(g);if(g==e){let v=x.number-c;O+=u*v+h*(e-l-v)}let y=u+h*x.length;s(new ri(x.from,x.length,O,y,0)),O+=y,g=x.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let l=r[r.length-1];l instanceof Rn?r[r.length-1]=new Rn(l.length+i):r.push(null,new Rn(i-1))}if(e>0){let l=r[0];l instanceof Rn?r[0]=new Rn(e+l.length):r.unshift(new Rn(e-1),null)}return Un.of(r)}decomposeLeft(e,n){n.push(new Rn(e-1),null)}decomposeRight(e,n){n.push(null,new Rn(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let l=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],c=Math.max(n,i.from),u=-1;for(i.from>n&&s.push(new Rn(i.from-n-1).updateHeight(e,n));c<=l&&i.more;){let g=e.doc.lineAt(c).length;s.length&&s.push(null);let O=i.heights[i.index++],x=0;O<0&&(x=-O,O=i.heights[i.index++]),u==-1?u=O:Math.abs(O-u)>=Af&&(u=-2);let y=new Mr(g,O,x);y.outdated=!1,s.push(y),c+=g+1}c<=l&&s.push(null,new Rn(l-c).updateHeight(e,c));let h=Un.of(s);return(u<0||Math.abs(h.height-this.height)>=Af||Math.abs(u-this.heightMetrics(e,n).perLine)>=Af)&&(So=!0),Uf(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class tD extends Un{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let l=r+this.left.height;return e<l?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,l,i+this.left.length+this.break)}lineAt(e,n,r,i,l){let s=i+this.left.height,c=l+this.left.length+this.break,u=n==Vt.ByHeight?e<s:e<c,h=u?this.left.lineAt(e,n,r,i,l):this.right.lineAt(e,n,r,s,c);if(this.break||(u?h.to<c:h.from>c))return h;let g=n==Vt.ByPosNoHeight?Vt.ByPosNoHeight:Vt.ByPos;return u?h.join(this.right.lineAt(c,g,r,s,c)):this.left.lineAt(c,g,r,i,l).join(h)}forEachLine(e,n,r,i,l,s){let c=i+this.left.height,u=l+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,r,i,l,s),n>=u&&this.right.forEachLine(e,n,r,c,u,s);else{let h=this.lineAt(u,Vt.ByPos,r,i,l);e<h.from&&this.left.forEachLine(e,h.from-1,r,i,l,s),h.to>=e&&h.from<=n&&s(h),n>h.to&&this.right.forEachLine(h.to+1,n,r,c,u,s)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let l=[];e>0&&this.decomposeLeft(e,l);let s=l.length;for(let c of r)l.push(c);if(e>0&&Ib(l,s-1),n<this.length){let c=l.length;this.decomposeRight(n,l),Ib(l,c)}return Un.of(l)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Un.of(this.break?[e,null,n]:[e,n]):(this.left=Uf(this.left,e),this.right=Uf(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:l,right:s}=this,c=n+l.length+this.break,u=null;return i&&i.from<=n+l.length&&i.more?u=l=l.updateHeight(e,n,r,i):l.updateHeight(e,n,r),i&&i.from<=c+s.length&&i.more?u=s=s.updateHeight(e,c,r,i):s.updateHeight(e,c,r),u?this.balanced(l,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ib(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof Rn&&(r=t[e+1])instanceof Rn&&t.splice(e-1,3,new Rn(n.length+1+r.length))}const nD=5;class o6{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Mr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Mr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,l=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-e;r.block?this.addBlock(new fk(s,i,r)):(s||l||i>=nD)&&this.addLineDeco(i,l,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Mr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new Rn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Mr)return e;let n=new Mr(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Mr)&&!this.isCovered?this.nodes.push(new Mr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Mr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let l=new o6(r,e);return nt.spans(n,r,i,l,0),l.finish(r)}}function rD(t,e,n){let r=new iD;return nt.compare(t,e,n,r,0),r.changes}class iD{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&io(e,n,this.changes,5)}}function aD(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,l=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),c=Math.max(0,n.top),u=Math.min(i.innerHeight,n.bottom);for(let h=t.parentNode;h&&h!=r.body;)if(h.nodeType==1){let g=h,O=window.getComputedStyle(g);if((g.scrollHeight>g.clientHeight||g.scrollWidth>g.clientWidth)&&O.overflow!="visible"){let x=g.getBoundingClientRect();l=Math.max(l,x.left),s=Math.min(s,x.right),c=Math.max(c,x.top),u=Math.min(h==t.parentNode?i.innerHeight:u,x.bottom)}h=O.position=="absolute"||O.position=="fixed"?g.offsetParent:g.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:l-n.left,right:Math.max(l,s)-n.left,top:c-(n.top+e),bottom:Math.max(c,u)-(n.top+e)}}function lD(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function sD(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Dp{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],l=n[r];if(i.from!=l.from||i.to!=l.to||i.size!=l.size)return!1}return!0}draw(e,n){return qe.replace({widget:new oD(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class oD extends is{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class qb{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Gb,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ln.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(a6).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new K_(r),this.stateDeco=Ub(n),this.heightMap=Un.empty().applyChanges(this.stateDeco,ut.empty,this.heightOracle.setDoc(n.doc),[new Fr(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=qe.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:l,to:s})=>i>=l&&i<=s)){let{from:l,to:s}=this.lineBlockAt(i);e.push(new X1(l,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Gb:new c6(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Fc(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=Ub(this.state);let i=e.changedRanges,l=Fr.extendWithRanges(i,rD(r,this.stateDeco,e?e.changes:xn.empty(this.state.doc.length))),s=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Yb(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),l),(this.heightMap.height!=s||So)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let u=l.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let h=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(JL)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,l=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ln.RTL:ln.LTR;let s=this.heightOracle.mustRefreshForWrapping(l)||this.mustMeasureContent==="refresh",c=n.getBoundingClientRect(),u=s||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let h=0,g=0;if(c.width&&c.height){let{scaleX:C,scaleY:j}=M9(n,c);(C>.005&&Math.abs(this.scaleX-C)>.005||j>.005&&Math.abs(this.scaleY-j)>.005)&&(this.scaleX=C,this.scaleY=j,h|=16,s=u=!0)}let O=(parseInt(r.paddingTop)||0)*this.scaleY,x=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=O||this.paddingBottom!=x)&&(this.paddingTop=O,this.paddingBottom=x,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let y=C9(this.view.contentDOM,!1).y;y!=this.scrollParent&&(this.scrollParent=y,this.scrollAnchorHeight=-1,this.scrollOffset=0);let v=this.getScrollOffset();this.scrollOffset!=v&&(this.scrollAnchorHeight=-1,this.scrollOffset=v),this.scrolledToBottom=T9(this.scrollParent||e.win);let w=(this.printing?sD:aD)(n,this.paddingTop),A=w.top-this.pixelViewport.top,k=w.bottom-this.pixelViewport.bottom;this.pixelViewport=w;let M=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(M!=this.inView&&(this.inView=M,M&&(u=!0)),!this.inView&&!this.scrollTarget&&!lD(e.dom))return 0;let E=c.width;if((this.contentDOMWidth!=E||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),u){let C=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(C)&&(s=!0),s||i.lineWrapping&&Math.abs(E-this.contentDOMWidth)>i.charWidth){let{lineHeight:j,charWidth:T,textHeight:N}=e.docView.measureTextSize();s=j>0&&i.refresh(l,j,T,N,Math.max(5,E/T),C),s&&(e.docView.minWidth=0,h|=16)}A>0&&k>0?g=Math.max(A,k):A<0&&k<0&&(g=Math.min(A,k)),Yb();for(let j of this.viewports){let T=j.from==this.viewport.from?C:e.docView.measureVisibleLineHeights(j);this.heightMap=(s?Un.empty().applyChanges(this.stateDeco,ut.empty,this.heightOracle,[new Fr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new J_(j.from,T))}So&&(h|=2)}let $=!this.viewportIsAppropriate(this.viewport,g)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return $&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(g,this.scrollTarget),h|=this.updateForViewport()),(h&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,l=this.heightOracle,{visibleTop:s,visibleBottom:c}=this,u=new X1(i.lineAt(s-r*1e3,Vt.ByHeight,l,0,0).from,i.lineAt(c+(1-r)*1e3,Vt.ByHeight,l,0,0).to);if(n){let{head:h}=n.range;if(h<u.from||h>u.to){let g=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),O=i.lineAt(h,Vt.ByPos,l,0,0),x;n.y=="center"?x=(O.top+O.bottom)/2-g/2:n.y=="start"||n.y=="nearest"&&h<u.from?x=O.top:x=O.bottom-g,u=new X1(i.lineAt(x-1e3/2,Vt.ByHeight,l,0,0).from,i.lineAt(x+g+1e3/2,Vt.ByHeight,l,0,0).to)}}return u}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new X1(this.heightMap.lineAt(r,Vt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Vt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Vt.ByPos,this.heightOracle,0,0),{bottom:l}=this.heightMap.lineAt(n,Vt.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:c}=this;return(e==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||l>=c+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&l<c+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new Dp(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,l=i>>1,s=i<<1;if(this.defaultTextDirection!=ln.LTR&&!r)return[];let c=[],u=(g,O,x,y)=>{if(O-g<l)return;let v=this.state.selection.main,w=[v.from];v.empty||w.push(v.to);for(let k of w)if(k>g&&k<O){u(g,k-10,x,y),u(k+10,O,x,y);return}let A=uD(e,k=>k.from>=x.from&&k.to<=x.to&&Math.abs(k.from-g)<l&&Math.abs(k.to-O)<l&&!w.some(M=>k.from<M&&k.to>M));if(!A){if(O<x.to&&n&&r&&n.visibleRanges.some(E=>E.from<=O&&E.to>=O)){let E=n.moveToLineBoundary(ge.cursor(O),!1,!0).head;E>g&&(O=E)}let k=this.gapSize(x,g,O,y),M=r||k<2e6?k:2e6;A=new Dp(g,O,k,M)}c.push(A)},h=g=>{if(g.length<s||g.type!=fr.Text)return;let O=cD(g.from,g.to,this.stateDeco);if(O.total<s)return;let x=this.scrollTarget?this.scrollTarget.range.head:null,y,v;if(r){let w=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,A,k;if(x!=null){let M=F1(O,x),E=((this.visibleBottom-this.visibleTop)/2+w)/g.height;A=M-E,k=M+E}else A=(this.visibleTop-g.top-w)/g.height,k=(this.visibleBottom-g.top+w)/g.height;y=z1(O,A),v=z1(O,k)}else{let w=O.total*this.heightOracle.charWidth,A=i*this.heightOracle.charWidth,k=0;if(w>2e6)for(let j of e)j.from>=g.from&&j.from<g.to&&j.size!=j.displaySize&&j.from*this.heightOracle.charWidth+k<this.pixelViewport.left&&(k=j.size-j.displaySize);let M=this.pixelViewport.left+k,E=this.pixelViewport.right+k,$,C;if(x!=null){let j=F1(O,x),T=((E-M)/2+A)/w;$=j-T,C=j+T}else $=(M-A)/w,C=(E+A)/w;y=z1(O,$),v=z1(O,C)}y>g.from&&u(g.from,y,g,O),v<g.to&&u(v,g.to,g,O)};for(let g of this.viewportLines)Array.isArray(g.type)?g.type.forEach(h):h(g);return c}gapSize(e,n,r,i){let l=F1(i,r)-F1(i,n);return this.heightOracle.lineWrapping?e.height*l:i.total*this.heightOracle.charWidth*l}updateLineGaps(e){Dp.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=qe.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];nt.spans(n,this.viewport.from,this.viewport.to,{span(l,s){r.push({from:l,to:s})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let l=0;l<r.length&&!(i&8);l++){let s=this.visibleRanges[l],c=r[l];(s.from!=c.from||s.to!=c.to)&&(i|=4,e&&e.mapPos(s.from,-1)==c.from&&e.mapPos(s.to,1)==c.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Fc(this.heightMap.lineAt(e,Vt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Fc(this.heightMap.lineAt(this.scaler.fromDOM(e),Vt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Fc(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class X1{constructor(e,n){this.from=e,this.to=n}}function cD(t,e,n){let r=[],i=t,l=0;return nt.spans(n,t,e,{span(){},point(s,c){s>i&&(r.push({from:i,to:s}),l+=s-i),i=c}},20),i<e&&(r.push({from:i,to:e}),l+=e-i),{total:l,ranges:r}}function z1({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:l,to:s}=e[i],c=s-l;if(r<=c)return l+r;r-=c}}function F1(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function uD(t,e){for(let n of t)if(e(n))return n}const Gb={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Ub(t){let e=t.facet(Pd).filter(r=>typeof r!="function"),n=t.facet(l6).filter(r=>typeof r!="function");return n.length&&e.push(nt.join(n)),e}class c6{constructor(e,n,r){let i=0,l=0,s=0;this.viewports=r.map(({from:c,to:u})=>{let h=n.lineAt(c,Vt.ByPos,e,0,0).top,g=n.lineAt(u,Vt.ByPos,e,0,0).bottom;return i+=g-h,{from:c,to:u,top:h,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let c of this.viewports)c.domTop=s+(c.top-l)*this.scale,s=c.domBottom=c.domTop+(c.bottom-c.top),l=c.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let l=n<this.viewports.length?this.viewports[n]:null;if(!l||e<l.top)return i+(e-r)*this.scale;if(e<=l.bottom)return l.domTop+(e-l.top);r=l.bottom,i=l.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let l=n<this.viewports.length?this.viewports[n]:null;if(!l||e<l.domTop)return r+(e-i)/this.scale;if(e<=l.domBottom)return l.top+(e-l.domTop);r=l.bottom,i=l.domBottom}}eq(e){return e instanceof c6?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Fc(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new ri(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Fc(i,e)):t._content)}const B1=je.define({combine:t=>t.join(" ")}),Xg=je.define({combine:t=>t.indexOf(!0)>-1}),zg=ml.newName(),dk=ml.newName(),hk=ml.newName(),mk={"&light":"."+dk,"&dark":"."+hk};function Fg(t,e,n){return new ml(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const fD=Fg("."+zg,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},mk),dD={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Hp=Ee.ie&&Ee.ie_version<=11;class hD{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new HL,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Ee.ie&&Ee.ie_version<=11||Ee.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ee.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ee.chrome&&Ee.chrome_version<126)&&(this.editContext=new pD(e),e.state.facet(ra)&&(e.contentDOM.editContext=this.editContext.editContext)),Hp&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(ra)?r.root.activeElement!=this.dom:!eu(this.dom,i))return;let l=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(l&&l.isWidget()&&l.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ee.ie&&Ee.ie_version<=11||Ee.android&&Ee.chrome)&&!r.state.selection.main.empty&&i.focusNode&&tu(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=ku(e.root);if(!n)return!1;let r=Ee.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&mD(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=eu(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&zL(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,dD),Hp&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Hp&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let l=this.delayedAndroidKey;l&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=l.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&l.force&&ao(this.dom,l.key,l.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let l of e){let s=this.readMutation(l);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&eu(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let l=new P_(this.view,e,n,r);return this.view.docView.domChanged={newSel:l.newSel?l.newSel.main:null},l}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=tk(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!Gf(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=Wb(n,e.previousSibling||e.target.previousSibling,-1),i=Wb(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ra)!=e.state.facet(ra)&&(e.view.contentDOM.editContext=e.state.facet(ra)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Wb(t,e,n){for(;e;){let r=Jt.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Kb(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,l=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor,1);return tu(s.node,s.offset,i,l)&&([n,r,i,l]=[i,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:l}}function mD(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Kb(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Kb(t,n):null}class pD{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:l,head:s}=i,c=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:c,drifted:!1});let h=u-c>r.text.length;c==this.from&&l<this.from?c=l:u==this.to&&l>this.to&&(u=l);let g=nk(e.state.sliceDoc(c,u),r.text,(h?i.from:i.to)-c,h?"end":null);if(!g){let x=ge.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Gf(x,i)||e.dispatch({selection:x,userEvent:"select"});return}let O={from:g.from+c,to:g.toA+c,insert:ut.of(r.text.slice(g.from,g.toB).split(`
107
- `))};if((Ee.mac||Ee.android)&&O.from==s-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:c,to:u,insert:ut.of([r.text.replace("."," ")])}),this.pendingContextChange=O,!e.state.readOnly){let x=this.to-this.from+(O.to-O.from+O.insert.length);s6(e,O,ge.single(this.toEditorPos(r.selectionStart,x),this.toEditorPos(r.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),O.from<O.to&&!O.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],l=null;for(let s=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);s<c;s++){let u=e.coordsForChar(s);l=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||l||new DOMRect,i.push(l)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let l of r.getTextFormats()){let s=l.underlineStyle,c=l.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(c)){let u=this.toEditorPos(l.rangeStart),h=this.toEditorPos(l.rangeEnd);if(u<h){let g=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;i.push(qe.mark({attributes:{style:g}}).range(u,h))}}}e.dispatch({effects:B9.of(qe.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=ku(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((l,s,c,u,h)=>{if(r)return;let g=h.length-(s-l);if(i&&s>=i.to)if(i.from==l&&i.to==s&&i.insert.eq(h)){i=this.pendingContextChange=null,n+=g,this.to+=g;return}else i=null,this.revertPending(e.state);if(l+=n,s+=n,s<=this.from)this.from+=g,this.to+=g;else if(l<this.to){if(l<this.from||s>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(l),this.toContextPos(s),h.toString()),this.to+=g}n+=g}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class $e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(l=>r(l,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||XL(e.parent)||document,this.viewState=new qb(this,e.state||gt.create(e)),e.scrollTo&&e.scrollTo.is(_1)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Us).map(i=>new Np(i));for(let i of this.plugins)i.update(this);this.observer=new hD(this),this.inputState=new R_(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Nb(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof gn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,l=this.state;for(let x of e){if(x.startState!=l)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");l=x.state}if(this.destroyed){this.viewState.state=l;return}let s=this.hasFocus,c=0,u=null;e.some(x=>x.annotation(ok))?(this.inputState.notifiedFocused=s,c=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,u=ck(l,s),u||(c=1));let h=this.observer.delayedAndroidKey,g=null;if(h?(this.observer.clearDelayedAndroidKey(),g=this.observer.readChange(),(g&&!this.state.doc.eq(l.doc)||!this.state.selection.eq(l.selection))&&(g=null)):this.observer.clear(),l.facet(gt.phrases)!=this.state.facet(gt.phrases))return this.setState(l);i=Yf.create(this,l,e),i.flags|=c;let O=this.viewState.scrollTarget;try{this.updateState=2;for(let x of e){if(O&&(O=O.map(x.changes)),x.scrollIntoView){let{main:y}=x.state.selection;O=new lo(y.empty?y:ge.cursor(y.head,y.head>y.anchor?-1:1))}for(let y of x.effects)y.is(_1)&&(O=y.value.clip(this.state))}this.viewState.update(i,O),this.bidiCache=Wf.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(zc)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(x=>x.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(B1)!=i.state.facet(B1)&&(this.viewState.mustMeasureContent=!0),(n||r||O||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let x of this.state.facet(Lg))try{x(i)}catch(y){Mi(this.state,y,"update listener")}(u||g)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),g&&!tk(this,g)&&h.force&&ao(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new qb(this,e),this.plugins=e.facet(Us).map(r=>new Np(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Nb(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Us),r=e.state.facet(Us);if(n!=r){let i=[];for(let l of r){let s=n.indexOf(l);if(s<0)i.push(new Np(l));else{let c=this.plugins[s];c.mustUpdate=e,i.push(c)}}for(let l of this.plugins)l.mustUpdate!=e&&l.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Mi(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:l,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(s<0)if(T9(r||this.win))l=-1,s=this.viewState.heightMap.height;else{let y=this.viewState.scrollAnchorAt(i);l=y.from,s=y.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];u&4||([this.measureRequests,h]=[h,this.measureRequests]);let g=h.map(y=>{try{return y.read(this)}catch(v){return Mi(this.state,v),Jb}}),O=Yf.create(this,this.state,[]),x=!1;O.flags|=u,n?n.flags|=u:n=O,this.updateState=2,O.empty||(this.updatePlugins(O),this.inputState.update(O),this.updateAttrs(),x=this.docView.update(O),x&&this.docViewUpdate());for(let y=0;y<h.length;y++)if(g[y]!=Jb)try{let v=h[y];v.write&&v.write(g[y],this)}catch(v){Mi(this.state,v)}if(x&&this.docView.updateSelection(!0),!O.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let v=((l<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(l).top)-s)/this.scaleY;if((v>1||v<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+v,r?r.scrollTop+=v:this.win.scrollBy(0,v),s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let c of this.state.facet(Lg))c(n)}get themeClasses(){return zg+" "+(this.state.facet(Xg)?hk:dk)+" "+this.state.facet(B1)}updateAttrs(){let e=e3(this,Y9,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ra)?"true":"false",class:"cm-content",style:`${Ee.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),e3(this,a6,n);let r=this.observer.ignore(()=>{let i=Tb(this.contentDOM,this.contentAttrs,n),l=Tb(this.dom,this.editorAttrs,e);return i||l});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is($e.announce)){n&&(this.announceDOM.textContent=""),n=!1;let l=this.announceDOM.appendChild(document.createElement("div"));l.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(zc);let e=this.state.facet($e.cspNonce);ml.mount(this.root,this.styleModules.concat(fD).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return _p(this,e,Rb(this,e,n,r))}moveByGroup(e,n){return _p(this,e,Rb(this,e,n,r=>M_(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),l=r[n?r.length-1:0];return ge.cursor(l.side(n,i)+e.from,l.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return A_(this,e,n,r)}moveVertically(e,n,r){return _p(this,e,C_(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=Dg(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Dg(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),l=this.bidiSpans(i),s=l[Ai.find(l,e-i.from,-1,n)];return Bf(r,s.dir==ln.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(z9)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>gD)return N9(e.length);let n=this.textDirectionAt(e.from),r;for(let l of this.bidiCache)if(l.from==e.from&&l.dir==n&&(l.fresh||Z9(l.isolates,r=Pb(this,e))))return l.order;r||(r=Pb(this,e));let i=UL(e.text,n,r);return this.bidiCache.push(new Wf(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ee.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{E9(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return _1.of(new lo(typeof e=="number"?ge.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return _1.of(new lo(ge.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return dr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return dr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ml.newName(),i=[B1.of(r),zc.of(Fg(`.${r}`,e))];return n&&n.dark&&i.push(Xg.of(!0)),i}static baseTheme(e){return Gu.lowest(zc.of(Fg("."+zg,e,mk)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Jt.get(r)||Jt.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}$e.styleModule=zc;$e.inputHandler=H9;$e.clipboardInputFilter=r6;$e.clipboardOutputFilter=i6;$e.scrollHandler=F9;$e.focusChangeEffect=X9;$e.perLineTextDirection=z9;$e.exceptionSink=D9;$e.updateListener=Lg;$e.editable=ra;$e.mouseSelectionStyle=_9;$e.dragMovesSelection=L9;$e.clickAddsSelectionRange=V9;$e.decorations=Pd;$e.blockWrappers=I9;$e.outerDecorations=l6;$e.atomicRanges=Ku;$e.bidiIsolatedRanges=q9;$e.scrollMargins=G9;$e.darkTheme=Xg;$e.cspNonce=je.define({combine:t=>t.length?t[0]:""});$e.contentAttributes=a6;$e.editorAttributes=Y9;$e.lineWrapping=$e.contentAttributes.of({class:"cm-lineWrapping"});$e.announce=xt.define();const gD=4096,Jb={};class Wf{constructor(e,n,r,i,l,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=l,this.order=s}static update(e,n){if(n.empty&&!e.some(l=>l.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:ln.LTR;for(let l=Math.max(0,e.length-10);l<e.length;l++){let s=e[l];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new Wf(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function e3(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let l=r[i],s=typeof l=="function"?l(t):l;s&&e6(s,n)}return n}const OD=Ee.mac?"mac":Ee.windows?"win":Ee.linux?"linux":"key";function xD(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,l,s,c;for(let u=0;u<n.length-1;++u){const h=n[u];if(/^(cmd|meta|m)$/i.test(h))c=!0;else if(/^a(lt)?$/i.test(h))i=!0;else if(/^(c|ctrl|control)$/i.test(h))l=!0;else if(/^s(hift)?$/i.test(h))s=!0;else if(/^mod$/i.test(h))e=="mac"?c=!0:l=!0;else throw new Error("Unrecognized modifier name: "+h)}return i&&(r="Alt-"+r),l&&(r="Ctrl-"+r),c&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function Y1(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const yD=Gu.default($e.domEventHandlers({keydown(t,e){return gk(pk(e.state),t,e,"editor")}})),u6=je.define({enables:yD}),t3=new WeakMap;function pk(t){let e=t.facet(u6),n=t3.get(e);return n||t3.set(e,n=SD(e.reduce((r,i)=>r.concat(i),[]))),n}function bD(t,e,n){return gk(pk(t.state),e,t,n)}let il=null;const vD=4e3;function SD(t,e=OD){let n=Object.create(null),r=Object.create(null),i=(s,c)=>{let u=r[s];if(u==null)r[s]=c;else if(u!=c)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},l=(s,c,u,h,g)=>{var O,x;let y=n[s]||(n[s]=Object.create(null)),v=c.split(/ (?!$)/).map(k=>xD(k,e));for(let k=1;k<v.length;k++){let M=v.slice(0,k).join(" ");i(M,!0),y[M]||(y[M]={preventDefault:!0,stopPropagation:!1,run:[E=>{let $=il={view:E,prefix:M,scope:s};return setTimeout(()=>{il==$&&(il=null)},vD),!0}]})}let w=v.join(" ");i(w,!1);let A=y[w]||(y[w]={preventDefault:!1,stopPropagation:!1,run:((x=(O=y._any)===null||O===void 0?void 0:O.run)===null||x===void 0?void 0:x.slice())||[]});u&&A.run.push(u),h&&(A.preventDefault=!0),g&&(A.stopPropagation=!0)};for(let s of t){let c=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let h of c){let g=n[h]||(n[h]=Object.create(null));g._any||(g._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:O}=s;for(let x in g)g[x].run.push(y=>O(y,Bg))}let u=s[e]||s.key;if(u)for(let h of c)l(h,u,s.run,s.preventDefault,s.stopPropagation),s.shift&&l(h,"Shift-"+u,s.shift,s.preventDefault,s.stopPropagation)}return n}let Bg=null;function gk(t,e,n,r){Bg=e;let i=ZL(e),l=rs(i,0),s=qu(l)==i.length&&i!=" ",c="",u=!1,h=!1,g=!1;il&&il.view==n&&il.scope==r&&(c=il.prefix+" ",ik.indexOf(e.keyCode)<0&&(h=!0,il=null));let O=new Set,x=A=>{if(A){for(let k of A.run)if(!O.has(k)&&(O.add(k),k(n)))return A.stopPropagation&&(g=!0),!0;A.preventDefault&&(A.stopPropagation&&(g=!0),h=!0)}return!1},y=t[r],v,w;return y&&(x(y[c+Y1(i,e,!s)])?u=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ee.windows&&e.ctrlKey&&e.altKey)&&!(Ee.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=pl[e.keyCode])&&v!=i?(x(y[c+Y1(v,e,!0)])||e.shiftKey&&(w=Su[e.keyCode])!=i&&w!=v&&x(y[c+Y1(w,e,!1)]))&&(u=!0):s&&e.shiftKey&&x(y[c+Y1(i,e,!0)])&&(u=!0),!u&&x(y._any)&&(u=!0)),h&&(u=!0),u&&g&&e.stopPropagation(),Bg=null,u}function wD(){return AD}const kD=qe.line({class:"cm-activeLine"}),AD=dr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(kD.range(i.from)),e=i.from)}return qe.set(n)}},{decorations:t=>t.decorations}),n3=je.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Ok(t,e){let n=t.plugin(xk),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const xk=dr.fromClass(class{constructor(t){this.input=t.state.facet(Kf),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(n3);this.top=new I1(t,!0,e.topContainer),this.bottom=new I1(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(n3);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new I1(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new I1(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Kf);if(n!=this.input){let r=n.filter(u=>u),i=[],l=[],s=[],c=[];for(let u of r){let h=this.specs.indexOf(u),g;h<0?(g=u(t.view),c.push(g)):(g=this.panels[h],g.update&&g.update(t)),i.push(g),(g.top?l:s).push(g)}this.specs=r,this.panels=i,this.top.sync(l),this.bottom.sync(s);for(let u of c)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>$e.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class I1{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=r3(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=r3(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function r3(t){let e=t.nextSibling;return t.remove(),e}const Kf=je.define({enables:xk});function MD(t,e){let n,r=new Promise(s=>n=s),i=s=>CD(s,e,n);t.state.field(Xp,!1)?t.dispatch({effects:yk.of(i)}):t.dispatch({effects:xt.appendConfig.of(Xp.init(()=>[i]))});let l=bk.of(i);return{close:l,result:r.then(s=>((t.win.queueMicrotask||(u=>t.win.setTimeout(u,10)))(()=>{t.state.field(Xp).indexOf(i)>-1&&t.dispatch({effects:l})}),s))}}const Xp=Tr.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(yk)?t=[n.value].concat(t):n.is(bk)&&(t=t.filter(r=>r!=n.value));return t},provide:t=>Kf.computeN([t],e=>e.field(t))}),yk=xt.define(),bk=xt.define();function CD(t,e,n){let r=e.content?e.content(t,()=>s(null)):null;if(!r){if(r=kn("form"),e.input){let c=kn("input",e.input);/^(text|password|number|email|tel|url)$/.test(c.type)&&c.classList.add("cm-textfield"),c.name||(c.name="input"),r.appendChild(kn("label",(e.label||"")+": ",c))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(kn("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let c=0;c<i.length;c++){let u=i[c];u.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),s(null)):h.keyCode==13&&(h.preventDefault(),s(u))}),u.addEventListener("submit",h=>{h.preventDefault(),s(u)})}let l=kn("div",r,kn("button",{onclick:()=>s(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(l.className=e.class),l.classList.add("cm-dialog");function s(c){l.contains(l.ownerDocument.activeElement)&&t.focus(),n(c)}return{dom:l,top:e.top,mount:()=>{if(e.focus){let c;typeof e.focus=="string"?c=r.querySelector(e.focus):c=r.querySelector("input")||r.querySelector("button"),c&&"select"in c?c.select():c&&"focus"in c&&c.focus()}}}}class xa extends hl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}xa.prototype.elementClass="";xa.prototype.toDOM=void 0;xa.prototype.mapMode=Xn.TrackBefore;xa.prototype.startSide=xa.prototype.endSide=-1;xa.prototype.point=!0;const Mf=je.define(),ED=je.define(),TD={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>nt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},ru=je.define();function $D(t){return[vk(),ru.of({...TD,...t})]}const i3=je.define({combine:t=>t.some(e=>e)});function vk(t){return[jD]}const jD=dr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ru).map(e=>new l3(t,e)),this.fixed=!t.state.facet(i3);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(i3)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=nt.iter(this.view.state.facet(Mf),this.view.viewport.from),r=[],i=this.gutters.map(l=>new PD(l,this.view.viewport,-this.view.documentPadding.top));for(let l of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(l.type)){let s=!0;for(let c of l.type)if(c.type==fr.Text&&s){Yg(n,r,c.from);for(let u of i)u.line(this.view,c,r);s=!1}else if(c.widget)for(let u of i)u.widget(this.view,c)}else if(l.type==fr.Text){Yg(n,r,l.from);for(let s of i)s.line(this.view,l,r)}else if(l.widget)for(let s of i)s.widget(this.view,l);for(let l of i)l.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(ru),n=t.state.facet(ru),r=t.docChanged||t.heightChanged||t.viewportChanged||!nt.eq(t.startState.facet(Mf),t.state.facet(Mf),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let l of n){let s=e.indexOf(l);s<0?i.push(new l3(this.view,l)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let l of this.gutters)l.dom.remove(),i.indexOf(l)<0&&l.destroy();for(let l of i)l.config.side=="after"?this.getDOMAfter().appendChild(l.dom):this.dom.appendChild(l.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>$e.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==ln.LTR?{left:r,right:i}:{right:r,left:i}})});function a3(t){return Array.isArray(t)?t:[t]}function Yg(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class PD{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=nt.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,l=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let c=new Sk(e,s,l,r);i.elements.push(c),i.dom.appendChild(c.dom)}else i.elements[this.i].update(e,s,l,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];Yg(this.cursor,i,n.from),r.length&&(i=i.concat(r));let l=this.gutter.config.lineMarker(e,n,i);l&&i.unshift(l);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let l of e.state.facet(ED)){let s=l(e,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class l3{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let l=i.target,s;if(l!=this.dom&&this.dom.contains(l)){for(;l.parentNode!=this.dom;)l=l.parentNode;let u=l.getBoundingClientRect();s=(u.top+u.bottom)/2}else s=i.clientY;let c=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,c,i)&&i.preventDefault()});this.markers=a3(n.markers(e)),n.initialSpacer&&(this.spacer=new Sk(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=a3(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!nt.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Sk{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),QD(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let l=0,s=0;;){let c=s,u=l<n.length?n[l++]:null,h=!1;if(u){let g=u.elementClass;g&&(r+=" "+g);for(let O=s;O<this.markers.length;O++)if(this.markers[O].compare(u)){c=O,h=!0;break}}else c=this.markers.length;for(;s<c;){let g=this.markers[s++];if(g.toDOM){g.destroy(i);let O=i.nextSibling;i.remove(),i=O}}if(!u)break;u.toDOM&&(h?i=i.nextSibling:this.dom.insertBefore(u.toDOM(e),i)),h&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function QD(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const ZD=je.define(),ND=je.define(),Ws=je.define({combine(t){return Ro(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let l=r[i],s=n[i];r[i]=l?(c,u,h)=>l(c,u,h)||s(c,u,h):s}return r}})}});class zp extends xa{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Fp(t,e){return t.state.facet(Ws).formatNumber(e,t.state)}const RD=ru.compute([Ws],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(ZD)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new zp(Fp(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(ND)){let l=i(e,n,r);if(l)return l}return null},lineMarkerChange:e=>e.startState.facet(Ws)!=e.state.facet(Ws),initialSpacer(e){return new zp(Fp(e,s3(e.state.doc.lines)))},updateSpacer(e,n){let r=Fp(n.view,s3(n.view.state.doc.lines));return r==e.number?e:new zp(r)},domEventHandlers:t.facet(Ws).domEventHandlers,side:"before"}));function VD(t={}){return[Ws.of(t),vk(),RD]}function s3(t){let e=9;for(;e<t;)e=e*10+9;return e}const LD=new class extends xa{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},_D=Mf.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(LD.range(i)))}return nt.of(e)});function DD(){return _D}const wk=1024;let HD=0;class Br{constructor(e,n){this.from=e,this.to=n}}class Ke{constructor(e={}){this.id=HD++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Wn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Ke.closedBy=new Ke({deserialize:t=>t.split(" ")});Ke.openedBy=new Ke({deserialize:t=>t.split(" ")});Ke.group=new Ke({deserialize:t=>t.split(" ")});Ke.isolate=new Ke({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Ke.contextHash=new Ke({perNode:!0});Ke.lookAhead=new Ke({perNode:!0});Ke.mounted=new Ke({perNode:!0});class so{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Ke.mounted.id]}}const XD=Object.create(null);class Wn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):XD,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Wn(e.name||"",n,e.id,r);if(e.props){for(let l of e.props)if(Array.isArray(l)||(l=l(i)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[l[0].id]=l[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Ke.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Ke.group),l=-1;l<(i?i.length:0);l++){let s=n[l<0?r.name:i[l]];if(s)return s}}}}Wn.none=new Wn("",Object.create(null),0,8);class f6{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let l of e){let s=l(r);if(s){i||(i=Object.assign({},r.props));let c=s[1],u=s[0];u.combine&&u.id in i&&(c=u.combine(i[u.id],c)),i[u.id]=c}}n.push(i?new Wn(r.name,i,r.id,r.flags):r)}return new f6(n)}}const q1=new WeakMap,o3=new WeakMap;var At;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(At||(At={}));class qt{constructor(e,n,r,i,l){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,l&&l.length){this.props=Object.create(null);for(let[s,c]of l)this.props[typeof s=="number"?s:s.id]=c}}toString(){let e=so.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Jf(this.topNode,e)}cursorAt(e,n=0,r=0){let i=q1.get(this)||this.topNode,l=new Jf(i);return l.moveTo(e,n),q1.set(this,l._tree),l}get topNode(){return new zn(this,0,0,null)}resolve(e,n=0){let r=Mu(q1.get(this)||this.topNode,e,n,!1);return q1.set(this,r),r}resolveInner(e,n=0){let r=Mu(o3.get(this)||this.topNode,e,n,!0);return o3.set(this,r),r}resolveStack(e,n=0){return BD(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:l=this.length}=e,s=e.mode||0,c=(s&At.IncludeAnonymous)>0;for(let u=this.cursor(s|At.IncludeAnonymous);;){let h=!1;if(u.from<=l&&u.to>=i&&(!c&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;h=!0}for(;h&&r&&(c||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:m6(Wn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new qt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new qt(Wn.none,n,r,i)))}static build(e){return YD(e)}}qt.empty=new qt(Wn.none,[],[],0);class d6{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new d6(this.buffer,this.index)}}class Ol{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Wn.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],l=i.name;if(/\W/.test(l)&&!i.isError&&(l=JSON.stringify(l)),e+=4,r==e)return l;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return l+"("+s.join(",")+")"}findChild(e,n,r,i,l){let{buffer:s}=this,c=-1;for(let u=e;u!=n&&!(kk(l,i,s[u+1],s[u+2])&&(c=u,r>0));u=s[u+3]);return c}slice(e,n,r){let i=this.buffer,l=new Uint16Array(n-e),s=0;for(let c=e,u=0;c<n;){l[u++]=i[c++],l[u++]=i[c++]-r;let h=l[u++]=i[c++]-r;l[u++]=i[c++]-e,s=Math.max(s,h)}return new Ol(l,s,this.set)}}function kk(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Mu(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof zn&&t.index<0?null:t.parent;if(!s)return t;t=s}let l=r?0:At.IgnoreOverlays;if(r)for(let s=t,c=s.parent;c;s=c,c=s.parent)s instanceof zn&&s.index<0&&((i=c.enter(e,n,l))===null||i===void 0?void 0:i.from)!=s.from&&(t=c);for(;;){let s=t.enter(e,n,l);if(!s)return t;t=s}}class Ak{cursor(e=0){return new Jf(this,e)}getChild(e,n=null,r=null){let i=c3(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return c3(this,e,n,r)}resolve(e,n=0){return Mu(this,e,n,!1)}resolveInner(e,n=0){return Mu(this,e,n,!0)}matchContext(e){return Ig(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class zn extends Ak{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,l=0){for(let s=this;;){for(let{children:c,positions:u}=s._tree,h=n>0?c.length:-1;e!=h;e+=n){let g=c[e],O=u[e]+s.from,x;if(!(!(l&At.EnterBracketed&&g instanceof qt&&(x=so.get(g))&&!x.overlay&&x.bracketed&&r>=O&&r<=O+g.length)&&!kk(i,r,O,O+g.length))){if(g instanceof Ol){if(l&At.ExcludeBuffers)continue;let y=g.findChild(0,g.buffer.length,n,r-O,i);if(y>-1)return new Ci(new zD(s,g,e,O),null,y)}else if(l&At.IncludeAnonymous||!g.type.isAnonymous||h6(g)){let y;if(!(l&At.IgnoreMounts)&&(y=so.get(g))&&!y.overlay)return new zn(y.tree,O,e,s);let v=new zn(g,O,e,s);return l&At.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?g.children.length-1:0,n,r,i,l)}}}if(l&At.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&At.IgnoreOverlays)&&(i=so.get(this._tree))&&i.overlay){let l=e-this.from,s=r&At.EnterBracketed&&i.bracketed;for(let{from:c,to:u}of i.overlay)if((n>0||s?c<=l:c<l)&&(n<0||s?u>=l:u>l))return new zn(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function c3(t,e,n,r){let i=t.cursor(),l=[];if(!i.firstChild())return l;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return l}for(;;){if(r!=null&&i.type.is(r))return l;if(i.type.is(e)&&l.push(i.node),!i.nextSibling())return r==null?l:[]}}function Ig(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class zD{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Ci extends Ak{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return l<0?null:new Ci(this.context,this,l)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&At.ExcludeBuffers)return null;let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return l<0?null:new Ci(this.context,this,l)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Ci(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Ci(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,l=r.buffer[this.index+3];if(l>i){let s=r.buffer[this.index+1];e.push(r.slice(i,l,s)),n.push(0)}return new qt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Mk(t){if(!t.length)return null;let e=0,n=t[0];for(let l=1;l<t.length;l++){let s=t[l];(s.from>n.from||s.to<n.to)&&(n=s,e=l)}let r=n instanceof zn&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new FD(i,n)}class FD{constructor(e,n){this.heads=e,this.node=n}get next(){return Mk(this.heads)}}function BD(t,e,n){let r=t.resolveInner(e,n),i=null;for(let l=r instanceof zn?r:r.context.parent;l;l=l.parent)if(l.index<0){let s=l.parent;(i||(i=[r])).push(s.resolve(e,n)),l=s}else{let s=so.get(l.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let c=new zn(s.tree,s.overlay[0].from+l.from,-1,l);(i||(i=[r])).push(Mu(c,e,n,!1))}}return i?Mk(i):r}class Jf{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~At.EnterBracketed,e instanceof zn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof zn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return l<0?!1:(this.stack.push(this.index),this.yieldBuf(l))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&At.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&At.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&At.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let l=0;l<this.index;l++)if(i.buffer.buffer[l+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let l=n+e,s=e<0?-1:r._tree.children.length;l!=s;l+=e){let c=r._tree.children[l];if(this.mode&At.IncludeAnonymous||c instanceof Ol||!c.type.isAnonymous||h6(c))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,l=this.stack.length;l>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=l+1;break e}i=this.stack[--l]}for(let i=r;i<this.stack.length;i++)n=new Ci(this.buffer,n,this.stack[i]);return this.bufferNode=new Ci(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Ig(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,l=this.stack.length-1;i>=0;l--){if(l<0)return Ig(this._tree,e,i);let s=r[n.buffer[this.stack[l]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function h6(t){return t.children.some(e=>e instanceof Ol||!e.type.isAnonymous||h6(e))}function YD(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=wk,reused:l=[],minRepeatType:s=r.types.length}=t,c=Array.isArray(n)?new d6(n,n.length):n,u=r.types,h=0,g=0;function O(C,j,T,N,R,D){let{id:V,start:z,end:I,size:U}=c,K=g,H=h;if(U<0)if(c.next(),U==-1){let P=l[V];T.push(P),N.push(z-C);return}else if(U==-3){h=V;return}else if(U==-4){g=V;return}else throw new RangeError(`Unrecognized record size: ${U}`);let q=u[V],X,G,F=z-C;if(I-z<=i&&(G=A(c.pos-j,R))){let P=new Uint16Array(G.size-G.skip),Z=c.pos-G.size,L=P.length;for(;c.pos>Z;)L=k(G.start,P,L);X=new Ol(P,I-G.start,r),F=G.start-C}else{let P=c.pos-U;c.next();let Z=[],L=[],B=V>=s?V:-1,J=0,te=I;for(;c.pos>P;)B>=0&&c.id==B&&c.size>=0?(c.end<=te-i&&(v(Z,L,z,J,c.end,te,B,K,H),J=Z.length,te=c.end),c.next()):D>2500?x(z,P,Z,L):O(z,P,Z,L,B,D+1);if(B>=0&&J>0&&J<Z.length&&v(Z,L,z,J,z,te,B,K,H),Z.reverse(),L.reverse(),B>-1&&J>0){let Y=y(q,H);X=m6(q,Z,L,0,Z.length,0,I-z,Y,Y)}else X=w(q,Z,L,I-z,K-I,H)}T.push(X),N.push(F)}function x(C,j,T,N){let R=[],D=0,V=-1;for(;c.pos>j;){let{id:z,start:I,end:U,size:K}=c;if(K>4)c.next();else{if(V>-1&&I<V)break;V<0&&(V=U-i),R.push(z,I,U),D++,c.next()}}if(D){let z=new Uint16Array(D*4),I=R[R.length-2];for(let U=R.length-3,K=0;U>=0;U-=3)z[K++]=R[U],z[K++]=R[U+1]-I,z[K++]=R[U+2]-I,z[K++]=K;T.push(new Ol(z,R[2]-I,r)),N.push(I-C)}}function y(C,j){return(T,N,R)=>{let D=0,V=T.length-1,z,I;if(V>=0&&(z=T[V])instanceof qt){if(!V&&z.type==C&&z.length==R)return z;(I=z.prop(Ke.lookAhead))&&(D=N[V]+z.length+I)}return w(C,T,N,R,D,j)}}function v(C,j,T,N,R,D,V,z,I){let U=[],K=[];for(;C.length>N;)U.push(C.pop()),K.push(j.pop()+T-R);C.push(w(r.types[V],U,K,D-R,z-D,I)),j.push(R-T)}function w(C,j,T,N,R,D,V){if(D){let z=[Ke.contextHash,D];V=V?[z].concat(V):[z]}if(R>25){let z=[Ke.lookAhead,R];V=V?[z].concat(V):[z]}return new qt(C,j,T,N,V)}function A(C,j){let T=c.fork(),N=0,R=0,D=0,V=T.end-i,z={size:0,start:0,skip:0};e:for(let I=T.pos-C;T.pos>I;){let U=T.size;if(T.id==j&&U>=0){z.size=N,z.start=R,z.skip=D,D+=4,N+=4,T.next();continue}let K=T.pos-U;if(U<0||K<I||T.start<V)break;let H=T.id>=s?4:0,q=T.start;for(T.next();T.pos>K;){if(T.size<0)if(T.size==-3||T.size==-4)H+=4;else break e;else T.id>=s&&(H+=4);T.next()}R=q,N+=U,D+=H}return(j<0||N==C)&&(z.size=N,z.start=R,z.skip=D),z.size>4?z:void 0}function k(C,j,T){let{id:N,start:R,end:D,size:V}=c;if(c.next(),V>=0&&N<s){let z=T;if(V>4){let I=c.pos-(V-4);for(;c.pos>I;)T=k(C,j,T)}j[--T]=z,j[--T]=D-C,j[--T]=R-C,j[--T]=N}else V==-3?h=N:V==-4&&(g=N);return T}let M=[],E=[];for(;c.pos>0;)O(t.start||0,t.bufferStart||0,M,E,-1,0);let $=(e=t.length)!==null&&e!==void 0?e:M.length?E[0]+M[0].length:0;return new qt(u[t.topID],M.reverse(),E.reverse(),$)}const u3=new WeakMap;function Cf(t,e){if(!t.isAnonymous||e instanceof Ol||e.type!=t)return 1;let n=u3.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof qt)){n=1;break}n+=Cf(t,r)}u3.set(e,n)}return n}function m6(t,e,n,r,i,l,s,c,u){let h=0;for(let v=r;v<i;v++)h+=Cf(t,e[v]);let g=Math.ceil(h*1.5/8),O=[],x=[];function y(v,w,A,k,M){for(let E=A;E<k;){let $=E,C=w[E],j=Cf(t,v[E]);for(E++;E<k;E++){let T=Cf(t,v[E]);if(j+T>=g)break;j+=T}if(E==$+1){if(j>g){let T=v[$];y(T.children,T.positions,0,T.children.length,w[$]+M);continue}O.push(v[$])}else{let T=w[E-1]+v[E-1].length-C;O.push(m6(t,v,w,$,E,C,T,null,u))}x.push(C+M-l)}}return y(e,n,r,i,0),(c||u)(O,x,s)}class Ck{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Ci?this.setBuffer(e.context.buffer,e.index,n):e instanceof zn&&this.map.set(e.tree,n)}get(e){return e instanceof Ci?this.getBuffer(e.context.buffer,e.index):e instanceof zn?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class sa{constructor(e,n,r,i,l=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(l?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new sa(0,e.length,e,0,!1,r)];for(let l of n)l.to>e.length&&i.push(l);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],l=1,s=e.length?e[0]:null;for(let c=0,u=0,h=0;;c++){let g=c<n.length?n[c]:null,O=g?g.fromA:1e9;if(O-u>=r)for(;s&&s.from<O;){let x=s;if(u>=x.from||O<=x.to||h){let y=Math.max(x.from,u)-h,v=Math.min(x.to,O)-h;x=y>=v?null:new sa(y,v,x.tree,x.offset+h,c>0,!!g)}if(x&&i.push(x),s.to>O)break;s=l<e.length?e[l++]:null}if(!g)break;u=g.toA,h=g.toA-g.toB}return i}}class Ek{startParse(e,n,r){return typeof e=="string"&&(e=new ID(e)),r=r?r.length?r.map(i=>new Br(i.from,i.to)):[new Br(0,0)]:[new Br(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let l=i.advance();if(l)return l}}}class ID{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function qD(t){return(e,n,r,i)=>new UD(e,t,n,r,i)}class f3{constructor(e,n,r,i,l,s){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=l,this.from=s}}function d3(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class GD{constructor(e,n,r,i,l,s,c,u){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=l,this.bracketed=s,this.target=c,this.prev=u,this.depth=0,this.ranges=[]}}const qg=new Ke({perNode:!0});class UD{constructor(e,n,r,i,l){this.nest=n,this.input=r,this.fragments=i,this.ranges=l,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new qt(r.type,r.children,r.positions,r.length,r.propValues.concat([[qg,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Ke.mounted.id]=new so(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new JD(this.fragments),n=null,r=null,i=new Jf(new zn(this.baseTree,this.ranges[0].from,0,null),At.IncludeAnonymous|At.IgnoreMounts);e:for(let l,s;;){let c=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)c=!1;else if(e.hasNode(i)){if(n){let h=n.mounts.find(g=>g.frag.from<=i.from&&g.frag.to>=i.to&&g.mount.overlay);if(h)for(let g of h.mount.overlay){let O=g.from+h.pos,x=g.to+h.pos;O>=i.from&&x<=i.to&&!n.ranges.some(y=>y.from<x&&y.to>O)&&n.ranges.push({from:O,to:x})}}c=!1}else if(r&&(s=WD(r.ranges,i.from,i.to)))c=s!=2;else if(!i.type.isAnonymous&&(l=this.nest(i,this.input))&&(i.from<i.to||!l.overlay)){i.tree||(KD(i),n&&n.depth++,r&&r.depth++);let h=e.findMounts(i.from,l.parser);if(typeof l.overlay=="function")n=new GD(l.parser,l.overlay,h,this.inner.length,i.from,!!l.bracketed,i.tree,n);else{let g=p3(this.ranges,l.overlay||(i.from<i.to?[new Br(i.from,i.to)]:[]));g.length&&d3(g),(g.length||!l.overlay)&&this.inner.push(new f3(l.parser,g.length?l.parser.startParse(this.input,g3(h,g),g):l.parser.startParse(""),l.overlay?l.overlay.map(O=>new Br(O.from-i.from,O.to-i.from)):null,!!l.bracketed,i.tree,g.length?g[0].from:i.from)),l.overlay?g.length&&(r={ranges:g,depth:0,prev:r}):c=!1}}else if(n&&(u=n.predicate(i))&&(u===!0&&(u=new Br(i.from,i.to)),u.from<u.to)){let h=n.ranges.length-1;h>=0&&n.ranges[h].to==u.from?n.ranges[h]={from:n.ranges[h].from,to:u.to}:n.ranges.push(u)}if(c&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let h=p3(this.ranges,n.ranges);h.length&&(d3(h),this.inner.splice(n.index,0,new f3(n.parser,n.parser.startParse(this.input,g3(n.mounts,h),h),n.ranges.map(g=>new Br(g.from-n.start,g.to-n.start)),n.bracketed,n.target,h[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function WD(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function h3(t,e,n,r,i,l){if(e<n){let s=t.buffer[e+1];r.push(t.slice(e,n,s)),i.push(s-l)}}function KD(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,l=i.children.indexOf(r),s=i.children[l],c=s.buffer,u=[l];function h(g,O,x,y,v,w){let A=n[w],k=[],M=[];h3(s,g,A,k,M,y);let E=c[A+1],$=c[A+2];u.push(k.length);let C=w?h(A+4,c[A+3],s.set.types[c[A]],E,$-E,w-1):e.toTree();return k.push(C),M.push(E-y),h3(s,c[A+3],O,k,M,y),new qt(x,k,M,v)}i.children[l]=h(0,c.length,Wn.none,0,s.length,n.length-1);for(let g of u){let O=t.tree.children[g],x=t.tree.positions[g];t.yield(new zn(O,x+t.from,g,t._tree))}}class m3{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(At.IncludeAnonymous|At.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)if(!(n.to>=e&&n.enter(r,1,At.IgnoreOverlays|At.ExcludeBuffers)))if(n.to<=e)n.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof qt)n=n.children[0];else break}return!1}}let JD=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(qg))!==null&&n!==void 0?n:r.to,this.inner=new m3(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(qg))!==null&&e!==void 0?e:n.to,this.inner=new m3(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let l=this.inner.cursor.node;l;l=l.parent){let s=(r=l.tree)===null||r===void 0?void 0:r.prop(Ke.mounted);if(s&&s.parser==n)for(let c=this.fragI;c<this.fragments.length;c++){let u=this.fragments[c];if(u.from>=l.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:l.from-u.offset,mount:s})}}}return i}};function p3(t,e){let n=null,r=e;for(let i=1,l=0;i<t.length;i++){let s=t[i-1].to,c=t[i].from;for(;l<r.length;l++){let u=r[l];if(u.from>=c)break;u.to<=s||(n||(r=n=e.slice()),u.from<s?(n[l]=new Br(u.from,s),u.to>c&&n.splice(l+1,0,new Br(c,u.to))):u.to>c?n[l--]=new Br(c,u.to):n.splice(l--,1))}}return r}function eH(t,e,n,r){let i=0,l=0,s=!1,c=!1,u=-1e9,h=[];for(;;){let g=i==t.length?1e9:s?t[i].to:t[i].from,O=l==e.length?1e9:c?e[l].to:e[l].from;if(s!=c){let x=Math.max(u,n),y=Math.min(g,O,r);x<y&&h.push(new Br(x,y))}if(u=Math.min(g,O),u==1e9)break;g==u&&(s?(s=!1,i++):s=!0),O==u&&(c?(c=!1,l++):c=!0)}return h}function g3(t,e){let n=[];for(let{pos:r,mount:i,frag:l}of t){let s=r+(i.overlay?i.overlay[0].from:0),c=s+i.tree.length,u=Math.max(l.from,s),h=Math.min(l.to,c);if(i.overlay){let g=i.overlay.map(x=>new Br(x.from+r,x.to+r)),O=eH(e,g,u,h);for(let x=0,y=u;;x++){let v=x==O.length,w=v?h:O[x].from;if(w>y&&n.push(new sa(y,w,i.tree,-s,l.from>=y||l.openStart,l.to<=w||l.openEnd)),v)break;y=O[x].to}}else n.push(new sa(u,h,i.tree,-s,l.from>=s||l.openStart,l.to<=c||l.openEnd))}return n}let tH=0;class Xr{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=tH++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Xr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Xr(r,[],null,[]);if(i.set.push(i),n)for(let l of n.set)i.set.push(l);return i}static defineModifier(e){let n=new ed(e);return r=>r.modified.indexOf(n)>-1?r:ed.get(r.base||r,r.modified.concat(n).sort((i,l)=>i.id-l.id))}}let nH=0;class ed{constructor(e){this.name=e,this.instances=[],this.id=nH++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(c=>c.base==e&&rH(n,c.modified));if(r)return r;let i=[],l=new Xr(e.name,i,e,n);for(let c of n)c.instances.push(l);let s=iH(n);for(let c of e.set)if(!c.modified.length)for(let u of s)i.push(ed.get(c,u));return l}}function rH(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function iH(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Rd(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let l=[],s=2,c=i;for(let O=0;;){if(c=="..."&&O>0&&O+3==i.length){s=1;break}let x=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!x)throw new RangeError("Invalid path: "+i);if(l.push(x[0]=="*"?"":x[0][0]=='"'?JSON.parse(x[0]):x[0]),O+=x[0].length,O==i.length)break;let y=i[O++];if(O==i.length&&y=="!"){s=0;break}if(y!="/")throw new RangeError("Invalid path: "+i);c=i.slice(O)}let u=l.length-1,h=l[u];if(!h)throw new RangeError("Invalid path: "+i);let g=new Cu(r,s,u>0?l.slice(0,u):null);e[h]=g.sort(e[h])}}return Tk.add(e)}const Tk=new Ke({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let l=new Cu(i.tags,i.mode,i.context);n?n.next=l:r=l,n=l}return r}});class Cu{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Cu.empty=new Cu([],2,null);function $k(t,e){let n=Object.create(null);for(let l of t)if(!Array.isArray(l.tag))n[l.tag.id]=l.class;else for(let s of l.tag)n[s.id]=l.class;let{scope:r,all:i=null}=e||{};return{style:l=>{let s=i;for(let c of l)for(let u of c.set){let h=n[u.id];if(h){s=s?s+" "+h:h;break}}return s},scope:r}}function aH(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function lH(t,e,n,r=0,i=t.length){let l=new sH(r,Array.isArray(e)?e:[e],n);l.highlightRange(t.cursor(),r,i,"",l.highlighters),l.flush(i)}class sH{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,l){let{type:s,from:c,to:u}=e;if(c>=r||u<=n)return;s.isTop&&(l=this.highlighters.filter(y=>!y.scope||y.scope(s)));let h=i,g=oH(e)||Cu.empty,O=aH(l,g.tags);if(O&&(h&&(h+=" "),h+=O,g.mode==1&&(i+=(i?" ":"")+O)),this.startSpan(Math.max(n,c),h),g.opaque)return;let x=e.tree&&e.tree.prop(Ke.mounted);if(x&&x.overlay){let y=e.node.enter(x.overlay[0].from+c,1),v=this.highlighters.filter(A=>!A.scope||A.scope(x.tree.type)),w=e.firstChild();for(let A=0,k=c;;A++){let M=A<x.overlay.length?x.overlay[A]:null,E=M?M.from+c:u,$=Math.max(n,k),C=Math.min(r,E);if($<C&&w)for(;e.from<C&&(this.highlightRange(e,$,C,i,l),this.startSpan(Math.min(C,e.to),h),!(e.to>=E||!e.nextSibling())););if(!M||E>r)break;k=M.to+c,k>n&&(this.highlightRange(y.cursor(),Math.max(n,M.from+c),Math.min(r,k),"",v),this.startSpan(Math.min(r,k),h))}w&&e.parent()}else if(e.firstChild()){x&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,l),this.startSpan(Math.min(r,e.to),h)}while(e.nextSibling());e.parent()}}}function oH(t){let e=t.type.prop(Tk);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const ke=Xr.define,G1=ke(),el=ke(),O3=ke(el),x3=ke(el),tl=ke(),U1=ke(tl),Bp=ke(tl),bi=ke(),Ll=ke(bi),xi=ke(),yi=ke(),Gg=ke(),Nc=ke(Gg),W1=ke(),ee={comment:G1,lineComment:ke(G1),blockComment:ke(G1),docComment:ke(G1),name:el,variableName:ke(el),typeName:O3,tagName:ke(O3),propertyName:x3,attributeName:ke(x3),className:ke(el),labelName:ke(el),namespace:ke(el),macroName:ke(el),literal:tl,string:U1,docString:ke(U1),character:ke(U1),attributeValue:ke(U1),number:Bp,integer:ke(Bp),float:ke(Bp),bool:ke(tl),regexp:ke(tl),escape:ke(tl),color:ke(tl),url:ke(tl),keyword:xi,self:ke(xi),null:ke(xi),atom:ke(xi),unit:ke(xi),modifier:ke(xi),operatorKeyword:ke(xi),controlKeyword:ke(xi),definitionKeyword:ke(xi),moduleKeyword:ke(xi),operator:yi,derefOperator:ke(yi),arithmeticOperator:ke(yi),logicOperator:ke(yi),bitwiseOperator:ke(yi),compareOperator:ke(yi),updateOperator:ke(yi),definitionOperator:ke(yi),typeOperator:ke(yi),controlOperator:ke(yi),punctuation:Gg,separator:ke(Gg),bracket:Nc,angleBracket:ke(Nc),squareBracket:ke(Nc),paren:ke(Nc),brace:ke(Nc),content:bi,heading:Ll,heading1:ke(Ll),heading2:ke(Ll),heading3:ke(Ll),heading4:ke(Ll),heading5:ke(Ll),heading6:ke(Ll),contentSeparator:ke(bi),list:ke(bi),quote:ke(bi),emphasis:ke(bi),strong:ke(bi),link:ke(bi),monospace:ke(bi),strikethrough:ke(bi),inserted:ke(),deleted:ke(),changed:ke(),invalid:ke(),meta:W1,documentMeta:ke(W1),annotation:ke(W1),processingInstruction:ke(W1),definition:Xr.defineModifier("definition"),constant:Xr.defineModifier("constant"),function:Xr.defineModifier("function"),standard:Xr.defineModifier("standard"),local:Xr.defineModifier("local"),special:Xr.defineModifier("special")};for(let t in ee){let e=ee[t];e instanceof Xr&&(e.name=t)}$k([{tag:ee.link,class:"tok-link"},{tag:ee.heading,class:"tok-heading"},{tag:ee.emphasis,class:"tok-emphasis"},{tag:ee.strong,class:"tok-strong"},{tag:ee.keyword,class:"tok-keyword"},{tag:ee.atom,class:"tok-atom"},{tag:ee.bool,class:"tok-bool"},{tag:ee.url,class:"tok-url"},{tag:ee.labelName,class:"tok-labelName"},{tag:ee.inserted,class:"tok-inserted"},{tag:ee.deleted,class:"tok-deleted"},{tag:ee.literal,class:"tok-literal"},{tag:ee.string,class:"tok-string"},{tag:ee.number,class:"tok-number"},{tag:[ee.regexp,ee.escape,ee.special(ee.string)],class:"tok-string2"},{tag:ee.variableName,class:"tok-variableName"},{tag:ee.local(ee.variableName),class:"tok-variableName tok-local"},{tag:ee.definition(ee.variableName),class:"tok-variableName tok-definition"},{tag:ee.special(ee.variableName),class:"tok-variableName2"},{tag:ee.definition(ee.propertyName),class:"tok-propertyName tok-definition"},{tag:ee.typeName,class:"tok-typeName"},{tag:ee.namespace,class:"tok-namespace"},{tag:ee.className,class:"tok-className"},{tag:ee.macroName,class:"tok-macroName"},{tag:ee.propertyName,class:"tok-propertyName"},{tag:ee.operator,class:"tok-operator"},{tag:ee.comment,class:"tok-comment"},{tag:ee.meta,class:"tok-meta"},{tag:ee.invalid,class:"tok-invalid"},{tag:ee.punctuation,class:"tok-punctuation"}]);var Yp;const Ks=new Ke;function jk(t){return je.define({combine:t?e=>e.concat(t):void 0})}const p6=new Ke;class li{constructor(e,n,r=[],i=""){this.data=e,this.name=i,gt.prototype.hasOwnProperty("tree")||Object.defineProperty(gt.prototype,"tree",{get(){return sn(this)}}),this.parser=n,this.extension=[xl.of(this),gt.languageData.of((l,s,c)=>{let u=y3(l,s,c),h=u.type.prop(Ks);if(!h)return[];let g=l.facet(h),O=u.type.prop(p6);if(O){let x=u.resolve(s-u.from,c);for(let y of O)if(y.test(x,l)){let v=l.facet(y.facet);return y.type=="replace"?v:v.concat(g)}}return g})].concat(r)}isActiveAt(e,n,r=-1){return y3(e,n,r).type.prop(Ks)==this.data}findRegions(e){let n=e.facet(xl);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(l,s)=>{if(l.prop(Ks)==this.data){r.push({from:s,to:s+l.length});return}let c=l.prop(Ke.mounted);if(c){if(c.tree.prop(Ks)==this.data){if(c.overlay)for(let u of c.overlay)r.push({from:u.from+s,to:u.to+s});else r.push({from:s,to:s+l.length});return}else if(c.overlay){let u=r.length;if(i(c.tree,c.overlay[0].from+s),r.length>u)return}}for(let u=0;u<l.children.length;u++){let h=l.children[u];h instanceof qt&&i(h,l.positions[u]+s)}};return i(sn(e),0),r}get allowsNesting(){return!0}}li.setState=xt.define();function y3(t,e,n){let r=t.facet(xl),i=sn(t).topNode;if(!r||r.allowsNesting)for(let l=i;l;l=l.enter(e,n,At.ExcludeBuffers|At.EnterBracketed))l.type.isTop&&(i=l);return i}class wo extends li{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=jk(e.languageData);return new wo(n,e.parser.configure({props:[Ks.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new wo(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function sn(t){let e=t.field(li.state,!1);return e?e.tree:qt.empty}class cH{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Rc=null;class td{constructor(e,n,r=[],i,l,s,c,u){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=l,this.viewport=s,this.skipped=c,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new td(e,n,[],qt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new cH(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=qt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(sa.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(sa.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Rc;Rc=this;try{return e()}finally{Rc=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=b3(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:l,viewport:s,skipped:c}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((h,g,O,x)=>u.push({fromA:h,toA:g,fromB:O,toB:x})),r=sa.applyChanges(r,u),i=qt.empty,l=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){c=[];for(let h of this.skipped){let g=e.mapPos(h.from,1),O=e.mapPos(h.to,-1);g<O&&c.push({from:g,to:O})}}}return new td(this.parser,n,r,i,l,s,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:l}=this.skipped[r];i<e.to&&l>e.from&&(this.fragments=b3(this.fragments,i,l),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Ek{createParse(n,r,i){let l=i[0].from,s=i[i.length-1].to;return{parsedPos:l,advance(){let u=Rc;if(u){for(let h of i)u.tempSkipped.push(h);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=s,new qt(Wn.none,[],[],s-l)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Rc}}function b3(t,e,n){return sa.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class ko{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new ko(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=td.create(e.facet(xl).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new ko(r)}}li.state=Tr.define({create:ko.init,update(t,e){for(let n of e.effects)if(n.is(li.setState))return n.value;return e.startState.facet(xl)!=e.state.facet(xl)?ko.init(e.state):t.apply(e)}});let Pk=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Pk=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Ip=typeof navigator<"u"&&(!((Yp=navigator.scheduling)===null||Yp===void 0)&&Yp.isInputPending)?()=>navigator.scheduling.isInputPending():null,uH=dr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(li.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(li.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Pk(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,l=r.field(li.state);if(l.tree==l.context.tree&&l.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!Ip?Math.max(25,e.timeRemaining()-5):1e9),c=l.context.treeLen<i&&r.doc.length>i+1e3,u=l.context.work(()=>Ip&&Ip()||Date.now()>s,i+(c?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(l.context.takeTree(),this.view.dispatch({effects:li.setState.of(new ko(l.context))})),this.chunkBudget>0&&!(u&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(l.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Mi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),xl=je.define({combine(t){return t.length?t[0]:null},enables:t=>[li.state,uH,$e.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class g6{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const fH=je.define(),Vd=je.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function nd(t){let e=t.facet(Vd);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Eu(t,e){let n="",r=t.tabSize,i=t.facet(Vd)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let l=0;l<e;l++)n+=i;return n}function O6(t,e){t instanceof gt&&(t=new Ld(t));for(let r of t.state.facet(fH)){let i=r(t,e);if(i!==void 0)return i}let n=sn(t.state);return n.length>=e?dH(t,n,e):null}class Ld{constructor(e,n={}){this.state=e,this.options=n,this.unit=nd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:l}=this.options;return i!=null&&i>=r.from&&i<=r.to?l&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),l=this.countColumn(r,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(l+=s-this.countColumn(r,r.search(/\S|$/))),l}countColumn(e,n=e.length){return $d(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),l=this.options.overrideIndentation;if(l){let s=l(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const _d=new Ke;function dH(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let l=[];for(let s=i;s&&!(s.from<r.node.from||s.to>r.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)l.push(s);for(let s=l.length-1;s>=0;s--)r={node:l[s],next:r}}return Qk(r,t,n)}function Qk(t,e,n){for(let r=t;r;r=r.next){let i=mH(r.node);if(i)return i(x6.create(e,n,r))}return 0}function hH(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function mH(t){let e=t.type.prop(_d);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Ke.closedBy))){let i=t.lastChild,l=i&&r.indexOf(i.name)>-1;return s=>Zk(s,!0,1,void 0,l&&!hH(s)?i.from:void 0)}return t.parent==null?pH:null}function pH(){return 0}class x6 extends Ld{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new x6(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(gH(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Qk(this.context.next,this.base,this.pos)}}function gH(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function OH(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,l=t.state.doc.lineAt(n.from),s=i==null||i<=l.from?l.to:Math.min(l.to,i);for(let c=n.to;;){let u=e.childAfter(c);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=s)return null;let h=/^ */.exec(l.text.slice(n.to-l.from))[0].length;return{from:n.from,to:n.to+h}}c=u.to}}function xH({closing:t,align:e=!0,units:n=1}){return r=>Zk(r,e,n,t)}function Zk(t,e,n,r,i){let l=t.textAfter,s=l.match(/^\s*/)[0].length,c=r&&l.slice(s,s+r.length)==r||i==t.pos+s,u=e?OH(t):null;return u?c?t.column(u.from):t.column(u.to):t.baseIndent+(c?0:t.unit*n)}const yH=t=>t.baseIndent;function Ef({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const bH=200;function vH(){return gt.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+bH)return t;let l=n.sliceString(i.from,r);if(!e.some(h=>h.test(l)))return t;let{state:s}=t,c=-1,u=[];for(let{head:h}of s.selection.ranges){let g=s.doc.lineAt(h);if(g.from==c)continue;c=g.from;let O=O6(s,g.from);if(O==null)continue;let x=/^\s*/.exec(g.text)[0],y=Eu(s,O);x!=y&&u.push({from:g.from,to:g.from+x.length,insert:y})}return u.length?[t,{changes:u,sequential:!0}]:t})}const SH=je.define(),Dd=new Ke;function Nk(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function wH(t,e,n){let r=sn(t);if(r.length<n)return null;let i=r.resolveStack(n,1),l=null;for(let s=i;s;s=s.next){let c=s.node;if(c.to<=n||c.from>n)continue;if(l&&c.from<e)break;let u=c.type.prop(Dd);if(u&&(c.to<r.length-50||r.length==t.doc.length||!kH(c))){let h=u(c,t);h&&h.from<=n&&h.from>=e&&h.to>n&&(l=h)}}return l}function kH(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function v3(t,e,n){for(let r of t.facet(SH)){let i=r(t,e,n);if(i)return i}return wH(t,e,n)}function Rk(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Vk=xt.define({map:Rk}),y6=xt.define({map:Rk}),rd=Tr.define({create(){return qe.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=S3(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Vk)&&!AH(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Lk),i=r?qe.replace({widget:new EH(r(e.state,n.value))}):w3;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(y6)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=S3(t,e.selection.main.head)),t},provide:t=>$e.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(w3.range(r,i))}return qe.set(e,!0)}});function S3(t,e,n=e){let r=!1;return t.between(e,n,(i,l)=>{i<n&&l>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,l)=>i>=n||l<=e}):t}function Ug(t,e,n){var r;let i=null;return(r=t.field(rd,!1))===null||r===void 0||r.between(e,n,(l,s)=>{(!i||i.from>l)&&(i={from:l,to:s})}),i}function AH(t,e,n){let r=!1;return t.between(e,e,(i,l)=>{i==e&&l==n&&(r=!0)}),r}const MH={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Lk=je.define({combine(t){return Ro(t,MH)}});function CH(t){return[rd,jH]}function _k(t,e){let{state:n}=t,r=n.facet(Lk),i=s=>{let c=t.lineBlockAt(t.posAtDOM(s.target)),u=Ug(t.state,c.from,c.to);u&&t.dispatch({effects:y6.of(u)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let l=document.createElement("span");return l.textContent=r.placeholderText,l.setAttribute("aria-label",n.phrase("folded code")),l.title=n.phrase("unfold"),l.className="cm-foldPlaceholder",l.onclick=i,l}const w3=qe.replace({widget:new class extends is{toDOM(t){return _k(t,null)}}});class EH extends is{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return _k(e,this.value)}}const TH={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class qp extends xa{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function $H(t={}){let e={...TH,...t},n=new qp(e,!0),r=new qp(e,!1),i=dr.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(xl)!=s.state.facet(xl)||s.startState.field(rd,!1)!=s.state.field(rd,!1)||sn(s.startState)!=sn(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let c=new Kl;for(let u of s.viewportLineBlocks){let h=Ug(s.state,u.from,u.to)?r:v3(s.state,u.from,u.to)?n:null;h&&c.add(u.from,u.from,h)}return c.finish()}}),{domEventHandlers:l}=e;return[i,$D({class:"cm-foldGutter",markers(s){var c;return((c=s.plugin(i))===null||c===void 0?void 0:c.markers)||nt.empty},initialSpacer(){return new qp(e,!1)},domEventHandlers:{...l,click:(s,c,u)=>{if(l.click&&l.click(s,c,u))return!0;let h=Ug(s.state,c.from,c.to);if(h)return s.dispatch({effects:y6.of(h)}),!0;let g=v3(s.state,c.from,c.to);return g?(s.dispatch({effects:Vk.of(g)}),!0):!1}}}),CH()]}const jH=$e.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Hd{constructor(e,n){this.specs=e;let r;function i(c){let u=ml.newName();return(r||(r=Object.create(null)))["."+u]=c,u}const l=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof li?c=>c.prop(Ks)==s.data:s?c=>c==s:void 0,this.style=$k(e.map(c=>({tag:c.tag,class:c.class||i(Object.assign({},c,{tag:null}))})),{all:l}).style,this.module=r?new ml(r):null,this.themeType=n.themeType}static define(e,n){return new Hd(e,n||{})}}const Wg=je.define(),PH=je.define({combine(t){return t.length?[t[0]]:null}});function Gp(t){let e=t.facet(Wg);return e.length?e:t.facet(PH)}function QH(t,e){let n=[NH],r;return t instanceof Hd&&(t.module&&n.push($e.styleModule.of(t.module)),r=t.themeType),r?n.push(Wg.computeN([$e.darkTheme],i=>i.facet($e.darkTheme)==(r=="dark")?[t]:[])):n.push(Wg.of(t)),n}class ZH{constructor(e){this.markCache=Object.create(null),this.tree=sn(e.state),this.decorations=this.buildDeco(e,Gp(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=sn(e.state),r=Gp(e.state),i=r!=Gp(e.startState),{viewport:l}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<l.to&&!i&&n.type==this.tree.type&&s>=l.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=l.to)}buildDeco(e,n){if(!n||!this.tree.length)return qe.none;let r=new Kl;for(let{from:i,to:l}of e.visibleRanges)lH(this.tree,n,(s,c,u)=>{r.add(s,c,this.markCache[u]||(this.markCache[u]=qe.mark({class:u})))},i,l);return r.finish()}}const NH=Gu.high(dr.fromClass(ZH,{decorations:t=>t.decorations})),RH=$e.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Dk=1e4,Hk="()[]{}",Xk=je.define({combine(t){return Ro(t,{afterCursor:!0,brackets:Hk,maxScanDistance:Dk,renderMatch:_H})}}),VH=qe.mark({class:"cm-matchingBracket"}),LH=qe.mark({class:"cm-nonmatchingBracket"});function _H(t){let e=[],n=t.matched?VH:LH;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}function k3(t){let e=[],n=t.facet(Xk);for(let r of t.selection.ranges){if(!r.empty)continue;let i=Ei(t,r.head,-1,n)||r.head>0&&Ei(t,r.head-1,1,n)||n.afterCursor&&(Ei(t,r.head,1,n)||r.head<t.doc.length&&Ei(t,r.head+1,-1,n));i&&(e=e.concat(n.renderMatch(i,t)))}return qe.set(e,!0)}const DH=dr.fromClass(class{constructor(t){this.paused=!1,this.decorations=k3(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=k3(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),HH=[DH,RH];function XH(t={}){return[Xk.of(t),HH]}const zk=new Ke;function Kg(t,e,n){let r=t.prop(e<0?Ke.openedBy:Ke.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function Jg(t){let e=t.type.prop(zk);return e?e(t.node):t}function Ei(t,e,n,r={}){let i=r.maxScanDistance||Dk,l=r.brackets||Hk,s=sn(t),c=s.resolveInner(e,n);for(let u=c;u;u=u.parent){let h=Kg(u.type,n,l);if(h&&u.from<u.to){let g=Jg(u);if(g&&(n>0?e>=g.from&&e<g.to:e>g.from&&e<=g.to))return zH(t,e,n,u,g,h,l)}}return FH(t,e,n,s,c.type,i,l)}function zH(t,e,n,r,i,l,s){let c=r.parent,u={from:i.from,to:i.to},h=0,g=c==null?void 0:c.cursor();if(g&&(n<0?g.childBefore(r.from):g.childAfter(r.to)))do if(n<0?g.to<=r.from:g.from>=r.to){if(h==0&&l.indexOf(g.type.name)>-1&&g.from<g.to){let O=Jg(g);return{start:u,end:O?{from:O.from,to:O.to}:void 0,matched:!0}}else if(Kg(g.type,n,s))h++;else if(Kg(g.type,-n,s)){if(h==0){let O=Jg(g);return{start:u,end:O&&O.from<O.to?{from:O.from,to:O.to}:void 0,matched:!1}}h--}}while(n<0?g.prevSibling():g.nextSibling());return{start:u,matched:!1}}function FH(t,e,n,r,i,l,s){if(n<0?!e:e==t.doc.length)return null;let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=s.indexOf(c);if(u<0||u%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},g=t.doc.iterRange(e,n>0?t.doc.length:0),O=0;for(let x=0;!g.next().done&&x<=l;){let y=g.value;n<0&&(x+=y.length);let v=e+x*n;for(let w=n>0?0:y.length-1,A=n>0?y.length:-1;w!=A;w+=n){let k=s.indexOf(y[w]);if(!(k<0||r.resolveInner(v+w,1).type!=i))if(k%2==0==n>0)O++;else{if(O==1)return{start:h,end:{from:v+w,to:v+w+1},matched:k>>1==u>>1};O--}}n>0&&(x+=y.length)}return g.done?{start:h,matched:!1}:null}const BH=Object.create(null),A3=[Wn.none],M3=[],C3=Object.create(null),YH=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])YH[t]=IH(BH,e);function Up(t,e){M3.indexOf(t)>-1||(M3.push(t),console.warn(e))}function IH(t,e){let n=[];for(let c of e.split(" ")){let u=[];for(let h of c.split(".")){let g=t[h]||ee[h];g?typeof g=="function"?u.length?u=u.map(g):Up(h,`Modifier ${h} used at start of tag`):u.length?Up(h,`Tag ${h} used as modifier`):u=Array.isArray(g)?g:[g]:Up(h,`Unknown highlighting tag ${h}`)}for(let h of u)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(c=>c.id),l=C3[i];if(l)return l.id;let s=C3[i]=Wn.define({id:A3.length,name:r,props:[Rd({[r]:n})]});return A3.push(s),s.id}ln.RTL,ln.LTR;const qH=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=v6(t.state,n.from);return r.line?GH(t):r.block?WH(t):!1};function b6(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const GH=b6(eX,0),UH=b6(Fk,0),WH=b6((t,e)=>Fk(t,e,JH(e)),0);function v6(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Vc=50;function KH(t,{open:e,close:n},r,i){let l=t.sliceDoc(r-Vc,r),s=t.sliceDoc(i,i+Vc),c=/\s*$/.exec(l)[0].length,u=/^\s*/.exec(s)[0].length,h=l.length-c;if(l.slice(h-e.length,h)==e&&s.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:i+u,margin:u&&1}};let g,O;i-r<=2*Vc?g=O=t.sliceDoc(r,i):(g=t.sliceDoc(r,r+Vc),O=t.sliceDoc(i-Vc,i));let x=/^\s*/.exec(g)[0].length,y=/\s*$/.exec(O)[0].length,v=O.length-y-n.length;return g.slice(x,x+e.length)==e&&O.slice(v,v+n.length)==n?{open:{pos:r+x+e.length,margin:/\s/.test(g.charAt(x+e.length))?1:0},close:{pos:i-y-n.length,margin:/\s/.test(O.charAt(v-1))?1:0}}:null}function JH(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let l=e.length-1;l>=0&&e[l].to>r.from?e[l].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function Fk(t,e,n=e.selection.ranges){let r=n.map(l=>v6(e,l.from).block);if(!r.every(l=>l))return null;let i=n.map((l,s)=>KH(e,r[s],l.from,l.to));if(t!=2&&!i.every(l=>l))return{changes:e.changes(n.map((l,s)=>i[s]?[]:[{from:l.from,insert:r[s].open+" "},{from:l.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(l=>l)){let l=[];for(let s=0,c;s<i.length;s++)if(c=i[s]){let u=r[s],{open:h,close:g}=c;l.push({from:h.pos-u.open.length,to:h.pos+h.margin},{from:g.pos-g.margin,to:g.pos+u.close.length})}return{changes:l}}return null}function eX(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:l,to:s}of n){let c=r.length,u=1e9,h;for(let g=l;g<=s;){let O=e.doc.lineAt(g);if(h==null&&(h=v6(e,O.from).line,!h))continue e;if(O.from>i&&(l==s||s>O.from)){i=O.from;let x=/^\s*/.exec(O.text)[0].length,y=x==O.length,v=O.text.slice(x,x+h.length)==h?x:-1;x<O.text.length&&x<u&&(u=x),r.push({line:O,comment:v,token:h,indent:x,empty:y,single:!1})}g=O.to+1}if(u<1e9)for(let g=c;g<r.length;g++)r[g].indent<r[g].line.text.length&&(r[g].indent=u);r.length==c+1&&(r[c].single=!0)}if(t!=2&&r.some(l=>l.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:c,token:u,indent:h,empty:g,single:O}of r)(O||!g)&&l.push({from:c.from+h,insert:u+" "});let s=e.changes(l);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(l=>l.comment>=0)){let l=[];for(let{line:s,comment:c,token:u}of r)if(c>=0){let h=s.from+c,g=h+u.length;s.text[g-s.from]==" "&&g++,l.push({from:h,to:g})}return{changes:l}}return null}const e8=va.define(),tX=va.define(),nX=je.define(),Bk=je.define({combine(t){return Ro(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),Yk=Tr.define({create(){return Ti.empty},update(t,e){let n=e.state.facet(Bk),r=e.annotation(e8);if(r){let u=ur.fromTransaction(e,r.selection),h=r.side,g=h==0?t.undone:t.done;return u?g=id(g,g.length,n.minDepth,u):g=Gk(g,e.startState.selection),new Ti(h==0?r.rest:g,h==0?g:r.rest)}let i=e.annotation(tX);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(gn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let l=ur.fromTransaction(e),s=e.annotation(gn.time),c=e.annotation(gn.userEvent);return l?t=t.addChanges(l,s,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,c,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Ti(t.done.map(ur.fromJSON),t.undone.map(ur.fromJSON))}});function rX(t={}){return[Yk,Bk.of(t),$e.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?Ik:e.inputType=="historyRedo"?t8:null;return r?(e.preventDefault(),r(n)):!1}})]}function Xd(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(Yk,!1);if(!i)return!1;let l=i.pop(t,n,e);return l?(r(l),!0):!1}}const Ik=Xd(0,!1),t8=Xd(1,!1),iX=Xd(0,!0),aX=Xd(1,!0);class ur{constructor(e,n,r,i,l){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=l}setSelAfter(e){return new ur(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new ur(e.changes&&xn.fromJSON(e.changes),[],e.mapped&&$i.fromJSON(e.mapped),e.startSelection&&ge.fromJSON(e.startSelection),e.selectionsAfter.map(ge.fromJSON))}static fromTransaction(e,n){let r=Yr;for(let i of e.startState.facet(nX)){let l=i(e);l.length&&(r=r.concat(l))}return!r.length&&e.changes.empty?null:new ur(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Yr)}static selection(e){return new ur(void 0,Yr,void 0,void 0,e)}}function id(t,e,n,r){let i=e+1>n+20?e-n-1:0,l=t.slice(i,e);return l.push(r),l}function lX(t,e){let n=[],r=!1;return t.iterChangedRanges((i,l)=>n.push(i,l)),e.iterChangedRanges((i,l,s,c)=>{for(let u=0;u<n.length;){let h=n[u++],g=n[u++];c>=h&&s<=g&&(r=!0)}}),r}function sX(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function qk(t,e){return t.length?e.length?t.concat(e):t:e}const Yr=[],oX=200;function Gk(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-oX));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),id(t,t.length-1,1e9,n.setSelAfter(r)))}else return[ur.selection([e])]}function cX(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Wp(t,e){if(!t.length)return t;let n=t.length,r=Yr;for(;n;){let i=uX(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let l=t.slice(0,n);return l[n-1]=i,l}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[ur.selection(r)]:Yr}function uX(t,e,n){let r=qk(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):Yr,n);if(!t.changes)return ur.selection(r);let i=t.changes.map(e),l=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(l):l;return new ur(i,xt.mapEffects(t.effects,e),s,t.startSelection.map(l),r)}const fX=/^(input\.type|delete)($|\.)/;class Ti{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Ti(this.done,this.undone):this}addChanges(e,n,r,i,l){let s=this.done,c=s[s.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!r||fX.test(r))&&(!c.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(l,lX(c.changes,e.changes))||r=="input.type.compose")?s=id(s,s.length-1,i.minDepth,new ur(e.changes.compose(c.changes),qk(xt.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,Yr)):s=id(s,s.length,i.minDepth,e),new Ti(s,Yr,n,r)}addSelection(e,n,r,i){let l=this.done.length?this.done[this.done.length-1].selectionsAfter:Yr;return l.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&sX(l[l.length-1],e)?this:new Ti(Gk(this.done,e),this.undone,n,r)}addMapping(e){return new Ti(Wp(this.done,e),Wp(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let l=i[i.length-1],s=l.selectionsAfter[0]||(l.startSelection?l.startSelection.map(l.changes.invertedDesc,1):n.selection);if(r&&l.selectionsAfter.length)return n.update({selection:l.selectionsAfter[l.selectionsAfter.length-1],annotations:e8.of({side:e,rest:cX(i),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(l.changes){let c=i.length==1?Yr:i.slice(0,i.length-1);return l.mapped&&(c=Wp(c,l.mapped)),n.update({changes:l.changes,selection:l.startSelection,effects:l.effects,annotations:e8.of({side:e,rest:c,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ti.empty=new Ti(Yr,Yr);const dX=[{key:"Mod-z",run:Ik,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:t8,preventDefault:!0},{linux:"Ctrl-Shift-z",run:t8,preventDefault:!0},{key:"Mod-u",run:iX,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:aX,preventDefault:!0}];function Vo(t,e){return ge.create(t.ranges.map(e),t.mainIndex)}function ui(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function fi({state:t,dispatch:e},n){let r=Vo(t.selection,n);return r.eq(t.selection,!0)?!1:(e(ui(t,r)),!0)}function zd(t,e){return ge.cursor(e?t.to:t.from)}function Uk(t,e){return fi(t,n=>n.empty?t.moveByChar(n,e):zd(n,e))}function Fn(t){return t.textDirectionAt(t.state.selection.main.head)==ln.LTR}const Wk=t=>Uk(t,!Fn(t)),Kk=t=>Uk(t,Fn(t));function Jk(t,e){return fi(t,n=>n.empty?t.moveByGroup(n,e):zd(n,e))}const hX=t=>Jk(t,!Fn(t)),mX=t=>Jk(t,Fn(t));function pX(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Fd(t,e,n){let r=sn(t).resolveInner(e.head),i=n?Ke.closedBy:Ke.openedBy;for(let u=e.head;;){let h=n?r.childAfter(u):r.childBefore(u);if(!h)break;pX(t,h,i)?r=h:u=n?h.to:h.from}let l=r.type.prop(i),s,c;return l&&(s=n?Ei(t,r.from,1):Ei(t,r.to,-1))&&s.matched?c=n?s.end.to:s.end.from:c=n?r.to:r.from,ge.cursor(c,n?-1:1)}const gX=t=>fi(t,e=>Fd(t.state,e,!Fn(t))),OX=t=>fi(t,e=>Fd(t.state,e,Fn(t)));function eA(t,e){return fi(t,n=>{if(!n.empty)return zd(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const tA=t=>eA(t,!1),nA=t=>eA(t,!0);function rA(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let l of t.state.facet($e.scrollMargins)){let s=l(t);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(r=Math.max(s==null?void 0:s.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function iA(t,e){let n=rA(t),{state:r}=t,i=Vo(r.selection,s=>s.empty?t.moveVertically(s,e,n.height):zd(s,e));if(i.eq(r.selection))return!1;let l;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),u=c.top+n.marginTop,h=c.bottom-n.marginBottom;s&&s.top>u&&s.bottom<h&&(l=$e.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-u}))}return t.dispatch(ui(r,i),{effects:l}),!0}const E3=t=>iA(t,!1),n8=t=>iA(t,!0);function yl(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let l=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;l&&e.head!=r.from+l&&(i=ge.cursor(r.from+l))}return i}const xX=t=>fi(t,e=>yl(t,e,!0)),yX=t=>fi(t,e=>yl(t,e,!1)),bX=t=>fi(t,e=>yl(t,e,!Fn(t))),vX=t=>fi(t,e=>yl(t,e,Fn(t))),SX=t=>fi(t,e=>ge.cursor(t.lineBlockAt(e.head).from,1)),wX=t=>fi(t,e=>ge.cursor(t.lineBlockAt(e.head).to,-1));function kX(t,e,n){let r=!1,i=Vo(t.selection,l=>{let s=Ei(t,l.head,-1)||Ei(t,l.head,1)||l.head>0&&Ei(t,l.head-1,1)||l.head<t.doc.length&&Ei(t,l.head+1,-1);if(!s||!s.end)return l;r=!0;let c=s.start.from==l.head?s.end.to:s.end.from;return ge.cursor(c)});return r?(e(ui(t,i)),!0):!1}const AX=({state:t,dispatch:e})=>kX(t,e);function Gr(t,e){let n=Vo(t.state.selection,r=>{let i=e(r);return ge.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(ui(t.state,n)),!0)}function aA(t,e){return Gr(t,n=>t.moveByChar(n,e))}const lA=t=>aA(t,!Fn(t)),sA=t=>aA(t,Fn(t));function oA(t,e){return Gr(t,n=>t.moveByGroup(n,e))}const MX=t=>oA(t,!Fn(t)),CX=t=>oA(t,Fn(t)),EX=t=>Gr(t,e=>Fd(t.state,e,!Fn(t))),TX=t=>Gr(t,e=>Fd(t.state,e,Fn(t)));function cA(t,e){return Gr(t,n=>t.moveVertically(n,e))}const uA=t=>cA(t,!1),fA=t=>cA(t,!0);function dA(t,e){return Gr(t,n=>t.moveVertically(n,e,rA(t).height))}const T3=t=>dA(t,!1),$3=t=>dA(t,!0),$X=t=>Gr(t,e=>yl(t,e,!0)),jX=t=>Gr(t,e=>yl(t,e,!1)),PX=t=>Gr(t,e=>yl(t,e,!Fn(t))),QX=t=>Gr(t,e=>yl(t,e,Fn(t))),ZX=t=>Gr(t,e=>ge.cursor(t.lineBlockAt(e.head).from)),NX=t=>Gr(t,e=>ge.cursor(t.lineBlockAt(e.head).to)),j3=({state:t,dispatch:e})=>(e(ui(t,{anchor:0})),!0),P3=({state:t,dispatch:e})=>(e(ui(t,{anchor:t.doc.length})),!0),Q3=({state:t,dispatch:e})=>(e(ui(t,{anchor:t.selection.main.anchor,head:0})),!0),Z3=({state:t,dispatch:e})=>(e(ui(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),RX=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),VX=({state:t,dispatch:e})=>{let n=Bd(t).map(({from:r,to:i})=>ge.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:ge.create(n),userEvent:"select"})),!0},LX=({state:t,dispatch:e})=>{let n=Vo(t.selection,r=>{let i=sn(t),l=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=l.node.from&&s.node.to<=l.node.to&&(l=s)}for(let s=l;s;s=s.next){let{node:c}=s;if((c.from<r.from&&c.to>=r.to||c.to>r.to&&c.from<=r.from)&&s.next)return ge.range(c.to,c.from)}return r});return n.eq(t.selection)?!1:(e(ui(t,n)),!0)};function hA(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let l of n.selection.ranges){let s=n.doc.lineAt(l.head);if(e?s.to<t.state.doc.length:s.from>0)for(let c=l;;){let u=t.moveVertically(c,e);if(u.head<s.from||u.head>s.to){i.some(h=>h.head==u.head)||i.push(u);break}else{if(u.head==c.head)break;c=u}}}return i.length==r.ranges.length?!1:(t.dispatch(ui(n,ge.create(i,i.length-1))),!0)}const _X=t=>hA(t,!1),DX=t=>hA(t,!0),HX=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=ge.create([n.main]):n.main.empty||(r=ge.create([ge.cursor(n.main.head)])),r?(e(ui(t,r)),!0):!1};function Ju(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(l=>{let{from:s,to:c}=l;if(s==c){let u=e(l);u<s?(n="delete.backward",u=K1(t,u,!1)):u>s&&(n="delete.forward",u=K1(t,u,!0)),s=Math.min(s,u),c=Math.max(c,u)}else s=K1(t,s,!1),c=K1(t,c,!0);return s==c?{range:l}:{changes:{from:s,to:c},range:ge.cursor(s,s<l.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?$e.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function K1(t,e,n){if(t instanceof $e)for(let r of t.state.facet($e.atomicRanges).map(i=>i(t)))r.between(e,e,(i,l)=>{i<e&&l>e&&(e=n?l:i)});return e}const mA=(t,e,n)=>Ju(t,r=>{let i=r.from,{state:l}=t,s=l.doc.lineAt(i),c,u;if(n&&!e&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(c=s.text.slice(0,i-s.from))){if(c[c.length-1]==" ")return i-1;let h=$d(c,l.tabSize),g=h%nd(l)||nd(l);for(let O=0;O<g&&c[c.length-1-O]==" ";O++)i--;u=i}else u=Cn(s.text,i-s.from,e,e)+s.from,u==i&&s.number!=(e?l.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(s.text.slice(u-s.from,i-s.from))&&(u=Cn(s.text,u-s.from,!1,!1)+s.from);return u}),r8=t=>mA(t,!1,!0),pA=t=>mA(t,!0,!1),gA=(t,e)=>Ju(t,n=>{let r=n.head,{state:i}=t,l=i.doc.lineAt(r),s=i.charCategorizer(r);for(let c=null;;){if(r==(e?l.to:l.from)){r==n.head&&l.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=Cn(l.text,r-l.from,e)+l.from,h=l.text.slice(Math.min(r,u)-l.from,Math.max(r,u)-l.from),g=s(h);if(c!=null&&g!=c)break;(h!=" "||r!=n.head)&&(c=g),r=u}return r}),OA=t=>gA(t,!1),XX=t=>gA(t,!0),zX=t=>Ju(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),FX=t=>Ju(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),BX=t=>Ju(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),YX=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ut.of(["",""])},range:ge.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},IX=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,l=t.doc.lineAt(i),s=i==l.from?i-1:Cn(l.text,i-l.from,!1)+l.from,c=i==l.to?i+1:Cn(l.text,i-l.from,!0)+l.from;return{changes:{from:s,to:c,insert:t.doc.slice(i,c).append(t.doc.slice(s,i))},range:ge.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Bd(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),l=t.doc.lineAt(r.to);if(!r.empty&&r.to==l.from&&(l=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=l.to,s.ranges.push(r)}else e.push({from:i.from,to:l.to,ranges:[r]});n=l.number+1}return e}function xA(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let l of Bd(t)){if(n?l.to==t.doc.length:l.from==0)continue;let s=t.doc.lineAt(n?l.to+1:l.from-1),c=s.length+1;if(n){r.push({from:l.to,to:s.to},{from:l.from,insert:s.text+t.lineBreak});for(let u of l.ranges)i.push(ge.range(Math.min(t.doc.length,u.anchor+c),Math.min(t.doc.length,u.head+c)))}else{r.push({from:s.from,to:l.from},{from:l.to,insert:t.lineBreak+s.text});for(let u of l.ranges)i.push(ge.range(u.anchor-c,u.head-c))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:ge.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const qX=({state:t,dispatch:e})=>xA(t,e,!1),GX=({state:t,dispatch:e})=>xA(t,e,!0);function yA(t,e,n){if(t.readOnly)return!1;let r=[];for(let l of Bd(t))n?r.push({from:l.from,insert:t.doc.slice(l.from,l.to)+t.lineBreak}):r.push({from:l.to,insert:t.lineBreak+t.doc.slice(l.from,l.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const UX=({state:t,dispatch:e})=>yA(t,e,!1),WX=({state:t,dispatch:e})=>yA(t,e,!0),KX=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Bd(e).map(({from:i,to:l})=>(i>0?i--:l<e.doc.length&&l++,{from:i,to:l}))),r=Vo(e.selection,i=>{let l;if(t.lineWrapping){let s=t.lineBlockAt(i.head),c=t.coordsAtPos(i.head,i.assoc||1);c&&(l=s.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,l)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function JX(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=sn(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),l;return r&&i&&r.to<=e&&i.from>=e&&(l=r.type.prop(Ke.closedBy))&&l.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const N3=bA(!1),ez=bA(!0);function bA(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:l,to:s}=i,c=e.doc.lineAt(l),u=!t&&l==s&&JX(e,l);t&&(l=s=(s<=c.to?c:e.doc.lineAt(s)).to);let h=new Ld(e,{simulateBreak:l,simulateDoubleBreak:!!u}),g=O6(h,l);for(g==null&&(g=$d(/^\s*/.exec(e.doc.lineAt(l).text)[0],e.tabSize));s<c.to&&/\s/.test(c.text[s-c.from]);)s++;u?{from:l,to:s}=u:l>c.from&&l<c.from+100&&!/\S/.test(c.text.slice(0,l))&&(l=c.from);let O=["",Eu(e,g)];return u&&O.push(Eu(e,h.lineIndent(c.from,-1))),{changes:{from:l,to:s,insert:ut.of(O)},range:ge.cursor(l+1+O[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function S6(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let c=t.doc.lineAt(s);c.number>n&&(r.empty||r.to>c.from)&&(e(c,i,r),n=c.number),s=c.to+1}let l=t.changes(i);return{changes:i,range:ge.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}const tz=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Ld(t,{overrideIndentation:l=>{let s=n[l];return s??-1}}),i=S6(t,(l,s,c)=>{let u=O6(r,l.from);if(u==null)return;/\S/.test(l.text)||(u=0);let h=/^\s*/.exec(l.text)[0],g=Eu(t,u);(h!=g||c.from<l.from+h.length)&&(n[l.from]=u,s.push({from:l.from,to:l.from+h.length,insert:g}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},nz=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(S6(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Vd)})}),{userEvent:"input.indent"})),!0),rz=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(S6(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let l=$d(i,t.tabSize),s=0,c=Eu(t,Math.max(0,l-nd(t)));for(;s<i.length&&s<c.length&&i.charCodeAt(s)==c.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:c.slice(s)})}),{userEvent:"delete.dedent"})),!0),iz=t=>(t.setTabFocusMode(),!0),az=[{key:"Ctrl-b",run:Wk,shift:lA,preventDefault:!0},{key:"Ctrl-f",run:Kk,shift:sA},{key:"Ctrl-p",run:tA,shift:uA},{key:"Ctrl-n",run:nA,shift:fA},{key:"Ctrl-a",run:SX,shift:ZX},{key:"Ctrl-e",run:wX,shift:NX},{key:"Ctrl-d",run:pA},{key:"Ctrl-h",run:r8},{key:"Ctrl-k",run:zX},{key:"Ctrl-Alt-h",run:OA},{key:"Ctrl-o",run:YX},{key:"Ctrl-t",run:IX},{key:"Ctrl-v",run:n8}],lz=[{key:"ArrowLeft",run:Wk,shift:lA,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:hX,shift:MX,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:bX,shift:PX,preventDefault:!0},{key:"ArrowRight",run:Kk,shift:sA,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:mX,shift:CX,preventDefault:!0},{mac:"Cmd-ArrowRight",run:vX,shift:QX,preventDefault:!0},{key:"ArrowUp",run:tA,shift:uA,preventDefault:!0},{mac:"Cmd-ArrowUp",run:j3,shift:Q3},{mac:"Ctrl-ArrowUp",run:E3,shift:T3},{key:"ArrowDown",run:nA,shift:fA,preventDefault:!0},{mac:"Cmd-ArrowDown",run:P3,shift:Z3},{mac:"Ctrl-ArrowDown",run:n8,shift:$3},{key:"PageUp",run:E3,shift:T3},{key:"PageDown",run:n8,shift:$3},{key:"Home",run:yX,shift:jX,preventDefault:!0},{key:"Mod-Home",run:j3,shift:Q3},{key:"End",run:xX,shift:$X,preventDefault:!0},{key:"Mod-End",run:P3,shift:Z3},{key:"Enter",run:N3,shift:N3},{key:"Mod-a",run:RX},{key:"Backspace",run:r8,shift:r8,preventDefault:!0},{key:"Delete",run:pA,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:OA,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:XX,preventDefault:!0},{mac:"Mod-Backspace",run:FX,preventDefault:!0},{mac:"Mod-Delete",run:BX,preventDefault:!0}].concat(az.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),sz=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:gX,shift:EX},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:OX,shift:TX},{key:"Alt-ArrowUp",run:qX},{key:"Shift-Alt-ArrowUp",run:UX},{key:"Alt-ArrowDown",run:GX},{key:"Shift-Alt-ArrowDown",run:WX},{key:"Mod-Alt-ArrowUp",run:_X},{key:"Mod-Alt-ArrowDown",run:DX},{key:"Escape",run:HX},{key:"Mod-Enter",run:ez},{key:"Alt-l",mac:"Ctrl-l",run:VX},{key:"Mod-i",run:LX,preventDefault:!0},{key:"Mod-[",run:rz},{key:"Mod-]",run:nz},{key:"Mod-Alt-\\",run:tz},{key:"Shift-Mod-k",run:KX},{key:"Shift-Mod-\\",run:AX},{key:"Mod-/",run:qH},{key:"Alt-A",run:UH},{key:"Ctrl-m",mac:"Shift-Alt-m",run:iz}].concat(lz);function R3(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function oz(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let l=1;l<i.length;l++)n[i[l]]=!0}let r=R3(e)+R3(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function cz(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:oz(e);return i=>{let l=i.matchBefore(r);return l||i.explicit?{from:l?l.from:i.pos,options:e,validFor:n}:null}}function uz(t,e){return n=>{for(let r=sn(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}const fz=va.define(),dz=$e.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class hz{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class w6{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Xn.TrackDel),r=e.mapPos(this.to,1,Xn.TrackDel);return n==null||r==null?null:new w6(this.field,n,r)}}class k6{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],l=e.doc.lineAt(n),s=/^\s*/.exec(l.text)[0];for(let u of this.lines){if(r.length){let h=s,g=/^\t*/.exec(u)[0].length;for(let O=0;O<g;O++)h+=e.facet(Vd);i.push(n+h.length-g),u=h+u.slice(g)}r.push(u),n+=u.length+1}let c=this.fieldPositions.map(u=>new w6(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:c}}static parse(e){let n=[],r=[],i=[],l;for(let s of e.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s);){let c=l[1]?+l[1]:null,u=l[2]||l[3]||"",h=-1,g=u.replace(/\\[{}]/g,O=>O[1]);for(let O=0;O<n.length;O++)(c!=null?n[O].seq==c:g&&n[O].name==g)&&(h=O);if(h<0){let O=0;for(;O<n.length&&(c==null||n[O].seq!=null&&n[O].seq<c);)O++;n.splice(O,0,{seq:c,name:g}),h=O;for(let x of i)x.field>=h&&x.field++}for(let O of i)if(O.line==r.length&&O.from>l.index){let x=l[2]?3+(l[1]||"").length:2;O.from-=x,O.to-=x}i.push(new hz(h,r.length,l.index,l.index+g.length)),s=s.slice(0,l.index)+u+s.slice(l.index+l[0].length)}s=s.replace(/\\([{}])/g,(c,u,h)=>{for(let g of i)g.line==r.length&&g.from>h&&(g.from--,g.to--);return u}),r.push(s)}return new k6(r,i)}}let mz=qe.widget({widget:new class extends is{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),pz=qe.mark({class:"cm-snippetField"});class Lo{constructor(e,n){this.ranges=e,this.active=n,this.deco=qe.set(e.map(r=>(r.from==r.to?mz:pz).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Lo(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const e0=xt.define({map(t,e){return t&&t.map(e)}}),gz=xt.define(),Tu=Tr.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(e0))return n.value;if(n.is(gz)&&t)return new Lo(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>$e.decorations.from(t,e=>e?e.deco:qe.none)});function A6(t,e){return ge.create(t.filter(n=>n.field==e).map(n=>ge.range(n.from,n.to)))}function Oz(t){let e=k6.parse(t);return(n,r,i,l)=>{let{text:s,ranges:c}=e.instantiate(n.state,i),{main:u}=n.state.selection,h={changes:{from:i,to:l==u.from?u.to:l,insert:ut.of(s)},scrollIntoView:!0,annotations:r?[fz.of(r),gn.userEvent.of("input.complete")]:void 0};if(c.length&&(h.selection=A6(c,0)),c.some(g=>g.field>0)){let g=new Lo(c,0),O=h.effects=[e0.of(g)];n.state.field(Tu,!1)===void 0&&O.push(xt.appendConfig.of([Tu,Sz,wz,dz]))}n.dispatch(n.state.update(h))}}function vA(t){return({state:e,dispatch:n})=>{let r=e.field(Tu,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,l=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:A6(r.ranges,i),effects:e0.of(l?null:new Lo(r.ranges,i)),scrollIntoView:!0})),!0}}const xz=({state:t,dispatch:e})=>t.field(Tu,!1)?(e(t.update({effects:e0.of(null)})),!0):!1,yz=vA(1),bz=vA(-1),vz=[{key:"Tab",run:yz,shift:bz},{key:"Escape",run:xz}],V3=je.define({combine(t){return t.length?t[0]:vz}}),Sz=Gu.highest(u6.compute([V3],t=>t.facet(V3)));function sr(t,e){return{...e,apply:Oz(t)}}const wz=$e.domEventHandlers({mousedown(t,e){let n=e.state.field(Tu,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(l=>l.from<=r&&l.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:A6(n.ranges,i.field),effects:e0.of(n.ranges.some(l=>l.field>i.field)?new Lo(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),$u={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Il=xt.define({map(t,e){let n=e.mapPos(t,-1,Xn.TrackAfter);return n??void 0}}),M6=new class extends hl{};M6.startSide=1;M6.endSide=-1;const SA=Tr.define({create(){return nt.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Il)&&(t=t.update({add:[M6.range(n.value,n.value+1)]}));return t}});function kz(){return[Mz,SA]}const Kp="()[]{}<>«»»«[]{}";function wA(t){for(let e=0;e<Kp.length;e+=2)if(Kp.charCodeAt(e)==t)return Kp.charAt(e+1);return c9(t<128?t:t+1)}function kA(t,e){return t.languageDataAt("closeBrackets",e)[0]||$u}const Az=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Mz=$e.inputHandler.of((t,e,n,r)=>{if((Az?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&qu(rs(r,0))==1||e!=i.from||n!=i.to)return!1;let l=Tz(t.state,r);return l?(t.dispatch(l),!0):!1}),Cz=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=kA(t,t.selection.main.head).brackets||$u.brackets,i=null,l=t.changeByRange(s=>{if(s.empty){let c=$z(t.doc,s.head);for(let u of r)if(u==c&&Yd(t.doc,s.head)==wA(rs(u,0)))return{changes:{from:s.head-u.length,to:s.head+u.length},range:ge.cursor(s.head-u.length)}}return{range:i=s}});return i||e(t.update(l,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},Ez=[{key:"Backspace",run:Cz}];function Tz(t,e){let n=kA(t,t.selection.main.head),r=n.brackets||$u.brackets;for(let i of r){let l=wA(rs(i,0));if(e==i)return l==i?Qz(t,i,r.indexOf(i+i+i)>-1,n):jz(t,i,l,n.before||$u.before);if(e==l&&AA(t,t.selection.main.from))return Pz(t,i,l)}return null}function AA(t,e){let n=!1;return t.field(SA).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function Yd(t,e){let n=t.sliceString(e,e+2);return n.slice(0,qu(rs(n,0)))}function $z(t,e){let n=t.sliceString(e-2,e);return qu(rs(n,0))==n.length?n:n.slice(1)}function jz(t,e,n,r){let i=null,l=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:Il.of(s.to+e.length),range:ge.range(s.anchor+e.length,s.head+e.length)};let c=Yd(t.doc,s.head);return!c||/\s/.test(c)||r.indexOf(c)>-1?{changes:{insert:e+n,from:s.head},effects:Il.of(s.head+e.length),range:ge.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function Pz(t,e,n){let r=null,i=t.changeByRange(l=>l.empty&&Yd(t.doc,l.head)==n?{changes:{from:l.head,to:l.head+n.length,insert:n},range:ge.cursor(l.head+n.length)}:r={range:l});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Qz(t,e,n,r){let i=r.stringPrefixes||$u.stringPrefixes,l=null,s=t.changeByRange(c=>{if(!c.empty)return{changes:[{insert:e,from:c.from},{insert:e,from:c.to}],effects:Il.of(c.to+e.length),range:ge.range(c.anchor+e.length,c.head+e.length)};let u=c.head,h=Yd(t.doc,u),g;if(h==e){if(L3(t,u))return{changes:{insert:e+e,from:u},effects:Il.of(u+e.length),range:ge.cursor(u+e.length)};if(AA(t,u)){let x=n&&t.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+x.length,insert:x},range:ge.cursor(u+x.length)}}}else{if(n&&t.sliceDoc(u-2*e.length,u)==e+e&&(g=_3(t,u-2*e.length,i))>-1&&L3(t,g))return{changes:{insert:e+e+e+e,from:u},effects:Il.of(u+e.length),range:ge.cursor(u+e.length)};if(t.charCategorizer(u)(h)!=It.Word&&_3(t,u,i)>-1&&!Zz(t,u,e,i))return{changes:{insert:e+e,from:u},effects:Il.of(u+e.length),range:ge.cursor(u+e.length)}}return{range:l=c}});return l?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function L3(t,e){let n=sn(t).resolveInner(e+1);return n.parent&&n.from==e}function Zz(t,e,n,r){let i=sn(t).resolveInner(e,-1),l=r.reduce((s,c)=>Math.max(s,c.length),0);for(let s=0;s<5;s++){let c=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+l)),u=c.indexOf(n);if(!u||u>-1&&r.indexOf(c.slice(0,u))>-1){let g=i.firstChild;for(;g&&g.from==i.from&&g.to-g.from>n.length+u;){if(t.sliceDoc(g.to-n.length,g.to)==n)return!1;g=g.firstChild}return!0}let h=i.to==e&&i.parent;if(!h)break;i=h}return!1}function _3(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=It.Word)return e;for(let i of n){let l=e-i.length;if(t.sliceDoc(l,e)==i&&r(t.sliceDoc(l-1,l))!=It.Word)return l}return-1}const D3=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Ao{constructor(e,n,r=0,i=e.length,l,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=l?c=>l(D3(c)):D3,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return rs(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=c9(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=qu(e);let i=this.normalize(n);if(i.length)for(let l=0,s=r,c=!0;;l++){let u=i.charCodeAt(l),h=this.match(u,s,c,this.bufferPos+this.bufferStart,l==i.length-1);if(h)return this.value=h,this;if(l==i.length-1)break;c&&l<n.length&&n.charCodeAt(l)==u?s++:c=!1}}}match(e,n,r,i,l){let s=null;for(let c=0;c<this.matches.length;){let u=this.matches[c],h=!1;this.query.charCodeAt(u.index)==e&&(u.index==this.query.length-1?s={from:u.from,to:i,precise:l&&u.precise}:(u.index++,h=!0)),h?c++:this.matches.splice(c,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:n,to:i,precise:r&&l}:this.matches.push({from:n,index:1,precise:r})),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Ao.prototype[Symbol.iterator]=function(){return this});const MA={from:-1,to:-1,match:/.*/.exec(""),precise:!0},C6="gm"+(/x/.unicode==null?"":"u");class CA{constructor(e,n,r,i=0,l=e.length){if(this.text=e,this.to=l,this.curLine="",this.done=!1,this.value=MA,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new EA(e,n,r,i,l);this.re=new RegExp(n,C6+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let s=e.lineAt(i);this.curLineStart=s.from,this.matchPos=ad(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=ad(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Jp=new WeakMap;class oo{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=Jp.get(e);if(!i||i.from>=r||i.to<=n){let c=new oo(n,e.sliceString(n,r));return Jp.set(e,c),c}if(i.from==n&&i.to==r)return i;let{text:l,from:s}=i;return s>n&&(l=e.sliceString(n,s)+l,s=n),i.to<r&&(l+=e.sliceString(i.to,r)),Jp.set(e,new oo(s,l)),new oo(n,l.slice(n-s,r-s))}}class EA{constructor(e,n,r,i,l){this.text=e,this.to=l,this.done=!1,this.value=MA,this.matchPos=ad(e,i),this.re=new RegExp(n,C6+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=oo.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=ad(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=oo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(CA.prototype[Symbol.iterator]=EA.prototype[Symbol.iterator]=function(){return this});function Nz(t){try{return new RegExp(t,C6),!0}catch{return!1}}function ad(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}const Rz=t=>{let{state:e}=t,n=String(e.doc.lineAt(t.state.selection.main.head).number),{close:r,result:i}=MD(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:e.phrase("go")});return i.then(l=>{let s=l&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(l.elements.line.value);if(!s){t.dispatch({effects:r});return}let c=e.doc.lineAt(e.selection.main.head),[,u,h,g,O]=s,x=g?+g.slice(1):0,y=h?+h:c.number;if(h&&O){let A=y/100;u&&(A=A*(u=="-"?-1:1)+c.number/e.doc.lines),y=Math.round(e.doc.lines*A)}else h&&u&&(y=y*(u=="-"?-1:1)+c.number);let v=e.doc.line(Math.max(1,Math.min(e.doc.lines,y))),w=ge.cursor(v.from+Math.max(0,Math.min(x,v.length)));t.dispatch({effects:[r,$e.scrollIntoView(w.from,{y:"center"})],selection:w})}),!0},Vz={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Lz=je.define({combine(t){return Ro(t,Vz,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function _z(t){return[Fz,zz]}const Dz=qe.mark({class:"cm-selectionMatch"}),Hz=qe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function H3(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=It.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=It.Word)}function Xz(t,e,n,r){return t(e.sliceDoc(n,n+1))==It.Word&&t(e.sliceDoc(r-1,r))==It.Word}const zz=dr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Lz),{state:n}=t,r=n.selection;if(r.ranges.length>1)return qe.none;let i=r.main,l,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return qe.none;let u=n.wordAt(i.head);if(!u)return qe.none;s=n.charCategorizer(i.head),l=n.sliceDoc(u.from,u.to)}else{let u=i.to-i.from;if(u<e.minSelectionLength||u>200)return qe.none;if(e.wholeWords){if(l=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(H3(s,n,i.from,i.to)&&Xz(s,n,i.from,i.to)))return qe.none}else if(l=n.sliceDoc(i.from,i.to),!l)return qe.none}let c=[];for(let u of t.visibleRanges){let h=new Ao(n.doc,l,u.from,u.to);for(;!h.next().done;){let{from:g,to:O}=h.value;if((!s||H3(s,n,g,O))&&(i.empty&&g<=i.from&&O>=i.to?c.push(Hz.range(g,O)):(g>=i.to||O<=i.from)&&c.push(Dz.range(g,O)),c.length>e.maxMatches))return qe.none}}return qe.set(c)}},{decorations:t=>t.decorations}),Fz=$e.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Bz=({state:t,dispatch:e})=>{let{selection:n}=t,r=ge.create(n.ranges.map(i=>t.wordAt(i.head)||ge.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function Yz(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),l=i&&i.from==n.from&&i.to==n.to;for(let s=!1,c=new Ao(t.doc,e,r[r.length-1].to);;)if(c.next(),c.done){if(s)return null;c=new Ao(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(u=>u.from==c.value.from))continue;if(l){let u=t.wordAt(c.value.from);if(!u||u.from!=c.value.from||u.to!=c.value.to)continue}return c.value}}const Iz=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(l=>l.from===l.to))return Bz({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(l=>t.sliceDoc(l.from,l.to)!=r))return!1;let i=Yz(t,r);return i?(e(t.update({selection:t.selection.addRange(ge.range(i.from,i.to),!1),effects:$e.scrollIntoView(i.to)})),!0):!1},_o=je.define({combine(t){return Ro(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new sF(e),scrollToMatch:e=>$e.scrollIntoView(e)})}});class TA{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Nz(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
108
- `:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Jz(this):new Uz(this)}getCursor(e,n=0,r){let i=e.doc?e:gt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Is(this,i,n,r):Ys(this,i,n,r)}}class $A{constructor(e){this.spec=e}}function qz(t,e,n){return(r,i,l,s)=>{if(n&&!n(r,i,l,s))return!1;let c=r>=s&&i<=s+l.length?l.slice(r-s,i-s):e.doc.sliceString(r,i);return t(c,e,r,i)}}function Ys(t,e,n,r){let i;return t.wholeWord&&(i=Gz(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=qz(t.test,e,i)),new Ao(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:l=>l.toLowerCase(),i)}function Gz(t,e){return(n,r,i,l)=>((l>n||l+i.length<r)&&(l=Math.max(0,n-2),i=t.sliceString(l,Math.min(t.length,r+2))),(e(ld(i,n-l))!=It.Word||e(sd(i,n-l))!=It.Word)&&(e(sd(i,r-l))!=It.Word||e(ld(i,r-l))!=It.Word))}class Uz extends $A{constructor(e){super(e)}nextMatch(e,n,r){let i=Ys(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let l=Math.min(e.doc.length,n+this.spec.unquoted.length);i=Ys(this.spec,e,0,l).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let l=Math.max(n,i-1e4-this.spec.unquoted.length),s=Ys(this.spec,e,l,i),c=null;for(;!s.nextOverlapping().done;)c=s.value;if(c)return c;if(l==n)return null;i-=1e4}}prevMatch(e,n,r){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Ys(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let l=Ys(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!l.next().done;)i(l.value.from,l.value.to)}}function Wz(t,e,n){return(r,i,l)=>(!n||n(r,i,l))&&t(l[0],e,r,i)}function Is(t,e,n,r){let i;return t.wholeWord&&(i=Kz(e.charCategorizer(e.selection.main.head))),t.test&&(i=Wz(t.test,e,i)),new CA(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},n,r)}function ld(t,e){return t.slice(Cn(t,e,!1),e)}function sd(t,e){return t.slice(e,Cn(t,e))}function Kz(t){return(e,n,r)=>!r[0].length||(t(ld(r.input,r.index))!=It.Word||t(sd(r.input,r.index))!=It.Word)&&(t(sd(r.input,r.index+r[0].length))!=It.Word||t(ld(r.input,r.index+r[0].length))!=It.Word)}class Jz extends $A{nextMatch(e,n,r){let i=Is(this.spec,e,r,e.doc.length).next();return i.done&&(i=Is(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let l=Math.max(n,r-i*1e4),s=Is(this.spec,e,l,r),c=null;for(;!s.next().done;)c=s.value;if(c&&(l==n||c.from>l+10))return c;if(l==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let l=+r.slice(0,i);if(l>0&&l<e.match.length)return e.match[l]+r.slice(i)}return n})}matchAll(e,n){let r=Is(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let l=Is(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!l.next().done;)i(l.value.from,l.value.to)}}const ju=xt.define(),E6=xt.define(),cl=Tr.define({create(t){return new e2(i8(t).create(),null)},update(t,e){for(let n of e.effects)n.is(ju)?t=new e2(n.value.create(),t.panel):n.is(E6)&&(t=new e2(t.query,n.value?T6:null));return t},provide:t=>Kf.from(t,e=>e.panel)});class e2{constructor(e,n){this.query=e,this.panel=n}}const eF=qe.mark({class:"cm-searchMatch"}),tF=qe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),nF=dr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(cl))}update(t){let e=t.state.field(cl);(e!=t.startState.field(cl)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return qe.none;let{view:n}=this,r=new Kl;for(let i=0,l=n.visibleRanges,s=l.length;i<s;i++){let{from:c,to:u}=l[i];for(;i<s-1&&u>l[i+1].from-500;)u=l[++i].to;t.highlight(n.state,c,u,(h,g)=>{let O=n.state.selection.ranges.some(x=>x.from==h&&x.to==g);r.add(h,g,O?tF:eF)})}return r.finish()}},{decorations:t=>t.decorations});function t0(t){return e=>{let n=e.state.field(cl,!1);return n&&n.query.spec.valid?t(e,n):QA(e)}}const od=t0((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=ge.single(r.from,r.to),l=t.state.facet(_o);return t.dispatch({selection:i,effects:[$6(t,r),l.scrollToMatch(i.main,t)],userEvent:"select.search"}),PA(t),!0}),cd=t0((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let l=ge.single(i.from,i.to),s=t.state.facet(_o);return t.dispatch({selection:l,effects:[$6(t,i),s.scrollToMatch(l.main,t)],userEvent:"select.search"}),PA(t),!0}),rF=t0((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:ge.create(n.map(r=>ge.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),iF=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,l=[],s=0;for(let c=new Ao(t.doc,t.sliceDoc(r,i));!c.next().done;){if(l.length>1e3)return!1;c.value.from==r&&(s=l.length),l.push(ge.range(c.value.from,c.value.to))}return e(t.update({selection:ge.create(l,s),userEvent:"select.search.matches"})),!0},X3=t0((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let l=e.nextMatch(n,r,r);if(!l)return!1;let s=l,c=[],u,h,g=[];s.precise?s.from==r&&s.to==i&&(h=n.toText(e.getReplacement(s)),c.push({from:s.from,to:s.to,insert:h}),g.push($e.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):s=e.nextMatch(n,s.from,s.to);let O=t.state.changes(c);return s&&(u=ge.single(s.from,s.to).map(O),g.push($6(t,s)),g.push(n.facet(_o).scrollToMatch(u.main,t))),t.dispatch({changes:O,selection:u,effects:g,userEvent:"input.replace"}),!0}),aF=t0((t,{query:e})=>{if(t.state.readOnly)return!1;let n=[];for(let i of e.matchAll(t.state,1e9)){let{from:l,to:s,precise:c}=i;c&&n.push({from:l,to:s,insert:e.getReplacement(i)})}if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:$e.announce.of(r),userEvent:"input.replace.all"}),!0});function T6(t){return t.state.facet(_o).createPanel(t)}function i8(t,e){var n,r,i,l,s;let c=t.selection.main,u=c.empty||c.to>c.from+100?"":t.sliceDoc(c.from,c.to);if(e&&!u)return e;let h=t.facet(_o);return new TA({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:h.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:h.literal,regexp:(l=e==null?void 0:e.regexp)!==null&&l!==void 0?l:h.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:h.wholeWord})}function jA(t){let e=Ok(t,T6);return e&&e.dom.querySelector("[main-field]")}function PA(t){let e=jA(t);e&&e==t.root.activeElement&&e.select()}const QA=t=>{let e=t.state.field(cl,!1);if(e&&e.panel){let n=jA(t);if(n&&n!=t.root.activeElement){let r=i8(t.state,e.query.spec);r.valid&&t.dispatch({effects:ju.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[E6.of(!0),e?ju.of(i8(t.state,e.query.spec)):xt.appendConfig.of(cF)]});return!0},ZA=t=>{let e=t.state.field(cl,!1);if(!e||!e.panel)return!1;let n=Ok(t,T6);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:E6.of(!1)}),!0},lF=[{key:"Mod-f",run:QA,scope:"editor search-panel"},{key:"F3",run:od,shift:cd,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:od,shift:cd,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ZA,scope:"editor search-panel"},{key:"Mod-Shift-l",run:iF},{key:"Mod-Alt-g",run:Rz},{key:"Mod-d",run:Iz,preventDefault:!0}];class sF{constructor(e){this.view=e;let n=this.query=e.state.field(cl).query.spec;this.commit=this.commit.bind(this),this.searchField=kn("input",{value:n.search,placeholder:wr(e,"Find"),"aria-label":wr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=kn("input",{value:n.replace,placeholder:wr(e,"Replace"),"aria-label":wr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=kn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=kn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=kn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,l,s){return kn("button",{class:"cm-button",name:i,onclick:l,type:"button"},s)}this.dom=kn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>od(e),[wr(e,"next")]),r("prev",()=>cd(e),[wr(e,"previous")]),r("select",()=>rF(e),[wr(e,"all")]),kn("label",null,[this.caseField,wr(e,"match case")]),kn("label",null,[this.reField,wr(e,"regexp")]),kn("label",null,[this.wordField,wr(e,"by word")]),...e.state.readOnly?[]:[kn("br"),this.replaceField,r("replace",()=>X3(e),[wr(e,"replace")]),r("replaceAll",()=>aF(e),[wr(e,"replace all")])],kn("button",{name:"close",onclick:()=>ZA(e),"aria-label":wr(e,"close"),type:"button"},["×"])])}commit(){let e=new TA({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ju.of(e)}))}keydown(e){bD(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?cd:od)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),X3(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(ju)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(_o).top}}function wr(t,e){return t.state.phrase(e)}const J1=30,ef=/[\s\.,:;?!]/;function $6(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,l=Math.max(r.from,e-J1),s=Math.min(i,n+J1),c=t.state.sliceDoc(l,s);if(l!=r.from){for(let u=0;u<J1;u++)if(!ef.test(c[u+1])&&ef.test(c[u])){c=c.slice(u);break}}if(s!=i){for(let u=c.length-1;u>c.length-J1;u--)if(!ef.test(c[u-1])&&ef.test(c[u])){c=c.slice(0,u);break}}return $e.announce.of(`${t.state.phrase("current match")}. ${c} ${t.state.phrase("on line")} ${r.number}.`)}const oF=$e.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),cF=[cl,Gu.low(nF),oF],uF="#e5c07b",z3="#e06c75",fF="#56b6c2",dF="#ffffff",Tf="#abb2bf",a8="#7d8799",hF="#61afef",mF="#98c379",F3="#d19a66",pF="#c678dd",gF="#21252b",B3="#2c313a",Y3="#282c34",t2="#353a42",OF="#3E4451",I3="#528bff",xF=$e.theme({"&":{color:Tf,backgroundColor:Y3},".cm-content":{caretColor:I3},".cm-cursor, .cm-dropCursor":{borderLeftColor:I3},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:OF},".cm-panels":{backgroundColor:gF,color:Tf},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Y3,color:a8,border:"none"},".cm-activeLineGutter":{backgroundColor:B3},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:t2},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:t2,borderBottomColor:t2},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:B3,color:Tf}}},{dark:!0}),yF=Hd.define([{tag:ee.keyword,color:pF},{tag:[ee.name,ee.deleted,ee.character,ee.propertyName,ee.macroName],color:z3},{tag:[ee.function(ee.variableName),ee.labelName],color:hF},{tag:[ee.color,ee.constant(ee.name),ee.standard(ee.name)],color:F3},{tag:[ee.definition(ee.name),ee.separator],color:Tf},{tag:[ee.typeName,ee.className,ee.number,ee.changed,ee.annotation,ee.modifier,ee.self,ee.namespace],color:uF},{tag:[ee.operator,ee.operatorKeyword,ee.url,ee.escape,ee.regexp,ee.link,ee.special(ee.string)],color:fF},{tag:[ee.meta,ee.comment],color:a8},{tag:ee.strong,fontWeight:"bold"},{tag:ee.emphasis,fontStyle:"italic"},{tag:ee.strikethrough,textDecoration:"line-through"},{tag:ee.link,color:a8,textDecoration:"underline"},{tag:ee.heading,fontWeight:"bold",color:z3},{tag:[ee.atom,ee.bool,ee.special(ee.variableName)],color:F3},{tag:[ee.processingInstruction,ee.string,ee.inserted],color:mF},{tag:ee.invalid,color:dF}]),bF=[xF,QH(yF)];var q3={};class ud{constructor(e,n,r,i,l,s,c,u,h,g=0,O){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=l,this.score=s,this.buffer=c,this.bufferBase=u,this.curContext=h,this.lookAhead=g,this.parent=O}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new ud(e,[],n,r,r,0,[],0,i?new G3(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:l}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),c=l.dynamicPrecedence(i);if(c&&(this.score+=c),r==0){i<l.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(l.getGoto(this.state,i,!0),this.reducePos),i<l.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),h=u?this.stack[u-2]:this.p.ranges[0].from;i<l.minRepeatTerm&&h==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let g=this.reducePos-h;g>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=g):this.p.lastBigReductionSize<g&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=g));let O=u?this.stack[u-1]:0,x=this.bufferBase+this.buffer.length-O;if(i<l.minRepeatTerm||e&131072){let y=l.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,h,y,x+4,!0)}if(e&262144)this.state=this.stack[u];else{let y=this.stack[u-3];this.state=l.getGoto(y,i,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(i,h)}storeNode(e,n,r,i=4,l=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this.buffer.length;if(s>0&&this.buffer[s-4]==0&&this.buffer[s-1]>-1){if(n==r)return;if(this.buffer[s-2]>=n){this.buffer[s-2]=r;return}}}if(!l||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let c=!1;for(let u=s;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){c=!0;break}if(c)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let l=e,{parser:s}=this.p;this.pos=i;let c=s.stateFlag(l,1);!c&&(i>r||n<=s.maxNode)&&(this.reducePos=i),this.pushState(l,c?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new ud(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new vF(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let l=0,s;l<n.length;l+=2)(s=n[l+1])!=this.state&&this.p.parser.hasAction(s,e)&&i.push(n[l],s);if(this.stack.length<120)for(let l=0;i.length<8&&l<n.length;l+=2){let s=n[l+1];i.some((c,u)=>u&1&&c==s)||i.push(n[l],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let l=n[i+1];if(l==this.state)continue;let s=this.split();s.pushState(l,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,l=this.stack.length-r*3;if(l<0||e.getGoto(this.stack[l],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,l)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let c=(s>>19)-l;if(c>1){let u=s&65535,h=this.stack.length-c*3;if(h>=0&&e.getGoto(this.stack[h],u,!1)>=0)return c<<19|65536|u}}else{let c=r(s,l+1);if(c!=null)return c}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new G3(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class G3{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class vF{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class fd{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new fd(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new fd(this.stack,this.pos,this.index)}}function Bc(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let l=0;for(;;){let s=t.charCodeAt(r++),c=!1;if(s==126){l=65535;break}s>=92&&s--,s>=34&&s--;let u=s-32;if(u>=46&&(u-=46,c=!0),l+=u,c)break;l*=46}n?n[i++]=l:n=new e(l)}return n}class $f{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const U3=new $f;class SF{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=U3,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,l=this.pos+e;for(;l<r.from;){if(!i)return null;let s=this.ranges[--i];l-=r.from-s.to,r=s}for(;n<0?l>r.to:l>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];l+=s.from-r.to,r=s}return l}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let l=this.resolveOffset(e,1);if(l==null)return-1;if(r=l,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,c=this.range;for(;c.to<=r;)c=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=U3,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class co{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;NA(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}co.prototype.contextual=co.prototype.fallback=co.prototype.extend=!1;class dd{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Bc(e):e}token(e,n){let r=e.pos,i=0;for(;;){let l=e.next<0,s=e.resolveOffset(1,1);if(NA(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(l||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}dd.prototype.contextual=co.prototype.fallback=co.prototype.extend=!1;class $r{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function NA(t,e,n,r,i,l){let s=0,c=1<<r,{dialect:u}=n.p.parser;e:for(;(c&t[s])!=0;){let h=t[s+1];for(let y=s+3;y<h;y+=2)if((t[y+1]&c)>0){let v=t[y];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||wF(v,e.token.value,i,l))){e.acceptToken(v);break}}let g=e.next,O=0,x=t[s+2];if(e.next<0&&x>O&&t[h+x*3-3]==65535){s=t[h+x*3-1];continue e}for(;O<x;){let y=O+x>>1,v=h+y+(y<<1),w=t[v],A=t[v+1]||65536;if(g<w)x=y;else if(g>=A)O=y+1;else{s=t[v+2],e.advance();continue e}}break}}function W3(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function wF(t,e,n,r){let i=W3(n,r,e);return i<0||W3(n,r,t)<i}const kr=typeof process<"u"&&q3&&/\bparse\b/.test(q3.LOG);let n2=null;function K3(t,e,n){let r=t.cursor(At.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class kF{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?K3(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?K3(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let l=r.children[i],s=this.start[n]+r.positions[i];if(s>e)return this.nextStart=s,null;if(l instanceof qt){if(s==e){if(s<this.safeFrom)return null;let c=s+l.length;if(c<=this.safeTo){let u=l.prop(Ke.lookAhead);if(!u||c+u<this.fragment.to)return l}}this.index[n]++,s+l.length>=Math.max(this.safeFrom,e)&&(this.trees.push(l),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+l.length}}}class AF{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new $f)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:l}=i,s=i.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,u=0;for(let h=0;h<l.length;h++){if((1<<h&s)==0)continue;let g=l[h],O=this.tokens[h];if(!(r&&!g.fallback)&&((g.contextual||O.start!=e.pos||O.mask!=s||O.context!=c)&&(this.updateCachedToken(O,g,e),O.mask=s,O.context=c),O.lookAhead>O.end+25&&(u=Math.max(O.lookAhead,u)),O.value!=0)){let x=n;if(O.extended>-1&&(n=this.addActions(e,O.extended,O.end,n)),n=this.addActions(e,O.value,O.end,n),!g.extend&&(r=O,n>x))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new $f,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new $f,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:l}=r.p;for(let s=0;s<l.specialized.length;s++)if(l.specialized[s]==e.value){let c=l.specializers[s](this.stream.read(e.start,e.end),r);if(c>=0&&r.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let l=0;l<i;l+=3)if(this.actions[l]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:l}=e,{parser:s}=e.p,{data:c}=s;for(let u=0;u<2;u++)for(let h=s.stateSlot(l,u?2:1);;h+=3){if(c[h]==65535)if(c[h+1]==1)h=na(c,h+2);else{i==0&&c[h+1]==2&&(i=this.putAction(na(c,h+2),n,r,i));break}c[h]==n&&(i=this.putAction(na(c,h+1),n,r,i))}return i}}class MF{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new SF(n,i),this.tokens=new AF(e,this.stream),this.topTerm=e.top[1];let{from:l}=i[0];this.stacks=[ud.start(this,e.top[0],l)],this.fragments=r.length&&this.stream.end-l>e.bufferLength*4?new kF(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,l;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let c=e[s];for(;;){if(this.tokens.mainToken=null,c.pos>n)r.push(c);else{if(this.advanceStack(c,r,e))continue;{i||(i=[],l=[]),i.push(c);let u=this.tokens.getMainToken(c);l.push(u.value,u.end)}}break}}if(!r.length){let s=i&&EF(i);if(s)return kr&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw kr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,l,r);if(s)return kr&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((c,u)=>u.score-c.score);r.length>s;)r.pop();r.some(c=>c.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let c=r[s];for(let u=s+1;u<r.length;u++){let h=r[u];if(c.sameState(h)||c.buffer.length>500&&h.buffer.length>500)if((c.score-h.score||c.buffer.length-h.buffer.length)>0)r.splice(u--,1);else{r.splice(s--,1);continue e}}}r.length>12&&(r.sort((s,c)=>c.score-s.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:l}=this,s=kr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,g=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(i);O;){let x=this.parser.nodeSet.types[O.type.id]==O.type?l.getGoto(e.state,O.type.id):-1;if(x>-1&&O.length&&(!h||(O.prop(Ke.contextHash)||0)==g))return e.useNode(O,x),kr&&console.log(s+this.stackID(e)+` (via reuse of ${l.getName(O.type.id)})`),!0;if(!(O instanceof qt)||O.children.length==0||O.positions[0]>0)break;let y=O.children[0];if(y instanceof qt&&O.positions[0]==0)O=y;else break}}let c=l.stateSlot(e.state,4);if(c>0)return e.reduce(c),kr&&console.log(s+this.stackID(e)+` (via always-reduce ${l.getName(c&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let h=0;h<u.length;){let g=u[h++],O=u[h++],x=u[h++],y=h==u.length||!r,v=y?e:e.split(),w=this.tokens.mainToken;if(v.apply(g,O,w?w.start:v.pos,x),kr&&console.log(s+this.stackID(v)+` (via ${(g&65536)==0?"shift":`reduce of ${l.getName(g&65535)}`} for ${l.getName(O)} @ ${i}${v==e?"":", split"})`),y)return!0;v.pos>i?n.push(v):r.push(v)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return J3(e,n),!0}}runRecovery(e,n,r){let i=null,l=!1;for(let s=0;s<e.length;s++){let c=e[s],u=n[s<<1],h=n[(s<<1)+1],g=kr?this.stackID(c)+" -> ":"";if(c.deadEnd&&(l||(l=!0,c.restart(),kr&&console.log(g+this.stackID(c)+" (restarted)"),this.advanceFully(c,r))))continue;let O=c.split(),x=g;for(let y=0;y<10&&O.forceReduce()&&(kr&&console.log(x+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,r));y++)kr&&(x=this.stackID(O)+" -> ");for(let y of c.recoverByInsert(u))kr&&console.log(g+this.stackID(y)+" (via recover-insert)"),this.advanceFully(y,r);this.stream.end>c.pos?(h==c.pos&&(h++,u=0),c.recoverByDelete(u,h),kr&&console.log(g+this.stackID(c)+` (via recover-delete ${this.parser.getName(u)})`),J3(c,r)):(!i||i.score<O.score)&&(i=O)}return i}stackToTree(e){return e.close(),qt.build({buffer:fd.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(n2||(n2=new WeakMap)).get(e);return n||n2.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function J3(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class CF{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const r2=t=>t;class RA{constructor(e){this.start=e.start,this.shift=e.shift||r2,this.reduce=e.reduce||r2,this.reuse=e.reuse||r2,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Mo extends Ek{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let c=0;c<e.repeatNodeCount;c++)n.push("");let r=Object.keys(e.topRules).map(c=>e.topRules[c][1]),i=[];for(let c=0;c<n.length;c++)i.push([]);function l(c,u,h){i[c].push([u,u.deserialize(String(h))])}if(e.nodeProps)for(let c of e.nodeProps){let u=c[0];typeof u=="string"&&(u=Ke[u]);for(let h=1;h<c.length;){let g=c[h++];if(g>=0)l(g,u,c[h++]);else{let O=c[h+-g];for(let x=-g;x>0;x--)l(c[h++],u,O);h++}}}this.nodeSet=new f6(n.map((c,u)=>Wn.define({name:u>=this.minRepeatTerm?void 0:c,id:u,props:i[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=wk;let s=Bc(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(ev),this.states=Bc(e.states,Uint32Array),this.data=Bc(e.stateData),this.goto=Bc(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new co(s,c):c),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new MF(this,e,n,r);for(let l of this.wrappers)i=l(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let l=i[n+1];;){let s=i[l++],c=s&1,u=i[l++];if(c&&r)return u;for(let h=l+(s>>1);l<h;l++)if(i[l]==e)return u;if(c)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let l=this.stateSlot(e,i?2:1),s;;l+=3){if((s=r[l])==65535)if(r[l+1]==1)s=r[l=na(r,l+2)];else{if(r[l+1]==2)return na(r,l+2);break}if(s==n||s==0)return na(r,l+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let l=this.stateSlot(e,1);i==null;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=na(this.data,l+2);else break;i=n(na(this.data,l+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=na(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((l,s)=>s&1&&l==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Mo.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(l=>l.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let l=e.specializers.find(c=>c.from==r.external);if(!l)return r;let s=Object.assign(Object.assign({},r),{external:l.to});return n.specializers[i]=ev(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let l of e.split(" ")){let s=n.indexOf(l);s>=0&&(r[s]=!0)}let i=null;for(let l=0;l<n.length;l++)if(!r[l])for(let s=this.dialects[n[l]],c;(c=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[c]=1;return new CF(e,r,i)}static deserialize(e){return new Mo(e)}}function na(t,e){return t[e]|t[e+1]<<16}function EF(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function ev(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const TF=55,$F=1,jF=56,PF=2,QF=57,ZF=3,tv=4,NF=5,j6=6,VA=7,LA=8,_A=9,DA=10,RF=11,VF=12,LF=13,i2=58,_F=14,DF=15,nv=59,HA=21,HF=23,XA=24,XF=25,l8=27,zA=28,zF=29,FF=32,BF=35,YF=37,IF=38,qF=0,GF=1,UF={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},WF={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},rv={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function KF(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let iv=null,av=null,lv=0;function s8(t,e){let n=t.pos+e;if(lv==n&&av==t)return iv;let r=t.peek(e),i="";for(;KF(r);)i+=String.fromCharCode(r),r=t.peek(++e);return av=t,lv=n,iv=i?i.toLowerCase():r==JF||r==eB?void 0:null}const FA=60,hd=62,P6=47,JF=63,eB=33,tB=45;function sv(t,e){this.name=t,this.parent=e}const nB=[j6,DA,VA,LA,_A],rB=new RA({start:null,shift(t,e,n,r){return nB.indexOf(e)>-1?new sv(s8(r,1)||"",t):t},reduce(t,e){return e==HA&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==j6||i==YF?new sv(s8(r,1)||"",t):t},strict:!1}),iB=new $r((t,e)=>{if(t.next!=FA){t.next<0&&e.context&&t.acceptToken(i2);return}t.advance();let n=t.next==P6;n&&t.advance();let r=s8(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?DF:_F);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(RF);if(i&&WF[i])return t.acceptToken(i2,-2);if(e.dialectEnabled(qF))return t.acceptToken(VF);for(let l=e.context;l;l=l.parent)if(l.name==r)return;t.acceptToken(LF)}else{if(r=="script")return t.acceptToken(VA);if(r=="style")return t.acceptToken(LA);if(r=="textarea")return t.acceptToken(_A);if(UF.hasOwnProperty(r))return t.acceptToken(DA);i&&rv[i]&&rv[i][r]?t.acceptToken(i2,-1):t.acceptToken(j6)}},{contextual:!0}),aB=new $r(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(nv);break}if(t.next==tB)e++;else if(t.next==hd&&e>=2){n>=3&&t.acceptToken(nv,-2);break}else e=0;t.advance()}});function lB(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const sB=new $r((t,e)=>{if(t.next==P6&&t.peek(1)==hd){let n=e.dialectEnabled(GF)||lB(e.context);t.acceptToken(n?NF:tv,2)}else t.next==hd&&t.acceptToken(tv,1)});function Q6(t,e,n){let r=2+t.length;return new $r(i=>{for(let l=0,s=0,c=0;;c++){if(i.next<0){c&&i.acceptToken(e);break}if(l==0&&i.next==FA||l==1&&i.next==P6||l>=2&&l<r&&i.next==t.charCodeAt(l-2))l++,s++;else if(l==r&&i.next==hd){c>s?i.acceptToken(e,-s):i.acceptToken(n,-(s-2));break}else if((i.next==10||i.next==13)&&c){i.acceptToken(e,1);break}else l=s=0;i.advance()}})}const oB=Q6("script",TF,$F),cB=Q6("style",jF,PF),uB=Q6("textarea",QF,ZF),fB=Rd({"Text RawText IncompleteTag IncompleteCloseTag":ee.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":ee.angleBracket,TagName:ee.tagName,"MismatchedCloseTag/TagName":[ee.tagName,ee.invalid],AttributeName:ee.attributeName,"AttributeValue UnquotedAttributeValue":ee.attributeValue,Is:ee.definitionOperator,"EntityReference CharacterReference":ee.character,Comment:ee.blockComment,ProcessingInst:ee.processingInstruction,DoctypeDecl:ee.documentMeta}),dB=Mo.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:rB,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[fB],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[oB,cB,uB,sB,iB,aB,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function BA(t,e){let n=Object.create(null);for(let r of t.getChildren(XA)){let i=r.getChild(XF),l=r.getChild(l8)||r.getChild(zA);i&&(n[e.read(i.from,i.to)]=l?l.type.id==l8?e.read(l.from+1,l.to-1):e.read(l.from,l.to):"")}return n}function ov(t,e){let n=t.getChild(HF);return n?e.read(n.from,n.to):" "}function a2(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=BA(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function YA(t=[],e=[]){let n=[],r=[],i=[],l=[];for(let c of t)(c.tag=="script"?n:c.tag=="style"?r:c.tag=="textarea"?i:l).push(c);let s=e.length?Object.create(null):null;for(let c of e)(s[c.name]||(s[c.name]=[])).push(c);return qD((c,u)=>{let h=c.type.id;if(h==zF)return a2(c,u,n);if(h==FF)return a2(c,u,r);if(h==BF)return a2(c,u,i);if(h==HA&&l.length){let g=c.node,O=g.firstChild,x=O&&ov(O,u),y;if(x){for(let v of l)if(v.tag==x&&(!v.attrs||v.attrs(y||(y=BA(O,u))))){let w=g.lastChild,A=w.type.id==IF?w.from:g.to;if(A>O.to)return{parser:v.parser,overlay:[{from:O.to,to:A}]}}}}if(s&&h==XA){let g=c.node,O;if(O=g.firstChild){let x=s[u.read(O.from,O.to)];if(x)for(let y of x){if(y.tagName&&y.tagName!=ov(g.parent,u))continue;let v=g.lastChild;if(v.type.id==l8){let w=v.from+1,A=v.lastChild,k=v.to-(A&&A.isError?0:1);if(k>w)return{parser:y.parser,overlay:[{from:w,to:k}],bracketed:!0}}else if(v.type.id==zA)return{parser:y.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const hB=135,cv=1,mB=136,pB=137,IA=2,gB=138,OB=3,xB=4,qA=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],yB=58,bB=40,GA=95,vB=91,jf=45,SB=46,wB=35,kB=37,AB=38,MB=92,CB=10,EB=42;function Pu(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Z6(t){return t>=48&&t<=57}function uv(t){return Z6(t)||t>=97&&t<=102||t>=65&&t<=70}const UA=(t,e,n)=>(r,i)=>{for(let l=!1,s=0,c=0;;c++){let{next:u}=r;if(Pu(u)||u==jf||u==GA||l&&Z6(u))!l&&(u!=jf||c>0)&&(l=!0),s===c&&u==jf&&s++,r.advance();else if(u==MB&&r.peek(1)!=CB){if(r.advance(),uv(r.next)){do r.advance();while(uv(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();l=!0}else{l&&r.acceptToken(s==2&&i.canShift(IA)?e:u==bB?n:t);break}}},TB=new $r(UA(mB,IA,pB),{contextual:!0}),$B=new $r(UA(gB,OB,xB),{contextual:!0}),jB=new $r(t=>{if(qA.includes(t.peek(-1))){let{next:e}=t;(Pu(e)||e==GA||e==wB||e==SB||e==EB||e==vB||e==yB&&Pu(t.peek(1))||e==jf||e==AB)&&t.acceptToken(hB)}}),PB=new $r(t=>{if(!qA.includes(t.peek(-1))){let{next:e}=t;if(e==kB&&(t.advance(),t.acceptToken(cv)),Pu(e)){do t.advance();while(Pu(t.next)||Z6(t.next));t.acceptToken(cv)}}}),QB=Rd({"AtKeyword import charset namespace keyframes media supports font-feature-values":ee.definitionKeyword,"from to selector scope MatchFlag":ee.keyword,NamespaceName:ee.namespace,KeyframeName:ee.labelName,KeyframeRangeName:ee.operatorKeyword,TagName:ee.tagName,ClassName:ee.className,PseudoClassName:ee.constant(ee.className),IdName:ee.labelName,"FeatureName PropertyName":ee.propertyName,AttributeName:ee.attributeName,NumberLiteral:ee.number,KeywordQuery:ee.keyword,UnaryQueryOp:ee.operatorKeyword,"CallTag ValueName FontName":ee.atom,VariableName:ee.variableName,Callee:ee.operatorKeyword,Unit:ee.unit,"UniversalSelector NestingSelector":ee.definitionOperator,"MatchOp CompareOp":ee.compareOperator,"ChildOp SiblingOp, LogicOp":ee.logicOperator,BinOp:ee.arithmeticOperator,Important:ee.modifier,Comment:ee.blockComment,ColorLiteral:ee.color,"ParenthesizedContent StringLiteral":ee.string,":":ee.punctuation,"PseudoOp #":ee.derefOperator,"; , |":ee.separator,"( )":ee.paren,"[ ]":ee.squareBracket,"{ }":ee.brace}),ZB={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},NB={__proto__:null,or:104,and:104,not:112,only:112,layer:186},RB={__proto__:null,selector:118,layer:182},VB={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},LB={__proto__:null,to:223},_B=Mo.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[QB],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[jB,PB,TB,$B,1,2,3,4,new dd("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:t=>ZB[t]||-1},{term:138,get:t=>NB[t]||-1},{term:4,get:t=>RB[t]||-1},{term:28,get:t=>VB[t]||-1},{term:136,get:t=>LB[t]||-1}],tokenPrec:2256});let l2=null;function s2(){if(!l2&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));l2=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return l2||[]}const fv=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),dv=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),DB=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),HB=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),ea=/^(\w[\w-]*|-\w[\w-]*|)$/,XB=/^-(-[\w-]*)?$/;function zB(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const hv=new Ck,FB=["Declaration"];function BB(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function WA(t,e,n){if(e.to-e.from>4096){let r=hv.get(e);if(r)return r;let i=[],l=new Set,s=e.cursor(At.IncludeAnonymous);if(s.firstChild())do for(let c of WA(t,s.node,n))l.has(c.label)||(l.add(c.label),i.push(c));while(s.nextSibling());return hv.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(l=>{var s;if(n(l)&&l.matchContext(FB)&&((s=l.node.nextSibling)===null||s===void 0?void 0:s.name)==":"){let c=t.sliceString(l.from,l.to);i.has(c)||(i.add(c),r.push({label:c,type:"variable"}))}}),r}}const YB=t=>e=>{let{state:n,pos:r}=e,i=sn(n).resolveInner(r,-1),l=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(l||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:s2(),validFor:ea};if(i.name=="ValueName")return{from:i.from,options:dv,validFor:ea};if(i.name=="PseudoClassName")return{from:i.from,options:fv,validFor:ea};if(t(i)||(e.explicit||l)&&zB(i,n.doc))return{from:t(i)||l?i.from:r,options:WA(n.doc,BB(i),t),validFor:XB};if(i.name=="TagName"){for(let{parent:u}=i;u;u=u.parent)if(u.name=="Block")return{from:i.from,options:s2(),validFor:ea};return{from:i.from,options:DB,validFor:ea}}if(i.name=="AtKeyword")return{from:i.from,options:HB,validFor:ea};if(!e.explicit)return null;let s=i.resolve(r),c=s.childBefore(r);return c&&c.name==":"&&s.name=="PseudoClassSelector"?{from:r,options:fv,validFor:ea}:c&&c.name==":"&&s.name=="Declaration"||s.name=="ArgList"?{from:r,options:dv,validFor:ea}:s.name=="Block"||s.name=="Styles"?{from:r,options:s2(),validFor:ea}:null},IB=YB(t=>t.name=="VariableName"),md=wo.define({name:"css",parser:_B.configure({props:[_d.add({Declaration:Ef()}),Dd.add({"Block KeyframeList":Nk})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function KA(){return new g6(md,md.data.of({autocomplete:IB}))}const qB=316,GB=317,mv=1,UB=2,WB=3,KB=4,JB=318,eY=320,tY=321,nY=5,rY=6,iY=0,o8=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],JA=125,aY=59,c8=47,lY=42,sY=43,oY=45,cY=60,uY=44,fY=63,dY=46,hY=91,mY=new RA({start:!1,shift(t,e){return e==nY||e==rY||e==eY?t:e==tY},strict:!1}),pY=new $r((t,e)=>{let{next:n}=t;(n==JA||n==-1||e.context)&&t.acceptToken(JB)},{contextual:!0,fallback:!0}),gY=new $r((t,e)=>{let{next:n}=t,r;o8.indexOf(n)>-1||n==c8&&((r=t.peek(1))==c8||r==lY)||n!=JA&&n!=aY&&n!=-1&&!e.context&&t.acceptToken(qB)},{contextual:!0}),OY=new $r((t,e)=>{t.next==hY&&!e.context&&t.acceptToken(GB)},{contextual:!0}),xY=new $r((t,e)=>{let{next:n}=t;if(n==sY||n==oY){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(mv);t.acceptToken(r?mv:UB)}}else n==fY&&t.peek(1)==dY&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(WB))},{contextual:!0});function o2(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const yY=new $r((t,e)=>{if(t.next!=cY||!e.dialectEnabled(iY)||(t.advance(),t.next==c8))return;let n=0;for(;o8.indexOf(t.next)>-1;)t.advance(),n++;if(o2(t.next,!0)){for(t.advance(),n++;o2(t.next,!1);)t.advance(),n++;for(;o8.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==uY)return;for(let r=0;;r++){if(r==7){if(!o2(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(KB,-n)}),bY=Rd({"get set async static":ee.modifier,"for while do if else switch try catch finally return throw break continue default case defer":ee.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":ee.operatorKeyword,"let var const using function class extends":ee.definitionKeyword,"import export from":ee.moduleKeyword,"with debugger new":ee.keyword,TemplateString:ee.special(ee.string),super:ee.atom,BooleanLiteral:ee.bool,this:ee.self,null:ee.null,Star:ee.modifier,VariableName:ee.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ee.function(ee.variableName),VariableDefinition:ee.definition(ee.variableName),Label:ee.labelName,PropertyName:ee.propertyName,PrivatePropertyName:ee.special(ee.propertyName),"CallExpression/MemberExpression/PropertyName":ee.function(ee.propertyName),"FunctionDeclaration/VariableDefinition":ee.function(ee.definition(ee.variableName)),"ClassDeclaration/VariableDefinition":ee.definition(ee.className),"NewExpression/VariableName":ee.className,PropertyDefinition:ee.definition(ee.propertyName),PrivatePropertyDefinition:ee.definition(ee.special(ee.propertyName)),UpdateOp:ee.updateOperator,"LineComment Hashbang":ee.lineComment,BlockComment:ee.blockComment,Number:ee.number,String:ee.string,Escape:ee.escape,ArithOp:ee.arithmeticOperator,LogicOp:ee.logicOperator,BitOp:ee.bitwiseOperator,CompareOp:ee.compareOperator,RegExp:ee.regexp,Equals:ee.definitionOperator,Arrow:ee.function(ee.punctuation),": Spread":ee.punctuation,"( )":ee.paren,"[ ]":ee.squareBracket,"{ }":ee.brace,"InterpolationStart InterpolationEnd":ee.special(ee.brace),".":ee.derefOperator,", ;":ee.separator,"@":ee.meta,TypeName:ee.typeName,TypeDefinition:ee.definition(ee.typeName),"type enum interface implements namespace module declare":ee.definitionKeyword,"abstract global Privacy readonly override":ee.modifier,"is keyof unique infer asserts":ee.operatorKeyword,JSXAttributeValue:ee.attributeValue,JSXText:ee.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ee.angleBracket,"JSXIdentifier JSXNameSpacedName":ee.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ee.attributeName,"JSXBuiltin/JSXIdentifier":ee.standard(ee.tagName)}),vY={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},SY={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},wY={__proto__:null,"<":193},kY=Mo.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:mY,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[bY],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[gY,OY,xY,yY,2,3,4,5,6,7,8,9,10,11,12,13,14,pY,new dd("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new dd("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>vY[t]||-1},{term:343,get:t=>SY[t]||-1},{term:95,get:t=>wY[t]||-1}],tokenPrec:15201}),eM=[sr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),sr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),sr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),sr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),sr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),sr(`try {
109
- \${}
110
- } catch (\${error}) {
111
- \${}
112
- }`,{label:"try",detail:"/ catch block",type:"keyword"}),sr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),sr(`if (\${}) {
113
- \${}
114
- } else {
115
- \${}
116
- }`,{label:"if",detail:"/ else block",type:"keyword"}),sr(`class \${name} {
117
- constructor(\${params}) {
118
- \${}
119
- }
120
- }`,{label:"class",detail:"definition",type:"keyword"}),sr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),sr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],AY=eM.concat([sr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),sr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),sr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),pv=new Ck,tM=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Lc(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const MY=["FunctionDeclaration"],CY={FunctionDeclaration:Lc("function"),ClassDeclaration:Lc("class"),ClassExpression:()=>!0,EnumDeclaration:Lc("constant"),TypeAliasDeclaration:Lc("type"),NamespaceDeclaration:Lc("namespace"),VariableDefinition(t,e){t.matchContext(MY)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function nM(t,e){let n=pv.get(e);if(n)return n;let r=[],i=!0;function l(s,c){let u=t.sliceString(s.from,s.to);r.push({label:u,type:c})}return e.cursor(At.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let c=CY[s.name];if(c&&c(s,l)||tM.has(s.name))return!1}else if(s.to-s.from>8192){for(let c of nM(t,s.node))r.push(c);return!1}}),pv.set(e,r),r}const gv=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,rM=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function EY(t){let e=sn(t.state).resolveInner(t.pos,-1);if(rM.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&gv.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)tM.has(i.name)&&(r=r.concat(nM(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:gv}}const ji=wo.define({name:"javascript",parser:kY.configure({props:[_d.add({IfStatement:Ef({except:/^\s*({|else\b)/}),TryStatement:Ef({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:yH,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:xH({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ef({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Dd.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Nk,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),iM={test:t=>/^JSX/.test(t.name),facet:jk({commentTokens:{block:{open:"{/*",close:"*/}"}}})},aM=ji.configure({dialect:"ts"},"typescript"),lM=ji.configure({dialect:"jsx",props:[p6.add(t=>t.isTop?[iM]:void 0)]}),sM=ji.configure({dialect:"jsx ts",props:[p6.add(t=>t.isTop?[iM]:void 0)]},"typescript");let oM=t=>({label:t,type:"keyword"});const cM="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(oM),TY=cM.concat(["declare","implements","private","protected","public"].map(oM));function uM(t={}){let e=t.jsx?t.typescript?sM:lM:t.typescript?aM:ji,n=t.typescript?AY.concat(TY):eM.concat(cM);return new g6(e,[ji.data.of({autocomplete:uz(rM,cz(n))}),ji.data.of({autocomplete:EY}),t.jsx?PY:[]])}function $Y(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function Ov(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const jY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),PY=$e.inputHandler.of((t,e,n,r,i)=>{if((jY?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!ji.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:s}=l,c=s.changeByRange(u=>{var h;let{head:g}=u,O=sn(s).resolveInner(g-1,-1),x;if(O.name=="JSXStartTag"&&(O=O.parent),!(s.doc.sliceString(g-1,g)!=r||O.name=="JSXAttributeValue"&&O.to>g)){if(r==">"&&O.name=="JSXFragmentTag")return{range:u,changes:{from:g,insert:"</>"}};if(r=="/"&&O.name=="JSXStartCloseTag"){let y=O.parent,v=y.parent;if(v&&y.from==g-2&&((x=Ov(s.doc,v.firstChild,g))||((h=v.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let w=`${x}>`;return{range:ge.cursor(g+w.length,-1),changes:{from:g,insert:w}}}}else if(r==">"){let y=$Y(O);if(y&&y.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(s.doc.sliceString(g,g+2))&&(x=Ov(s.doc,y,g)))return{range:u,changes:{from:g,insert:`</${x}>`}}}}return{range:u}});return c.changes.empty?!1:(t.dispatch([l,s.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),_c=["_blank","_self","_top","_parent"],c2=["ascii","utf-8","utf-16","latin1","latin1"],u2=["get","post","put","delete"],f2=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ar=["true","false"],Ne={},QY={a:{attrs:{href:null,ping:null,type:null,media:null,target:_c,hreflang:null}},abbr:Ne,address:Ne,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ne,aside:Ne,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ne,base:{attrs:{href:null,target:_c}},bdi:Ne,bdo:Ne,blockquote:{attrs:{cite:null}},body:Ne,br:Ne,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:f2,formmethod:u2,formnovalidate:["novalidate"],formtarget:_c,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ne,center:Ne,cite:Ne,code:Ne,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ne,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ne,div:Ne,dl:Ne,dt:Ne,em:Ne,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ne,figure:Ne,footer:Ne,form:{attrs:{action:null,name:null,"accept-charset":c2,autocomplete:["on","off"],enctype:f2,method:u2,novalidate:["novalidate"],target:_c}},h1:Ne,h2:Ne,h3:Ne,h4:Ne,h5:Ne,h6:Ne,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ne,hgroup:Ne,hr:Ne,html:{attrs:{manifest:null}},i:Ne,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:f2,formmethod:u2,formnovalidate:["novalidate"],formtarget:_c,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ne,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ne,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ne,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:c2,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ne,noscript:Ne,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ne,param:{attrs:{name:null,value:null}},pre:Ne,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ne,rt:Ne,ruby:Ne,samp:Ne,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:c2}},section:Ne,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ne,source:{attrs:{src:null,type:null,media:null}},span:Ne,strong:Ne,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ne,summary:Ne,sup:Ne,table:Ne,tbody:Ne,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ne,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ne,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ne,time:{attrs:{datetime:null}},title:Ne,tr:Ne,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ne,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ne},fM={accesskey:null,class:null,contenteditable:Ar,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ar,autocorrect:Ar,autocapitalize:Ar,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ar,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ar,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ar,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ar,"aria-hidden":Ar,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ar,"aria-multiselectable":Ar,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ar,"aria-relevant":null,"aria-required":Ar,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},dM="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of dM)fM[t]=null;class pd{constructor(e,n){this.tags={...QY,...e},this.globalAttrs={...fM,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}pd.default=new pd;function Co(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Eo(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function hM(t,e,n){let r=n.tags[Co(t,Eo(e))];return(r==null?void 0:r.children)||n.allTags}function N6(t,e){let n=[];for(let r=Eo(e);r&&!r.type.isTop;r=Eo(r.parent)){let i=Co(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const mM=/^[:\-\.\w\u00b7-\uffff]*$/;function xv(t,e,n,r,i){let l=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",s=Eo(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:hM(t.doc,s,e).map(c=>({label:c,type:"type"})).concat(N6(t.doc,n).map((c,u)=>({label:"/"+c,apply:"/"+c+l,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function yv(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:N6(t.doc,e).map((l,s)=>({label:l,apply:l+i,type:"type",boost:99-s})),validFor:mM}}function ZY(t,e,n,r){let i=[],l=0;for(let s of hM(t.doc,n,e))i.push({label:"<"+s,type:"type"});for(let s of N6(t.doc,n))i.push({label:"</"+s+">",type:"type",boost:99-l++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function NY(t,e,n,r,i){let l=Eo(n),s=l?e.tags[Co(t.doc,l)]:null,c=s&&s.attrs?Object.keys(s.attrs):[],u=s&&s.globalAttrs===!1?c:c.length?c.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:u.map(h=>({label:h,type:"property"})),validFor:mM}}function RY(t,e,n,r,i){var l;let s=(l=n.parent)===null||l===void 0?void 0:l.getChild("AttributeName"),c=[],u;if(s){let h=t.sliceDoc(s.from,s.to),g=e.globalAttrs[h];if(!g){let O=Eo(n),x=O?e.tags[Co(t.doc,O)]:null;g=(x==null?void 0:x.attrs)&&x.attrs[h]}if(g){let O=t.sliceDoc(r,i).toLowerCase(),x='"',y='"';/^['"]/.test(O)?(u=O[0]=='"'?/^[^"]*$/:/^[^']*$/,x="",y=t.sliceDoc(i,i+1)==O[0]?"":O[0],O=O.slice(1),r++):u=/^[^\s<>='"]*$/;for(let v of g)c.push({label:v,apply:x+v+y,type:"constant"})}}return{from:r,to:i,options:c,validFor:u}}function VY(t,e){let{state:n,pos:r}=e,i=sn(n).resolveInner(r,-1),l=i.resolve(r);for(let s=r,c;l==i&&(c=i.childBefore(s));){let u=c.lastChild;if(!u||!u.type.isError||u.from<u.to)break;l=i=c,s=u.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?yv(n,i,i.from,r):xv(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?xv(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?yv(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?NY(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?RY(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(l.name=="Element"||l.name=="Text"||l.name=="Document")?ZY(n,t,i,r):null}function LY(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new pd(e,n):pd.default;return i=>VY(r,i)}const _Y=ji.parser.configure({top:"SingleExpression"}),pM=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:aM.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:lM.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:sM.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:_Y},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:ji.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:md.parser}],gM=[{name:"style",parser:md.parser.configure({top:"Styles"})}].concat(dM.map(t=>({name:t,parser:ji.parser}))),OM=wo.define({name:"html",parser:dB.configure({props:[_d.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),Dd.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),zk.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Pf=OM.configure({wrap:YA(pM,gM)});function bv(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=YA((t.nestedLanguages||[]).concat(pM),(t.nestedAttributes||[]).concat(gM)));let r=n?OM.configure({wrap:n,dialect:e}):e?Pf.configure({dialect:e}):Pf;return new g6(r,[Pf.data.of({autocomplete:LY(t)}),t.autoCloseTags!==!1?DY:[],uM().support,KA().support])}const vv=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),DY=$e.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Pf.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:s}=l,c=s.changeByRange(u=>{var h,g,O;let x=s.doc.sliceString(u.from-1,u.to)==r,{head:y}=u,v=sn(s).resolveInner(y,-1),w;if(x&&r==">"&&v.name=="EndTag"){let A=v.parent;if(((g=(h=A.parent)===null||h===void 0?void 0:h.lastChild)===null||g===void 0?void 0:g.name)!="CloseTag"&&(w=Co(s.doc,A.parent,y))&&!vv.has(w)){let k=y+(s.doc.sliceString(y,y+1)===">"?1:0),M=`</${w}>`;return{range:u,changes:{from:y,to:k,insert:M}}}}else if(x&&r=="/"&&v.name=="IncompleteCloseTag"){let A=v.parent;if(v.from==y-2&&((O=A.lastChild)===null||O===void 0?void 0:O.name)!="CloseTag"&&(w=Co(s.doc,A,y))&&!vv.has(w)){let k=y+(s.doc.sliceString(y,y+1)===">"?1:0),M=`${w}>`;return{range:ge.cursor(y+M.length,-1),changes:{from:y,to:k,insert:M}}}}return{range:u}});return c.changes.empty?!1:(t.dispatch([l,s.update(c,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function HY(t){switch(t){case"html":return bv();case"css":return KA();case"javascript":case"js":case"typescript":case"ts":return uM({typescript:t==="typescript"||t==="ts"});default:return bv()}}function XY(t){var r;const e=((r=t.split(".").pop())==null?void 0:r.toLowerCase())??"";return{html:"html",htm:"html",css:"css",js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",json:"javascript"}[e]??"html"}const zY=d.memo(function({content:e,filePath:n,language:r,onChange:i,readOnly:l=!1,revealOffset:s}){const c=d.useRef(null),u=d.useRef(null),h=d.useRef(i);h.current=i;const g=d.useRef(e);g.current=e;const O=d.useCallback(x=>{if(c.current&&(c.current.destroy(),c.current=null),!x)return;u.current=x;const y=r??(n?XY(n):"html"),v=$e.updateListener.of(A=>{A.docChanged&&h.current&&h.current(A.state.doc.toString())}),w=gt.create({doc:g.current,extensions:[VD(),wD(),DD(),rX(),$H(),vH(),XH(),kz(),_z(),u6.of([...Ez,...sz,...lF,...dX]),HY(y),bF,v,gt.readOnly.of(l),$e.theme({"&":{height:"100%"},".cm-scroller":{overflow:"auto"}})]});c.current=new $e({state:w,parent:x})},[n,r,l]);return d.useEffect(()=>{const x=c.current;if(!x)return;const y=x.state.doc.toString();y!==e&&x.dispatch({changes:{from:0,to:y.length,insert:e}})},[e]),d.useEffect(()=>{const x=c.current;if(!x||s==null||s<0)return;const y=x.state.doc.length,v=Math.min(s,y);x.dispatch({selection:{anchor:v},effects:$e.scrollIntoView(v,{y:"center"})}),x.focus()},[s]),m.jsx("div",{ref:O,className:"h-full w-full overflow-hidden"})}),Js={width:1920,height:1080},Sv=80,wv=45,kv=3,FY=10;function BY(t){const e=Number.isFinite(t.stageWidth)&&t.stageWidth>0?t.stageWidth:Js.width,n=Number.isFinite(t.stageHeight)&&t.stageHeight>0?t.stageHeight:Js.height,r=t.cardWidth/e,i=t.cardHeight/n;return Math.min(r,i)}function YY(t){return Number.isFinite(t)&&t!=null&&t>0&&t<kv?t/2:kv}function Av(t){if(t==null)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function IY(t){var e,n;try{const r=t==null?void 0:t.contentWindow,i=(n=(e=r==null?void 0:r.__player)==null?void 0:e.getDuration)==null?void 0:n.call(e);if(Number.isFinite(i)&&i!=null&&i>0)return i}catch{}try{const r=t==null?void 0:t.contentDocument,i=(r==null?void 0:r.querySelector("[data-composition-id]"))??(r==null?void 0:r.documentElement)??null;return Av((i==null?void 0:i.getAttribute("data-composition-duration"))??null)??Av((i==null?void 0:i.getAttribute("data-duration"))??null)}catch{return null}}function qY(t,e){var n,r,i,l;try{const s=(n=t==null?void 0:t.contentWindow)==null?void 0:n.__player;return s?e?((r=s.play)==null||r.call(s),!0):((i=s.pause)==null||i.call(s),(l=s.seek)==null||l.call(s,YY(IY(t))),!0):!1}catch{return!1}}function GY({projectId:t,comp:e,isActive:n,onSelect:r,onRender:i,isRendering:l}){const[s,c]=d.useState(!1),[u,h]=d.useState(Js),g=d.useRef(null),O=d.useRef(null),x=d.useRef(null),y=d.useCallback(C=>{x.current&&(clearTimeout(x.current),x.current=null);const j=T=>{qY(g.current,C)||T<=0||(x.current=setTimeout(()=>j(T-1),100))};j(FY)},[]),v=()=>{O.current=setTimeout(()=>c(!0),300)},w=()=>{O.current&&(clearTimeout(O.current),O.current=null),c(!1)},A=e.replace(/^compositions\//,"").replace(/\.html$/,""),k=`/api/projects/${t}/preview/comp/${e}`,M=BY({cardWidth:Sv,cardHeight:wv,stageWidth:u.width,stageHeight:u.height}),E=(Sv-u.width*M)/2,$=(wv-u.height*M)/2;return d.useEffect(()=>{y(s)},[s,y]),d.useEffect(()=>()=>{O.current&&clearTimeout(O.current),x.current&&clearTimeout(x.current)},[]),m.jsxs("div",{onClick:r,onPointerEnter:v,onPointerLeave:w,className:`group/card w-full text-left px-2 py-1.5 flex items-center gap-2.5 transition-colors cursor-pointer ${n?"bg-studio-accent/10 border-l-2 border-studio-accent":"border-l-2 border-transparent hover:bg-neutral-800/50"}`,children:[m.jsx("div",{className:"w-20 h-[45px] rounded overflow-hidden bg-neutral-900 flex-shrink-0 relative",children:m.jsx("iframe",{ref:g,src:k,sandbox:"allow-scripts allow-same-origin",loading:"lazy",className:"absolute border-none pointer-events-none",style:{transformOrigin:"0 0",width:u.width,height:u.height,left:E,top:$,transform:`scale(${M})`},onLoad:C=>{var j;try{const N=(j=C.currentTarget.contentDocument)==null?void 0:j.querySelector("[data-composition-id]"),R=Number(N==null?void 0:N.getAttribute("data-width"))||Js.width,D=Number(N==null?void 0:N.getAttribute("data-height"))||Js.height;h({width:R,height:D}),y(s)}catch{h(Js)}},title:`${A} preview`,tabIndex:-1})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate block",children:A}),m.jsx("span",{className:"text-[9px] text-neutral-600 truncate block",children:e})]}),i&&m.jsx("button",{type:"button",title:l?"Rendering...":`Render ${A}`,"aria-label":l?"Rendering...":`Render ${A}`,disabled:l,onClick:C=>{C.stopPropagation(),i()},className:`flex-shrink-0 p-1 rounded transition-colors ${l?"text-neutral-600 cursor-not-allowed":"text-neutral-600 hover:text-studio-accent hover:bg-neutral-800"}`,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}const UY=d.memo(function({projectId:e,compositions:n,activeComposition:r,onSelect:i,onRenderComposition:l,isRendering:s}){return n.length===0?m.jsx("div",{className:"flex-1 flex items-center justify-center px-4",children:m.jsx("p",{className:"text-xs text-neutral-600 text-center",children:"No compositions found"})}):m.jsx("div",{className:"flex-1 overflow-y-auto",children:n.map(c=>m.jsx(GY,{projectId:e,comp:c,isActive:r===c,onSelect:()=>i(c),onRender:l?()=>l(c):void 0,isRendering:s},c))})});function xM({src:t}){const[e,n]=d.useState(null);return d.useEffect(()=>{const r=document.createElement("video");r.crossOrigin="anonymous",r.muted=!0,r.preload="metadata";const i=document.createElement("canvas"),l=i.getContext("2d"),s=()=>{r.src="",r.load()};return r.addEventListener("loadedmetadata",()=>{r.currentTime=Math.min(2,r.duration*.1||2)}),r.addEventListener("seeked",()=>{l&&(i.width=r.videoWidth,i.height=r.videoHeight,l.drawImage(r,0,0),n(i.toDataURL("image/jpeg",.7)),s())}),r.addEventListener("error",s),r.src=t,r.load(),s},[t]),e?m.jsx("img",{src:e,alt:"",draggable:!1,className:"w-full h-full object-contain"}):m.jsx("div",{className:"w-full h-full bg-neutral-800 animate-pulse"})}function WY({serveUrl:t,name:e,isImage:n,isVideo:r,isAudio:i}){return m.jsxs(m.Fragment,{children:[n&&m.jsx("img",{src:t,alt:e,loading:"lazy",className:"w-full h-full object-contain",onError:l=>{l.target.style.display="none"}}),r&&m.jsx(xM,{src:t}),i&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-purple-400",children:[m.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("circle",{cx:"6",cy:"18",r:"3"}),m.jsx("circle",{cx:"18",cy:"16",r:"3"})]})}),!n&&!r&&!i&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[m.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function KY({projectId:t,asset:e,onCopy:n,isCopied:r,onDelete:i,onRename:l}){const[s,c]=d.useState(!1),[u,h]=d.useState(null),[g,O]=d.useState(!1),[x,y]=d.useState(""),[v,w]=d.useState(!1),A=e.split("/").pop()??e,k=`/api/projects/${t}/preview/${e}`,M=A8.test(e);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{draggable:!0,onClick:()=>n(e),onDragStart:E=>{E.dataTransfer.effectAllowed="copy",E.dataTransfer.setData(I2,JSON.stringify({path:e})),E.dataTransfer.setData("text/plain",e)},onContextMenu:E=>{E.preventDefault(),h({x:E.clientX,y:E.clientY})},onPointerEnter:()=>c(!0),onPointerLeave:()=>c(!1),className:`w-full text-left px-2 py-1.5 flex items-center gap-2.5 transition-colors cursor-pointer ${r?"bg-studio-accent/10 border-l-2 border-studio-accent":"border-l-2 border-transparent hover:bg-neutral-800/50"}`,children:[m.jsxs("div",{className:"w-16 h-10 rounded overflow-hidden bg-neutral-900 flex-shrink-0 relative",children:[m.jsx(WY,{serveUrl:k,name:A,isImage:uu.test(e),isVideo:M,isAudio:M8.test(e)}),M&&s&&m.jsx("video",{src:k,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-contain"})]}),m.jsx("div",{className:"min-w-0 flex-1",children:g?m.jsx("input",{autoFocus:!0,value:x,onChange:E=>y(E.target.value),onKeyDown:E=>{if(E.key==="Enter"){E.preventDefault();const $=x.trim();if($&&$!==A){const C=e.includes("/")?e.slice(0,e.lastIndexOf("/")+1):"";l==null||l(e,C+$)}O(!1)}else E.key==="Escape"&&O(!1)},onBlur:()=>{const E=x.trim();if(E&&E!==A){const $=e.includes("/")?e.slice(0,e.lastIndexOf("/")+1):"";l==null||l(e,$+E)}O(!1)},onClick:E=>E.stopPropagation(),className:"w-full bg-neutral-800 text-neutral-200 text-[11px] px-1.5 py-0.5 rounded border border-neutral-600 outline-none focus:border-studio-accent",spellCheck:!1}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate block",children:A}),r?m.jsx("span",{className:"text-[9px] text-studio-accent",children:"Copied!"}):m.jsx("span",{className:"text-[9px] text-neutral-600 truncate block",children:e})]})})]}),u&&m.jsx("div",{className:"fixed inset-0 z-[200]",onClick:()=>h(null),onContextMenu:E=>{E.preventDefault(),h(null)},children:m.jsxs("div",{className:"absolute bg-neutral-900 border border-neutral-700 rounded-lg shadow-xl py-1 min-w-[140px] text-xs",style:{left:u.x,top:u.y},children:[m.jsx("button",{onClick:E=>{E.stopPropagation(),n(e),h(null)},className:"w-full text-left px-3 py-1.5 text-neutral-300 hover:bg-neutral-800 transition-colors",children:"Copy path"}),l&&m.jsx("button",{onClick:E=>{E.stopPropagation(),y(A),O(!0),h(null)},className:"w-full text-left px-3 py-1.5 text-neutral-300 hover:bg-neutral-800 transition-colors",children:"Rename"}),i&&m.jsx("button",{onClick:E=>{E.stopPropagation(),w(!0),h(null)},className:"w-full text-left px-3 py-1.5 text-red-400 hover:bg-neutral-800 transition-colors",children:"Delete"})]})}),v&&m.jsxs("div",{className:"px-2 py-1.5 bg-red-950/30 border-l-2 border-red-500 flex items-center justify-between gap-2",children:[m.jsxs("span",{className:"text-[10px] text-red-400 truncate",children:["Delete ",A,"?"]}),m.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[m.jsx("button",{onClick:E=>{E.stopPropagation(),i==null||i(e),w(!1)},className:"px-2 py-0.5 text-[10px] rounded bg-red-600 text-white hover:bg-red-500 transition-colors",children:"Delete"}),m.jsx("button",{onClick:E=>{E.stopPropagation(),w(!1)},className:"px-2 py-0.5 text-[10px] rounded text-neutral-400 hover:text-neutral-200 transition-colors",children:"Cancel"})]})]})]})}const JY=d.memo(function({projectId:e,assets:n,onImport:r,onDelete:i,onRename:l}){const s=d.useRef(null),[c,u]=d.useState(!1),[h,g]=d.useState(null),O=d.useCallback(v=>{v.preventDefault(),u(!1),v.dataTransfer.files.length&&(r==null||r(v.dataTransfer.files))},[r]),x=d.useCallback(async v=>{await cu(v)&&(g(v),setTimeout(()=>g(null),1500))},[]),y=n.filter(v=>US.test(v));return m.jsxs("div",{className:`flex-1 flex flex-col min-h-0 transition-colors ${c?"bg-studio-accent/[0.05]":""}`,onDragOver:v=>{v.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:O,children:[r&&m.jsxs("div",{className:"px-3 py-2 border-b border-neutral-800/40 flex-shrink-0",children:[m.jsxs("button",{onClick:()=>{var v;return(v=s.current)==null?void 0:v.click()},className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-[11px] rounded-lg border border-dashed border-neutral-700/50 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600 transition-colors",children:[m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:m.jsx("path",{d:"M12 5v14M5 12h14"})}),"Import media"]}),m.jsx("input",{ref:s,type:"file",accept:"video/*,image/*,audio/*",multiple:!0,className:"hidden",onChange:v=>{var w;(w=v.target.files)!=null&&w.length&&(r(v.target.files),v.target.value="")}})]}),m.jsx("div",{className:"flex-1 overflow-y-auto",children:y.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 gap-2",children:[m.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-700",children:[m.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("polyline",{points:"17 8 12 3 7 8",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15",strokeLinecap:"round"})]}),m.jsx("p",{className:"text-[10px] text-neutral-600 text-center",children:"Drop media files here"})]}):y.map(v=>m.jsx(KY,{projectId:e,asset:v,onCopy:x,isCopied:h===v,onDelete:i,onRename:l},v))})]})}),gd=[{id:"captions",label:"Captions",color:"cyan"},{id:"vfx",label:"VFX",color:"purple"},{id:"transitions",label:"Transitions",color:"blue"},{id:"effects",label:"Effects",color:"rose"},{id:"text-effects",label:"Text Effects",color:"violet"},{id:"social",label:"Social",color:"pink"},{id:"data",label:"Data",color:"green"},{id:"scenes",label:"Scenes",color:"amber"}];function eI(t){if(!t||t.length===0)return"scenes";const e=new Set(t);return e.has("captions")||e.has("caption-style")?"captions":e.has("transition")?"transitions":e.has("social")||e.has("overlay")?"social":e.has("data")||e.has("chart")||e.has("map")?"data":e.has("html-in-canvas")||e.has("webgl")||e.has("shader")?"vfx":e.has("text-effect")?"text-effects":e.has("effect")||e.has("grain")||e.has("vignette")?"effects":"scenes"}const tI={transitions:{bg:"bg-blue-500/15",text:"text-blue-400",dot:"bg-blue-400"},vfx:{bg:"bg-purple-500/15",text:"text-purple-400",dot:"bg-purple-400"},social:{bg:"bg-pink-500/15",text:"text-pink-400",dot:"bg-pink-400"},data:{bg:"bg-green-500/15",text:"text-green-400",dot:"bg-green-400"},scenes:{bg:"bg-amber-500/15",text:"text-amber-400",dot:"bg-amber-400"},captions:{bg:"bg-cyan-500/15",text:"text-cyan-400",dot:"bg-cyan-400"},effects:{bg:"bg-rose-500/15",text:"text-rose-400",dot:"bg-rose-400"},"text-effects":{bg:"bg-violet-500/15",text:"text-violet-400",dot:"bg-violet-400"}};function yM(t){return tI[t]}function nI(){const[t,e]=d.useState([]),[n,r]=d.useState(!0),[i,l]=d.useState(null),[s,c]=d.useState(""),[u,h]=d.useState(null);d.useEffect(()=>{let O=!1;return(async()=>{try{const x=await fetch("/api/registry/blocks");if(!x.ok)throw new Error("Failed to load catalog");const y=await x.json();if(O)return;const v=y.map(w=>({...w,category:eI(w.tags)})).sort((w,A)=>{const k=gd.findIndex(E=>E.id===w.category),M=gd.findIndex(E=>E.id===A.category);return(k===-1?99:k)-(M===-1?99:M)});e(v)}catch(x){if(O)return;l(x instanceof Error?x.message:"Failed to load catalog")}finally{O||r(!1)}})(),()=>{O=!0}},[]);const g=d.useMemo(()=>{let O=t;if(u&&(O=O.filter(x=>x.category===u)),s.trim()){const x=s.toLowerCase();O=O.filter(y=>{var v;return y.title.toLowerCase().includes(x)||y.description.toLowerCase().includes(x)||y.category.toLowerCase().includes(x)||((v=y.tags)==null?void 0:v.some(w=>w.toLowerCase().includes(x)))})}return O},[t,u,s]);return{blocks:t,loading:n,error:i,search:s,setSearch:c,category:u,setCategory:h,filteredBlocks:g}}const rI=d.memo(function({onAddBlock:e,onPreviewBlock:n}){const{loading:r,error:i,search:l,setSearch:s,category:c,setCategory:u,filteredBlocks:h}=nI(),[g,O]=d.useState(null);return r?m.jsx("div",{className:"flex flex-1 items-center justify-center text-neutral-600 text-xs",children:"Loading blocks…"}):i?m.jsx("div",{className:"flex flex-1 items-center justify-center text-red-400 text-xs px-4 text-center",children:i}):m.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[m.jsx("div",{className:"px-3 pt-2 pb-1 flex-shrink-0",children:m.jsxs("div",{className:"relative",children:[m.jsxs("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-neutral-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("circle",{cx:"11",cy:"11",r:"8"}),m.jsx("path",{d:"m21 21-4.35-4.35"})]}),m.jsx("input",{type:"text",value:l,onChange:x=>s(x.target.value),placeholder:"Search by name, category, or tag…",className:"w-full bg-neutral-900 border border-neutral-800 rounded-md pl-7 pr-2 py-1.5 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:border-neutral-700 transition-colors"})]})}),m.jsx("div",{className:"px-3 pt-1 pb-2 flex-shrink-0 overflow-x-auto",children:m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Mv,{label:"All",active:c===null,onClick:()=>u(null)}),gd.map(x=>m.jsx(Mv,{label:x.label,category:x.id,active:c===x.id,onClick:()=>u(c===x.id?null:x.id)},x.id))]})}),m.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 pb-2",children:[c==="vfx"&&m.jsxs("div",{className:"mb-2 px-2 py-1.5 rounded-md bg-purple-500/10 border border-purple-500/20 text-[9px] text-purple-300 leading-relaxed",children:["VFX blocks use WebGL via HTML-in-Canvas. Enable"," ",m.jsx("span",{className:"font-mono text-purple-200",children:"chrome://flags/#html-in-canvas"})," for preview."]}),h.length===0?m.jsx("div",{className:"flex items-center justify-center h-32 text-neutral-600 text-xs",children:"No blocks match your search"}):m.jsx("div",{className:"grid gap-1.5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(120px, 1fr))"},children:h.map(x=>{var v,w;const y="duration"in x?x.duration:void 0;return m.jsx(lI,{name:x.name,title:x.title,description:x.description,blockType:x.type,duration:y,category:x.category,tags:x.tags,posterUrl:(v=x.preview)==null?void 0:v.poster,videoUrl:(w=x.preview)==null?void 0:w.video,onPreview:n,onShowPrompt:O,onAdd:x.category==="vfx"||x.category==="social"||x.category==="scenes"?()=>e==null?void 0:e(x.name):void 0},x.name)})})]}),g&&w8.createPortal(m.jsx(sI,{title:g.title,prompt:g.prompt,onClose:()=>O(null)}),document.body)]})});function Mv({label:t,category:e,active:n,onClick:r}){const i=e?yM(e):null;return m.jsx("button",{type:"button",onClick:r,className:`flex-shrink-0 px-2 py-1 rounded-full text-[10px] font-medium transition-colors ${n?i?`${i.bg} ${i.text}`:"bg-neutral-700 text-neutral-200":"bg-neutral-900 text-neutral-500 hover:text-neutral-300"}`,children:t})}function iI(t){const e=[`Playback time: ${yn(t.currentTime)}`,`Active composition: ${t.activeCompPath||"index.html"}`];t.compositionDimensions&&e.push(`Dimensions: ${t.compositionDimensions.width}x${t.compositionDimensions.height}`);const n=t.elements.filter(i=>t.currentTime>=i.start&&t.currentTime<i.start+i.duration);n.length>0&&e.push("",`Elements visible at ${yn(t.currentTime)}:`,...n.map(i=>`- ${i.label||i.id} (track ${i.track}, ${yn(i.start)}–${yn(i.start+i.duration)}${i.compositionSrc?`, src: ${i.compositionSrc}`:""})`));const r=t.elements.length>0?Math.max(...t.elements.map((i,l)=>l+1)):0;return e.push("",`Highest track index: ${r}`),e.join(`
121
- `)}function aI(t,e,n,r,i,l){const c=i==="hyperframes:component"?"component":"block",u=iI(l);return[{captions:[`Using /hyperframes, add the "${t}" caption style (registry: ${e}) to my composition.`,`${n}`,"Transcribe the audio with /hyperframes-media, then wire the transcript into this caption component. Match the font colors and animation timing to my composition's design tokens. Place it as an overlay above the main content with the highest z-index."].join(`
122
-
123
- `),vfx:[`Using /hyperframes, add the "${t}" VFX (registry: ${e}) as a full-screen overlay on my composition.`,`${n}`,"This is a WebGL effect that requires chrome://flags/#html-in-canvas. Layer it on top of all content, adjust the shader uniforms and color palette to complement my scene, and set the duration to match the composition length."].join(`
124
-
125
- `),transitions:[`Using /hyperframes, add the "${t}" transition (registry: ${e}) between my scenes.`,`${n}`,"Place this transition at the cut point between the current scene and the next. Set the duration to 0.5–1s, position it at the scene boundary on the timeline, and make sure the z-index is above both scenes. Adjust colors to match my palette."].join(`
126
-
127
- `),effects:[`Using /hyperframes, add the "${t}" effect (registry: ${e}) as an overlay on my composition.`,`${n}`,"Layer this on top of the current content. Adjust the opacity, colors, and animation timing to enhance the scene without overwhelming the main content."].join(`
128
-
129
- `),social:[`Using /hyperframes, add the "${t}" template (registry: ${e}) to my composition.`,`${n}`,"Replace the placeholder text, handle, and avatar with my actual content. Match the typography and colors to my brand. Adjust timing so the elements animate in sync with the voiceover."].join(`
130
-
131
- `),data:[`Using /hyperframes, add the "${t}" visualization (registry: ${e}) to my composition.`,`${n}`,"Replace the placeholder data with my actual values and labels. Adjust the color scale, animation stagger timing, and typography to match my composition's design system. Size it to fit the current viewport."].join(`
132
-
133
- `),scenes:[`Using /hyperframes, add the "${t}" scene (registry: ${e}) to my composition.`,`${n}`,"Replace all placeholder text, images, and content with my actual material. Match fonts, colors, and layout to my existing design tokens. Set the timeline position and duration to fit the narrative flow."].join(`
134
-
135
- `)}[r]??[`Using /hyperframes, add the "${t}" ${c} (registry: ${e}) to my composition.`,`${n}`,"Customize it to match my composition's design and timeline."].join(`
136
-
137
- `),"","## Current composition state","",u].join(`
138
- `)}function lI({name:t,title:e,description:n,blockType:r,duration:i,category:l,tags:s,posterUrl:c,videoUrl:u,onAdd:h,onShowPrompt:g,onPreview:O}){var R;const[x,y]=d.useState(!1),[v,w]=d.useState(!1),A=d.useRef(null),k=yM(l),M=(s==null?void 0:s.includes("html-in-canvas"))||(s==null?void 0:s.includes("webgl")),E=d.useCallback(()=>{A.current=setTimeout(()=>{y(!0),O==null||O({videoUrl:u,posterUrl:c,title:e})},300)},[O,u,c,e]),$=d.useCallback(()=>{A.current&&(clearTimeout(A.current),A.current=null),y(!1),O==null||O(null)},[O]);d.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]);const C=d.useCallback(D=>{D.stopPropagation(),!(v||!h)&&(w(!0),h(),setTimeout(()=>w(!1),1e3))},[h,v]),{activeCompPath:j,compositionDimensions:T}=No(),N=d.useCallback(D=>{D.stopPropagation();const V=fe.getState(),z={currentTime:V.currentTime,activeCompPath:j,elements:V.elements.map(U=>({id:U.id,start:U.start,duration:U.duration,track:U.track,label:U.label,compositionSrc:U.compositionSrc})),compositionDimensions:T??void 0},I=aI(e,t,n,l,r,z);g==null||g({title:e,prompt:I})},[e,t,n,l,r,j,T,g]);return m.jsxs("div",{className:"group/card rounded-md overflow-hidden cursor-pointer transition-colors bg-neutral-900 hover:bg-neutral-800",onPointerEnter:E,onPointerLeave:$,children:[m.jsxs("div",{className:"aspect-video w-full overflow-hidden relative",children:[x&&u?m.jsx("video",{src:u,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover"}):c?m.jsx("img",{src:c,alt:e,loading:"lazy",className:"w-full h-full object-cover"}):u?m.jsx("video",{src:u,muted:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"}):m.jsx("div",{className:`w-full h-full flex items-center justify-center ${k.bg}`,children:m.jsx("span",{className:`text-[9px] font-medium ${k.text}`,children:l.toUpperCase()})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-1.5 bg-black/60 opacity-0 group-hover/card:opacity-100 transition-opacity",children:[h&&m.jsxs("button",{type:"button",onClick:C,title:"Add to composition at current time",className:"flex items-center gap-1 px-3 py-1.5 rounded-md bg-white text-black text-[10px] font-semibold hover:bg-neutral-200 transition-colors",children:[m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:m.jsx("path",{d:"M12 5v14M5 12h14"})}),v?"Added!":"Add"]}),m.jsxs("button",{type:"button",onClick:N,title:"Generate a prompt to paste into your AI agent",className:`flex items-center gap-1.5 px-3 ${h?"py-1":"py-1.5"} rounded-md transition-colors ${h?"bg-white/15 text-white/90 hover:bg-white/25 text-[9px]":"bg-white text-black hover:bg-neutral-200 text-[10px] font-semibold"}`,children:[m.jsxs("svg",{width:h?9:11,height:h?9:11,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),m.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Ask agent"]})]}),m.jsxs("div",{className:"absolute top-1 right-1 flex items-center gap-0.5 pointer-events-none",children:[M&&m.jsx("span",{className:"px-1 py-px rounded text-[7px] font-semibold text-purple-300 bg-purple-900/70",children:"WebGL"}),i!=null&&m.jsxs("span",{className:"px-1 py-px rounded text-[8px] font-medium text-white/80 bg-black/50",children:[i,"s"]})]})]}),m.jsxs("div",{className:"px-1.5 py-1.5",children:[m.jsx("div",{className:"text-[10px] font-medium text-neutral-200 truncate leading-tight",children:e}),m.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[m.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${k.dot}`}),m.jsx("span",{className:`text-[8px] ${k.text}`,children:(R=gd.find(D=>D.id===l))==null?void 0:R.label})]})]})]})}function sI({title:t,prompt:e,onClose:n}){const[r,i]=d.useState(e),[l,s]=d.useState(!1),c=d.useRef(null);d.useEffect(()=>{requestAnimationFrame(()=>{var h;return(h=c.current)==null?void 0:h.focus()})},[]);const u=d.useCallback(()=>{navigator.clipboard.writeText(r),s(!0),setTimeout(()=>s(!1),1500)},[r]);return m.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:n,children:m.jsxs("div",{className:"w-[560px] max-h-[80vh] flex flex-col rounded-2xl border border-neutral-800 bg-neutral-950 shadow-2xl",onClick:h=>h.stopPropagation(),children:[m.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-neutral-800/60",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-sm font-medium text-neutral-200",children:"Ask agent"}),m.jsx("p",{className:"text-xs text-neutral-500 mt-0.5",children:t})]}),m.jsx("button",{className:"p-1 rounded-md text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800/50",onClick:n,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[m.jsx("p",{className:"text-[11px] text-neutral-500 mb-2",children:"Edit the prompt below, then copy and paste into your AI agent"}),m.jsx("textarea",{ref:c,value:r,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&u(),h.key==="Escape"&&n()},className:"w-full min-h-[240px] text-[11px] text-neutral-200 leading-relaxed font-mono bg-neutral-900/60 rounded-lg p-3 border border-neutral-800 resize-y focus:outline-none focus:border-studio-accent/60 focus:ring-1 focus:ring-studio-accent/30"})]}),m.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-neutral-800/60",children:[m.jsxs("span",{className:"text-[11px] text-neutral-600",children:[navigator.platform.includes("Mac")?"⌘":"Ctrl","+Enter to copy"]}),m.jsx("button",{className:`px-4 py-1.5 rounded-lg text-xs font-medium transition-colors ${l?"bg-emerald-500 text-white":"bg-studio-accent/90 text-neutral-950 hover:bg-studio-accent"}`,onClick:u,children:l?"Copied!":"Copy prompt"})]})]})})}const Zn=14,Nn="duotone";function bM({path:t}){var r;const e=((r=t.split(".").pop())==null?void 0:r.toLowerCase())??"",n="flex-shrink-0";return e==="html"?m.jsx(DQ,{size:Zn,weight:Nn,color:"#E44D26",className:n}):e==="css"?m.jsx(_Q,{size:Zn,weight:Nn,color:"#264DE4",className:n}):e==="js"||e==="mjs"||e==="cjs"?m.jsx(XQ,{size:Zn,weight:Nn,color:"#F0DB4F",className:n}):e==="jsx"?m.jsx(zQ,{size:Zn,weight:Nn,color:"#61DAFB",className:n}):e==="ts"||e==="mts"?m.jsx(IQ,{size:Zn,weight:Nn,color:"#3178C6",className:n}):e==="tsx"?m.jsx(qQ,{size:Zn,weight:Nn,color:"#3178C6",className:n}):e==="json"?m.jsx(LQ,{size:Zn,weight:Nn,color:"#4ADE80",className:n}):e==="svg"?m.jsx(YQ,{size:Zn,weight:Nn,color:"#F97316",className:n}):e==="md"||e==="mdx"?m.jsx(FQ,{size:Zn,weight:Nn,color:"#9CA3AF",className:n}):e==="txt"?m.jsx(GQ,{size:Zn,weight:Nn,color:"#9CA3AF",className:n}):e==="png"?m.jsx(BQ,{size:Zn,weight:Nn,color:"#22C55E",className:n}):e==="jpg"||e==="jpeg"?m.jsx(HQ,{size:Zn,weight:Nn,color:"#22C55E",className:n}):e==="webp"||e==="gif"||e==="ico"?m.jsx(tZ,{size:Zn,weight:Nn,color:"#22C55E",className:n}):e==="mp4"||e==="webm"||e==="mov"?m.jsx(UQ,{size:Zn,weight:Nn,color:"#A855F7",className:n}):e==="mp3"||e==="wav"||e==="ogg"||e==="m4a"?m.jsx(hZ,{size:Zn,weight:Nn,color:"#3CE6AC",className:n}):e==="woff"||e==="woff2"||e==="ttf"||e==="otf"?m.jsx(uZ,{size:Zn,weight:Nn,color:"#6B7280",className:n}):m.jsx(VQ,{size:Zn,weight:Nn,color:"#6B7280",className:n})}function oI(t){const e={name:"",fullPath:"",children:new Map,isFile:!1};for(const n of t){const r=n.split("/");let i=e;for(let l=0;l<r.length;l++){const s=r[l],c=l===r.length-1,u=r.slice(0,l+1).join("/");i.children.has(s)||i.children.set(s,{name:s,fullPath:u,children:new Map,isFile:c}),i=i.children.get(s),c&&(i.isFile=!0)}}return e}function vM(t){return Array.from(t.values()).sort((e,n)=>e.name==="index.html"?-1:n.name==="index.html"?1:!e.isFile&&n.isFile?-1:e.isFile&&!n.isFile?1:e.name.localeCompare(n.name))}function R6(t,e){if(!e)return!1;if(t.fullPath===e)return!0;for(const n of t.children.values())if(R6(n,e))return!0;return!1}const cI=14;function uI({state:t,onClose:e,onNewFile:n,onNewFolder:r,onRename:i,onDuplicate:l,onDelete:s}){const c=d.useRef(null);d.useEffect(()=>{const O=y=>{c.current&&!c.current.contains(y.target)&&e()},x=y=>{y.key==="Escape"&&e()};return document.addEventListener("mousedown",O),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",O),document.removeEventListener("keydown",x)}},[e]);const u=Math.min(t.x,window.innerWidth-180),h=Math.min(t.y,window.innerHeight-200),g=t.targetIsFolder?t.targetPath:t.targetPath.includes("/")?t.targetPath.slice(0,t.targetPath.lastIndexOf("/")):"";return m.jsxs("div",{ref:c,className:"fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[160px]",style:{left:u,top:h},children:[t.targetIsFolder&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{n(t.targetPath),e()},children:[m.jsx(Ay,{size:12,weight:"duotone",className:"text-neutral-500"}),"New File"]}),m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{r(t.targetPath),e()},children:[m.jsx(D7,{size:12,weight:"duotone",className:"text-neutral-500"}),"New Folder"]}),m.jsx("div",{className:"border-t border-neutral-700 my-1"})]}),!t.targetIsFolder&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{n(g),e()},children:[m.jsx(Ay,{size:12,weight:"duotone",className:"text-neutral-500"}),"New File"]}),m.jsx("div",{className:"border-t border-neutral-700 my-1"})]}),m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{i(t.targetPath),e()},children:[m.jsx(lZ,{size:12,weight:"duotone",className:"text-neutral-500"}),"Rename"]}),!t.targetIsFolder&&m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-800 cursor-pointer text-left",onClick:()=>{l(t.targetPath),e()},children:[m.jsx(NQ,{size:12,weight:"duotone",className:"text-neutral-500"}),"Duplicate"]}),m.jsx("div",{className:"border-t border-neutral-700 my-1"}),m.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-red-900/30 cursor-pointer text-left",onClick:()=>{s(t.targetPath),e()},children:[m.jsx(dZ,{size:12,weight:"duotone"}),"Delete"]})]})}function Od({defaultValue:t,depth:e,isFolder:n,onCommit:r,onCancel:i}){const l=d.useRef(null),s=d.useRef(!1),[c,u]=d.useState(t);d.useEffect(()=>{const x=l.current;if(x)if(x.focus(),t&&t.includes(".")){const y=t.lastIndexOf(".");x.setSelectionRange(0,y)}else x.select()},[t]);const h=x=>{s.current||(s.current=!0,r(x))},g=x=>{if(x.key==="Enter"){x.preventDefault();const y=c.trim();y&&!(/[/\\]/.test(y)||y.includes(".."))?h(y):i()}else x.key==="Escape"&&(x.preventDefault(),i())},O=()=>{const x=c.trim();x&&x!==t&&!(/[/\\]/.test(x)||x.includes(".."))?h(x):i()};return m.jsxs("div",{className:"flex items-center gap-2 py-0.5 min-h-7",style:{paddingLeft:`${8+e*12+(n?0:14)}px`},children:[n?m.jsx(KQ,{size:cI,weight:"duotone",color:"#6B7280",className:"flex-shrink-0"}):m.jsx(bM,{path:c}),m.jsx("input",{ref:l,value:c,onChange:x=>u(x.target.value),onKeyDown:g,onBlur:O,className:"flex-1 min-w-0 bg-neutral-800 text-neutral-200 text-xs px-1.5 py-0.5 rounded border border-neutral-600 outline-none focus:border-[#3CE6AC]",spellCheck:!1})]})}function fI({name:t,onConfirm:e,onCancel:n}){const r=d.useRef(null);return d.useEffect(()=>{const i=s=>{s.key==="Escape"&&n()},l=s=>{r.current&&!r.current.contains(s.target)&&n()};return document.addEventListener("keydown",i),document.addEventListener("mousedown",l),()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",l)}},[n]),m.jsxs("div",{ref:r,className:"mx-1 my-0.5 p-2 bg-neutral-800 border border-neutral-700 rounded-md text-xs",children:[m.jsxs("p",{className:"text-neutral-300 mb-2",children:["Delete ",m.jsx("span",{className:"font-medium text-neutral-100",children:t}),"?"]}),m.jsxs("div",{className:"flex gap-1.5",children:[m.jsx("button",{onClick:n,className:"flex-1 px-2 py-1 rounded bg-neutral-700 text-neutral-300 hover:bg-neutral-600 transition-colors",children:"Cancel"}),m.jsx("button",{onClick:e,className:"flex-1 px-2 py-1 rounded bg-red-900/60 text-red-300 hover:bg-red-800/60 transition-colors",children:"Delete"})]})]})}const u8=d.memo(function({node:e,depth:n,activeFile:r,onSelectFile:i,onContextMenu:l,inlineInput:s,onDragStart:c}){const u=e.fullPath===r;return(s==null?void 0:s.mode)==="rename"&&s.originalPath===e.fullPath?m.jsx(Od,{defaultValue:s.originalName??e.name,depth:n,isFolder:!1,onCommit:g=>{var O;(O=s==null?void 0:s.onCommit)==null||O.call(s,g)},onCancel:()=>{var g;(g=s==null?void 0:s.onCancel)==null||g.call(s)}}):m.jsxs("button",{draggable:!0,onDragStart:g=>c(g,e.fullPath),onClick:()=>i(e.fullPath),onContextMenu:g=>{g.preventDefault(),l(g,e.fullPath,!1)},className:`w-full flex items-center gap-2 py-1 min-h-7 text-left transition-all text-xs ${u?"bg-neutral-800/60 text-neutral-200":"text-neutral-500 hover:bg-neutral-800/30 hover:text-neutral-300"}`,style:{paddingLeft:`${8+n*12+14}px`},children:[m.jsx(bM,{path:e.name}),m.jsx("span",{className:"truncate",children:e.name})]})}),dI=d.memo(function t({node:e,depth:n,activeFile:r,onSelectFile:i,defaultOpen:l,onContextMenu:s,inlineInput:c,onDragStart:u,onDragOver:h,onDrop:g,onDragLeave:O,dragOverFolder:x}){const[y,v]=d.useState(l),w=d.useCallback(()=>v($=>!$),[]),A=d.useMemo(()=>vM(e.children),[e.children]),k=y?JV:eL,M=x===e.fullPath;return(c==null?void 0:c.mode)==="rename"&&c.originalPath===e.fullPath?m.jsx(Od,{defaultValue:c.originalName??e.name,depth:n,isFolder:!0,onCommit:$=>{var C;(C=c==null?void 0:c.onCommit)==null||C.call(c,$)},onCancel:()=>{var $;($=c==null?void 0:c.onCancel)==null||$.call(c)}}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{draggable:!0,onDragStart:$=>u($,e.fullPath),onClick:w,onContextMenu:$=>{$.preventDefault(),s($,e.fullPath,!0)},onDragOver:$=>{$.preventDefault(),$.stopPropagation(),h($,e.fullPath)},onDrop:$=>{$.preventDefault(),$.stopPropagation(),g($,e.fullPath)},onDragLeave:O,className:`w-full flex items-center gap-1.5 px-2.5 py-1 min-h-7 text-left text-xs text-neutral-400 hover:bg-neutral-800/30 hover:text-neutral-300 transition-colors ${M?"bg-[#3CE6AC]/10 outline outline-1 outline-[#3CE6AC]/40":""}`,style:{paddingLeft:`${8+n*12}px`},children:[m.jsx(k,{size:10,className:"flex-shrink-0 text-neutral-600"}),m.jsx("span",{className:"truncate font-medium",children:e.name})]}),y&&m.jsxs(m.Fragment,{children:[c&&(c.mode==="new-file"||c.mode==="new-folder")&&c.parentPath===e.fullPath&&m.jsx(Od,{defaultValue:"",depth:n+1,isFolder:c.mode==="new-folder",onCommit:$=>{var C;(C=c==null?void 0:c.onCommit)==null||C.call(c,$)},onCancel:()=>{var $;($=c==null?void 0:c.onCancel)==null||$.call(c)}}),A.map($=>$.isFile&&$.children.size===0?m.jsx(u8,{node:$,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:s,inlineInput:c,onDragStart:u},$.fullPath):$.children.size>0?m.jsx(t,{node:$,depth:n+1,activeFile:r,onSelectFile:i,defaultOpen:R6($,r),onContextMenu:s,inlineInput:c,onDragStart:u,onDragOver:h,onDrop:g,onDragLeave:O,dragOverFolder:x},$.fullPath):m.jsx(u8,{node:$,depth:n+1,activeFile:r,onSelectFile:i,onContextMenu:s,inlineInput:c,onDragStart:u},$.fullPath))]})]})}),hI=d.memo(function({files:e,activeFile:n,onSelectFile:r,onCreateFile:i,onCreateFolder:l,onDeleteFile:s,onRenameFile:c,onDuplicateFile:u,onMoveFile:h,onImportFiles:g}){const O=d.useMemo(()=>oI(e),[e]),x=d.useMemo(()=>vM(O.children),[O]),[y,v]=d.useState(null),[w,A]=d.useState(null),[k,M]=d.useState(null),[E,$]=d.useState(null),C=d.useRef(null),j=!!(i||l||s||c||u),T=d.useCallback((P,Z,L)=>{j&&(P.preventDefault(),v({x:P.clientX,y:P.clientY,targetPath:Z,targetIsFolder:L}))},[j]),N=d.useCallback(()=>v(null),[]),R=d.useCallback(P=>{A({parentPath:P,mode:"new-file",onCommit:Z=>{const L=P?`${P}/${Z}`:Z;i==null||i(L),A(null)},onCancel:()=>A(null)})},[i]),D=d.useCallback(P=>{A({parentPath:P,mode:"new-folder",onCommit:Z=>{const L=P?`${P}/${Z}`:Z;l==null||l(L),A(null)},onCancel:()=>A(null)})},[l]),V=d.useCallback(P=>{const Z=P.includes("/")?P.slice(P.lastIndexOf("/")+1):P,L=P.includes("/")?P.slice(0,P.lastIndexOf("/")):"";A({parentPath:L,mode:"rename",originalPath:P,originalName:Z,onCommit:B=>{if(B!==Z){const J=L?`${L}/${B}`:B;c==null||c(P,J)}A(null)},onCancel:()=>A(null)})},[c]),z=d.useCallback(P=>{u==null||u(P)},[u]),I=d.useCallback(P=>{M(P)},[]),U=d.useCallback(()=>{k&&(s==null||s(k),M(null))},[k,s]),K=d.useCallback(()=>{M(null)},[]),H=d.useCallback((P,Z)=>{C.current=Z,P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",Z)},[]),q=d.useCallback((P,Z)=>{$(Z)},[]),X=d.useCallback((P,Z)=>{if(P.dataTransfer.files.length>0&&!C.current){P.preventDefault(),g==null||g(P.dataTransfer.files,Z||void 0),$(null);return}const L=C.current;if(!L||!h){$(null);return}const B=L.includes("/")?L.slice(L.lastIndexOf("/")+1):L,J=Z?`${Z}/${B}`:B;J!==L&&!Z.startsWith(L+"/")&&h(L,J),$(null),C.current=null},[h,g]),G=d.useCallback(()=>{$(null)},[]),F=d.useCallback(P=>{j&&P.target===P.currentTarget&&(P.preventDefault(),v({x:P.clientX,y:P.clientY,targetPath:"",targetIsFolder:!0}))},[j]);return m.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[j&&m.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 border-b border-neutral-800/50 flex-shrink-0",children:[m.jsx("span",{className:"text-[10px] font-semibold tracking-wider text-neutral-600 uppercase",children:"Files"}),m.jsxs("div",{className:"flex items-center gap-0.5",children:[m.jsx("button",{onClick:()=>R(""),className:"p-0.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 transition-colors",title:"New File",children:m.jsx(U7,{size:12,weight:"bold"})}),m.jsx("button",{onClick:()=>D(""),className:"p-0.5 rounded hover:bg-neutral-800 text-neutral-600 hover:text-neutral-400 transition-colors",title:"New Folder",children:m.jsx(D7,{size:12,weight:"duotone"})})]})]}),m.jsxs("div",{className:`flex-1 overflow-y-auto py-1 transition-colors ${E===""?"bg-[#3CE6AC]/5 outline outline-1 outline-[#3CE6AC]/30 -outline-offset-1":""}`,onContextMenu:F,onDragOver:P=>{P.preventDefault(),P.target===P.currentTarget&&$("")},onDragLeave:P=>{P.target===P.currentTarget&&$(null)},onDrop:P=>{P.preventDefault(),X(P,"")},children:[w&&(w.mode==="new-file"||w.mode==="new-folder")&&w.parentPath===""&&m.jsx(Od,{defaultValue:"",depth:0,isFolder:w.mode==="new-folder",onCommit:P=>{var Z;return(Z=w.onCommit)==null?void 0:Z.call(w,P)},onCancel:()=>{var P;return(P=w.onCancel)==null?void 0:P.call(w)}}),x.map(P=>P.isFile&&P.children.size===0?m.jsx(u8,{node:P,depth:0,activeFile:n,onSelectFile:r,onContextMenu:T,inlineInput:w,onDragStart:H},P.fullPath):m.jsx(dI,{node:P,depth:0,activeFile:n,onSelectFile:r,defaultOpen:R6(P,n),onContextMenu:T,inlineInput:w,onDragStart:H,onDragOver:q,onDrop:X,onDragLeave:G,dragOverFolder:E},P.fullPath))]}),k&&m.jsx("div",{className:"border-t border-neutral-800/50 flex-shrink-0",children:m.jsx(fI,{name:k.includes("/")?k.slice(k.lastIndexOf("/")+1):k,onConfirm:U,onCancel:K})}),y&&m.jsx(uI,{state:y,onClose:N,onNewFile:R,onNewFolder:D,onRename:V,onDuplicate:z,onDelete:I})]})}),SM="hf-studio-sidebar-tab";function mI(){const t=localStorage.getItem(SM);return t==="assets"?"assets":t==="code"?"code":t==="blocks"?"blocks":"compositions"}const pI=d.memo(d.forwardRef(function({width:e=240,projectId:n,compositions:r,assets:i,activeComposition:l,onSelectComposition:s,onImportFiles:c,fileTree:u,editingFile:h,onSelectFile:g,onCreateFile:O,onCreateFolder:x,onDeleteFile:y,onRenameFile:v,onDuplicateFile:w,onMoveFile:A,codeChildren:k,onRenderComposition:M,isRendering:E,onLint:$,linting:C,onToggleCollapse:j,onAddBlock:T,onPreviewBlock:N,takeoverContent:R},D){const[V,z]=d.useState(mI),I=d.useRef(V);I.current=V;const U=d.useCallback(H=>{z(H),localStorage.setItem(SM,H),Lt("tab_switch",{panel:"left_sidebar",tab:H})},[]),K=d.useCallback(()=>I.current,[]);return d.useImperativeHandle(D,()=>({selectTab:U,getTab:K}),[U,K]),m.jsx("div",{className:"flex flex-col h-full bg-neutral-950 border-r border-neutral-800/50",style:{width:e},children:R?m.jsx("div",{className:"flex min-h-0 flex-1",children:R}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"border-b border-neutral-800/50 px-3 py-3 flex-shrink-0",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5 rounded-[18px] bg-neutral-900 p-1 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]",style:{gridTemplateColumns:pp?"1fr 1fr 1fr 1fr":"1fr 1fr 1fr"},children:[m.jsx(Yt,{label:"Source code editor",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>U("code"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${V==="code"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Code"})}),m.jsx(Yt,{label:"Compositions and sub-compositions",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>U("compositions"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${V==="compositions"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Comps"})}),m.jsx(Yt,{label:"Videos, images, audio, fonts",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>U("assets"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${V==="assets"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Assets"})}),pp&&m.jsx(Yt,{label:"Browse blocks and components",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>U("blocks"),className:`rounded-[14px] px-1.5 py-2 text-[10px] font-semibold truncate transition-all ${V==="blocks"?"bg-neutral-800 text-white":"text-neutral-500 hover:text-neutral-200"}`,children:"Catalog"})})]}),j&&m.jsx("button",{type:"button",onClick:j,className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border border-transparent text-neutral-500 transition-colors hover:border-neutral-800 hover:bg-neutral-900 hover:text-neutral-300",title:"Hide sidebar","aria-label":"Hide sidebar",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"m14 7-5 5 5 5"}),m.jsx("path",{d:"M19 4v16"})]})})]})}),V==="compositions"&&m.jsx(UY,{projectId:n,compositions:r,activeComposition:l,onSelect:s,onRenderComposition:M,isRendering:E}),V==="assets"&&m.jsx(JY,{projectId:n,assets:i,onImport:c,onDelete:y,onRename:v}),V==="code"&&m.jsxs("div",{className:"flex flex-1 min-h-0",children:[((u==null?void 0:u.length)??0)>0&&m.jsx("div",{className:"w-[160px] flex-shrink-0 border-r border-neutral-800 overflow-y-auto",children:m.jsx(hI,{files:u??[],activeFile:(h==null?void 0:h.path)??null,onSelectFile:g??(()=>{}),onCreateFile:O,onCreateFolder:x,onDeleteFile:y,onRenameFile:v,onDuplicateFile:w,onMoveFile:A,onImportFiles:c})}),m.jsx("div",{className:"flex-1 overflow-hidden min-w-0",children:k??m.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Select a file to edit"})})]}),pp&&V==="blocks"&&m.jsx(rI,{onAddBlock:T,onPreviewBlock:N}),$&&m.jsx("div",{className:"border-t border-neutral-800 p-2 flex-shrink-0",children:m.jsxs("button",{onClick:$,disabled:C,className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-md text-[11px] font-medium text-neutral-500 hover:text-amber-300 hover:bg-neutral-800 transition-colors disabled:opacity-40",children:[m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("path",{d:"M9 11l3 3L22 4"}),m.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),C?"Linting…":"Lint"]})})]})})}));function gI({projectId:t,filePath:e}){const n=`/api/projects/${t}/preview/${e}`,r=e.split("/").pop()??e;return uu.test(e)?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[m.jsx("img",{src:n,alt:r,className:"max-w-full max-h-[70%] object-contain rounded border border-neutral-800"}),m.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):A8.test(e)?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950",children:[m.jsx("video",{src:n,controls:!0,className:"max-w-full max-h-[70%] rounded border border-neutral-800"}),m.jsx("span",{className:"mt-3 text-[11px] text-neutral-500 font-mono",children:e})]}):M8.test(e)?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-3",children:[m.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[m.jsx("path",{d:"M9 18V5l12-2v13",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("circle",{cx:"6",cy:"18",r:"3"}),m.jsx("circle",{cx:"18",cy:"16",r:"3"})]}),m.jsx("audio",{src:n,controls:!0,className:"w-full max-w-[280px]"}),m.jsx("span",{className:"text-[11px] text-neutral-500 font-mono",children:e})]}):m.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2",children:[m.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-600",children:[m.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("polyline",{points:"14 2 14 8 20 8",strokeLinecap:"round",strokeLinejoin:"round"})]}),m.jsx("span",{className:"text-sm text-neutral-400 font-medium",children:r}),m.jsx("span",{className:"text-[11px] text-neutral-600 font-mono",children:e}),m.jsx("span",{className:"text-[10px] text-neutral-600",children:"Binary file — preview not available"})]})}const wM=d.createContext(null);function kM(){const t=d.useContext(wM);if(!t)throw new Error("useFileManagerContext must be used within FileManagerProvider");return t}function OI({value:{editingFile:t,setEditingFile:e,projectDir:n,fileTree:r,fileTreeLoaded:i,setFileTree:l,editingPathRef:s,projectIdRef:c,saveRafRef:u,importedFontAssetsRef:h,readProjectFile:g,writeProjectFile:O,readOptionalProjectFile:x,revealSourceOffset:y,openSourceForSelection:v,handleFileSelect:w,handleContentChange:A,refreshFileTree:k,uploadProjectFiles:M,handleCreateFile:E,handleCreateFolder:$,handleDeleteFile:C,handleRenameFile:j,handleDuplicateFile:T,handleMoveFile:N,handleImportFiles:R,handleImportFonts:D,compositions:V,assets:z,fontAssets:I},children:U}){const K=d.useMemo(()=>({editingFile:t,setEditingFile:e,projectDir:n,fileTree:r,fileTreeLoaded:i,setFileTree:l,editingPathRef:s,projectIdRef:c,saveRafRef:u,importedFontAssetsRef:h,readProjectFile:g,writeProjectFile:O,readOptionalProjectFile:x,revealSourceOffset:y,openSourceForSelection:v,handleFileSelect:w,handleContentChange:A,refreshFileTree:k,uploadProjectFiles:M,handleCreateFile:E,handleCreateFolder:$,handleDeleteFile:C,handleRenameFile:j,handleDuplicateFile:T,handleMoveFile:N,handleImportFiles:R,handleImportFonts:D,compositions:V,assets:z,fontAssets:I}),[t,e,n,r,i,l,s,c,u,h,g,O,x,y,v,w,A,k,M,E,$,C,j,T,N,R,D,V,z,I]);return m.jsx(wM,{value:K,children:U})}const AM="hf-studio-render-settings";function MM(){try{const t=localStorage.getItem(AM);if(t){const e=JSON.parse(t);return{format:["mp4","webm","mov"].includes(e.format)?e.format:"mp4",quality:["draft","standard","high"].includes(e.quality)?e.quality:"standard",fps:[24,30,60].includes(e.fps)?e.fps:30}}}catch{}return{format:"mp4",quality:"standard",fps:30}}function d2(t,e,n){try{localStorage.setItem(AM,JSON.stringify({format:t,quality:e,fps:n}))}catch{}}function xI({leftSidebarRef:t,onSelectComposition:e,onAddBlock:n,onPreviewBlock:r,onLint:i,linting:l}){const{leftCollapsed:s,leftWidth:c,toggleLeftSidebar:u,handlePanelResizeStart:h,handlePanelResizeMove:g,handlePanelResizeEnd:O}=G8(),{projectId:x,renderQueue:y,waitForPendingDomEditSaves:v}=No(),{compositions:w,assets:A,editingFile:k,fileTree:M,revealSourceOffset:E,handleFileSelect:$,handleCreateFile:C,handleCreateFolder:j,handleDeleteFile:T,handleRenameFile:N,handleDuplicateFile:R,handleMoveFile:D,handleImportFiles:V,handleContentChange:z}=kM(),I=d.useCallback(async U=>{await v();const{format:K,quality:H,fps:q}=MM();await y.startRender({composition:U,format:K,quality:H,fps:q})},[y,v]);return s?m.jsx("div",{className:"flex w-10 flex-shrink-0 flex-col items-center border-r border-neutral-800/50 bg-neutral-950 pt-1",children:m.jsx("button",{type:"button",onClick:u,className:"flex h-8 w-8 items-center justify-center rounded-md border border-transparent text-neutral-500 transition-colors hover:border-neutral-800 hover:bg-neutral-900 hover:text-neutral-300",title:"Show sidebar","aria-label":"Show sidebar",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M5 4v16"}),m.jsx("path",{d:"m10 7 5 5-5 5"})]})})}):m.jsxs(m.Fragment,{children:[m.jsx(pI,{ref:t,width:c,projectId:x,compositions:w,assets:A,activeComposition:(k==null?void 0:k.path)??null,onSelectComposition:e,fileTree:M,editingFile:k,onSelectFile:$,onCreateFile:C,onCreateFolder:j,onDeleteFile:T,onRenameFile:N,onDuplicateFile:R,onMoveFile:D,onImportFiles:V,codeChildren:k?WS(k.path)?m.jsx(gI,{projectId:x,filePath:k.path}):m.jsx(zY,{content:k.content??"",filePath:k.path,onChange:z,revealOffset:E}):void 0,onRenderComposition:I,isRendering:y.isRendering,onLint:i,linting:l,onToggleCollapse:u,onAddBlock:n,onPreviewBlock:r}),m.jsx("div",{className:"group w-2 flex-shrink-0 cursor-col-resize flex items-center justify-center",style:{touchAction:"none"},onPointerDown:U=>h("left",U),onPointerMove:g,onPointerUp:O,children:m.jsx("div",{className:"h-[52px] w-px bg-white/12 transition-colors group-hover:bg-white/18 group-active:bg-white/24"})})]})}const yI=25,bI=400,vI='[data-preview-pan-surface="true"]',xd=48,f8={zoomPercent:100,panX:0,panY:0},SI=.007,Cv=10;function nl(t){return Math.round(t*1e4)/1e4}function oa(t){return Number.isFinite(t)?Math.min(bI,Math.max(yI,t)):100}function wI(t){return t===1}function h2(t,e){return t instanceof Element?e!=null&&e.contains(t)?!0:!!t.closest(vI):!1}function kI(t,e){if(!Number.isFinite(t))return oa(e);const r=-(Math.abs(t)>Cv?Cv*Math.sign(t):t)*SI,i=oa(e);return oa(i*Math.exp(r))}function CM(t){const e=oa(t.zoomPercent)/100,n=t.contentWidth??t.viewportWidth,r=t.contentHeight??t.viewportHeight,i=Math.max(0,(n*e-t.viewportWidth)/2)+xd,l=Math.max(0,(r*e-t.viewportHeight)/2)+xd;return{panX:Math.min(i,Math.max(-i,t.panX)),panY:Math.min(l,Math.max(-l,t.panY))}}function AI(t,e,n,r,i,l,s){const c=oa(n)/100,u=Math.abs(l*c-r)/2+xd,h=Math.abs(s*c-i)/2+xd;return{panX:Math.min(u,Math.max(-u,t)),panY:Math.min(h,Math.max(-h,e))}}function MI(t){const e=oa(t.state.zoomPercent),n=kI(t.deltaY,e),r=e/100,i=n/100;let l=t.state.panX,s=t.state.panY;if(t.cursorX!==void 0&&t.cursorY!==void 0){const g=i/r;l=t.cursorX*(1-g)+l*g,s=t.cursorY*(1-g)+s*g}const c=t.contentWidth??t.viewportWidth,u=t.contentHeight??t.viewportHeight,h=AI(l,s,n,t.viewportWidth,t.viewportHeight,c,u);return{zoomPercent:n,...h}}function CI(t){const e=CM({panX:t.state.panX-t.deltaX,panY:t.state.panY-t.deltaY,zoomPercent:t.state.zoomPercent,viewportWidth:t.viewportWidth,viewportHeight:t.viewportHeight,contentWidth:t.contentWidth,contentHeight:t.contentHeight});return{zoomPercent:oa(t.state.zoomPercent),...e}}function EI({projectId:t,directUrl:e}){return e??t}const TI=1200,$I=200,Ev=16;function m2(t){return Math.abs(t.zoomPercent-100)<.5&&Math.abs(t.panX)<.1&&Math.abs(t.panY)<.1}function jI(){const t=ul().previewZoom;return t?{zoomPercent:oa(t.zoomPercent),panX:t.panX,panY:t.panY}:f8}function PI(t){try{const e=t==null?void 0:t.contentDocument,n=(e==null?void 0:e.querySelector("[data-composition-id][data-width][data-height]"))??(e==null?void 0:e.querySelector("[data-width][data-height]"));if(!n)return null;const r=Number.parseInt(n.getAttribute("data-width")??"",10),i=Number.parseInt(n.getAttribute("data-height")??"",10);return!Number.isFinite(r)||r<=0||!Number.isFinite(i)||i<=0?null:{width:r,height:i}}catch{return null}}function Tv(t,e,n,r){const i=Math.max(0,t-Ev),l=Math.max(0,e-Ev),s=n&&n.width>0&&n.height>0?n.width/n.height:r?9/16:16/9;if(i===0||l===0)return{width:0,height:0};let c=i,u=c/s;return u>l&&(u=l,c=u*s),{width:nl(c),height:nl(u)}}const QI=d.memo(function({projectId:e,iframeRef:n,onIframeLoad:r,onCompositionLoadingChange:i,portrait:l,directUrl:s,suppressLoadingOverlay:c,onStageRef:u}){const h=EI({projectId:e,directUrl:s}),g=d.useRef(null),O=d.useRef(null),x=d.useRef(null);d.useEffect(()=>{u==null||u(O)},[u]);const[y,v]=d.useState(null),[w,A]=d.useState(()=>Tv(0,0,null,l)),k=d.useRef(jI()),[M,E]=d.useState(()=>k.current),$=d.useRef(null),C=d.useRef(null),j=d.useRef(null),T=d.useRef(!1),N=d.useRef(null);d.useEffect(()=>()=>{j.current&&clearTimeout(j.current),C.current&&clearTimeout(C.current)},[]),d.useEffect(()=>{const X=g.current;if(!X)return;const G=()=>{const P=X.getBoundingClientRect();A(Tv(P.width,P.height,y,l))};G();const F=new ResizeObserver(G);return F.observe(X),()=>F.disconnect()},[y,l]);const R=d.useCallback(()=>{const X=PI(x.current);v(G=>(G==null?void 0:G.width)===(X==null?void 0:X.width)&&(G==null?void 0:G.height)===(X==null?void 0:X.height)?G:X)},[]),D=d.useCallback(X=>{x.current=X,n.current=X},[n]),V=d.useRef(w);V.current=w;const z=d.useCallback(X=>{const G=O.current;if(!G)return;const F=nl(X.zoomPercent/100),P=nl(X.panX),Z=nl(X.panY);G.style.transform=`translate3d(${P}px, ${Z}px, 0) scale(${F})`},[]),I=d.useCallback((X,G)=>{const F={zoomPercent:oa(X.zoomPercent),panX:Number.isFinite(X.panX)?X.panX:0,panY:Number.isFinite(X.panY)?X.panY:0};if(k.current=F,G&&!T.current){T.current=!0;const P=$.current;P&&(P.style.opacity="1")}z(F),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{T.current=!1;const P=k.current;if(ho({previewZoom:P}),E(Z=>Z.zoomPercent===P.zoomPercent&&Z.panX===P.panX&&Z.panY===P.panY?Z:P),G){const Z=$.current;Z&&(Z.textContent=m2(P)?"Fit":`${Math.round(P.zoomPercent)}%`,C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{$.current&&($.current.style.opacity="0")},TI))}},$I)},[z]),U=d.useCallback(X=>I(X,!0),[I]),K=d.useCallback(X=>I(X,!1),[I]),H=d.useCallback(()=>{const X=k.current;(Math.abs(X.zoomPercent-100)>.5||Math.abs(X.panX)>.1||Math.abs(X.panY)>.1)&&z(X)},[z]);d.useEffect(()=>{const X=g.current;if(!X)return;const G=F=>{const P=X.getBoundingClientRect();if(F.clientX<P.left||F.clientX>P.right||F.clientY<P.top||F.clientY>P.bottom)return;if(F.ctrlKey||F.metaKey){F.preventDefault(),F.stopPropagation();const J=V.current,te=F.clientX-(P.left+P.width/2),Y=F.clientY-(P.top+P.height/2),re=MI({state:k.current,deltaY:F.deltaY,viewportWidth:P.width,viewportHeight:P.height,contentWidth:J.width,contentHeight:J.height,cursorX:te,cursorY:Y});U(re);return}if(!h2(F.target,O.current))return;F.preventDefault(),F.stopPropagation();const L=V.current,B=CI({state:k.current,deltaX:F.deltaX,deltaY:F.deltaY,viewportWidth:P.width,viewportHeight:P.height,contentWidth:L.width,contentHeight:L.height});K(B)};return document.addEventListener("wheel",G,{passive:!1,capture:!0}),()=>document.removeEventListener("wheel",G,{capture:!0})},[U,K]),d.useEffect(()=>{const X=g.current;if(!X)return;const G=F=>{if(m2(k.current))return;const P=X.getBoundingClientRect();F.clientX<P.left||F.clientX>P.right||F.clientY<P.top||F.clientY>P.bottom||U(f8)};return document.addEventListener("dblclick",G,{capture:!0}),()=>document.removeEventListener("dblclick",G,{capture:!0})},[U]),d.useEffect(()=>{const X=(L,B)=>{const J=g.current;if(!J)return null;const te=J.getBoundingClientRect();return L<te.left||L>te.right||B<te.top||B>te.bottom?null:te},G=L=>{X(L.clientX,L.clientY)&&h2(L.target,O.current)&&wI(L.button)&&(L.preventDefault(),N.current={pointerId:L.pointerId,startX:L.clientX,startY:L.clientY,originX:k.current.panX,originY:k.current.panY})},F=L=>{const B=N.current,J=g.current;if(!B||!J||B.pointerId!==L.pointerId)return;L.preventDefault();const te=J.getBoundingClientRect(),Y=V.current,re=CM({panX:B.originX+L.clientX-B.startX,panY:B.originY+L.clientY-B.startY,zoomPercent:k.current.zoomPercent,viewportWidth:te.width,viewportHeight:te.height,contentWidth:Y.width,contentHeight:Y.height});K({...k.current,...re})},P=L=>{var B;((B=N.current)==null?void 0:B.pointerId)===L.pointerId&&(N.current=null)},Z=L=>{L.button===1&&X(L.clientX,L.clientY)&&h2(L.target,O.current)&&L.preventDefault()};return document.addEventListener("pointerdown",G,{capture:!0}),document.addEventListener("pointermove",F,{capture:!0}),document.addEventListener("pointerup",P,{capture:!0}),document.addEventListener("pointercancel",P,{capture:!0}),document.addEventListener("auxclick",Z,{capture:!0}),()=>{document.removeEventListener("pointerdown",G,{capture:!0}),document.removeEventListener("pointermove",F,{capture:!0}),document.removeEventListener("pointerup",P,{capture:!0}),document.removeEventListener("pointercancel",P,{capture:!0}),document.removeEventListener("auxclick",Z,{capture:!0})}},[K]);const q=k.current;return m.jsx("div",{className:"flex flex-col h-full min-h-0",children:m.jsxs("div",{ref:g,className:"relative flex-1 flex items-center justify-center p-2 overflow-hidden min-h-0 outline-none focus:ring-1 focus:ring-studio-accent/40 bg-neutral-700",tabIndex:0,"aria-label":"Composition preview",children:[m.jsx("div",{className:"absolute inset-2 flex items-center justify-center pointer-events-none",children:m.jsxs("div",{ref:O,className:"relative shrink-0 pointer-events-auto",style:{width:`${w.width}px`,height:`${w.height}px`,transform:`translate3d(${nl(q.panX)}px, ${nl(q.panY)}px, 0) scale(${nl(q.zoomPercent/100)})`,transformOrigin:"center center"},"data-testid":"preview-zoom-stage",children:[(s==null?void 0:s.includes("/components/"))&&m.jsx(D2,{projectId:e,onLoad:()=>{},portrait:l,suppressLoadingOverlay:!0,style:{position:"absolute",inset:0,zIndex:0}},`backdrop-${e}`),m.jsx(D2,{ref:D,projectId:s?void 0:e,directUrl:s,onLoad:()=>{R(),r(),H()},onCompositionLoadingChange:i,portrait:l,suppressLoadingOverlay:c,style:s!=null&&s.includes("/components/")?{position:"absolute",inset:0,zIndex:1}:void 0},h)]})}),m.jsx("div",{ref:$,className:"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-50 rounded-lg px-4 py-2 text-sm font-mono tabular-nums text-white/90 bg-black/60 backdrop-blur-sm shadow-lg",style:{opacity:0,transition:"opacity 300ms ease-out"},"aria-live":"polite"}),!m2(M)&&m.jsxs("button",{type:"button",className:"absolute bottom-3 right-3 z-50 rounded-md px-2.5 py-1 text-xs font-medium text-white/80 bg-black/50 backdrop-blur-sm hover:bg-black/70 hover:text-white transition-colors",onClick:()=>U(f8),"aria-label":"Reset zoom to fit","data-testid":"preview-reset-zoom",children:[Math.round(M.zoomPercent),"% — Reset"]})]})})});function ZI({stack:t,onNavigate:e}){return t.length<=1?null:m.jsxs("nav",{"aria-label":"Composition navigation",className:"flex items-center gap-1 px-2 h-8 border-b border-neutral-800/50 bg-neutral-900/50 flex-shrink-0",children:[m.jsx("button",{type:"button",onClick:()=>{var n;Lt("navigation",{action:"back",target:(n=t[t.length-2])==null?void 0:n.label}),e(t.length-2)},className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-xs text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors",title:"Back (Esc)",children:m.jsx(CQ,{size:12,weight:"bold"})}),t.map((n,r)=>{const i=r===t.length-1;return m.jsxs("span",{className:"flex items-center gap-1",children:[r>0&&m.jsx(m7,{size:10,className:"text-neutral-600 flex-shrink-0"}),i?m.jsx("span",{className:"text-xs text-neutral-200 font-medium",children:n.label}):m.jsx("button",{type:"button",onClick:()=>{Lt("navigation",{action:"breadcrumb",target:n.label}),e(r)},className:"text-xs text-neutral-500 hover:text-neutral-200 transition-colors",children:n.label})]},n.id)})]})}function NI(t){try{const e=JSON.parse(t);return e.name?e:null}catch{return null}}function RI(t,e,n,r){if(n.width===0||n.height===0)return null;const i=(t-n.left)/n.width,l=(e-n.top)/n.height,s=r?1080:1920,c=r?1920:1080;return{left:Math.max(0,Math.min(i*s,s)),top:Math.max(0,Math.min(l*c,c))}}function VI(t,e){var i,l;const n=((i=e.dimensions)==null?void 0:i.width)??0,r=((l=e.dimensions)==null?void 0:l.height)??0;return{left:Math.max(0,t.left-n/2),top:Math.max(0,t.top-r/2)}}function LI({portrait:t,stageRef:e,onBlockDrop:n}){const[r,i]=d.useState(!1),l=d.useCallback(u=>{n&&u.dataTransfer.types.includes(Qf)&&(u.preventDefault(),u.dataTransfer.dropEffect="copy",i(!0))},[n]),s=d.useCallback(()=>{i(!1)},[]),c=d.useCallback(u=>{if(i(!1),!n)return;const h=u.dataTransfer.getData(Qf);if(!h)return;u.preventDefault();const g=NI(h),O=e.current;if(!g||!O)return;const x=RI(u.clientX,u.clientY,O.getBoundingClientRect(),t);x&&n(g.name,VI(x,g))},[n,e,t]);return{isDragOver:r,handleDragOver:l,handleDragLeave:s,handleDrop:c}}function _I({projectId:t,activeCompositionPath:e,onCompositionChange:n}){const[r,i]=d.useState([{id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`}]),l=d.useRef(n);l.current=n;const s=d.useCallback(y=>{i(v=>{var k;const w=typeof y=="function"?y(v):y,A=(k=w[w.length-1])==null?void 0:k.id;return queueMicrotask(()=>{var M;return(M=l.current)==null?void 0:M.call(l,A==="master"?null:A)}),w})},[]),c=d.useRef(0),[u,h]=d.useState(new Map),g=d.useRef(u);g.current=u;const O=d.useCallback(y=>{y===0&&c.current>0&&fe.getState().setCurrentTime(c.current),fe.getState().setElements([]),s(v=>v.slice(0,y+1))},[]),x=d.useCallback(y=>{if(!y.compositionSrc)return;c.current=fe.getState().currentTime;const v=y.id;let w=g.current.get(v);if(!w){const A=y.compositionSrc,k=A.match(/compositions\/.*\.html/);w=k?k[0]:A}fe.getState().setElements([]),s(A=>{var $;if(A[A.length-1].id===w&&A.length>1)return A.slice(0,-1);const M=(($=w.split("/").pop())==null?void 0:$.replace(/\.html$/,""))||w,E=`/api/projects/${t}/preview/comp/${w}`;return[...A,{id:w,label:M,previewUrl:E}]})},[t]);return d.useEffect(()=>{if(e==="index.html")fe.getState().setElements([]),s(y=>y.length>1?[y[0]]:y);else if(e&&e.startsWith("compositions/")){const y=e.replace(/^compositions\//,"").replace(/\.html$/,""),v=`/api/projects/${t}/preview/comp/${e}`;fe.getState().setElements([]),s(w=>{var A;return((A=w[w.length-1])==null?void 0:A.id)===e?w:[{id:"master",label:"Master",previewUrl:`/api/projects/${t}/preview`},{id:e,label:y,previewUrl:v}]})}else e||fe.getState().setElements([])},[e,t,s]),{compositionStack:r,updateCompositionStack:s,handleNavigateComposition:O,handleDrillDown:x,masterSeekRef:c,compIdToSrc:u,setCompIdToSrc:h}}const DI=100,HI=220,XI=120;function zI(t){return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)}function FI(){return document.fullscreenElement}const BI=d.memo(function({projectId:e,portrait:n,previewOverlay:r,timelineToolbar:i,timelineFooter:l,refreshKey:s,activeCompositionPath:c,onIframeRef:u,onCompositionChange:h,renderClipContent:g,onFileDrop:O,onDeleteElement:x,onAssetDrop:y,onBlockDrop:v,onPreviewBlockDrop:w,onMoveElement:A,onResizeElement:k,onBlockedEditAttempt:M,onSplitElement:E,onSelectTimelineElement:$,onDeleteKeyframe:C,onDeleteAllKeyframes:j,onChangeKeyframeEase:T,onMoveKeyframe:N,onToggleKeyframeAtPlayhead:R,onCompIdToSrcChange:D,timelineVisible:V,onToggleTimeline:z,onCompositionLoadingChange:I}){const{iframeRef:U,togglePlay:K,seek:H,onIframeLoad:q,refreshPlayer:X}=CP(),G=d.useRef(e);G.current!==e&&(G.current=e,fe.getState().reset());const F=d.useRef(null),P=d.useCallback(Ze=>{F.current=Ze.current},[]),{isDragOver:Z,handleDragOver:L,handleDragLeave:B,handleDrop:J}=LI({portrait:n,stageRef:F,onBlockDrop:w}),te=d.useRef(s);d.useEffect(()=>{s!==te.current&&(te.current=s,X())},[s,X]);const Y=d.useCallback(()=>{q(),u==null||u(U.current)},[q,U,u]),{compositionStack:re,updateCompositionStack:ae,handleNavigateComposition:ue,handleDrillDown:me,compIdToSrc:ye,setCompIdToSrc:Oe}=_I({projectId:e,activeCompositionPath:c,onCompositionChange:h}),Se=U,Ae=d.useCallback(Ze=>{var lt;if(!Ze.compositionSrc)return;const Be=Ze.id;let vt=ye.get(Be);if(!vt)try{const Je=(lt=Se.current)==null?void 0:lt.contentDocument;if(Je){const mt=Je.querySelector(`[data-composition-id="${Be}"][data-composition-src]`);mt&&(vt=mt.getAttribute("data-composition-src")||void 0)}}catch{}me({id:Be,compositionSrc:vt??Ze.compositionSrc})},[ye,me,Se]),Me=d.useRef(ye);Me.current=ye,Xt(()=>{fetch(`/api/projects/${e}/files/index.html`).then(Ze=>Ze.json()).then(Ze=>{const Be=Ze.content||"",vt=new Map,lt=/data-composition-id=["']([^"']+)["'][^>]*data-composition-src=["']([^"']+)["']|data-composition-src=["']([^"']+)["'][^>]*data-composition-id=["']([^"']+)["']/g;let Je;for(;(Je=lt.exec(Be))!==null;){const mt=Je[1]||Je[4],Tt=Je[2]||Je[3];mt&&Tt&&vt.set(mt,Tt)}Oe(vt),D==null||D(vt)}).catch(()=>{})}),d.useEffect(()=>{if(ye.size===0)return;const Ze=lt=>{const Je=Me.current;if(Je.size===0)return null;let mt=!1;const Tt=lt.map(cn=>{if(cn.compositionSrc)return cn;const Bn=Je.get(cn.id)??Je.get(cn.id.replace(/-(host|comp|layer)$/,""));return Bn?(mt=!0,{...cn,compositionSrc:Bn}):cn});return mt?Tt:null},Be=Ze(fe.getState().elements);Be&&fe.getState().setElements(Be);let vt=!1;return fe.subscribe((lt,Je)=>{if(vt||lt.elements===Je.elements||lt.elements.length===0||lt.elements.every(Tt=>Tt.compositionSrc))return;vt=!0;const mt=Ze(lt.elements);mt&&lt.setElements(mt),vt=!1})},[ye]);const[Ve,Pe]=d.useState(HI),ft=d.useRef(!1),[yt,Le]=d.useState(!0),Ye=d.useCallback(Ze=>{Ze||(ft.current=!0),!(Ze&&ft.current)&&Le(Ze)},[]),_e=yt;d.useEffect(()=>{I==null||I(yt)},[yt,I]);const be=d.useSyncExternalStore(zI,FI),dt=V??!0,Ue=d.useRef(!1),bt=d.useRef(null),Re=be===bt.current&&be!=null,on=d.useCallback(()=>{bt.current&&(document.fullscreenElement?document.exitFullscreen():bt.current.requestFullscreen())},[]),Rt=re[re.length-1],we=re.length>1?Rt.previewUrl:void 0,ht=d.useRef(u);ht.current=u,d.useEffect(()=>{var Ze;(Ze=ht.current)==null||Ze.call(ht,U.current)},[re.length,s,U]);const Mt=d.useCallback(Ze=>{_e||(Ze.preventDefault(),Ue.current=!0,Ze.target.setPointerCapture(Ze.pointerId))},[_e]),ot=d.useCallback(Ze=>{if(_e||!Ue.current||!bt.current)return;const Be=bt.current.getBoundingClientRect(),vt=Ze.clientY-Be.top,lt=Be.height,Je=Math.max(DI,Math.min(lt-XI,lt-vt));Pe(Je)},[_e]),ve=d.useCallback(()=>{Ue.current=!1},[]),ze=d.useCallback(Ze=>{Ze.key==="Escape"&&re.length>1&&ae(Be=>Be.slice(0,-1))},[re.length]);return m.jsxs("div",{ref:bt,className:"flex flex-col h-full min-h-0 bg-neutral-950",onKeyDown:ze,tabIndex:-1,"data-studio-fullscreen-target":"",children:[m.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[m.jsxs("div",{className:"flex-1 min-h-0 relative overflow-hidden","data-preview-pan-surface":"true",onDragOver:L,onDragLeave:B,onDrop:J,children:[m.jsx(QI,{projectId:e,iframeRef:U,onIframeLoad:Y,onCompositionLoadingChange:Ye,portrait:n,directUrl:we,suppressLoadingOverlay:ft.current,onStageRef:P}),Z&&m.jsx("div",{className:"absolute inset-2 z-40 rounded-lg border-2 border-dashed border-studio-accent/50 bg-studio-accent/[0.04] pointer-events-none"}),!Re&&r]}),m.jsxs("div",{className:"bg-neutral-950 border-t border-neutral-800/50 flex-shrink-0",children:[!Re&&re.length>1&&m.jsx(ZI,{stack:re,onNavigate:ue}),m.jsx(V$,{onTogglePlay:K,onSeek:H,disabled:_e,isFullscreen:Re,onToggleFullscreen:on})]})]}),!Re&&dt?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"group h-2 flex-shrink-0 cursor-row-resize flex items-center justify-center z-10",style:{touchAction:"none"},onPointerDown:Mt,onPointerMove:ot,onPointerUp:ve,children:m.jsx("div",{className:"h-px w-full bg-white/10 transition-colors group-hover:bg-white/16 group-active:bg-white/22"})}),m.jsxs("div",{className:"relative flex flex-col flex-shrink-0",style:{height:Ve},"aria-disabled":_e||void 0,children:[m.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden bg-neutral-950",onDoubleClick:Ze=>{Ze.target.closest("[data-clip]")||_e||re.length>1&&ae(Be=>Be.slice(0,-1))},children:[m.jsx("div",{className:"flex-shrink-0",children:i}),m.jsx(aP,{onSeek:H,onDrillDown:Ae,renderClipContent:g,onFileDrop:O,onDeleteElement:x,onAssetDrop:y,onBlockDrop:v,onMoveElement:A,onResizeElement:k,onBlockedEditAttempt:M,onSplitElement:E,onSelectElement:$,onDeleteKeyframe:C,onDeleteAllKeyframes:j,onChangeKeyframeEase:T,onMoveKeyframe:N,onToggleKeyframeAtPlayhead:R})]}),l&&m.jsx("div",{className:"flex-shrink-0",children:l}),_e&&m.jsx("div",{className:"absolute inset-0 z-30 cursor-not-allowed bg-black/18","data-testid":"timeline-loading-disabled-overlay","aria-hidden":"true",onPointerDown:Ze=>Ze.preventDefault(),onDragOver:Ze=>Ze.preventDefault(),onDrop:Ze=>Ze.preventDefault()})]})]}):!Re&&z?m.jsx("div",{className:"flex-shrink-0 border-t border-neutral-800/50 bg-neutral-950/96",children:m.jsxs("div",{className:"flex h-10 items-center justify-between px-3",children:[m.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-neutral-500",children:"Timeline"}),m.jsxs("button",{type:"button",onClick:z,className:"flex h-7 items-center gap-1.5 rounded-md border border-neutral-800 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-700 hover:bg-neutral-900 hover:text-neutral-100",title:Xw(!1),"aria-label":"Show timeline editor",children:[m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("rect",{x:"3",y:"13",width:"18",height:"8",rx:"1"}),m.jsx("path",{d:"M7 9h10"}),m.jsx("path",{d:"M8 5h8"})]}),m.jsx("span",{children:"Show"}),m.jsx("span",{className:"hidden rounded bg-white/5 px-1 py-0.5 font-mono text-[9px] text-neutral-500 sm:inline",children:Hw})]})]})}):null]})}),YI=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function II(t){return t.metaKey||t.ctrlKey||t.altKey?!1:YI.has(t.key)}function qI(t,e,n){var y,v;let r=null,i=null;try{r=t.contentDocument,i=t.contentWindow}catch{return[]}if(!r||!i)return[];const l=t.getBoundingClientRect(),s=n.getBoundingClientRect(),c=parseFloat(t.style.width)||l.width,u=l.width/c,h=l.left-s.left,g=l.top-s.top,O=r.querySelectorAll(".caption-group"),x=[];for(let w=0;w<e.groupOrder.length;w++){const A=e.groupOrder[w],k=e.groups.get(A);if(!k)continue;const M=O[w];if(!M)continue;const E=i.getComputedStyle(M);if(parseFloat(E.opacity)<=.01||E.visibility==="hidden")continue;const $=[];for(const C of M.children){const j=C;if(j.dataset.captionWrapper==="true"){const T=j.querySelector(":scope > span");T&&$.push(T)}else j.tagName==="SPAN"&&$.push(j)}if($.length===0&&((y=M.textContent)!=null&&y.trim())){const C=M.childNodes[0];if(C&&C.nodeType===Node.TEXT_NODE){const j=(C.textContent||"").split(/\s+/).filter(Boolean),T=r.createDocumentFragment();for(const N of j){const R=r.createElement("span");R.textContent=N+" ",R.style.display="inline",T.appendChild(R),$.push(R)}M.replaceChild(T,C)}else{const j=M.querySelector(":scope > span");if(j&&((v=j.textContent)!=null&&v.trim())){const T=j.textContent.split(/\s+/).filter(Boolean),N=r.createDocumentFragment();for(const R of T){const D=r.createElement("span");D.textContent=R+" ",D.style.display="inline",N.appendChild(D),$.push(D)}j.replaceWith(N)}}}for(let C=0;C<k.segmentIds.length;C++){const j=k.segmentIds[C],T=$[C];if(!T)continue;const N=T.getBoundingClientRect();x.push({segmentId:j,groupId:A,groupIndex:w,wordIndex:C,x:N.left*u+h,y:N.top*u+g,width:N.width*u,height:N.height*u})}}return x}function tf(t,e,n){let r=null;try{r=t.contentDocument}catch{return null}if(!r)return null;const i=r.querySelectorAll(".caption-group")[e];if(!i)return null;const l=[];for(const s of i.children){const c=s;if(c.dataset.captionWrapper==="true"){const u=c.querySelector(":scope > span");u&&l.push(u)}else c.tagName==="SPAN"&&l.push(c)}return l[n]??null}function Yc(t,e){const n=e.gsap;if(n&&n.getProperty)return{x:n.getProperty(t,"x")||0,y:n.getProperty(t,"y")||0,scale:n.getProperty(t,"scale")||1,rotation:n.getProperty(t,"rotation")||0};const r=t.style.transform||"",i=r.match(/scale\(([^)]+)\)/),l=r.match(/rotate\(([^)]+)deg\)/),s=r.match(/translate\(([^,]+)px,\s*([^)]+)px\)/);return{x:s?parseFloat(s[1]):0,y:s?parseFloat(s[2]):0,scale:i?parseFloat(i[1]):1,rotation:l?parseFloat(l[1]):0}}function eo(t){var i;if(t.dataset.captionWrapper==="true")return t;const e=t.parentElement;if(e&&e.dataset.captionWrapper==="true")return e;const r=t.ownerDocument.createElement("span");return r.style.display="inline-block",r.dataset.captionWrapper="true",(i=t.parentNode)==null||i.insertBefore(r,t),r.appendChild(t),r}function nf(t,e,n,r,i,l){const s=eo(t),c=e.gsap;c&&c.set?c.set(s,{x:n,y:r,scale:i,rotation:l}):s.style.transform=`translate(${n.toFixed(1)}px, ${r.toFixed(1)}px) rotate(${l.toFixed(1)}deg) scale(${i.toFixed(3)})`}function GI(t,e){const n=eo(t),{x:r,y:i,scale:l,rotation:s}=Yc(n,e),c={};return Math.abs(r)>.5&&(c.x=r),Math.abs(i)>.5&&(c.y=i),Math.abs(l-1)>.001&&(c.scaleX=l,c.scaleY=l),Math.abs(s)>.1&&(c.rotation=s),c}const lr=8,p2=20;function $v(t,e,n){const r=GI(e,n);Object.keys(r).length>0&&Ot.getState().updateSegmentStyle(t,r)}const UI=d.memo(function({iframeRef:e}){const n=Ot($=>$.isEditMode),r=Ot($=>$.model),i=Ot($=>$.selectedSegmentIds),l=Ot($=>$.selectSegment),s=Ot($=>$.clearSelection),[c,u]=d.useState([]),h=d.useRef(null),g=d.useRef(r);g.current=r;const O=d.useRef(null);Xt(()=>{if(!n)return;let $=[];const C=()=>{const N=e.current,R=g.current,D=h.current;if(!N||!R||!D)return;const V=qI(N,R,D);V.length===$.length&&V.every((z,I)=>Math.abs(z.x-$[I].x)<.5&&Math.abs(z.y-$[I].y)<.5)||($=V,u(V))},j=setInterval(C,66);C();const T=N=>{const{selectedSegmentIds:R,model:D}=Ot.getState();if(R.size===0||!D)return;const V=N.key;if(!II(N))return;N.preventDefault();const z=N.shiftKey?10:1,I=V==="ArrowLeft"?-z:V==="ArrowRight"?z:0,U=V==="ArrowUp"?-z:V==="ArrowDown"?z:0,K=e.current,H=K==null?void 0:K.contentWindow;if(!(!K||!H))for(const q of R)for(let X=0;X<D.groupOrder.length;X++){const G=D.groups.get(D.groupOrder[X]);if(!G)continue;const F=G.segmentIds.indexOf(q);if(F<0)continue;const P=tf(K,X,F);if(!P)continue;const Z=eo(P),L=Yc(Z,H);nf(P,H,L.x+I,L.y+U,L.scale,L.rotation),$v(q,P,H);break}};return window.addEventListener("keydown",T),()=>{clearInterval(j),window.removeEventListener("keydown",T)}});const x=d.useCallback(()=>{const $=e.current;if(!$)return 1;const C=$.getBoundingClientRect(),j=parseFloat($.style.width)||C.width;return C.width/j},[e]),y=d.useCallback(($,C,j,T)=>{T.stopPropagation(),T.currentTarget.setPointerCapture(T.pointerId);const N=e.current;if(!N)return;const R=tf(N,$,C),D=N.contentWindow;if(!R||!D)return;const V=Yc(eo(R),D);O.current={type:"move",wordEl:R,segmentId:j,startMX:T.clientX,startMY:T.clientY,origTX:V.x,origTY:V.y,origScale:V.scale,origRotation:V.rotation}},[e]),v=d.useCallback(($,C,j,T)=>{var K;T.stopPropagation(),T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId);const N=e.current;if(!N)return;const R=tf(N,$,C),D=N.contentWindow;if(!R||!D)return;const V=R.getBoundingClientRect(),z=x(),I=V.left*z+(((K=e.current)==null?void 0:K.getBoundingClientRect().left)??0)+V.width*z/2,U=Yc(eo(R),D);O.current={type:"scale",wordEl:R,segmentId:j,startMX:T.clientX,startDxFromCenter:T.clientX-I,origTX:U.x,origTY:U.y,origScale:U.scale,origRotation:U.rotation}},[e,x]),w=d.useCallback(($,C)=>{C.stopPropagation(),C.preventDefault(),C.currentTarget.setPointerCapture(C.pointerId);const j=e.current;if(!j)return;const T=tf(j,$.groupIndex,$.wordIndex),N=j.contentWindow;if(!T||!N)return;const R=Yc(eo(T),N);O.current={type:"rotate",wordEl:T,segmentId:$.segmentId,startMX:C.clientX,origTX:R.x,origTY:R.y,origRotation:R.rotation,origScale:R.scale}},[e]),A=d.useCallback(()=>{var $;try{return(($=e.current)==null?void 0:$.contentWindow)??null}catch{return null}},[e]),k=d.useCallback($=>{const C=O.current;if(!C)return;const j=A();if(j){if(C.type==="move"){const T=x(),N=($.clientX-C.startMX)/T,R=($.clientY-C.startMY)/T;nf(C.wordEl,j,C.origTX+N,C.origTY+R,C.origScale,C.origRotation)}else if(C.type==="scale"){const T=C.startMX-C.startDxFromCenter,N=Math.abs(C.startDxFromCenter),R=Math.abs($.clientX-T),D=N>5?R/N:1,V=Math.max(.1,C.origScale*D);nf(C.wordEl,j,C.origTX,C.origTY,V,C.origRotation)}else if(C.type==="rotate"){const N=($.clientX-C.startMX)/200*90;nf(C.wordEl,j,C.origTX,C.origTY,C.origScale,C.origRotation+N)}}},[x,A]),M=d.useCallback(()=>{const $=O.current;if($){const C=A();C&&$v($.segmentId,$.wordEl,C),O.current=null}},[A]),E=d.useCallback($=>{$.target===$.currentTarget&&s()},[s]);return n?m.jsx("div",{ref:h,className:"absolute inset-0 z-50",style:{pointerEvents:"auto"},onClick:E,onPointerMove:k,onPointerUp:M,onLostPointerCapture:M,children:c.map($=>{const C=i.has($.segmentId);return m.jsx("div",{className:["absolute",C?"ring-2 ring-studio-accent":"hover:ring-1 hover:ring-white/30"].join(" "),style:{left:$.x,top:$.y,width:$.width,height:$.height,cursor:C?"move":"pointer",touchAction:"none",borderRadius:2},onClick:j=>{j.stopPropagation(),l($.segmentId,j.shiftKey)},onPointerDown:j=>{C&&y($.groupIndex,$.wordIndex,$.segmentId,j)},children:C&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{position:"absolute",left:"50%",top:-p2-lr,marginLeft:-lr/2,width:lr,height:lr,borderRadius:"50%",backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)",cursor:"grab",touchAction:"none"},onPointerDown:j=>w($,j)}),m.jsx("div",{style:{position:"absolute",left:"50%",top:-p2,width:1,height:p2,marginLeft:-.5,backgroundColor:"var(--hf-accent, #3CE6AC)",opacity:.5,pointerEvents:"none"}}),[{right:-lr/2,bottom:-lr/2,cursor:"nwse-resize"},{left:-lr/2,top:-lr/2,cursor:"nwse-resize"},{right:-lr/2,top:-lr/2,cursor:"nesw-resize"},{left:-lr/2,bottom:-lr/2,cursor:"nesw-resize"}].map((j,T)=>m.jsx("div",{style:{position:"absolute",...j,width:lr,height:lr,backgroundColor:"var(--hf-accent, #3CE6AC)",border:"1px solid rgba(0,0,0,0.5)",borderRadius:2,touchAction:"none"},onPointerDown:N=>v($.groupIndex,$.wordIndex,$.segmentId,N)},T))]})},$.segmentId)})}):null}),jv=["#3CE6AC","#FF6B6B","#4ECDC4","#FFE66D","#A78BFA","#F472B6","#34D399","#FB923C","#60A5FA","#C084FC"],WI=d.memo(function({pixelsPerSecond:e,onSeek:n}){const r=Ot(w=>w.model),i=Ot(w=>w.selectedSegmentIds),l=Ot(w=>w.selectSegment),s=Ot(w=>w.updateSegmentTiming),c=Ot(w=>w.splitGroup),u=d.useRef(null),h=d.useCallback((w,A,k,M,E)=>{w.stopPropagation(),w.preventDefault(),w.target.setPointerCapture(w.pointerId),u.current={segId:A,edge:k,originalStart:M,originalEnd:E,startX:w.clientX}},[]),g=d.useCallback(w=>{const A=u.current;if(!A)return;const k=(w.clientX-A.startX)/e;if(A.edge==="start"){const M=Math.max(0,A.originalStart+k),E=Math.min(M,A.originalEnd-.05);s(A.segId,E,A.originalEnd)}else{const M=Math.max(A.originalStart+.05,A.originalEnd+k),E=Math.max(0,M);s(A.segId,A.originalStart,E)}},[e,s]),O=d.useCallback(()=>{u.current=null},[]),x=d.useCallback((w,A)=>{w.stopPropagation(),l(A,w.shiftKey)},[l]),y=d.useCallback((w,A,k)=>{w.stopPropagation(),c(A,k)},[c]),v=d.useCallback(w=>{if(!n)return;const A=w.currentTarget.getBoundingClientRect(),k=w.clientX-A.left-32,M=Math.max(0,k/e);n(M)},[n,e]);return r?m.jsx("div",{className:"relative select-none overflow-x-auto",style:{height:40,minWidth:"100%"},onPointerMove:g,onPointerUp:O,onPointerLeave:O,onClick:v,children:r.groupOrder.map((w,A)=>{const k=r.groups.get(w);if(!k)return null;const M=jv[A%jv.length];return k.segmentIds.map(E=>{const $=r.segments.get(E);if(!$)return null;const C=32+$.start*e,j=Math.max(($.end-$.start)*e,4),T=i.has(E);return m.jsxs("div",{className:`absolute top-1 bottom-1 rounded flex items-center overflow-hidden cursor-pointer${T?" ring-1 ring-white/50 z-10":""}`,style:{left:C,width:j,backgroundColor:M,zIndex:T?10:1},onClick:N=>x(N,E),onDoubleClick:N=>y(N,w,E),children:[m.jsx("div",{className:"absolute left-0 top-0 bottom-0 cursor-col-resize z-20",style:{width:6},onPointerDown:N=>h(N,E,"start",$.start,$.end)}),m.jsx("span",{className:"flex-1 truncate px-2 pointer-events-none",style:{fontSize:9,color:"#000000",lineHeight:1},children:$.text}),m.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize z-20",style:{width:6},onPointerDown:N=>h(N,E,"end",$.start,$.end)})]},E)})})}):null});function EM(t){const e=t.ownerDocument.defaultView;if(!e)return!0;let n=t;for(;n;){const r=e.getComputedStyle(n);if(r.display==="none"||r.visibility==="hidden")return!1;const i=Number.parseFloat(r.opacity);if(Number.isFinite(i)&&i<=.01)return!1;n=n.parentElement}return!0}function rf(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function KI(t){let e=t;for(;e;){if(e.hasAttribute("data-composition-file")||e.hasAttribute("data-composition-src"))return e;e=e.parentElement}return null}function JI(t){const e=t.rootScaleX>0?t.rootScaleX:1,n=t.rootScaleY>0?t.rootScaleY:1,r=t.sourceRectWidth&&t.sourceRectWidth>0&&t.sourceWidth&&t.sourceWidth>0?t.sourceRectWidth*e/t.sourceWidth:e,i=t.sourceRectHeight&&t.sourceRectHeight>0&&t.sourceHeight&&t.sourceHeight>0?t.sourceRectHeight*n/t.sourceHeight:n;return{scaleX:r>0?r:e,scaleY:i>0?i:n}}function uo(t,e,n){const r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),l=e.contentDocument,s=(l==null?void 0:l.querySelector("[data-composition-id]"))??(l==null?void 0:l.documentElement)??null,c=s==null?void 0:s.getBoundingClientRect(),u=rf((s==null?void 0:s.getAttribute("data-width"))??null),h=rf((s==null?void 0:s.getAttribute("data-height"))??null),g=u??(c==null?void 0:c.width),O=h??(c==null?void 0:c.height);if(!g||!O||!c)return null;const x=n.getBoundingClientRect(),y=r.width/g,v=r.height/O,w=KI(n),A=w==null?void 0:w.getBoundingClientRect(),k=JI({rootScaleX:y,rootScaleY:v,sourceRectWidth:A==null?void 0:A.width,sourceRectHeight:A==null?void 0:A.height,sourceWidth:rf((w==null?void 0:w.getAttribute("data-width"))??null),sourceHeight:rf((w==null?void 0:w.getAttribute("data-height"))??null)});return{left:r.left-i.left+x.left*y,top:r.top-i.top+x.top*v,width:x.width*y,height:x.height*v,editScaleX:k.scaleX,editScaleY:k.scaleY}}const af=.5;function d8(t,e){return t===e?!0:!t||!e?!1:Math.abs(t.left-e.left)<af&&Math.abs(t.top-e.top)<af&&Math.abs(t.width-e.width)<af&&Math.abs(t.height-e.height)<af&&Math.abs(t.editScaleX-e.editScaleX)<.001&&Math.abs(t.editScaleY-e.editScaleY)<.001}function eq(t,e){return t===e?!0:t.length!==e.length?!1:t.every((n,r)=>{const i=e[r];return!!(i&&n.key===i.key&&n.element===i.element&&n.selection===i.selection&&d8(n.rect,i.rect))})}function TM(t){const e=t[0];if(!e)return null;let n=e.left,r=e.top,i=e.left+e.width,l=e.top+e.height;for(const s of t.slice(1))n=Math.min(n,s.left),r=Math.min(r,s.top),i=Math.max(i,s.left+s.width),l=Math.max(l,s.top+s.height);return{left:n,top:r,width:i-n,height:l-r,editScaleX:1,editScaleY:1}}function tq(t){return t.filter(e=>!t.some(n=>n!==e&&n.element.contains(e.element)))}function rl(t){return[t.sourceFile??"",t.id??"",t.selector??"",t.selectorIndex??""].join("|")}function Pv(t,e,n,r){const i=rl(e),l=r.current;if((l==null?void 0:l.key)===i&&l.element.isConnected&&l.element.ownerDocument===t)return l.element;const s=or(t,e,n);return r.current=s?{key:i,element:s}:null,s}const lf=4,sf=20,nq=.05,Qv=15;function rq(t){t==null||t.focus({preventScroll:!0})}function iq(t){const e=t.scaleX>0?t.scaleX:1,n=t.scaleY>0?t.scaleY:1;if(t.uniform){const r=t.dx/e,i=t.dy/n,l=Math.abs(r)>=Math.abs(i)?r:i,s=Math.max(1,Math.max(t.actualWidth,t.actualHeight)+l);return{overlayWidth:Math.max(sf,s*e),overlayHeight:Math.max(sf,s*n),width:s,height:s}}return{overlayWidth:Math.max(sf,t.originWidth+t.dx),overlayHeight:Math.max(sf,t.originHeight+t.dy),width:Math.max(1,t.actualWidth+t.dx/e),height:Math.max(1,t.actualHeight+t.dy/n)}}function Zv(t,e,n,r){return Math.atan2(r-e,n-t)*180/Math.PI}function aq(t){return((t+180)%360+360)%360-180}function lq(t){return Math.round(t*10)/10}function Nv(t){const e=Zv(t.centerX,t.centerY,t.startX,t.startY),n=Zv(t.centerX,t.centerY,t.currentX,t.currentY),r=aq(n-e),i=t.actualAngle+r;return{angle:t.snap?Math.round(i/Qv)*Qv:lq(i)}}function sq(t,e){return Math.abs(e-t)>=nq}function oq({iframeRef:t,overlayRef:e,selectionRef:n,activeCompositionPathRef:r,groupSelectionsRef:i,hoverSelectionRef:l,rafPausedRef:s}){const[c,u]=d.useState(null),[h,g]=d.useState(null),[O,x]=d.useState([]),y=d.useRef(null),v=d.useRef(null),w=d.useRef([]),A=d.useRef(null),k=d.useRef(null),M=d.useRef(new Map),E=T=>{d8(y.current,T)||(y.current=T,u(T))},$=T=>{d8(v.current,T)||(v.current=T,g(T))},C=T=>{eq(w.current,T)||(w.current=T,x(T))},j=(T,N)=>{const R=rl(N),D=M.current.get(R);if(D!=null&&D.isConnected&&D.ownerDocument===T)return D;const V=or(T,N,r.current);return V?M.current.set(R,V):M.current.delete(R),V};return Xt(()=>{let T=0;const N=()=>{E(null),$(null),C([])},R=()=>{if(T=requestAnimationFrame(R),s.current)return;const D=n.current,V=t.current,z=e.current;if(!V||!z){A.current=null,k.current=null,M.current.clear(),N();return}const I=V.contentDocument;if(!I){A.current=null,k.current=null,M.current.clear(),N();return}if(D){const G=Pv(I,D,r.current,A);G&&EM(G)?E(uo(z,V,G)):E(null)}else A.current=null,E(null);const U=i.current;if(U.length>0){const G=[],F=new Set;for(const P of U){const Z=rl(P);F.add(Z);const L=j(I,P),B=L?uo(z,V,L):null;L&&B&&G.push({key:Z,selection:P,element:L,rect:B})}for(const P of M.current.keys())F.has(P)||M.current.delete(P);C(G)}else M.current.clear(),C([]);const K=l.current,H=!!(D&&K&&rl(D)===rl(K)),q=!!(K&&U.some(G=>rl(G)===rl(K)));if(!K||H||q){k.current=null,$(null);return}const X=Pv(I,K,r.current,k);if(!X){$(null);return}$(uo(z,V,X))};return T=requestAnimationFrame(R),()=>cancelAnimationFrame(T)}),{overlayRect:c,overlayRectRef:y,setOverlayRect:E,hoverRect:h,hoverRectRef:v,setHoverRect:$,groupOverlayItems:O,groupOverlayItemsRef:w,setGroupOverlayItems:C}}const cq=100,Rv=.01,uq=1e-6;function Vv(t){return Number.isFinite(t.x)&&Number.isFinite(t.y)}function Lv(t){return Math.hypot(t.x,t.y)}function _v(t){return Number.isFinite(t.left)&&Number.isFinite(t.top)&&Number.isFinite(t.width)&&Number.isFinite(t.height)}function fq(t){const e=t.document.documentElement,n=t.innerWidth||e.clientWidth||1,r=t.innerHeight||e.clientHeight||1;return{width:n>0?n:1,height:r>0?r:1}}function dq(t){try{const e=t.frameElement;if(!e)return null;const n=e.ownerDocument.defaultView,r=n==null?void 0:n.HTMLElement;return r&&e instanceof r?e:null}catch{return null}}function g2(t){const e=t.getBoundingClientRect();if(!_v(e)||e.width<=0&&e.height<=0)return null;let n={x:e.left+e.width/2,y:e.top+e.height/2},r=t.ownerDocument.defaultView;for(;r;){const i=dq(r);if(!i)break;const l=i.getBoundingClientRect();if(!_v(l)||l.width<=0||l.height<=0)return null;const s=fq(r);n={x:l.left+n.x*(l.width/s.width),y:l.top+n.y*(l.height/s.height)},r=i.ownerDocument.defaultView}return n}function hq(t){const e=t.a*t.d-t.b*t.c;return!Number.isFinite(e)||Math.abs(e)<uq?null:{a:t.d/e,b:-t.b/e,c:-t.c/e,d:t.a/e}}function mq(t,e){return{x:t.a*e.x+t.c*e.y,y:t.b*e.x+t.d*e.y}}function pq(t,e,n={}){const r=n.probeSize??cq;if(!Number.isFinite(r)||r<=0)return{ok:!1,reason:"Invalid movement probe size."};const i=_8(t);try{bf(t,e);const l=g2(t);if(!l)return{ok:!1,reason:"Element has no measurable box."};bf(t,{x:e.x+r,y:e.y});const s=g2(t);if(!s)return{ok:!1,reason:"Element X movement could not be measured."};bf(t,{x:e.x,y:e.y+r});const c=g2(t);if(!c)return{ok:!1,reason:"Element Y movement could not be measured."};const u={x:(s.x-l.x)/r,y:(s.y-l.y)/r},h={x:(c.x-l.x)/r,y:(c.y-l.y)/r};if(!Vv(u)||!Vv(h)||Lv(u)<Rv||Lv(h)<Rv)return{ok:!1,reason:"Element movement response is too small to measure."};const g={a:u.x,b:u.y,c:h.x,d:h.y},O=hq(g);return O?{ok:!0,matrix:O}:{ok:!1,reason:"Element movement response is not invertible."}}finally{Gs(t,i)}}function gq(t){const e=mq(t.screenToOffset,{x:t.dx,y:t.dy});return{x:t.initialOffset.x+e.x,y:t.initialOffset.y+e.y}}function $M(t){const e=ig(t.element),n=_8(t.element),r=dw(t.element),i=pq(t.element,e);if(!i.ok){const l=t.rect.editScaleX||1,s=t.rect.editScaleY||1;return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,initialPathOffset:n,gestureToken:r,screenToOffset:{a:1/l,b:0,c:0,d:1/s},originRect:t.rect}}}return{ok:!0,member:{key:t.key,selection:t.selection,element:t.element,initialOffset:e,initialPathOffset:n,gestureToken:r,screenToOffset:i.matrix,originRect:t.rect}}}function jM(t,e,n){return gq({initialOffset:t.initialOffset,screenToOffset:t.screenToOffset,dx:e,dy:n})}function Dv(t,e,n){const r=jM(t,e,n);return bf(t.element,r),r}function Hv(t,e,n){const r=jM(t,e,n);return Vf(t.element,r),r}function Oq(t){Gs(t.element,t.initialPathOffset),vi(t.element,t.gestureToken)}function PM(t){for(const e of t)Oq(e)}function Xv(t){for(const e of t)vi(e.element,e.gestureToken)}const O2=6,zv=1;function Do(t){return t.left+t.width}function Ho(t){return t.top+t.height}function Id(t){return t.left+t.width/2}function qd(t){return t.top+t.height/2}function xq(t){return t.map(({rect:e,id:n})=>({left:e.left,top:e.top,right:Do(e),bottom:Ho(e),centerX:Id(e),centerY:qd(e),id:n}))}function yq(t){return{left:t.left,top:t.top,right:Do(t),bottom:Ho(t),centerX:Id(t),centerY:qd(t),id:"composition"}}function bq(t,e,n){const r=[],i=[];if(e<=0||n<=0)return{x:r,y:i};const l=e*n;let s=t.left+l;const c=t.left+t.width;let u=0;for(;s<c;)r.push({position:s,source:"grid",id:`grid-x-${u}`}),s+=l,u++;let h=t.top+l;const g=t.top+t.height;for(u=0;h<g;)i.push({position:h,source:"grid",id:`grid-y-${u}`}),h+=l,u++;return{x:r,y:i}}function yd(t,e,n,r,i){const l=[];for(const s of e){const c=n(s);for(const u of t)for(const h of c){const g=h-u,O=Math.abs(g);O<=i&&l.push({adjustment:g,distance:O,guidePosition:h,source:s.id==="composition"?"composition":"element",targetId:s.id})}}if(r)for(const s of r)for(const c of t){const u=s.position-c,h=Math.abs(u);h<=i&&l.push({adjustment:u,distance:h,guidePosition:s.position,source:"grid",targetId:s.id})}return l}function bd(t){if(t.length===0)return null;const e=t.filter(x=>x.source==="element"||x.source==="composition"),n=t.filter(x=>x.source==="grid");let r;const i=e.length?Math.min(...e.map(x=>x.distance)):1/0,l=n.length?Math.min(...n.map(x=>x.distance)):1/0;i<=l?r=e:r=n;const s=Math.min(...r.map(x=>x.distance)),c=r.filter(x=>x.distance===s),u=c.some(x=>x.adjustment>0),h=c.some(x=>x.adjustment<0);if(u&&h)return null;const g=c[0].adjustment,O=r.filter(x=>x.adjustment===g);return{adjustment:g,matches:O}}function vq(t,e,n,r){const i=[];if(t==="x"){i.push(e.top,Ho(e));for(const l of n){const s=r.get(l);s&&i.push(s.top,s.bottom)}}else{i.push(e.left,Do(e));for(const l of n){const s=r.get(l);s&&i.push(s.left,s.right)}}return{from:Math.min(...i),to:Math.max(...i)}}function QM(t,e,n,r){const i=[];for(const[l,s]of[["x",t],["y",e]]){if(!s)continue;const c=new Set;for(const u of s.matches){if(c.has(u.guidePosition))continue;c.add(u.guidePosition);const h=s.matches.filter(O=>O.guidePosition===u.guidePosition).map(O=>O.targetId),g=vq(l,n,h,r);i.push({axis:l,position:u.guidePosition,from:g.from,to:g.to})}}return i}const ZM=(t,e)=>({dx:t,dy:e,guides:[],spacingGuides:[]});function Fv(t){var O,x;if(t.disabled||t.threshold<=0)return ZM(t.proposedDx,t.proposedDy);const e=t.movingRect,n={left:e.left+t.proposedDx,top:e.top+t.proposedDy,width:e.width,height:e.height},r=yd([n.left,Id(n),Do(n)],t.targets,y=>[y.left,y.centerX,y.right],(O=t.gridEdges)==null?void 0:O.x,t.threshold),i=yd([n.top,qd(n),Ho(n)],t.targets,y=>[y.top,y.centerY,y.bottom],(x=t.gridEdges)==null?void 0:x.y,t.threshold),l=bd(r),s=bd(i),c=t.proposedDx+((l==null?void 0:l.adjustment)??0),u=t.proposedDy+((s==null?void 0:s.adjustment)??0),h={left:e.left+c,top:e.top+u,width:e.width,height:e.height},g=new Map(t.targets.map(y=>[y.id,y]));return{dx:c,dy:u,guides:QM(l,s,h,g),spacingGuides:[]}}function Sq(t){var x,y;if(t.disabled||t.threshold<=0)return ZM(t.proposedDx,t.proposedDy);const e=t.movingRect,n=Do(e)+t.proposedDx,r=Ho(e)+t.proposedDy,i=yd([n],t.targets,v=>[v.left,v.centerX,v.right],(x=t.gridEdges)==null?void 0:x.x,t.threshold),l=yd([r],t.targets,v=>[v.top,v.centerY,v.bottom],(y=t.gridEdges)==null?void 0:y.y,t.threshold),s=bd(i),c=bd(l),u=t.proposedDx+((s==null?void 0:s.adjustment)??0),h=t.proposedDy+((c==null?void 0:c.adjustment)??0),g={left:e.left,top:e.top,width:e.width+u,height:e.height+h},O=new Map(t.targets.map(v=>[v.id,v]));return{dx:u,dy:h,guides:QM(s,c,g,O),spacingGuides:[]}}function Bv(t){const e=[],n=t.movingRect,r={left:n.left,top:n.top,right:Do(n),bottom:Ho(n),centerX:Id(n),centerY:qd(n),id:"\0__snap_moving__"},i=[...t.targets,r],l=[...i].sort((c,u)=>c.centerX-u.centerX);for(let c=0;c<l.length-2;c++){const u=l[c],h=l[c+1],g=l[c+2],O=h.left-u.right,x=g.left-h.right;if(!(O<0||x<0||!(u.id==="\0__snap_moving__"||h.id==="\0__snap_moving__"||g.id==="\0__snap_moving__"))&&Math.abs(O-x)<=zv){const v=Math.min(u.top,h.top,g.top),w=Math.max(u.bottom,h.bottom,g.bottom);e.push({axis:"x",position:u.right,size:O,from:v,to:w}),e.push({axis:"x",position:h.right,size:x,from:v,to:w})}}const s=[...i].sort((c,u)=>c.centerY-u.centerY);for(let c=0;c<s.length-2;c++){const u=s[c],h=s[c+1],g=s[c+2],O=h.top-u.bottom,x=g.top-h.bottom;if(!(O<0||x<0||!(u.id==="\0__snap_moving__"||h.id==="\0__snap_moving__"||g.id==="\0__snap_moving__"))&&Math.abs(O-x)<=zv){const v=Math.min(u.left,h.left,g.left),w=Math.max(u.right,h.right,g.right);e.push({axis:"y",position:u.bottom,size:O,from:v,to:w}),e.push({axis:"y",position:h.bottom,size:x,from:v,to:w})}}return e}function Yv(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}const wq=new Set(["script","style","link","meta","base","template","br","wbr"]);function kq(t){return t.nodeType===1}function Aq(t,e,n){const r=[],i=l=>{if(!(r.length>=n))for(const s of Array.from(l.children))kq(s)&&(wq.has(s.tagName.toLowerCase())||s.hasAttribute("data-composition-id")||e.has(s)||EM(s)&&(r.push(s),i(s)))};return i(t),r}function NM(t){const e=ul(),n=e.snapEnabled??!0,r=t.iframe.contentDocument;if(!r)return{targets:[],compositionTarget:null,gridEdges:null,snapEnabled:n};const i=r.querySelector("[data-composition-id]")??r.documentElement,l=i==null?void 0:i.getBoundingClientRect(),s=Yv((i==null?void 0:i.getAttribute("data-width"))??null),c=Yv((i==null?void 0:i.getAttribute("data-height"))??null),u=s??(l==null?void 0:l.width),h=c??(l==null?void 0:l.height);if(!u||!h||!l)return{targets:[],compositionTarget:null,gridEdges:null,snapEnabled:n};const g=t.iframe.getBoundingClientRect(),O=t.overlayEl.getBoundingClientRect(),x=g.width/u;g.height/h;const y={left:g.left-O.left,top:g.top-O.top,width:g.width,height:g.height},v=yq(y),w=80,A=Aq(i,t.excludeElements,w);A.length>=w&&console.warn(`[snap] Target cap reached (${w}). Elements beyond this limit are excluded from snap alignment.`);const k=[];for(let j=0;j<A.length;j++){const T=uo(t.overlayEl,t.iframe,A[j]);T&&k.push({rect:T,id:`snap-target-${j}`})}const M=xq(k);let E=null;const $=e.gridSpacing??50;return(e.snapToGrid??!1)&&$>0&&(E=bq(y,$,x)),{targets:M,compositionTarget:v,gridEdges:E,snapEnabled:n}}function RM(t){const e=new Set,n=t.selection;if(n!=null&&n.element&&e.add(n.element),t.groupSelections)for(const r of t.groupSelections)r.element&&e.add(r.element);return e}function Mq(t,e){var h,g,O;const n=e.groupOverlayItemsRef.current;if(n.length<=1)return!1;const r=(h=n.find(x=>!x.selection.capabilities.canApplyManualOffset))==null?void 0:h.selection;if(r)return t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(r),!1;(O=(g=e.onManualDragStartRef).current)==null||O.call(g);const i=tq(n),l=[];for(const x of i){const y=$M({key:x.key,selection:x.selection,element:x.element,rect:x.rect});if(!y.ok)return PM(l),t.preventDefault(),t.stopPropagation(),e.onBlockedMoveRef.current(y.selection),!1;l.push(y.member)}const s=e.overlayRef.current,c=e.iframeRef.current,u=s&&c?NM({overlayEl:s,iframe:c,excludeElements:RM({groupSelections:n.map(x=>x.selection)})}):void 0;return t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture(t.pointerId),e.rafPausedRef.current=!0,e.groupGestureRef.current={startX:t.clientX,startY:t.clientY,originItems:n,members:l,snapContext:u},!0}function Cq(t,e,n,r){var C,j;const i=(r==null?void 0:r.selection)??n.selectionRef.current,l=(r==null?void 0:r.rect)??n.overlayRectRef.current,s=n.boxRef.current,c=n.overlayRef.current;if(!i||!l||t!=="drag"&&!s)return!1;const u=t==="rotate"?"rotation":t==="drag"?"path-offset":"box-size";if(t==="drag"&&!i.capabilities.canApplyManualOffset||t==="resize"&&!i.capabilities.canApplyManualSize||t==="rotate"&&!i.capabilities.canApplyManualRotation||t==="resize"&&(!Number.isFinite(l.width)||!Number.isFinite(l.height)))return!1;const h=Rf(i.element),g=mw(i.element),O=h.width>0?h.width:l.width/l.editScaleX,x=h.height>0?h.height:l.height/l.editScaleY;let y=_8(i.element),v,w;if(t==="drag"){(j=(C=n.onManualDragStartRef).current)==null||j.call(C);const T=$M({key:rl(i),selection:i,element:i.element,rect:l});if(!T.ok)return n.onBlockedMoveRef.current(T.selection),!1;w=T.member,y=T.member.initialPathOffset,v=T.member.gestureToken}else v=dw(i.element);const A=c==null?void 0:c.getBoundingClientRect(),k=((A==null?void 0:A.left)??0)+l.left+l.width/2,M=((A==null?void 0:A.top)??0)+l.top+l.height/2,E=n.iframeRef.current,$=(t==="drag"||t==="resize")&&c&&E?NM({overlayEl:c,iframe:E,excludeElements:RM({selection:i})}):void 0;return e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),n.rafPausedRef.current=!0,n.gestureRef.current={kind:t,mode:u,selection:i,startX:e.clientX,startY:e.clientY,centerX:k,centerY:M,initialPathOffset:y,initialRotation:AN(i.element),initialBoxSize:kN(i.element),pathOffsetMember:w,originLeft:l.left,originTop:l.top,originWidth:l.width,originHeight:l.height,actualWidth:O,actualHeight:x,actualRotation:g.angle,editScaleX:l.editScaleX,editScaleY:l.editScaleY,manualEditDragToken:v,snapContext:$},!0}function Eq(t){const e=g=>{t.setOverlayRect(g)},n=g=>{e({left:g.originLeft,top:g.originTop,width:g.originWidth,height:g.originHeight,editScaleX:g.editScaleX,editScaleY:g.editScaleY})},r=g=>{t.setGroupOverlayItems(g)},i=g=>{PM(g.members),r(g.originItems)};return{startGesture:(g,O,x)=>Cq(g,O,t,x),startGroupDrag:g=>Mq(g,t),onPointerMove:g=>{const O=t.gestureRef.current,x=t.groupGestureRef.current,y=(O==null?void 0:O.selection)??t.selectionRef.current,v=t.boxRef.current,w=t.blockedMoveRef.current;if(!w&&!O&&!x&&t.onCanvasPointerMoveRef.current(g,{preferClipAncestor:!1}),w&&y){const M=g.clientX-w.startX,E=g.clientY-w.startY;!w.notified&&Math.hypot(M,E)>=lf&&(w.notified=!0,t.suppressNextBoxClickRef.current=!0,t.onBlockedMoveRef.current(y));return}if(x){let M=g.clientX-x.startX,E=g.clientY-x.startY;const $=x.snapContext;if($!=null&&$.snapEnabled&&$.targets.length>0){const C=TM(x.originItems.map(j=>j.rect));if(C){const j=$.compositionTarget?[...$.targets,$.compositionTarget]:$.targets,T=Fv({movingRect:C,proposedDx:M,proposedDy:E,targets:j,gridEdges:$.gridEdges??void 0,threshold:O2,disabled:g.altKey});M=T.dx,E=T.dy;const N={left:C.left+M,top:C.top+E,width:C.width,height:C.height},R=g.altKey?[]:Bv({movingRect:N,targets:j});t.snapGuidesRef.current={guides:T.guides,spacingGuides:R}}}x.lastSnappedDx=M,x.lastSnappedDy=E,r(x.originItems.map(C=>({...C,rect:{...C.rect,left:C.rect.left+M,top:C.rect.top+E}})));for(const C of x.members)Dv(C,M,E);return}if(!O||!y)return;let A=g.clientX-O.startX,k=g.clientY-O.startY;if(O.kind==="rotate"){yN(y.element,Nv({centerX:O.centerX,centerY:O.centerY,startX:O.startX,startY:O.startY,currentX:g.clientX,currentY:g.clientY,actualAngle:O.actualRotation,snap:g.shiftKey}));return}if(O.kind==="drag"){const M=O.snapContext;if(M!=null&&M.snapEnabled&&M.targets.length>0){const C={left:O.originLeft,top:O.originTop,width:O.originWidth,height:O.originHeight},j=M.compositionTarget?[...M.targets,M.compositionTarget]:M.targets,T=Fv({movingRect:C,proposedDx:A,proposedDy:k,targets:j,gridEdges:M.gridEdges??void 0,threshold:O2,disabled:g.altKey});A=T.dx,k=T.dy;const N={left:C.left+A,top:C.top+k,width:C.width,height:C.height},R=g.altKey?[]:Bv({movingRect:N,targets:j});t.snapGuidesRef.current={guides:T.guides,spacingGuides:R}}O.lastSnappedDx=A,O.lastSnappedDy=k;const E=O.originLeft+A,$=O.originTop+k;e({left:E,top:$,width:O.originWidth,height:O.originHeight,editScaleX:O.editScaleX,editScaleY:O.editScaleY}),v&&(v.style.left=`${E}px`,v.style.top=`${$}px`),O.pathOffsetMember&&Dv(O.pathOffsetMember,A,k)}else{if(!v)return;const M=O.snapContext;if(M!=null&&M.snapEnabled&&M.targets.length>0){const V={left:O.originLeft,top:O.originTop,width:O.originWidth,height:O.originHeight},z=M.compositionTarget?[...M.targets,M.compositionTarget]:M.targets,I=Sq({movingRect:V,proposedDx:A,proposedDy:k,targets:z,gridEdges:M.gridEdges??void 0,threshold:O2,disabled:g.altKey});A=I.dx,k=I.dy,t.snapGuidesRef.current={guides:I.guides,spacingGuides:[]}}const E=iq({originWidth:O.originWidth,originHeight:O.originHeight,actualWidth:O.actualWidth,actualHeight:O.actualHeight,scaleX:O.editScaleX,scaleY:O.editScaleY,dx:A,dy:k,uniform:g.shiftKey});gN(y.element,E);const $=t.overlayRef.current,C=t.iframeRef.current,j=$&&C?uo($,C,y.element):null,T=j?j.left:O.originLeft,N=j?j.top:O.originTop,R=j?j.width:E.overlayWidth,D=j?j.height:E.overlayHeight;v.style.left=`${T}px`,v.style.top=`${N}px`,v.style.width=`${R}px`,v.style.height=`${D}px`,e({left:T,top:N,width:R,height:D,editScaleX:O.editScaleX,editScaleY:O.editScaleY})}},onPointerUp:g=>{t.snapGuidesRef.current=null;const O=t.gestureRef.current,x=t.groupGestureRef.current,y=(O==null?void 0:O.selection)??t.selectionRef.current,v=t.boxRef.current;if(t.blockedMoveRef.current=null,x){t.groupGestureRef.current=null,t.rafPausedRef.current=!1;const A=g.clientX-x.startX,k=g.clientY-x.startY;if(Math.hypot(A,k)<lf){i(x),t.suppressNextBoxClickRef.current=!0;return}const M=x.lastSnappedDx??A,E=x.lastSnappedDy??k;r(x.originItems.map(C=>({...C,rect:{...C.rect,left:C.rect.left+M,top:C.rect.top+E}})));const $=x.members.map(C=>({selection:C.selection,next:Hv(C,M,E)}));Promise.resolve(t.onGroupPathOffsetCommitRef.current($)).catch(()=>{for(const C of x.members)C.gestureToken&&M1(C.element,C.gestureToken)&&Gs(C.element,C.initialPathOffset)}).finally(()=>Xv(x.members));return}if(!O||!y){t.gestureRef.current=null,t.rafPausedRef.current=!1;return}t.gestureRef.current=null,t.rafPausedRef.current=!1;const w=Math.hypot(g.clientX-O.startX,g.clientY-O.startY);if(O.kind==="drag"&&w<lf){Gs(y.element,O.initialPathOffset),vi(y.element,O.manualEditDragToken),v&&(v.style.left=`${O.originLeft}px`,v.style.top=`${O.originTop}px`),n(O),t.suppressNextBoxClickRef.current=!0,t.onCanvasMouseDown(g,{preferClipAncestor:!1});return}if(O.kind==="resize"&&w<lf){vp(y.element,O.initialBoxSize),vi(y.element,O.manualEditDragToken),v&&(v.style.width=`${O.originWidth}px`,v.style.height=`${O.originHeight}px`),n(O),t.suppressNextBoxClickRef.current=!0;return}if(O.kind==="rotate"){const A=Nv({centerX:O.centerX,centerY:O.centerY,startX:O.startX,startY:O.startY,currentX:g.clientX,currentY:g.clientY,actualAngle:O.actualRotation,snap:g.shiftKey});if(!sq(O.actualRotation,A.angle)){Sp(y.element,O.initialRotation),vi(y.element,O.manualEditDragToken);return}V8(y.element,A),Promise.resolve(t.onRotationCommitRef.current(y,A)).catch(()=>{O.manualEditDragToken&&M1(y.element,O.manualEditDragToken)&&Sp(y.element,O.initialRotation)}).finally(()=>vi(y.element,O.manualEditDragToken))}else if(O.kind==="drag"){const A=O.lastSnappedDx??g.clientX-O.startX,k=O.lastSnappedDy??g.clientY-O.startY;if(!O.pathOffsetMember)return;const M=Hv(O.pathOffsetMember,A,k),E=O.originLeft+A,$=O.originTop+k;e({left:E,top:$,width:O.originWidth,height:O.originHeight,editScaleX:O.editScaleX,editScaleY:O.editScaleY}),v&&(v.style.left=`${E}px`,v.style.top=`${$}px`),Promise.resolve(t.onPathOffsetCommitRef.current(y,M)).catch(()=>{var C;(C=O.pathOffsetMember)!=null&&C.gestureToken&&M1(y.element,O.pathOffsetMember.gestureToken)&&Gs(y.element,O.initialPathOffset)}).finally(()=>{O.pathOffsetMember&&Xv([O.pathOffsetMember])})}else{t.suppressNextBoxClickRef.current=!0;const A=Rf(y.element);N8(y.element,A),Promise.resolve(t.onBoxSizeCommitRef.current(y,A)).catch(()=>{O.manualEditDragToken&&M1(y.element,O.manualEditDragToken)&&vp(y.element,O.initialBoxSize)}).finally(()=>vi(y.element,O.manualEditDragToken))}},clearPointerState:g=>{t.snapGuidesRef.current=null;const O=t.groupGestureRef.current;O&&i(O);const x=t.gestureRef.current,y=(x==null?void 0:x.selection)??g.current;(x==null?void 0:x.mode)==="path-offset"&&y&&(Gs(y.element,x.initialPathOffset),vi(y.element,x.manualEditDragToken),n(x)),(x==null?void 0:x.mode)==="box-size"&&y&&(vp(y.element,x.initialBoxSize),vi(y.element,x.manualEditDragToken),n(x)),(x==null?void 0:x.mode)==="rotation"&&y&&(Sp(y.element,x.initialRotation),vi(y.element,x.manualEditDragToken)),t.blockedMoveRef.current=null,t.groupGestureRef.current=null,t.gestureRef.current=null,t.rafPausedRef.current=!1}}}const Iv=6,qv=4,Gv="rgba(255, 68, 204, 0.85)",of="rgba(255, 68, 204, 0.6)",Tq="rgba(255, 68, 204, 0.15)",$q=d.memo(function({snapGuidesRef:e,overlayWidth:n,overlayHeight:r}){const i=d.useRef([]),l=d.useRef([]),s=d.useRef([]),c=d.useRef(n);c.current=n;const u=d.useRef(r);return u.current=r,Xt(()=>{let h=0;const g=()=>{h=requestAnimationFrame(g);const O=e.current,x=(O==null?void 0:O.guides)??[],y=(O==null?void 0:O.spacingGuides)??[],v=c.current,w=u.current;for(let A=0;A<Iv;A++){const k=i.current[A];if(!k)continue;const M=x[A];if(!M){k.style.display="none";continue}k.style.display="",M.axis==="x"?(k.style.left=`${M.position}px`,k.style.top="0",k.style.width="1px",k.style.height=`${w}px`):(k.style.left="0",k.style.top=`${M.position}px`,k.style.width=`${v}px`,k.style.height="1px")}for(let A=0;A<qv;A++){const k=l.current[A],M=s.current[A];if(!k)continue;const E=y[A];if(!E){k.style.display="none";continue}k.style.display="flex",k.style.alignItems="center",k.style.justifyContent="center",E.axis==="x"?(k.style.left=`${E.position}px`,k.style.top=`${E.from}px`,k.style.width=`${E.size}px`,k.style.height=`${E.to-E.from}px`,k.style.borderLeft=`1px dashed ${of}`,k.style.borderRight=`1px dashed ${of}`,k.style.borderTop="none",k.style.borderBottom="none"):(k.style.left=`${E.from}px`,k.style.top=`${E.position}px`,k.style.width=`${E.to-E.from}px`,k.style.height=`${E.size}px`,k.style.borderTop=`1px dashed ${of}`,k.style.borderBottom=`1px dashed ${of}`,k.style.borderLeft="none",k.style.borderRight="none"),M&&(M.textContent=`${Math.round(E.size)}`)}};return h=requestAnimationFrame(g),()=>cancelAnimationFrame(h)}),m.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[Array.from({length:Iv},(h,g)=>m.jsx("div",{ref:O=>{i.current[g]=O},style:{display:"none",position:"absolute",backgroundColor:Gv,zIndex:50}},`guide-${g}`)),Array.from({length:qv},(h,g)=>m.jsx("div",{ref:O=>{l.current[g]=O},style:{display:"none",position:"absolute",zIndex:50},children:m.jsx("span",{ref:O=>{s.current[g]=O},style:{fontSize:"10px",fontFamily:"monospace",color:Gv,backgroundColor:Tq,padding:"0 3px",borderRadius:"2px",lineHeight:"14px",whiteSpace:"nowrap"}})},`spacing-${g}`))]})}),jq=d.memo(function({visible:e,spacing:n,scaleX:r,scaleY:i,compositionLeft:l,compositionTop:s,compositionWidth:c,compositionHeight:u}){if(!e||n<=0)return null;const h=n*r,g=n*i;return h<4||g<4?null:m.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute",style:{left:l,top:s,width:c,height:u,backgroundImage:[`repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${h}px)`,`repeating-linear-gradient(0deg, rgba(255,255,255,0.12) 0px, rgba(255,255,255,0.12) 1px, transparent 1px, transparent ${g}px)`].join(", "),backgroundSize:`${h}px ${g}px`}})}),Pq=d.memo(function({iframeRef:e,activeCompositionPath:n,selection:r,groupSelections:i=[],hoverSelection:l,allowCanvasMovement:s=!0,onCanvasMouseDown:c,onCanvasPointerMove:u,onCanvasPointerLeave:h,onSelectionChange:g,onBlockedMove:O,gridVisible:x=!1,gridSpacing:y=50,onManualDragStart:v,onPathOffsetCommit:w,onGroupPathOffsetCommit:A,onBoxSizeCommit:k,onRotationCommit:M}){const E=d.useRef(null),$=d.useRef(null),C=d.useRef(null),j=d.useRef(null),T=d.useRef(null),N=d.useRef(!1),R=d.useRef(!1),D=d.useRef(!1),V=d.useRef(null),z=d.useRef(!1),I=d.useRef(r);I.current=r;const U=d.useRef(n);U.current=n;const K=d.useRef(i);K.current=i;const H=d.useRef(l);H.current=l;const q=d.useRef(w);q.current=w;const X=d.useRef(A);X.current=A;const G=d.useRef(k);G.current=k;const F=d.useRef(M);F.current=M;const P=d.useRef(O);P.current=O;const Z=d.useRef(v);Z.current=v;const L=d.useRef(u);L.current=u;const B=d.useRef(h);B.current=h;const J=d.useRef(g);J.current=g;const{overlayRect:te,overlayRectRef:Y,setOverlayRect:re,hoverRect:ae,groupOverlayItems:ue,groupOverlayItemsRef:me,setGroupOverlayItems:ye}=oq({iframeRef:e,overlayRef:E,selectionRef:I,activeCompositionPathRef:U,groupSelectionsRef:K,hoverSelectionRef:H,rafPausedRef:z}),[Oe,Se]=d.useState({left:0,top:0,width:0,height:0,scaleX:1,scaleY:1});Xt(()=>{let be=0;const dt=()=>{be=requestAnimationFrame(dt);const Ue=e.current,bt=E.current;if(!Ue||!bt)return;const Re=Ue.getBoundingClientRect(),on=bt.getBoundingClientRect(),Rt=Re.left-on.left,we=Re.top-on.top;if(Re.width<=0||Re.height<=0)return;const ht=Ue.contentDocument,Mt=(ht==null?void 0:ht.querySelector("[data-composition-id]"))??(ht==null?void 0:ht.documentElement),ot=Number.parseFloat((Mt==null?void 0:Mt.getAttribute("data-width"))??""),ve=Number.parseFloat((Mt==null?void 0:Mt.getAttribute("data-height"))??""),ze=ot>0?Re.width/ot:1,Ze=ve>0?Re.height/ve:1;Se(Be=>Math.abs(Be.left-Rt)<.5&&Math.abs(Be.top-we)<.5&&Math.abs(Be.width-Re.width)<.5&&Math.abs(Be.height-Re.height)<.5&&Math.abs(Be.scaleX-ze)<.001&&Math.abs(Be.scaleY-Ze)<.001?Be:{left:Rt,top:we,width:Re.width,height:Re.height,scaleX:ze,scaleY:Ze})};return be=requestAnimationFrame(dt),()=>cancelAnimationFrame(be)});const Ae=Eq({overlayRef:E,iframeRef:e,boxRef:$,selectionRef:I,overlayRectRef:Y,groupOverlayItemsRef:me,gestureRef:C,groupGestureRef:j,blockedMoveRef:T,rafPausedRef:z,suppressNextBoxClickRef:N,setOverlayRect:re,setGroupOverlayItems:ye,onBlockedMoveRef:P,onManualDragStartRef:Z,onPathOffsetCommitRef:q,onGroupPathOffsetCommitRef:X,onBoxSizeCommitRef:G,onRotationCommitRef:F,onCanvasPointerMoveRef:L,onCanvasMouseDown:c,snapGuidesRef:V}),Me=d.useMemo(()=>r?`${r.sourceFile}:${r.id??r.selector??r.label}:${r.selectorIndex??0}`:"none",[r]),Ve=d.useMemo(()=>TM(ue.map(be=>be.rect)),[ue]),Pe=i.length>1,ft=Pe&&ue.length>1&&ue.every(be=>be.selection.capabilities.canApplyManualOffset),yt=be=>{if(D.current){D.current=!1,R.current=!1,N.current=!1,be.preventDefault(),be.stopPropagation();return}const dt=be.target;dt!=null&&dt.closest('[data-dom-edit-selection-box="true"]')||(c(be,{preferClipAncestor:!1}),be.shiftKey&&(R.current=!0,N.current=!0))},Le=be=>{if(!s||be.button!==0)return;if(be.shiftKey){const we=H.current;if(!we)return;be.preventDefault(),be.stopPropagation(),D.current=!0,R.current=!0,N.current=!0,J.current(we,{additive:!0});return}const dt=be.target;if(dt!=null&&dt.closest('[data-dom-edit-selection-box="true"]'))return;const Ue=H.current;if(!(Ue!=null&&Ue.capabilities.canApplyManualOffset))return;const bt=E.current,Re=e.current,on=bt&&Re?uo(bt,Re,Ue.element):null;if(!on)return;if(D.current=!0,I.current=Ue,re(on),!Ae.startGesture("drag",be,{selection:Ue,rect:on})){D.current=!1;return}J.current(Ue)},Ye=be=>{if(!(C.current||j.current)){if(N.current){N.current=!1,be.stopPropagation();return}c(be,{preferClipAncestor:!1})}},_e=be=>{R.current&&(R.current=!1,be.preventDefault(),be.stopPropagation())};return m.jsxs("div",{ref:E,className:"absolute inset-0 z-10 pointer-events-auto outline-none",tabIndex:-1,"aria-label":"Composition canvas",onPointerDownCapture:be=>rq(be.currentTarget),onPointerDown:Le,onMouseDown:yt,onPointerMove:Ae.onPointerMove,onPointerLeave:()=>B.current(),onPointerUp:Ae.onPointerUp,onPointerCancel:()=>Ae.clearPointerState(I),children:[l&&ae&&m.jsx("div",{"aria-hidden":"true","data-dom-edit-hover-box":"true",className:"pointer-events-none absolute rounded-xl border border-studio-accent/80 bg-studio-accent/5 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]",style:{left:ae.left,top:ae.top,width:ae.width,height:ae.height}}),Pe&&ue.length>1&&Ve&&m.jsxs(m.Fragment,{children:[ue.map(be=>m.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute rounded-xl border border-studio-accent/70 bg-studio-accent/[0.03]",style:{left:be.rect.left,top:be.rect.top,width:be.rect.width,height:be.rect.height}},be.key)),m.jsx("div",{"data-dom-edit-selection-box":"true",className:"pointer-events-auto absolute rounded-xl border border-studio-accent bg-studio-accent/5 shadow-[0_0_0_1px_rgba(60,230,172,0.3)]",style:{left:Ve.left,top:Ve.top,width:Ve.width,height:Ve.height,cursor:s&&ft?"move":"default"},onPointerDown:be=>{!s||!ft||be.shiftKey||Ae.startGroupDrag(be)},onMouseDown:_e,onClick:Ye})]}),!Pe&&r&&te&&m.jsxs(m.Fragment,{children:[s&&r.capabilities.canApplyManualRotation&&m.jsxs("div",{className:"pointer-events-none absolute",style:{left:te.left+te.width/2,top:te.top-34,width:28,height:34,transform:"translateX(-50%)"},children:[m.jsx("div",{className:"absolute left-1/2 top-3 bottom-0 w-px -translate-x-1/2 bg-studio-accent/60"}),m.jsx("button",{type:"button",className:"pointer-events-auto absolute left-1/2 top-0 h-3 w-3 -translate-x-1/2 rounded-full border border-studio-accent bg-studio-accent p-0 shadow-[0_0_0_2px_rgba(60,230,172,0.18)]",style:{cursor:"grab",touchAction:"none"},title:"Rotate","aria-label":"Rotate selection",onPointerDown:be=>{be.stopPropagation(),Ae.startGesture("rotate",be)}})]}),m.jsx("div",{ref:$,"data-dom-edit-selection-box":"true",className:"pointer-events-auto absolute rounded-xl border border-studio-accent/80 bg-studio-accent/5 shadow-[0_0_0_1px_rgba(60,230,172,0.25)]",style:{left:te.left,top:te.top,width:te.width,height:te.height,cursor:s&&r.capabilities.canApplyManualOffset?"move":"default"},onPointerDown:be=>{if(!(!s||be.shiftKey)){if(r.capabilities.canApplyManualOffset){Ae.startGesture("drag",be);return}be.preventDefault(),be.stopPropagation(),be.currentTarget.setPointerCapture(be.pointerId),T.current={pointerId:be.pointerId,startX:be.clientX,startY:be.clientY,notified:!1}}},onMouseDown:_e,onClick:Ye,children:s&&r.capabilities.canApplyManualSize&&m.jsx("div",{className:"absolute -right-1.5 -bottom-1.5 w-3 h-3 rounded-sm bg-studio-accent border border-studio-accent/60",style:{cursor:"se-resize",touchAction:"none"},onPointerDown:be=>{be.stopPropagation(),Ae.startGesture("resize",be)}})},Me)]}),m.jsx(jq,{visible:x,spacing:y,scaleX:Oe.scaleX,scaleY:Oe.scaleY,compositionLeft:Oe.left,compositionTop:Oe.top,compositionWidth:Oe.width,compositionHeight:Oe.height}),m.jsx($q,{snapGuidesRef:V,overlayWidth:Oe.width,overlayHeight:Oe.height})]})}),cf={snapEnabled:!0,gridVisible:!1,gridSpacing:50,snapToGrid:!1};function x2(){const t=ul();return{snapEnabled:t.snapEnabled??cf.snapEnabled,gridVisible:t.gridVisible??cf.gridVisible,gridSpacing:t.gridSpacing??cf.gridSpacing,snapToGrid:t.snapToGrid??cf.snapToGrid}}const Qq=d.memo(function({onSnapChange:e}){const[n,r]=d.useState(x2),[i,l]=d.useState(!1),s=d.useRef(null),c=d.useRef(null),u=d.useCallback(O=>{r(x=>{const y={...x,...O};return ho(O),e==null||e(y),y})},[e]),h=d.useCallback(()=>{u({snapEnabled:!n.snapEnabled})},[n.snapEnabled,u]),g=d.useCallback(()=>{u({gridVisible:!n.gridVisible})},[n.gridVisible,u]);return d.useEffect(()=>{const O=x=>{const y=x.target;y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement||y instanceof HTMLElement&&y.isContentEditable||y instanceof HTMLIFrameElement||(x.key==="s"&&!x.metaKey&&!x.ctrlKey&&!x.altKey&&(x.preventDefault(),u({snapEnabled:!x2().snapEnabled})),x.key==="g"&&!x.metaKey&&!x.ctrlKey&&!x.altKey&&(x.preventDefault(),u({gridVisible:!x2().gridVisible})))};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[u]),d.useEffect(()=>{if(!i)return;const O=x=>{var v,w;const y=x.target;(v=s.current)!=null&&v.contains(y)||(w=c.current)!=null&&w.contains(y)||l(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[i]),m.jsxs("div",{className:"absolute top-2 right-2 z-50 flex items-center gap-1",children:[m.jsx("button",{type:"button",className:`rounded-md p-1.5 transition-colors ${n.snapEnabled?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:h,title:n.snapEnabled?"Snap enabled (S)":"Snap disabled (S)","aria-label":"Toggle snap",children:m.jsx(rZ,{size:16,weight:n.snapEnabled?"fill":"regular"})}),m.jsxs("div",{className:"relative",children:[m.jsx("button",{ref:c,type:"button",className:`rounded-md p-1.5 transition-colors ${n.gridVisible?"bg-studio-accent/20 text-studio-accent":"bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,onClick:g,onContextMenu:O=>{O.preventDefault(),l(x=>!x)},title:n.gridVisible?"Grid visible (G)":"Grid hidden (G)","aria-label":"Toggle grid",children:m.jsx(eZ,{size:16,weight:n.gridVisible?"fill":"regular"})}),i&&m.jsxs("div",{ref:s,className:"absolute right-0 top-full mt-1 rounded-lg bg-neutral-800 border border-neutral-700 p-3 shadow-xl min-w-[180px]",children:[m.jsxs("label",{className:"flex items-center justify-between text-xs text-white/80 mb-2",children:[m.jsx("span",{children:"Grid spacing"}),m.jsx("input",{type:"number",min:10,max:500,step:10,value:n.gridSpacing,onChange:O=>{const x=Number.parseInt(O.target.value,10);Number.isFinite(x)&&x>=10&&x<=500&&u({gridSpacing:x})},className:"w-16 rounded bg-neutral-900 border border-neutral-600 px-1.5 py-0.5 text-xs text-white text-right tabular-nums outline-none focus:border-studio-accent"})]}),m.jsxs("label",{className:"flex items-center gap-2 text-xs text-white/80 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:n.snapToGrid,onChange:()=>u({snapToGrid:!n.snapToGrid}),className:"accent-studio-accent"}),m.jsx("span",{children:"Snap to grid"})]})]})]})]})}),Zq=10,Nq=2e4;function Rq(){try{return!1}catch{return!1}}function Vq(){return Zq}const To={sessionCount:"hyperframes-studio:feedbackSessionCount",lastPromptedAt:"hyperframes-studio:feedbackLastPromptedAt"};function Lq(){if(Rq())return!1;try{const t=parseInt(localStorage.getItem(To.sessionCount)||"0",10)||0,e=parseInt(localStorage.getItem(To.lastPromptedAt)||"0",10)||0;return t-e>=Vq()}catch{return!1}}const Uv="hyperframes-studio:feedbackSessionCounted";function _q(){try{if(sessionStorage.getItem(Uv))return;sessionStorage.setItem(Uv,"1");const t=parseInt(localStorage.getItem(To.sessionCount)||"0",10)||0;localStorage.setItem(To.sessionCount,String(t+1))}catch{}}function Wv(){try{const t=localStorage.getItem(To.sessionCount)||"0";localStorage.setItem(To.lastPromptedAt,t)}catch{}}const Dq=d.memo(function(){const[e,n]=d.useState(!1),[r,i]=d.useState(null),[l,s]=d.useState(""),[c,u]=d.useState(!1),[h,g]=d.useState(!1),O=d.useRef(null),x=d.useRef(null);d.useEffect(()=>{_q();const A=setTimeout(()=>{Lq()&&n(!0)},3e3);return()=>clearTimeout(A)},[]),d.useEffect(()=>{if(!(!e||r!==null||c))return x.current=setTimeout(()=>{y()},Nq),()=>{x.current&&clearTimeout(x.current)}},[e,r,c]),d.useEffect(()=>{r!==null&&O.current&&O.current.focus()},[r]);const y=d.useCallback(()=>{g(!0),Wv(),setTimeout(()=>n(!1),300)},[]),v=d.useCallback(()=>{r!==null&&(_T({rating:r,comment:l.trim()||void 0}),u(!0),Wv(),setTimeout(()=>{g(!0),setTimeout(()=>n(!1),300)},1500))},[r,l]),w=d.useCallback(A=>{i(A),x.current&&(clearTimeout(x.current),x.current=null)},[]);return e?m.jsx("div",{className:["flex items-center gap-3 px-4 h-8 border-t border-neutral-800/50 bg-neutral-900/80 text-[11px] transition-all duration-300",h?"opacity-0 translate-y-2":"opacity-100 translate-y-0"].join(" "),children:c?m.jsx("span",{className:"text-neutral-500",children:"Thanks for the feedback!"}):r!==null?m.jsxs(m.Fragment,{children:[m.jsx("input",{ref:O,type:"text",value:l,onChange:A=>s(A.target.value),onKeyDown:A=>{A.key==="Enter"&&v(),A.key==="Escape"&&y()},placeholder:"Any details? (enter to send, esc to close)",className:"flex-1 bg-transparent border-none text-[11px] text-neutral-300 placeholder-neutral-600 outline-none",maxLength:500}),m.jsx("button",{onClick:v,className:"text-[11px] text-neutral-500 hover:text-neutral-300 transition-colors flex-shrink-0",children:"send"})]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-neutral-500 flex-shrink-0",children:"How's the Studio experience?"}),m.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4,5].map(A=>m.jsx("button",{onClick:()=>w(A),className:"w-6 h-6 rounded text-[11px] text-neutral-600 hover:text-neutral-200 hover:bg-neutral-700/50 transition-colors",children:A},A))}),m.jsx("div",{className:"flex-1"}),m.jsx("button",{onClick:y,className:"text-neutral-700 hover:text-neutral-400 transition-colors flex-shrink-0","aria-label":"Dismiss",children:m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}):null});function Hq({timelineToolbar:t,renderClipContent:e,handleTimelineElementDelete:n,handleTimelineAssetDrop:r,handleTimelineBlockDrop:i,handlePreviewBlockDrop:l,handleTimelineFileDrop:s,handleTimelineElementMove:c,handleTimelineElementResize:u,handleBlockedTimelineEdit:h,handleTimelineElementSplit:g,setCompIdToSrc:O,setCompositionLoading:x,shouldShowSelectedDomBounds:y,blockPreview:v}){const{projectId:w,refreshKey:A,activeCompPath:k,setActiveCompPath:M,captionEditMode:E,compositionLoading:$,isPlaying:C,previewIframeRef:j,refreshPreviewDocumentVersion:T,handlePreviewIframeRef:N,timelineVisible:R,toggleTimelineVisibility:D}=No(),{domEditHoverSelection:V,domEditSelection:z,domEditGroupSelections:I,handleTimelineElementSelect:U,handlePreviewCanvasMouseDown:K,handlePreviewCanvasPointerMove:H,handlePreviewCanvasPointerLeave:q,applyDomSelection:X,handleBlockedDomMove:G,handleDomManualDragStart:F,handleDomPathOffsetCommit:P,handleDomGroupPathOffsetCommit:Z,handleDomBoxSizeCommit:L,handleDomRotationCommit:B,selectedGsapAnimations:J,handleGsapRemoveKeyframe:te,handleGsapUpdateMeta:Y,handleGsapAddKeyframe:re,handleGsapConvertToKeyframes:ae,handleGsapDeleteAnimation:ue}=Ed(),[me,ye]=d.useState(()=>{const Oe=ul();return{snapEnabled:Oe.snapEnabled??!0,gridVisible:Oe.gridVisible??!1,gridSpacing:Oe.gridSpacing??50,snapToGrid:Oe.snapToGrid??!1}});return m.jsxs("div",{className:"flex-1 flex flex-col relative min-w-0",children:[m.jsx("div",{className:"flex-1 min-h-0 relative",children:m.jsx(BI,{projectId:w,refreshKey:A,activeCompositionPath:k,timelineToolbar:t,renderClipContent:e,onDeleteElement:n,onAssetDrop:r,onBlockDrop:i,onPreviewBlockDrop:l,onFileDrop:s,onMoveElement:c,onResizeElement:u,onBlockedEditAttempt:h,onSplitElement:g,onSelectTimelineElement:U,onDeleteAllKeyframes:Oe=>{const Se=J.find(Ae=>Ae.keyframes)??J[0];Se&&ue(Se.id)},onDeleteKeyframe:(Oe,Se)=>{const Ae=J.find(Me=>Me.keyframes);Ae&&te(Ae.id,Se)},onChangeKeyframeEase:(Oe,Se,Ae)=>{const Me=J.find(Ve=>Ve.keyframes);Me&&Y(Me.id,{ease:Ae})},onMoveKeyframe:(Oe,Se,Ae)=>{const Me=J.find(Pe=>Pe.keyframes);if(!(Me!=null&&Me.keyframes))return;const Ve=Me.keyframes.keyframes.find(Pe=>Pe.percentage===Se);if(Ve){te(Me.id,Se);for(const[Pe,ft]of Object.entries(Ve.properties))re(Me.id,Ae,Pe,ft)}},onToggleKeyframeAtPlayhead:Oe=>{const Se=fe.getState().currentTime,Ae=Oe.duration>0?Math.max(0,Math.min(100,Math.round((Se-Oe.start)/Oe.duration*100))):0,Me=J.find(Ve=>Ve.keyframes);if(Me!=null&&Me.keyframes){const Ve=Me.keyframes.keyframes.find(Pe=>Math.abs(Pe.percentage-Ae)<=1);Ve?te(Me.id,Ve.percentage):re(Me.id,Ae,"x",0)}else{const Ve=J.find(Pe=>!Pe.keyframes);Ve&&ae(Ve.id)}},onCompIdToSrcChange:O,onCompositionLoadingChange:x,onCompositionChange:Oe=>{Oe!==k&&(M(Oe),T())},onIframeRef:N,previewOverlay:v?m.jsx("div",{className:"absolute inset-0 z-30 bg-black pointer-events-none",children:v.videoUrl?m.jsx("video",{src:v.videoUrl,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-contain"}):v.posterUrl?m.jsx("img",{src:v.posterUrl,alt:v.title,className:"w-full h-full object-contain"}):null}):E?m.jsx(UI,{iframeRef:j}):Mn?m.jsxs(m.Fragment,{children:[m.jsx(Pq,{iframeRef:j,activeCompositionPath:k,hoverSelection:G2&&!E&&!$&&!C?V:null,selection:y?z:null,groupSelections:y?I:[],allowCanvasMovement:Vj,onCanvasMouseDown:K,onCanvasPointerMove:H,onCanvasPointerLeave:q,onSelectionChange:X,onBlockedMove:G,onManualDragStart:F,onPathOffsetCommit:P,onGroupPathOffsetCommit:Z,onBoxSizeCommit:L,onRotationCommit:B,gridVisible:me.gridVisible,gridSpacing:me.gridSpacing}),m.jsx(Qq,{onSnapChange:ye})]}):null,timelineFooter:E?m.jsxs("div",{className:"border-t border-neutral-800/30 flex-shrink-0",style:{height:60},children:[m.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5",children:m.jsx("span",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider",children:"Captions"})}),m.jsx(WI,{pixelsPerSecond:100})]}):void 0,timelineVisible:R,onToggleTimeline:D})}),m.jsx(Dq,{})]})}function Er(t){return Math.max(0,Math.min(255,Math.round(t)))}function V6(t){return Math.max(0,Math.min(1,t))}function y2(t){return Er(t).toString(16).padStart(2,"0")}function Xq(t){return`${Math.round(V6(t)*100)/100}`}function VM(t){const e=t.trim().toLowerCase();if(!e)return null;if(e==="transparent")return{red:0,green:0,blue:0,alpha:0};const n=e.match(/^#([0-9a-f]{3})$/i);if(n){const[l,s,c]=n[1].split("");return{red:Number.parseInt(l+l,16),green:Number.parseInt(s+s,16),blue:Number.parseInt(c+c,16),alpha:1}}const r=e.match(/^#([0-9a-f]{6})$/i);if(r)return{red:Number.parseInt(r[1].slice(0,2),16),green:Number.parseInt(r[1].slice(2,4),16),blue:Number.parseInt(r[1].slice(4,6),16),alpha:1};const i=e.match(/^rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)(?:\s*,\s*([0-9.]+))?\s*\)$/i);return i?{red:Er(Number.parseFloat(i[1])),green:Er(Number.parseFloat(i[2])),blue:Er(Number.parseFloat(i[3])),alpha:V6(i[4]!=null?Number.parseFloat(i[4]):1)}:null}function b2(t){return`#${y2(t.red)}${y2(t.green)}${y2(t.blue)}`}function uf(t){const e=Er(t.red),n=Er(t.green),r=Er(t.blue),i=V6(t.alpha);return i>=1?`rgb(${e}, ${n}, ${r})`:`rgba(${e}, ${n}, ${r}, ${Xq(i)})`}function zq(t){const e=Er(t.red)/255,n=Er(t.green)/255,r=Er(t.blue)/255,i=Math.max(e,n,r),l=Math.min(e,n,r),s=i-l;let c=0;return s!==0&&(i===e?c=60*((n-r)/s%6):i===n?c=60*((r-e)/s+2):c=60*((e-n)/s+4)),c<0&&(c+=360),{hue:c,saturation:i===0?0:s/i,value:i}}function Kv(t){const e=(t.hue%360+360)%360/60,n=Math.max(0,Math.min(1,t.saturation)),r=Math.max(0,Math.min(1,t.value)),i=r*n,l=i*(1-Math.abs(e%2-1)),s=r-i;let c=0,u=0,h=0;return e>=0&&e<1?(c=i,u=l):e>=1&&e<2?(c=l,u=i):e>=2&&e<3?(u=i,h=l):e>=3&&e<4?(u=l,h=i):e>=4&&e<5?(c=l,h=i):(c=i,h=l),{red:Er((c+s)*255),green:Er((u+s)*255),blue:Er((h+s)*255)}}const L6=new Set(["inherit","initial","revert","revert-layer","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-sans-serif","ui-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),Fq=[...hg,"Inter","system-ui","sans-serif","serif","monospace"];function Jv(t){return t.replace(/[^\w .-]+/g," ").replace(/\s+/g," ").trim()}function ff(t){var r,i;const e=((r=t.style)==null?void 0:r.toLowerCase())??"",n=((i=t.fullName)==null?void 0:i.toLowerCase())??"";return e==="regular"||n.endsWith(" regular")?0:e==="normal"||n.endsWith(" normal")?1:e==="medium"||n.endsWith(" medium")?2:3}function v2(t){const e=new Set;return t.reduce((n,r)=>{const i=r.trim();if(!i)return n;const l=i.toLowerCase();return e.has(l)||(e.add(l),n.push(i)),n},[])}function eS(t){const e=new Set;return t.reduce((n,r)=>{const i=r.family.trim();if(!i)return n;const l=i.toLowerCase();return e.has(l)||(e.add(l),n.push({family:i,source:r.source})),n},[])}function Bq(t){return[...t].sort((e,n)=>{const r=tS(e.source)-tS(n.source);if(r!==0)return r;const i=hg.findIndex(c=>c.toLowerCase()===e.family.toLowerCase()),l=hg.findIndex(c=>c.toLowerCase()===n.family.toLowerCase()),s=(i===-1?Number.MAX_SAFE_INTEGER:i)-(l===-1?Number.MAX_SAFE_INTEGER:l);return s===0?e.family.localeCompare(n.family):s})}function tS(t){return t==="Current"?0:t==="Document"?1:t==="Imported"?2:t==="Google"?3:t==="Local"?4:5}const Qi="min-w-0 rounded-xl border border-neutral-800 bg-neutral-900/95 px-3 py-2 text-neutral-100 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] transition-colors focus-within:border-neutral-600",Kt="text-[11px] font-medium uppercase tracking-[0.18em] text-neutral-500",qn="grid grid-cols-[repeat(auto-fit,minmax(118px,1fr))] gap-3",Yq={},h8="none",LM={none:"none",soft:"0 12px 36px rgba(0, 0, 0, 0.28)",lift:"0 18px 54px rgba(0, 0, 0, 0.38)",glow:"0 0 0 1px rgba(60, 230, 172, 0.34), 0 18px 56px rgba(60, 230, 172, 0.2)"};function S2(t){return VM(t)??{red:0,green:0,blue:0,alpha:1}}function m8(t){if(!t)return null;const e=Number.parseFloat(t);return Number.isFinite(e)?e:null}function Bt(t){const e=Math.round(t*100)/100;return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function as(t){if(!t)return null;const e=t.trim().match(/^(-?\d+(?:\.\d+)?)([a-z%]*)$/i);if(!e)return null;const n=Number.parseFloat(e[1]);return Number.isFinite(n)?{value:n,unit:e[2]??""}:null}function ta(t){const e=as(t);return!e||e.unit&&e.unit.toLowerCase()!=="px"?null:e.value}function _M(t,e,n,r){return Number.isFinite(t)?Math.max(e,Math.min(n,t)):r}function Iq(t,e={}){const n=as(t.trim());if(!n||n.unit&&n.unit.toLowerCase()!=="px")return null;const r=_M(n.value,e.min??Number.NEGATIVE_INFINITY,e.max??Number.POSITIVE_INFINITY,e.fallback??0);return`${Bt(r)}px`}function zl(t){return`${Bt(t)}px`}function nS(t,e){const n=e.trim();if(!n||n==="normal")return n||"normal";const r=as(n);return r?t==="letter-spacing"?r.unit?n:`${Bt(r.value)}px`:r.unit?n:r.value>4?`${Bt(r.value)}px`:Bt(r.value):n}function qq(t){const e=[];let n="",r=0;for(const i of t.trim()){if(i==="("&&(r+=1),i===")"&&(r=Math.max(0,r-1)),/\s/.test(i)&&r===0){n.trim()&&e.push(n.trim()),n="";continue}n+=i}return n.trim()&&e.push(n.trim()),e}function rS(t,e){const n=t==null?void 0:t.trim();if(!n||n===h8)return 0;const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(?:^|\\s)${r}\\((-?\\d+(?:\\.\\d+)?)px\\)`,"i").exec(n);if(!i)return 0;const l=Number.parseFloat(i[1]);return Number.isFinite(l)?Math.max(0,l):0}function iS(t,e,n){const r=_M(n,0,200,0),i=qq(t&&t.trim()!==h8?t:""),l=e.toLowerCase(),s=i.filter(c=>!c.toLowerCase().startsWith(`${l}(`));return r>0&&s.push(`${e}(${Bt(r)}px)`),s.length>0?s.join(" "):h8}function Gq(t){const e=(t==null?void 0:t.trim())||"none";for(const[n,r]of Object.entries(LM))if(e===r)return n;return e==="none"?"none":"custom"}function Uq(t,e){return t==="custom"?(e==null?void 0:e.trim())||"none":LM[t]}function Wq(t){const e=t==null?void 0:t.trim();return!e||e==="none"?"none":/^inset\(/i.test(e)?"inset":/^circle\(/i.test(e)?"circle":"custom"}function Kq(t){const e=/^inset\(\s*(-?\d+(?:\.\d+)?)px\b/i.exec((t==null?void 0:t.trim())??"");if(!e)return 0;const n=Number.parseFloat(e[1]);return Number.isFinite(n)?Math.max(0,n):0}function Jq(t,e){const n=[["border-width",t]],r=as(t),i=(e==null?void 0:e.trim().toLowerCase())||"none";return r&&r.value>0&&(i==="none"||i==="hidden")&&n.push(["border-style","solid"]),n}function eG(t,e){const n=[["border-style",t]],r=t.trim().toLowerCase();if(!r||r==="none"||r==="hidden")return n;const i=as((e==null?void 0:e.trim())||"0");return(!i||i.value<=0)&&n.push(["border-width","1px"]),n}function tG(t,e,n){return t==="custom"?(n==null?void 0:n.trim())||"none":t==="circle"?"circle(50% at 50% 50%)":t==="inset"?`inset(0 round ${Bt(Math.max(0,e))}px)`:"none"}function nG(t,e){return`inset(${Bt(Math.max(0,t))}px round ${Bt(Math.max(0,e))}px)`}function aS(t,e,n){const r=as(t);if(!r)return null;const i=n!=null&&n.altKey?.1:n!=null&&n.shiftKey?10:1,l=r.value+i*e;return`${Bt(l)}${r.unit}`}function rG(t){if(!t)return"";const n=t.toLowerCase().indexOf("url(");if(n<0)return"";let r=n+4;for(;r<t.length&&(t[r]===" "||t[r]===`
139
- `||t[r]==="\r"||t[r]===" "||t[r]==="\f");)r+=1;const i=t[r]==='"'||t[r]==="'"?t[r]:null;if(i){r+=1;const s=t.indexOf(i,r);return s>=r?t.slice(r,s):""}const l=t.indexOf(")",r);return l<r?"":t.slice(r,l).trim()}function iG(t){var y;const e=t.element,n=(y=e.ownerDocument)==null?void 0:y.defaultView,r=Array.from(e.children).filter(v=>v.nodeType===1);if(r.length===0)return null;let i=1/0,l=1/0,s=-1/0,c=-1/0;for(const v of r){if(n){const A=n.getComputedStyle(v);if(A.visibility==="hidden"||A.display==="none")continue}const w=v.getBoundingClientRect();w.width===0&&w.height===0||(i=Math.min(i,w.left),l=Math.min(l,w.top),s=Math.max(s,w.right),c=Math.max(c,w.bottom))}if(!isFinite(i))return null;const u=e.getBoundingClientRect(),h=u.width>0?t.boundingBox.width/u.width:1,g=u.height>0?t.boundingBox.height/u.height:1,O=Math.round((s-i)*h),x=Math.round((c-l)*g);return O>0&&x>0?{width:O,height:x}:null}function DM({value:t,disabled:e,liveCommit:n,onCommit:r}){const[i,l]=d.useState(t),s=d.useRef(null),c=d.useRef(t),u=d.useRef(i),h=d.useRef(null);c.current=t,u.current=i,d.useEffect(()=>{l(t)},[t]),d.useEffect(()=>{const y=h.current;if(!y)return;const v=w=>{if(e||document.activeElement!==y)return;const A=w.deltaY===0?w.deltaX:w.deltaY;if(A===0)return;const k=aS(u.current,A<0?1:-1,w);k&&(w.preventDefault(),w.stopPropagation(),l(k),x.current(k))};return y.addEventListener("wheel",v,{passive:!1}),()=>y.removeEventListener("wheel",v)},[e]),d.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const g=y=>{s.current&&clearTimeout(s.current),y!==c.current&&r(y)},O=y=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{y!==c.current&&r(y)},120)},x=d.useRef(O);return x.current=O,m.jsx("input",{ref:h,type:"text",value:i,disabled:e,onChange:y=>{l(y.target.value),n&&O(y.target.value)},onBlur:()=>g(i),onKeyDown:y=>{if(y.key==="Enter"){y.target.blur();return}if(y.key!=="ArrowUp"&&y.key!=="ArrowDown")return;const v=aS(i,y.key==="ArrowUp"?1:-1,y);v&&(y.preventDefault(),l(v),O(v))},title:as(t)?"Scroll or use Arrow keys to adjust":void 0,className:"min-w-0 w-full bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600"})}function An({label:t,value:e,disabled:n,liveCommit:r,scrub:i,suffix:l,tooltip:s,onCommit:c}){const u=d.useRef(null),h=d.useCallback(y=>{if(n||!i)return;const v=parseFloat(e);Number.isFinite(v)&&(y.target.setPointerCapture(y.pointerId),u.current={startX:y.clientX,startValue:v,pointerId:y.pointerId})},[n,i,e]),g=d.useCallback(y=>{const v=u.current;if(!v)return;const w=y.clientX-v.startX;c(String(Math.round(v.startValue+w)))},[c]),O=d.useCallback(()=>{u.current=null},[]),x=i&&!n?{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500 cursor-ew-resize select-none",onPointerDown:h,onPointerMove:g,onPointerUp:O}:{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500"};return m.jsx("div",{className:Qi,title:s,children:m.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[m.jsx("span",{...x,children:t}),m.jsx(DM,{value:e,disabled:n,liveCommit:r,onCommit:c}),l&&m.jsx("span",{className:"flex-shrink-0 text-[10px] text-neutral-600",children:l})]})})}function _6({label:t,value:e,disabled:n,onCommit:r}){return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:t}),m.jsx("div",{className:Qi,children:m.jsx(DM,{value:e,disabled:n,onCommit:r})})]})}function ii({value:t,min:e,max:n,step:r,displayValue:i,formatDisplayValue:l,disabled:s,onCommit:c}){const[u,h]=d.useState(t),g=d.useRef(null),O=d.useRef(t);O.current=t,d.useEffect(()=>{h(t)},[t]),d.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=v=>{g.current&&clearTimeout(g.current),v!==O.current&&c(v)},y=v=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{v!==O.current&&c(v)},40)};return m.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2",children:[m.jsx("input",{type:"range",min:e,max:n,step:r,value:u,disabled:s,onChange:v=>{const w=Number(v.target.value);h(w),y(w)},onMouseUp:()=>x(u),onTouchEnd:()=>x(u),onBlur:()=>x(u),className:"h-2 min-w-0 w-full cursor-pointer appearance-none rounded-full bg-neutral-800 accent-[#3ce6ac] disabled:cursor-not-allowed"}),m.jsx("div",{className:"min-w-[52px] rounded-xl border border-neutral-800 bg-neutral-900 px-2 py-2 text-right text-[11px] font-medium text-neutral-100 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]",children:(l==null?void 0:l(u))??i})]})}function fo({options:t,value:e,disabled:n,onChange:r}){return m.jsx("div",{className:"grid min-w-0 gap-1 rounded-xl bg-neutral-900 p-1 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]",style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},children:t.map(i=>m.jsx("button",{type:"button",disabled:n,onClick:()=>r(i.value),className:`min-w-0 truncate rounded-lg px-2 py-1.5 text-[11px] font-medium transition-colors disabled:cursor-not-allowed ${i.value===e?"bg-neutral-800 text-white shadow-[0_1px_3px_rgba(0,0,0,0.28)]":"text-neutral-500 hover:text-neutral-200"}`,children:i.label},i.value))})}function Vn({label:t,value:e,disabled:n,options:r,onChange:i}){const l=e&&!r.includes(e)?[e,...r]:r;return m.jsxs("label",{className:`${Qi} flex items-center gap-3`,children:[m.jsx("span",{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500",children:t}),m.jsx("select",{value:e,disabled:n,onChange:s=>i(s.target.value),className:"min-w-0 w-full appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600",children:l.map(s=>m.jsx("option",{value:s,children:s},s))})]})}function Cr({title:t,icon:e,children:n,accessory:r,defaultCollapsed:i=!1}){const[l,s]=d.useState(i);return m.jsxs("section",{className:"min-w-0 border-t border-neutral-800/80",children:[m.jsxs("button",{type:"button",onClick:()=>s(c=>!c),className:"flex w-full items-center justify-between gap-2 px-4 py-3",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[m.jsx("span",{className:"flex-shrink-0 text-neutral-500",children:e}),m.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-neutral-300",children:t})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[r,m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",className:`flex-shrink-0 text-neutral-500 transition-transform ${l?"-rotate-90":""}`,children:m.jsx("path",{d:"M2 3l3 4 3-4z"})})]})]}),!l&&m.jsx("div",{className:"px-4 pb-4",children:n})]})}const aG=new Set(["video","audio"]);function lG(t){return aG.has(t.tagName)}function lS(t){return!Number.isFinite(t)||t<0?"0.00s":`${t.toFixed(2)}s`}function sG({projectDir:t,element:e,styles:n,onSetStyle:r,onSetAttribute:i,onSetHtmlAttribute:l}){const s=e.tagName==="video",c=e.element,u=m8(e.dataAttributes.volume??"")??1,h=Math.round(u*100),g=Number.parseFloat(e.dataAttributes["media-start"]??e.dataAttributes["playback-start"]??"0")||0,O=c.hasAttribute("loop"),x=c.hasAttribute("muted"),y=e.dataAttributes["has-audio"]==="true",v=Number.parseFloat(e.dataAttributes["playback-rate"]??"1")||1,w=n["object-fit"]||"contain",A=n["object-position"]||"center",k=Number.parseFloat(e.dataAttributes["source-duration"]??"")||c.duration||0,M=Math.max(30,Math.ceil(k||g+10)),E=c.getAttribute("src")??"",[$,C]=d.useState(!1),j=t&&E&&!E.startsWith("http")?`${t}/${E}`:E;return m.jsx(Cr,{title:s?"Video":"Audio",icon:s?m.jsx(Jw,{size:15}):m.jsx(UV,{size:15}),children:m.jsxs("div",{className:"space-y-4",children:[E&&m.jsxs("div",{className:"min-w-0",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsx("div",{className:"text-[10px] uppercase tracking-[0.12em] text-neutral-500",children:"Source"}),m.jsxs("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(j).then(()=>{C(!0),setTimeout(()=>C(!1),1500)})},className:"flex h-6 items-center gap-1 rounded-lg border border-neutral-700 bg-neutral-950 px-2 text-[10px] font-medium text-neutral-400 transition-colors hover:border-neutral-600 hover:text-neutral-200",children:[$?m.jsx(YV,{size:11}):m.jsx(tL,{size:11}),m.jsx("span",{children:$?"Copied":"Copy"})]})]}),m.jsx("div",{className:"mt-1 truncate text-[11px] font-medium text-neutral-300",title:j,children:j})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Volume"}),m.jsx(ii,{value:h,min:0,max:100,step:1,displayValue:`${h}%`,formatDisplayValue:T=>`${Math.round(T)}%`,onCommit:T=>{i("volume",Bt(T/100))}})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Playback rate"}),m.jsx(ii,{value:v*100,min:25,max:300,step:5,displayValue:`${Bt(v)}x`,formatDisplayValue:T=>`${Bt(T/100)}x`,onCommit:T=>{i("playback-rate",Bt(T/100))}})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Media start"}),m.jsx(ii,{value:Math.round(g*100),min:0,max:M*100,step:10,displayValue:lS(g),formatDisplayValue:T=>lS(T/100),onCommit:T=>{i("media-start",(T/100).toFixed(2))}})]}),m.jsxs("div",{className:qn,children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Loop"}),m.jsx(fo,{value:O?"on":"off",onChange:T=>{l("loop",T==="on"?"true":null)},options:[{label:"On",value:"on"},{label:"Off",value:"off"}]})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Muted"}),m.jsx(fo,{value:x?"on":"off",onChange:T=>{l("muted",T==="on"?"true":null)},options:[{label:"On",value:"on"},{label:"Off",value:"off"}]})]})]}),s&&m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Has audio track"}),m.jsx(fo,{value:y?"yes":"no",onChange:T=>{T==="yes"?(i("has-audio","true"),l("muted",null)):(i("has-audio",""),l("muted","true"))},options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]})]}),s&&m.jsx(m.Fragment,{children:m.jsxs("div",{className:qn,children:[m.jsx(Vn,{label:"Fit",value:w,onChange:T=>{r("object-fit",T)},options:["contain","cover","fill","none","scale-down"]}),m.jsx(Vn,{label:"Position",value:A,onChange:T=>{r("object-position",T)},options:["center","top","bottom","left","right","left top","right top","left bottom","right bottom"]})]})})]})})}function w2(t,e,n){return Math.max(e,Math.min(n,t))}function oG(t,e,n,r){const s=Math.max(12,e.width-n.width-12),c=t.left+t.width/2-n.width/2,u=w2(c,12,s),h=t.bottom+8,g=t.top-n.height-8,O=h+n.height<=e.height-12,x=g>=12;return O||!x?{left:u,top:w2(h,12,Math.max(12,e.height-n.height-12)),placement:"bottom"}:{left:u,top:w2(g,12,Math.max(12,e.height-n.height-12)),placement:"top"}}const sS={width:292,height:386};function oS({label:t,value:e,min:n,max:r,step:i,displayValue:l,background:s,thumbColor:c,disabled:u,onCommit:h}){const g=d.useRef(null),O=(e-n)/(r-n)*100,x=v=>{var M;const w=(M=g.current)==null?void 0:M.getBoundingClientRect();if(!w||w.width<=0)return;const A=n+(v-w.left)/w.width*(r-n),k=Math.round(A/i)*i;h(Math.max(n,Math.min(r,k)))},y=v=>{h(Math.max(n,Math.min(r,v)))};return m.jsxs("div",{className:"grid gap-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:Kt,children:t}),m.jsx("span",{className:"text-[10px] font-medium text-neutral-400",children:l})]}),m.jsx("div",{ref:g,role:"slider",tabIndex:u?-1:0,"aria-label":t,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":e,"aria-disabled":u,className:`relative h-4 rounded-full border border-neutral-700 shadow-[inset_0_1px_2px_rgba(0,0,0,0.55)] outline-none focus:border-[#f5a400] focus:ring-2 focus:ring-[#f5a400]/40 ${u?"cursor-not-allowed opacity-50":"cursor-ew-resize"}`,style:{background:s},onPointerDown:v=>{u||(v.currentTarget.setPointerCapture(v.pointerId),x(v.clientX))},onPointerUp:v=>{v.currentTarget.blur()},onPointerMove:v=>{u||v.buttons!==1||x(v.clientX)},onKeyDown:v=>{u||(v.key==="ArrowRight"||v.key==="ArrowUp"?(v.preventDefault(),y(e+i)):v.key==="ArrowLeft"||v.key==="ArrowDown"?(v.preventDefault(),y(e-i)):v.key==="Home"?(v.preventDefault(),y(n)):v.key==="End"&&(v.preventDefault(),y(r)))},children:m.jsx("div",{className:"pointer-events-none absolute top-1/2 h-6 w-6 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.85),0_6px_14px_rgba(0,0,0,0.5)]",style:{left:`${Math.max(0,Math.min(100,O))}%`,backgroundColor:c}})})]})}function iu({label:t,value:e,disabled:n,onCommit:r}){const i=d.useRef(null),l=d.useRef(null),[s,c]=d.useState(!1),[u,h]=d.useState(null),[g,O]=d.useState(()=>S2(e)),[x,y]=d.useState(()=>b2(S2(e)).toUpperCase()),v=zq(g),w=uf({...Kv({hue:v.hue,saturation:1,value:1}),alpha:1}),A=uf({...g,alpha:1}),k=uf(g),M=Math.round(v.saturation*100),E=Math.round(v.value*100),$=Math.round(g.alpha*100);d.useEffect(()=>{const z=S2(e);O(z),y(b2(z).toUpperCase())},[e]);const C=d.useCallback(()=>{var U,K;const z=(U=i.current)==null?void 0:U.getBoundingClientRect();if(!z)return;const I=(K=l.current)==null?void 0:K.getBoundingClientRect();h(oG(z,{width:window.innerWidth,height:window.innerHeight},{width:(I==null?void 0:I.width)||sS.width,height:(I==null?void 0:I.height)||sS.height}))},[]);d.useLayoutEffect(()=>{if(!s)return;C();const z=()=>C();return window.addEventListener("resize",z),window.addEventListener("scroll",z,!0),()=>{window.removeEventListener("resize",z),window.removeEventListener("scroll",z,!0)}},[s,C]),d.useEffect(()=>{if(!s)return;const z=U=>{var H,q;const K=U.target;K&&((H=l.current)!=null&&H.contains(K)||(q=i.current)!=null&&q.contains(K)||c(!1))},I=U=>{U.key==="Escape"&&c(!1)};return document.addEventListener("pointerdown",z),document.addEventListener("keydown",I),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("keydown",I)}},[s]);const j=z=>{O(z),y(b2(z).toUpperCase()),r(uf(z))},T=z=>{const I=Kv({hue:z.hue??v.hue,saturation:z.saturation??v.saturation,value:z.value??v.value});j({...I,alpha:g.alpha})},N=(z,I,U)=>{const K=U.getBoundingClientRect(),H=Math.max(0,Math.min(1,(z-K.left)/K.width)),q=Math.max(0,Math.min(1,1-(I-K.top)/K.height));T({saturation:H,value:q})},R=z=>{y(z);const I=z.trim().startsWith("#")?z.trim():`#${z.trim()}`,U=VM(I);U&&j({...U,alpha:g.alpha})},D=s?w8.createPortal(m.jsxs("div",{ref:l,className:"fixed z-[9999] w-[292px] overflow-hidden rounded-2xl border border-neutral-700 bg-neutral-950 shadow-2xl shadow-black/50",style:{left:(u==null?void 0:u.left)??-9999,top:(u==null?void 0:u.top)??-9999},children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-800 px-3 py-2",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"truncate text-[11px] font-medium text-neutral-100",children:t}),m.jsx("div",{className:"text-[9px] uppercase tracking-[0.16em] text-neutral-600",children:"Color"})]}),m.jsx("button",{type:"button",onClick:()=>c(!1),className:"flex h-7 w-7 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-neutral-900 hover:text-neutral-200","aria-label":"Close color picker",children:m.jsx(Cd,{size:13})})]}),m.jsxs("div",{className:"space-y-3 p-3",children:[m.jsxs("div",{className:"relative h-36 cursor-crosshair overflow-hidden rounded-xl border border-neutral-700 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]",style:{backgroundColor:w},onPointerDown:z=>{z.currentTarget.setPointerCapture(z.pointerId),N(z.clientX,z.clientY,z.currentTarget)},onPointerMove:z=>{z.buttons===1&&N(z.clientX,z.clientY,z.currentTarget)},children:[m.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-white to-transparent"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black to-transparent"}),m.jsx("div",{className:"pointer-events-none absolute top-0 h-full w-px -translate-x-1/2 bg-white/70 shadow-[0_0_0_1px_rgba(0,0,0,0.45)] mix-blend-difference",style:{left:`${v.saturation*100}%`}}),m.jsx("div",{className:"pointer-events-none absolute left-0 h-px w-full -translate-y-1/2 bg-white/70 shadow-[0_0_0_1px_rgba(0,0,0,0.45)] mix-blend-difference",style:{top:`${(1-v.value)*100}%`}}),m.jsx("div",{className:"pointer-events-none absolute h-6 w-6 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.85),0_8px_18px_rgba(0,0,0,0.45)]",style:{left:`${v.saturation*100}%`,top:`${(1-v.value)*100}%`,backgroundColor:A}})]}),m.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[m.jsx("div",{className:"h-9 w-9 flex-shrink-0 rounded-xl border border-neutral-600 shadow-[inset_0_1px_0_rgba(255,255,255,0.08)]",style:{backgroundColor:k}}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate text-[11px] font-medium text-neutral-100",children:k}),m.jsxs("div",{className:"mt-0.5 text-[9px] uppercase tracking-[0.12em] text-neutral-600",children:["S ",M,"% · B ",E,"% · A ",$,"%"]})]})]}),m.jsx(oS,{label:"Hue",value:v.hue,min:0,max:360,step:1,displayValue:`${Math.round(v.hue)}°`,background:"linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)",thumbColor:w,disabled:n,onCommit:z=>T({hue:z})}),m.jsx(oS,{label:"Alpha",value:g.alpha,min:0,max:1,step:.01,displayValue:`${$}%`,background:`linear-gradient(90deg, transparent, ${A})`,thumbColor:k,disabled:n,onCommit:z=>j({...g,alpha:z})}),m.jsxs("label",{className:"grid gap-1.5",children:[m.jsx("span",{className:Kt,children:"Hex"}),m.jsx("input",{value:x,onChange:z=>R(z.target.value),className:`${Qi} h-10 w-full text-[11px] font-medium outline-none`,spellCheck:!1})]})]})]}),document.body):null,V=()=>{n||(c(z=>!z),s||requestAnimationFrame(C))};return m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:t}),m.jsxs("button",{type:"button",disabled:n,"aria-label":`Pick ${t.toLowerCase()} color`,ref:i,onClick:V,className:`${Qi} flex items-center gap-3 text-left hover:border-neutral-700 disabled:cursor-not-allowed ${s?"border-neutral-600":""}`,children:[m.jsx("div",{className:"relative h-7 w-7 flex-shrink-0 overflow-hidden rounded-lg border border-neutral-700 bg-neutral-950 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]",style:{backgroundColor:e||"transparent"}}),m.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-neutral-100",children:e})]}),D]})}function cG(t){const e=[];let n="",r=null;for(const i of t){if((i==='"'||i==="'")&&!r){r=i;continue}if(i===r){r=null;continue}if(i===","&&!r){n.trim()&&e.push(n.trim()),n="";continue}n+=i}return n.trim()&&e.push(n.trim()),e.map(i=>i.replace(/^["']|["']$/g,"").trim()).filter(Boolean)}function uG(t){return cG(t)[0]??"inherit"}function fG(t){const e=t.trim();return L6.has(e.toLowerCase())?e:`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function k2(t){const e=t.trim();return e?L6.has(e.toLowerCase())?e:`${fG(e)}, ui-sans-serif, system-ui, sans-serif`:"inherit"}function dG(){if(typeof document>"u")return[];const t=document.fonts;return t?Array.from(t,e=>e.family.replace(/^["']|["']$/g,"").trim()).filter(Boolean).sort((e,n)=>e.localeCompare(n)):[]}function cS(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"")}function hG(t,e){const n=e.trim().toLowerCase();return!n||t.toLowerCase().includes(n)?!0:cS(t).includes(cS(n))}function uS(t){if(typeof document>"u")return;const e=t.trim();if(!e)return;const n=`studio-google-font-${e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(document.getElementById(n))return;if(!document.querySelector('link[data-studio-google-font-preconnect="true"]')){const l=document.createElement("link");l.setAttribute("data-studio-google-font-preconnect","true"),l.rel="preconnect",l.href="https://fonts.gstatic.com",l.crossOrigin="anonymous",document.head.appendChild(l)}const i=document.createElement("link");i.id=n,i.rel="stylesheet",i.href=_w(e),document.head.appendChild(i)}function df(t){if(typeof document>"u")return;const e=`studio-imported-font-${t.family.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;if(document.getElementById(e))return;const n=document.createElement("style");n.id=e,n.textContent=j8(t),document.head.appendChild(n)}function mG({value:t,disabled:e,importedFonts:n,onImportFonts:r,onCommit:i}){const l=uG(t),s=d.useRef(null),c=d.useRef(null),u=d.useRef(null),[h,g]=d.useState(!1),[O,x]=d.useState(""),[y,v]=d.useState([]),[w,A]=d.useState([]),[k,M]=d.useState(()=>[...Gy]),[E,$]=d.useState(!1),[C,j]=d.useState(!1),[T,N]=d.useState(!1),[R,D]=d.useState(null),V=typeof window<"u"&&typeof window.queryLocalFonts=="function";d.useEffect(()=>{if(!h)return;const F=P=>{var L;const Z=P.target;Z instanceof Node&&((L=s.current)!=null&&L.contains(Z)||g(!1))};return document.addEventListener("pointerdown",F),()=>document.removeEventListener("pointerdown",F)},[h]),d.useEffect(()=>{h&&requestAnimationFrame(()=>{var F;return(F=c.current)==null?void 0:F.focus()})},[h]),d.useEffect(()=>{let F=!1;return fetch("/api/fonts").then(P=>P.ok?P.json():null).then(P=>{F||!Array.isArray(P==null?void 0:P.fonts)||v(Z=>v2([...Z,...P.fonts]))}).catch(()=>{}),()=>{F=!0}},[]),d.useEffect(()=>{let F=!1;return j(!0),fetch("/api/fonts/google").then(P=>P.ok?P.json():null).then(P=>{F||!Array.isArray(P==null?void 0:P.fonts)||M(v2([...P.fonts,...Gy]))}).catch(()=>{}).finally(()=>{F||j(!1)}),()=>{F=!0}},[]),d.useEffect(()=>{k.some(P=>P.toLowerCase()===l.toLowerCase())&&uS(l);const F=n.find(P=>P.family.toLowerCase()===l.toLowerCase());F&&df(F)},[l,k,n]);const z=async()=>{if(!V||!window.queryLocalFonts){D("This browser does not expose installed fonts. Import a font file instead.");return}$(!0),D(null);try{const F=await window.queryLocalFonts(),P=[...F].sort((L,B)=>ff(L)-ff(B)),Z=P.map(L=>L.family).filter(L=>!!L).map(L=>go(`${L}.ttf`));A(P),v(L=>v2([...L,...Z])),D(F.length===0?"No browser-local fonts were returned.":null)}catch(F){const P=F instanceof Error?F.name:"";D(P==="NotAllowedError"?"Local font access was denied. Import a font file instead.":"Local font access is unavailable. Import a font file instead.")}finally{$(!1)}},I=async F=>{if(!(!(F!=null&&F.length)||!r)){N(!0),D(null);try{const P=await r(F);for(const L of P)df(L);const Z=P[0];Z?(i(k2(Z.family)),x(""),g(!1)):D("No supported font files were imported.")}finally{N(!1)}}},U=d.useMemo(()=>eS(n.map(F=>({family:F.family,source:"Imported"}))),[n]),K=d.useMemo(()=>{const F=dG(),P=new Set(k.map(L=>L.toLowerCase())),Z=y.map(L=>({family:L,source:P.has(L.toLowerCase())?"Google":"Local"}));return Bq(eS([{family:l,source:"Current"},...F.map(L=>({family:L,source:"Document"})),...U,...k.map(L=>({family:L,source:"Google"})),...Z,...Fq.map(L=>({family:L,source:"System"}))]))},[l,k,y,U]),H=d.useMemo(()=>{const F=K.filter(L=>hG(L.family,O));if(O.trim())return F.slice(0,200);const P=new Map;for(const L of F){const B=P.get(L.source)??[];B.push(L),P.set(L.source,B)}const Z=[];for(const L of["Current","Document","Imported"])Z.push(...P.get(L)??[]);return Z.push(...(P.get("Google")??[]).slice(0,100)),Z.push(...(P.get("Local")??[]).slice(0,80)),Z.push(...P.get("System")??[]),Z},[K,O]),q=async F=>{if(!r)return null;const Z=w.filter(re=>go(`${re.family}.ttf`)===F).sort((re,ae)=>ff(re)-ff(ae)).find(re=>typeof re.blob=="function");if(!(Z!=null&&Z.blob))return null;const L=await Z.blob(),B=Jv(Z.style??"Regular")||"Regular",J=Jv(`${F} ${B}`)||F,te=new File([L],`${J}.ttf`,{type:L.type||"font/ttf"}),Y=await r([te]);return Y.find(re=>re.family.toLowerCase()===F.toLowerCase())??Y[0]??null},X=async F=>{var te,Y;if(!r)return null;const P=await fetch(`/api/fonts/file?family=${encodeURIComponent(F)}`);if(!P.ok)return null;const Z=await P.blob(),L=((Y=(te=P.headers.get("Content-Disposition"))==null?void 0:te.match(/\.(\w+)"?$/))==null?void 0:Y[1])??"ttf",B=new File([Z],`${F}.${L}`,{type:Z.type||"font/ttf"}),J=await r([B]);return J.find(re=>re.family.toLowerCase()===F.toLowerCase())??J[0]??null},G=async F=>{if(F.source==="Local"||F.source==="System"&&!L6.has(F.family.toLowerCase())){N(!0),D(null);try{const L=F.source==="Local"?await q(F.family):await X(F.family);if(L){df(L),i(k2(L.family)),x(""),g(!1);return}}finally{N(!1)}}F.source==="Google"&&uS(F.family);const Z=n.find(L=>L.family.toLowerCase()===F.family.toLowerCase());Z&&df(Z),i(k2(F.family)),x(""),g(!1)};return m.jsxs("div",{ref:s,className:"relative grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Font family"}),m.jsxs("button",{type:"button",disabled:e,onClick:()=>g(F=>!F),className:`${Qi} flex h-10 items-center justify-between gap-3 text-left hover:border-neutral-700 disabled:cursor-not-allowed`,children:[m.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-neutral-100",style:{fontFamily:t},children:l}),m.jsx("span",{className:"flex-shrink-0 text-[10px] uppercase tracking-[0.14em] text-neutral-600",children:"Font"})]}),h&&m.jsxs("div",{className:"absolute left-0 right-0 top-[calc(100%+6px)] z-50 overflow-hidden rounded-xl border border-neutral-700 bg-neutral-950 shadow-2xl",children:[m.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_auto] gap-2 border-b border-neutral-800 p-2",children:[m.jsx("input",{ref:c,type:"text",value:O,disabled:e,placeholder:C?"Loading Google Fonts...":"Search fonts",onChange:F=>x(F.target.value),onKeyDown:F=>{F.key==="Escape"&&(F.preventDefault(),g(!1)),F.key==="Enter"&&H[0]&&(F.preventDefault(),G(H[0]))},className:"min-w-0 rounded-lg border border-neutral-800 bg-neutral-900 px-2.5 py-2 text-[11px] font-medium text-neutral-100 outline-none placeholder:text-neutral-600 focus:border-neutral-600"}),V&&m.jsx("button",{type:"button",disabled:e||E,onClick:z,className:"rounded-lg border border-neutral-700 bg-neutral-900 px-2.5 text-[10px] font-medium text-neutral-400 transition-colors hover:border-neutral-600 hover:text-neutral-100 disabled:cursor-not-allowed disabled:text-neutral-700",children:E?"...":"Local"}),m.jsx("button",{type:"button",disabled:e||T||!r,onClick:()=>{var F;return(F=u.current)==null?void 0:F.click()},className:"rounded-lg border border-neutral-700 bg-neutral-900 px-2.5 text-[10px] font-medium text-neutral-400 transition-colors hover:border-neutral-600 hover:text-neutral-100 disabled:cursor-not-allowed disabled:text-neutral-700",children:T?"...":"Import"}),m.jsx("input",{ref:u,type:"file",accept:".ttf,.otf,.ttc,.woff,.woff2,.eot,font/*",multiple:!0,"aria-label":"Import local font files",disabled:e||T||!r,className:"hidden",onChange:async F=>{await I(F.target.files),F.target.value=""}})]}),R&&m.jsx("div",{className:"border-b border-neutral-800 px-3 py-2 text-[10px] leading-4 text-neutral-500",children:R}),m.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:H.length===0?m.jsx("div",{className:"px-2 py-3 text-[11px] text-neutral-500",children:"No fonts found."}):H.map(F=>m.jsxs("button",{type:"button",onClick:()=>G(F),className:`flex w-full min-w-0 items-center justify-between gap-3 rounded-lg px-2 py-2 text-left text-[11px] transition-colors ${F.family===l?"bg-studio-accent/15 text-neutral-50":"text-neutral-300 hover:bg-neutral-900 hover:text-neutral-100"}`,children:[m.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[m.jsx("span",{className:"truncate font-medium",children:F.family}),Uy(F.family)&&m.jsxs("span",{className:"flex-shrink-0 text-[9px] text-neutral-500",children:["→ ",Uy(F.family)]})]}),m.jsx("span",{className:"flex-shrink-0 text-[9px] uppercase tracking-[0.14em] text-neutral-600",children:F.source})]},`${F.source}-${F.family}`))})]})]})}const pG=["closest-side","closest-corner","farthest-side","farthest-corner"];function HM(t){return t===" "||t===`
140
- `||t==="\r"||t===" "||t==="\f"}function p8(t){return t!=null&&t>="0"&&t<="9"}function XM(t){if(!t)return!1;let e=t[0]==="-"?1:0,n=0;for(;p8(t[e]);)e+=1,n+=1;if(t[e]===".")for(e+=1;p8(t[e]);)e+=1,n+=1;return n>0&&e===t.length}function D6(t){if(!t)return null;const e=t.trim();if(!XM(e))return null;const n=Number(e);return Number.isFinite(n)?n:null}function H6(t){const e=[];let n="";for(const r of t){if(HM(r)){n&&(e.push(n),n="");continue}n+=r}return n&&e.push(n),e}function to(t,e){return H6(t.toLowerCase()).includes(e)}function vd(t,e){if(!(t!=null&&t.endsWith("%")))return e;const n=D6(t.slice(0,-1));return n==null?e:n0(n,0,100)}function zM(t){const e=t==null?void 0:t.trim().toLowerCase();return e!=null&&e.endsWith("deg")?D6(e.slice(0,-3)):null}function gG(t){if(!t.endsWith("%"))return null;const e=t.slice(0,-1).trimEnd();let n=e.length;for(;n>0&&(p8(e[n-1])||e[n-1]===".");)n-=1;n>0&&e[n-1]==="-"&&(n-=1);const r=e.slice(n);return!XM(r)||n===0||!HM(e[n-1])?null:n}function n0(t,e,n){return Math.min(n,Math.max(e,t))}function Si(t){return Math.round(t*100)/100}function OG(t,e){const n=D6(t);return n==null?e:n0(n,0,100)}function X6(t){const e=t.trim(),n=gG(e);if(n==null)return{color:e,position:null};const r=e.slice(0,-1).trimEnd();return{color:r.slice(0,n).trim(),position:OG(r.slice(n),0)}}function Gd(t){return t.length===0?[{color:"rgba(60, 230, 172, 0.18)",position:0},{color:"rgba(255, 255, 255, 0.04)",position:100}]:t.length===1?[{color:t[0].color,position:0},{color:t[0].color,position:100}]:t.map((n,r)=>({color:n.color,position:n.position??r/(t.length-1)*100})).map(n=>({color:n.color,position:Si(n0(n.position,0,100))}))}function xG(t){const e=[];let n="",r=0;for(const i of t){if(i==="("&&(r+=1),i===")"&&(r=Math.max(0,r-1)),i===","&&r===0){n.trim()&&e.push(n.trim()),n="";continue}n+=i}return n.trim()&&e.push(n.trim()),e}function yG(t){const e=t.trim().toLowerCase(),n={"to top":0,"to top right":45,"to right top":45,"to right":90,"to bottom right":135,"to right bottom":135,"to bottom":180,"to bottom left":225,"to left bottom":225,"to left":270,"to top left":315,"to left top":315};return e in n?n[e]:null}function bG(t){const e=t[0]??"",n=yG(e),r=zM(e),i=r!=null,l=r??n??180,s=i||n!=null?t.slice(1):t;return{kind:"linear",repeating:!1,angle:l,centerX:50,centerY:50,shape:"ellipse",radialSize:"farthest-corner",stops:Gd(s.map(X6))}}function vG(t){const e=t[0]??"",n=e.toLowerCase(),r=to(n,"at")||to(n,"circle")||to(n,"ellipse")||n.includes("closest-")||n.includes("farthest-"),i=r?e:"",l=r?t.slice(1):t,s=i.toLowerCase(),c=H6(s),u=c.indexOf("at"),h=to(s,"circle")?"circle":"ellipse",g=pG.find(O=>c.includes(O))??"farthest-corner";return{kind:"radial",repeating:!1,angle:180,centerX:vd(c[u+1],50),centerY:vd(c[u+2],50),shape:h,radialSize:g,stops:Gd(l.map(X6))}}function SG(t){const e=t[0]??"",n=e.toLowerCase(),r=to(n,"from")||to(n,"at"),i=r?e:"",l=r?t.slice(1):t,s=H6(i.toLowerCase()),c=s.indexOf("from"),u=s.indexOf("at");return{kind:"conic",repeating:!1,angle:zM(s[c+1])??0,centerX:vd(s[u+1],50),centerY:vd(s[u+2],50),shape:"ellipse",radialSize:"farthest-corner",stops:Gd(l.map(X6))}}function g8(t){return{kind:"linear",repeating:!1,angle:135,centerX:50,centerY:50,shape:"ellipse",radialSize:"farthest-corner",stops:Gd([{color:t&&t!=="transparent"?t:"rgba(60, 230, 172, 0.18)",position:0},{color:"rgba(255, 255, 255, 0.04)",position:100}])}}function wG(t){if(!t||t==="none")return null;const e=t.trim(),n=e.indexOf("(");if(n<=0||!e.endsWith(")"))return null;const r=e.slice(0,n).toLowerCase(),l={"linear-gradient":{kind:"linear",repeating:!1},"radial-gradient":{kind:"radial",repeating:!1},"conic-gradient":{kind:"conic",repeating:!1},"repeating-linear-gradient":{kind:"linear",repeating:!0},"repeating-radial-gradient":{kind:"radial",repeating:!0},"repeating-conic-gradient":{kind:"conic",repeating:!0}}[r];if(!l)return null;const{kind:s,repeating:c}=l,u=xG(e.slice(n+1,-1));return{...s==="linear"?bG(u):s==="radial"?vG(u):SG(u),repeating:c}}function kG(t){return`${t.color} ${Si(t.position)}%`}function Sd(t){const e=`${t.repeating?"repeating-":""}${t.kind}-gradient`,n=t.stops.map(kG).join(", ");return t.kind==="linear"?`${e}(${Si(t.angle)}deg, ${n})`:t.kind==="radial"?`${e}(${t.shape} ${t.radialSize} at ${Si(t.centerX)}% ${Si(t.centerY)}%, ${n})`:`${e}(from ${Si(t.angle)}deg at ${Si(t.centerX)}% ${Si(t.centerY)}%, ${n})`}function A2(t,e,n){return Math.round(t+(e-t)*n)}function M2(t){return t.toString(16).padStart(2,"0")}function AG(t,e){var A;const n=n0(e,0,100),r=[...t.stops].sort((k,M)=>k.position-M.position),i=r.find(k=>Math.abs(k.position-n)<.001);if(i)return i.color;const l=r.find(k=>k.position>n)??r.at(-1),s=[...r].reverse().find(k=>k.position<n)??r[0];if(!s||!l)return((A=r[0])==null?void 0:A.color)??"rgba(255, 255, 255, 1)";if(s===l)return s.color;const c=s.color,u=l.color,h=c?dS(c):null,g=u?dS(u):null;if(!h||!g)return s.color;const O=(n-s.position)/Math.max(1,l.position-s.position),x=A2(h.red,g.red,O),y=A2(h.green,g.green,O),v=A2(h.blue,g.blue,O),w=Si(h.alpha+(g.alpha-h.alpha)*O);return w>=1?`#${M2(x)}${M2(y)}${M2(v)}`.toUpperCase():`rgba(${x}, ${y}, ${v}, ${w})`}function fS(t,e){const n=Si(n0(e,0,100)),r=AG(t,n),i=[...t.stops,{color:r,position:n}].sort((l,s)=>l.position-s.position);return{...t,stops:i}}function dS(t){const e=t.trim().toLowerCase();if(e==="transparent")return{red:0,green:0,blue:0,alpha:0};const n=e.match(/^#([0-9a-f]{6})$/i);if(n)return{red:Number.parseInt(n[1].slice(0,2),16),green:Number.parseInt(n[1].slice(2,4),16),blue:Number.parseInt(n[1].slice(4,6),16),alpha:1};const r=e.match(/^rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)(?:\s*,\s*([0-9.]+))?\s*\)$/i);return r?{red:Number.parseFloat(r[1]),green:Number.parseFloat(r[2]),blue:Number.parseFloat(r[3]),alpha:r[4]!=null?Number.parseFloat(r[4]):1}:null}function Qu(t){const e=t.trim(),n=/^[a-z]+:\/\//i.test(e)?new URL(e).pathname:e;return decodeURIComponent(n).replace(/\\/g,"/").replace(/^\.?\//,"")}function MG(t,e){const n=Qu(t).split("/").filter(Boolean),r=Qu(e).split("/").filter(Boolean);for(n.pop();n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return[...n.map(()=>".."),...r].join("/")||e}function hS(t){return Qu(t)}function CG(t,e,n){const r=Qu(t);if(!r)return null;for(const i of n){const l=Qu(i),s=MG(e,i);if(r===l||r===s||r.endsWith(`/${l}`)||r.endsWith(`/${s}`))return i}return null}function EG({projectId:t,sourceFile:e,value:n,assets:r,disabled:i,onCommit:l,onImportAssets:s}){const c=d.useRef(null),[u,h]=d.useState(!1),g=d.useMemo(()=>r.filter(v=>uu.test(v)),[r]),O=d.useMemo(()=>CG(n,e,g),[g,e,n]),x=O?"":n,y=async v=>{if(!(!(v!=null&&v.length)||!s)){h(!0);try{const A=(await s(v)).find(k=>uu.test(k));A&&l(`url("${hS(A)}")`)}finally{h(!1)}}};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[m.jsx("span",{className:Kt,children:"Project asset"}),m.jsxs("button",{type:"button",disabled:i||u,onClick:()=>{var v;return(v=c.current)==null?void 0:v.click()},className:`inline-flex h-7 max-w-full items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors ${i||u?"cursor-not-allowed text-neutral-600":"cursor-pointer hover:border-neutral-600 hover:text-white"}`,children:[m.jsx(Y8,{size:12,className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:u?"Uploading…":"Upload image"})]}),m.jsx("input",{ref:c,type:"file",accept:"image/*","aria-label":"Upload image asset",disabled:i||u,className:"hidden",onChange:async v=>{await y(v.target.files),v.target.value=""}})]}),g.length>0?m.jsxs("div",{className:"space-y-3",children:[O&&m.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-800 bg-neutral-900/80",children:m.jsx("img",{src:`/api/projects/${t}/preview/${O}`,alt:O.split("/").pop()??O,className:"h-28 w-full object-contain bg-neutral-950/80"})}),m.jsx("div",{className:Qi,children:m.jsxs("select",{value:O??"",disabled:i,onChange:v=>{const w=v.target.value;if(!w){l("none");return}l(`url("${hS(w)}")`)},className:"min-w-0 w-full appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600",children:[m.jsx("option",{value:"",children:"None"}),g.map(v=>m.jsx("option",{value:v,children:v},v))]})})]}):m.jsx("div",{className:"rounded-xl border border-dashed border-neutral-800 bg-neutral-900/50 px-3 py-3 text-[11px] leading-5 text-neutral-500",children:"No image assets yet. Upload one here and Studio will also add it to the Assets tab."})]}),m.jsx(_6,{label:"External URL",value:x,disabled:i,onCommit:v=>l(v.trim()?`url("${v.trim()}")`:"none")})]})}function TG({value:t,fallbackColor:e,disabled:n,onCommit:r}){const i=d.useRef(null),l=wG(t)??g8(e),s=x=>r(Sd(x)),c=x=>s({...l,...x}),u=(x,y)=>{const v=l.stops.map((w,A)=>A===x?{...w,...y}:w);s({...l,stops:v})},h=x=>{var v,w;const y=x!=null?fS(l,x):fS(l,((v=l.stops.at(-1))==null?void 0:v.position)!=null?Math.min(100,(((w=l.stops.at(-1))==null?void 0:w.position)??90)+10):100);s(y)},g=x=>{l.stops.length<=2||s({...l,stops:l.stops.filter((y,v)=>v!==x)})},O={backgroundImage:Sd(l)};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:`${Qi} space-y-3 p-3`,children:[m.jsx("div",{ref:i,className:"relative h-11 overflow-hidden rounded-lg border border-neutral-700",style:O,onClick:x=>{var v;if(n)return;const y=(v=i.current)==null?void 0:v.getBoundingClientRect();!y||y.width<=0||h((x.clientX-y.left)/y.width*100)},children:l.stops.map((x,y)=>m.jsx("div",{className:"absolute top-1/2 h-4 w-4 -translate-y-1/2 rounded-full border-2 border-white/90 shadow-[0_0_0_1px_rgba(0,0,0,0.35)]",style:{left:`calc(${x.position}% - 8px)`,backgroundColor:x.color}},`stop-preview-${y}`))}),m.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[m.jsx(fo,{disabled:n,value:l.kind,onChange:x=>c({kind:x}),options:[{label:"Linear",value:"linear"},{label:"Radial",value:"radial"},{label:"Conic",value:"conic"}]}),m.jsxs("label",{className:"flex items-center gap-2 text-[11px] font-medium text-neutral-400",children:[m.jsx("input",{type:"checkbox",checked:l.repeating,disabled:n,onChange:x=>c({repeating:x.target.checked}),className:"h-4 w-4 rounded border-neutral-700 bg-neutral-950 text-[#3ce6ac] focus:ring-[#3ce6ac]"}),"Repeat"]}),m.jsxs("button",{type:"button",disabled:n,onClick:()=>s({...l,stops:[...l.stops].reverse().map(x=>({...x,position:100-x.position}))}),className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:text-neutral-600",children:[m.jsx(q8,{size:12}),"Reverse"]})]})]}),(l.kind==="linear"||l.kind==="conic")&&m.jsxs("div",{className:"grid gap-1.5",children:[m.jsx("span",{className:Kt,children:l.kind==="linear"?"Angle":"Start angle"}),m.jsx(ii,{value:l.angle,min:0,max:360,step:1,disabled:n,displayValue:`${Math.round(l.angle)}°`,formatDisplayValue:x=>`${Math.round(x)}°`,onCommit:x=>c({angle:x})})]}),l.kind==="radial"&&m.jsxs("div",{className:qn,children:[m.jsx(Vn,{label:"Shape",value:l.shape,disabled:n,onChange:x=>c({shape:x}),options:["ellipse","circle"]}),m.jsx(Vn,{label:"Size",value:l.radialSize,disabled:n,onChange:x=>c({radialSize:x}),options:["closest-side","closest-corner","farthest-side","farthest-corner"]})]}),(l.kind==="radial"||l.kind==="conic")&&m.jsxs("div",{className:qn,children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Center X"}),m.jsx(ii,{value:l.centerX,min:0,max:100,step:1,disabled:n,displayValue:`${Math.round(l.centerX)}%`,formatDisplayValue:x=>`${Math.round(x)}%`,onCommit:x=>c({centerX:x})})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Center Y"}),m.jsx(ii,{value:l.centerY,min:0,max:100,step:1,disabled:n,displayValue:`${Math.round(l.centerY)}%`,formatDisplayValue:x=>`${Math.round(x)}%`,onCommit:x=>c({centerY:x})})]})]}),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:Kt,children:"Stops"}),m.jsxs("button",{type:"button",disabled:n||l.stops.length>=6,onClick:()=>h(),className:"inline-flex h-7 items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:text-neutral-600",children:[m.jsx(Y8,{size:12}),"Add stop"]})]}),m.jsx("div",{className:"space-y-3",children:l.stops.map((x,y)=>m.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_68px_28px] gap-2",children:[m.jsx(iu,{label:`Stop ${y+1}`,value:x.color,disabled:n,onCommit:v=>u(y,{color:v})}),m.jsx(_6,{label:"Pos",value:`${Math.round(x.position)}%`,disabled:n,onCommit:v=>u(y,{position:Number.parseFloat(v.replace("%",""))||0})}),m.jsx("button",{type:"button",disabled:n||l.stops.length<=2,onClick:()=>g(y),className:"mt-[22px] flex h-10 items-center justify-center rounded-lg border border-neutral-700 bg-neutral-950 text-neutral-400 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:text-neutral-700","aria-label":`Remove stop ${y+1}`,children:m.jsx(Cd,{size:12})})]},`stop-editor-${y}`))})]})]})}function $G({projectId:t,element:e,styles:n,assets:r,onSetStyle:i,onImportAssets:l}){const s=!e.capabilities.canEditStyles,c=n.display==="flex"||n.display==="inline-flex",u=m8(n["border-radius"])??0,h=Math.round((m8(n.opacity)??1)*100),g=ta(n["border-width"]??"")??ta(n["border-top-width"]??"")??0,O=n.background!=null&&n.background!=="none"&&n.background!==""||n["background-color"]!=null&&n["background-color"]!=="transparent"&&n["background-color"]!=="rgba(0, 0, 0, 0)"&&n["background-color"]!==""||n["background-image"]!=null&&n["background-image"]!=="none"&&n["background-image"]!==""||g>0,x=n["border-style"]||n["border-top-style"]||"none",y=n["border-color"]||n["border-top-color"]||"rgba(255, 255, 255, 0.18)",v=Gq(n["box-shadow"]),w=rS(n.filter,"blur"),A=rS(n["backdrop-filter"],"blur"),k=n["clip-path"]||"none",M=Wq(k),E=Kq(k),$=n["background-image"]??"none",C=z8(e),j=$&&$!=="none"?$.includes("gradient")?"Gradient":"Image":"Solid",[T,N]=d.useState(j),R=rG($);d.useEffect(()=>{N(j)},[j,e.id,e.selector,$]);const D=V=>{if(N(V),V==="Solid"){i("background-image","none");return}V==="Gradient"&&!$.includes("gradient")&&i("background-image",Sd(g8(n["background-color"])))};return m.jsxs(m.Fragment,{children:[c&&m.jsx(Cr,{title:"Flex",icon:m.jsx(Df,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(fo,{disabled:s,value:n["flex-direction"]||"row",onChange:V=>i("flex-direction",V),options:[{label:"→ Row",value:"row"},{label:"↓ Column",value:"column"}]}),m.jsxs("div",{className:qn,children:[m.jsx(Vn,{label:"Justify",value:n["justify-content"]||"flex-start",disabled:s,onChange:V=>i("justify-content",V),options:["flex-start","center","space-between","space-around","space-evenly","flex-end"]}),m.jsx(Vn,{label:"Align",value:n["align-items"]||"stretch",disabled:s,onChange:V=>i("align-items",V),options:["stretch","flex-start","center","flex-end","baseline"]})]}),m.jsx(_6,{label:"Gap",value:n.gap??"0px",disabled:s,onCommit:V=>i("gap",V.endsWith("px")?V:`${V}px`)})]})}),O&&m.jsx(Cr,{title:"Radius",icon:m.jsx(iL,{size:15}),defaultCollapsed:!0,children:m.jsx(ii,{value:u,min:0,max:Math.max(240,Math.ceil(u)),step:1,disabled:s,displayValue:`${Bt(u)}px`,formatDisplayValue:V=>`${Bt(V)}px`,onCommit:V=>i("border-radius",`${Bt(V)}px`)})}),m.jsx(Cr,{title:"Stroke",icon:m.jsx(KV,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:qn,children:[m.jsx(An,{label:"Width",value:zl(g),disabled:s,liveCommit:!0,onCommit:async V=>{const z=Iq(V,{min:0,max:200,fallback:g});if(z)for(const[I,U]of Jq(z,x))await i(I,U)}}),m.jsx(Vn,{label:"Style",value:x,disabled:s,onChange:async V=>{for(const[z,I]of eG(V,zl(g)))await i(z,I)},options:["none","solid","dashed","dotted","double","hidden","groove","ridge","inset","outset"]})]}),m.jsx(iu,{label:"Stroke color",value:y,disabled:s,onCommit:V=>i("border-color",V)})]})}),m.jsx(Cr,{title:"Effects",icon:m.jsx(I8,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(Vn,{label:"Shadow",value:v,disabled:s,onChange:V=>{V!=="custom"&&i("box-shadow",Uq(V,n["box-shadow"]))},options:["custom","none","soft","lift","glow"]}),m.jsxs("div",{className:qn,children:[m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Layer blur"}),m.jsx(ii,{value:w,min:0,max:Math.max(40,Math.ceil(w)),step:1,disabled:s,displayValue:`${Bt(w)}px`,formatDisplayValue:V=>`${Bt(V)}px`,onCommit:V=>i("filter",iS(n.filter,"blur",V))})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Backdrop"}),m.jsx(ii,{value:A,min:0,max:Math.max(60,Math.ceil(A)),step:1,disabled:s,displayValue:`${Bt(A)}px`,formatDisplayValue:V=>`${Bt(V)}px`,onCommit:V=>i("backdrop-filter",iS(n["backdrop-filter"],"blur",V))})]})]})]})}),m.jsx(Cr,{title:"Clip",icon:m.jsx(Df,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:qn,children:[m.jsx(Vn,{label:"Overflow",value:n.overflow||"visible",disabled:s,onChange:V=>i("overflow",V),options:["visible","hidden","clip","auto","scroll"]}),m.jsx(Vn,{label:"Mask",value:M,disabled:s,onChange:V=>{V!=="custom"&&i("clip-path",tG(V,u,k))},options:["custom","none","inset","circle"]})]}),m.jsxs("div",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:"Mask inset"}),m.jsx(ii,{value:E,min:0,max:Math.max(120,Math.ceil(E)),step:1,disabled:s,displayValue:`${Bt(E)}px`,formatDisplayValue:V=>`${Bt(V)}px`,onCommit:V=>i("clip-path",nG(V,u))})]})]})}),m.jsx(Cr,{title:"Transparency",icon:m.jsx(Kw,{size:15}),defaultCollapsed:!0,children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(ii,{value:h,min:0,max:100,step:1,disabled:s,displayValue:`${h}%`,formatDisplayValue:V=>`${Math.round(V)}%`,onCommit:V=>i("opacity",Bt(V/100))}),m.jsx(Vn,{label:"Mode",value:n["mix-blend-mode"]||"normal",disabled:s,onChange:V=>i("mix-blend-mode",V),options:["normal","multiply","screen","overlay","darken","lighten"]})]})}),m.jsx(Cr,{title:"Fill",icon:m.jsx(WV,{size:15}),accessory:m.jsx("div",{className:"rounded-full border border-neutral-700 bg-neutral-900 px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.16em] text-neutral-400",children:T}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(fo,{disabled:s,value:T,onChange:D,options:[{label:"Solid",value:"Solid"},{label:"Gradient",value:"Gradient"},{label:"Image",value:"Image"}]}),T==="Solid"?m.jsx(iu,{label:"Fill color",value:n["background-color"]??"transparent",disabled:s,onCommit:V=>i("background-color",V)}):T==="Gradient"?m.jsx(TG,{value:$!=="none"?$:Sd(g8(n["background-color"])),fallbackColor:n["background-color"],disabled:s,onCommit:V=>i("background-image",V)}):m.jsx(EG,{projectId:t,sourceFile:e.sourceFile,value:R,assets:r,disabled:s,onCommit:V=>i("background-image",V),onImportAssets:l}),!C&&m.jsx(iu,{label:"Text color",value:n.color??"rgb(0, 0, 0)",disabled:s,onCommit:V=>i("color",V)})]})})]})}function FM(t){const e=t.trim().replace(/\s+/g," ");return e.length<=56?e:`${e.slice(0,55)}…`}function BM(t,e){return t.computedStyles.color||e.color||"rgb(0, 0, 0)"}function Dc(t,e,n,r){return t.computedStyles[n]||e[n]||r}const Ic=["100","200","300","400","500","600","700","800","900"],jG={100:"100 · Thin",200:"200 · Extra Light",300:"300 · Light",400:"400 · Regular",500:"500 · Medium",600:"600 · Semi Bold",700:"700 · Bold",800:"800 · Extra Bold",900:"900 · Black"};function PG(t){var i;const e=document.fonts;if(!e)return Ic;const n=(i=t.split(",")[0])==null?void 0:i.trim().replace(/['"]/g,"");if(!n)return Ic;const r=[];for(const l of Ic)e.check(`${l} 16px "${n}"`)&&r.push(l);return r.length>0?r:Ic}function QG({label:t,value:e,disabled:n,autoFocus:r,onCommit:i}){const[l,s]=d.useState(e),c=d.useRef(null),u=d.useRef(null),h=d.useRef(!1),g=d.useRef(e);g.current=e,d.useEffect(()=>{h.current||s(e)},[e]),d.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]),d.useEffect(()=>{var y;r&&((y=c.current)==null||y.focus())},[r]);const O=y=>{u.current&&clearTimeout(u.current),y!==g.current&&i(y)},x=y=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{y!==g.current&&i(y)},120)};return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:Kt,children:t}),m.jsx("div",{className:Qi,children:m.jsx("textarea",{ref:c,value:l,disabled:n,rows:4,onFocus:()=>{h.current=!0},onChange:y=>{s(y.target.value),x(y.target.value)},onBlur:()=>{h.current=!1,O(l)},className:"w-full resize-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600"})})]})}function ZG({value:t,disabled:e,fontFamily:n,onCommit:r}){const i=n?PG(n):Ic,l=t&&!i.includes(t)?[t,...i]:i;return m.jsx("div",{className:Qi,children:m.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[m.jsx("span",{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500",children:"Weight"}),m.jsx("select",{value:t,disabled:e,onChange:s=>r(s.target.value),className:"min-w-0 w-full appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600",children:l.map(s=>m.jsx("option",{value:s,children:jG[s]??s},s))})]})})}function NG({field:t,inheritedStyles:e,disabled:n,onCommit:r}){return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:qn,children:[m.jsx(Vn,{label:"Line",value:Dc(t,e,"line-height","normal"),disabled:n,options:["normal","1","1.1","1.2","1.25","1.3","1.4","1.5","1.6","1.75","2"],onChange:i=>r("line-height",nS("line-height",i))}),m.jsx(Vn,{label:"Track",value:Dc(t,e,"letter-spacing","0px"),disabled:n,options:["0px","-0.05em","-0.04em","-0.03em","-0.02em","-0.01em","0em","0.01em","0.02em","0.03em","0.05em","0.1em","0.15em","0.2em"],onChange:i=>r("letter-spacing",nS("letter-spacing",i))})]}),m.jsxs("div",{className:qn,children:[m.jsx(Vn,{label:"Align",value:Dc(t,e,"text-align","start"),disabled:n,onChange:i=>r("text-align",i),options:["start","left","center","right","justify","end"]}),m.jsx(Vn,{label:"Case",value:Dc(t,e,"text-transform","none"),disabled:n,onChange:i=>r("text-transform",i),options:["none","uppercase","lowercase","capitalize"]})]}),m.jsx(Vn,{label:"Style",value:Dc(t,e,"font-style","normal"),disabled:n,onChange:i=>r("font-style",i),options:["normal","italic"]})]})}function mS({field:t,styles:e,fontAssets:n,onImportFonts:r,showRemove:i,onSetText:l,onSetTextFieldStyle:s,onRemoveTextField:c}){return m.jsxs("div",{className:"space-y-4 rounded-xl border border-neutral-800 bg-neutral-900/60 p-3",children:[m.jsxs("div",{className:i?"flex min-w-0 items-center justify-between gap-2":"min-w-0",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"truncate text-[11px] font-medium text-neutral-100",children:FM(t.value)||"Text"}),m.jsx("div",{className:"text-[10px] uppercase tracking-[0.12em] text-neutral-500",children:t.tagName})]}),i&&m.jsx("button",{type:"button",onClick:()=>c(t.key),className:"inline-flex h-7 flex-shrink-0 items-center rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white",children:"Remove"})]}),m.jsx(QG,{label:"Content",value:t.value,disabled:!1,autoFocus:i,onCommit:u=>l(u,t.key)},t.key),m.jsx(iu,{label:"Text color",value:BM(t,e),disabled:!1,onCommit:u=>s(t.key,"color",u)}),m.jsxs("div",{className:qn,children:[m.jsx(An,{label:"Size",value:t.computedStyles["font-size"]||e["font-size"]||"16px",disabled:!1,liveCommit:!0,onCommit:u=>s(t.key,"font-size",u)}),m.jsx(ZG,{value:t.computedStyles["font-weight"]||e["font-weight"]||"400",fontFamily:t.computedStyles["font-family"]||e["font-family"],disabled:!1,onCommit:u=>s(t.key,"font-weight",u)})]}),m.jsx(mG,{value:t.computedStyles["font-family"]||e["font-family"]||"inherit",disabled:!1,importedFonts:n,onImportFonts:r,onCommit:u=>s(t.key,"font-family",u)}),m.jsx(NG,{field:t,inheritedStyles:e,disabled:!1,onCommit:(u,h)=>s(t.key,u,h)})]})}function RG({element:t,styles:e,fontAssets:n,onImportFonts:r,onSetText:i,onSetTextFieldStyle:l,onAddTextField:s,onRemoveTextField:c}){var y;const u=z8(t),[h,g]=d.useState(((y=t.textFields[0])==null?void 0:y.key)??null);if(d.useEffect(()=>{const v=t.textFields;g(w=>{var A;return w&&v.some(k=>k.key===w)?w:((A=v[0])==null?void 0:A.key)??null})},[t.id,t.selector,t.textFields]),!u)return null;const O=t.textFields,x=O.find(v=>v.key===h)??O[0];return x?O.length===1?m.jsx(Cr,{title:"Text",icon:m.jsx(pb,{size:15}),children:m.jsx(mS,{field:x,styles:e,fontAssets:n,onImportFonts:r,showRemove:!1,onSetText:i,onSetTextFieldStyle:l,onRemoveTextField:c})}):m.jsx(Cr,{title:"Text",icon:m.jsx(pb,{size:15}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"grid gap-1.5",children:[m.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[m.jsx("span",{className:Kt,children:"Text layers"}),m.jsxs("button",{type:"button",onClick:()=>{Promise.resolve(s(x.key)).then(v=>{v&&g(v)})},className:"inline-flex h-7 max-w-full items-center gap-1.5 rounded-lg border border-neutral-700 bg-neutral-950 px-2.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white",children:[m.jsx(Y8,{size:12,className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:"Add text"})]})]}),m.jsx("div",{className:"grid gap-2",children:O.map((v,w)=>{const A=v.key===x.key;return m.jsx("button",{type:"button",onClick:()=>g(v.key),className:`min-w-0 w-full rounded-xl border px-3 py-2 text-left transition-colors ${A?"border-studio-accent/50 bg-studio-accent/10":"border-neutral-800 bg-neutral-900/80 hover:border-neutral-700 hover:bg-neutral-900"}`,children:m.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("span",{className:"h-4 w-4 flex-shrink-0 rounded border border-neutral-700 bg-neutral-950",style:{backgroundColor:BM(v,e)}}),m.jsx("span",{className:"min-w-0 truncate text-[11px] font-medium text-neutral-100",children:FM(v.value)||`Text ${w+1}`})]}),m.jsx("span",{className:"flex-shrink-0 rounded-md border border-neutral-700 bg-neutral-950 px-1.5 py-0.5 text-[10px] uppercase tracking-[0.12em] text-neutral-500",children:v.tagName})]})},v.key)})})]}),m.jsx(mS,{field:x,styles:e,fontAssets:n,onImportFonts:r,showRemove:!0,onSetText:i,onSetTextFieldStyle:l,onRemoveTextField:c})]})}):null}const pS=["x","y","scale","scaleX","scaleY","rotation","skewX","skewY","z","rotationX","rotationY","rotationZ","perspective","transformOrigin","opacity","visibility","autoAlpha","width","height","color","backgroundColor","borderColor","borderRadius","fontSize","letterSpacing","filter","clipPath","innerText"],VG=["none","power1.in","power1.out","power1.inOut","power2.in","power2.out","power2.inOut","power3.in","power3.out","power3.inOut","power4.in","power4.out","power4.inOut","back.in","back.out","back.inOut","elastic.in","elastic.out","elastic.inOut","bounce.in","bounce.out","bounce.inOut","expo.in","expo.out","expo.inOut","spring-gentle","spring-bouncy","spring-stiff","spring-wobbly","spring-heavy"];function gS(t,e){const n=n7[t]??"";return r7.has(t)?`${Math.round(Number(e)*100)}${n}`:`${e}${n}`}function LG(t){const e=t.ease??"none",n=mu[e]??e,r=Object.entries(t.properties),i=t.targetSelector,l=t.duration??0,s=t.position,c=typeof s=="number"?parseFloat(s.toFixed(3)):s,u=r.map(([g,O])=>`${(sl[g]??g).toLowerCase()} to ${gS(g,O)}`),h=u.length>0?u.join(", "):"no properties yet";if(t.method==="set")return`At ${c}s, instantly set ${i}'s ${h}.`;if(t.method==="from")return`Starting at ${c}s, over ${l}s, ${i} enters from ${h} using a ${n.toLowerCase()} curve.`;if(t.method==="fromTo"){const O=Object.entries(t.fromProperties??{}).map(([y,v])=>`${(sl[y]??y).toLowerCase()} ${gS(y,v)}`),x=O.length>0?O.join(", "):"—";return`Starting at ${c}s, over ${l}s, ${i} animates from [${x}] to [${h}] using a ${n.toLowerCase()} curve.`}return`Starting at ${c}s, over ${l}s, animate ${i}'s ${h} using a ${n.toLowerCase()} curve.`}function hf(t){return Math.round(t*100)/100}function _G({ease:t,duration:e,onCustomEaseCommit:n}){const r=t.startsWith("custom("),i=Wj[t],l=r?Kj(t):null,s=r&&l?[l.x1,l.y1,l.x2,l.y2]:i??null,[c,u]=d.useState(null),[h,g]=d.useState(null),O=d.useRef(null),x=d.useRef(null),y=d.useRef(0),v=d.useCallback(()=>{const P=performance.now(),Z=1e3,L=B=>{const J=Math.min((B-P)/Z,1);g(J),J<1?y.current=requestAnimationFrame(L):setTimeout(()=>g(null),400)};cancelAnimationFrame(y.current),y.current=requestAnimationFrame(L)},[]),w=c??s;if(!w)return null;const[A,k,M,E]=w,$=200,C=100,j=14,T=$-j*2,N=C-j*2,R=(P,Z)=>({x:j+T*P,y:C-j-N*Z}),D=`M${j},${C-j} C${R(A,k).x},${R(A,k).y} ${R(M,E).x},${R(M,E).y} ${$-j},${j}`;let V=j,z=C-j;if(h!==null){const P=h,Z=1-P;V=j+T*(Z*Z*Z*0+3*Z*Z*P*A+3*Z*P*P*M+P*P*P),z=C-j-N*(Z*Z*Z*0+3*Z*Z*P*k+3*Z*P*P*E+P*P*P)}const I=(P,Z)=>{Z.preventDefault(),Z.stopPropagation(),O.current=P,Z.target.setPointerCapture(Z.pointerId),c||u([A,k,M,E])},U=P=>{if(!O.current||!x.current)return;P.preventDefault();const Z=x.current.getBoundingClientRect(),L=(P.clientX-Z.left)/Z.width*$,B=(P.clientY-Z.top)/Z.height*C,J=Math.max(0,Math.min(1,(L-j)/T)),te=Math.max(-1,Math.min(2,(C-j-B)/N)),Y=c??[A,k,M,E],re=O.current==="p1"?[hf(J),hf(te),Y[2],Y[3]]:[Y[0],Y[1],hf(J),hf(te)];u(re)},K=()=>{if(!O.current||!c)return;O.current=null;const P=`M0,0 C${c[0]},${c[1]} ${c[2]},${c[3]} 1,1`;n(`custom(${P})`),u(null)},H=R(A,k),q=R(M,E),X=R(0,0),G=R(1,1),F=r?"Custom curve":mu[t]??t;return m.jsxs("div",{className:"rounded-lg bg-neutral-900/50 p-2",children:[m.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[m.jsx("span",{className:"text-[10px] font-medium text-neutral-500",children:"Speed curve"}),m.jsx("button",{type:"button",onClick:v,className:"rounded px-1.5 py-0.5 text-[10px] font-medium text-emerald-400 transition-colors hover:bg-emerald-500/10",children:h!==null?"Playing…":"Preview"})]}),m.jsx("div",{className:"overflow-hidden rounded pt-[72px] -mt-[72px]",style:{aspectRatio:`${$}/${C}`},children:m.jsxs("svg",{ref:x,width:"100%",height:"100%",viewBox:`0 0 ${$} ${C}`,preserveAspectRatio:"none",style:{overflow:"visible"},className:"touch-none select-none",onPointerMove:U,onPointerUp:K,onPointerCancel:K,children:[m.jsx("line",{x1:j,y1:C-j,x2:$-j,y2:C-j,stroke:"white",strokeOpacity:"0.06",strokeWidth:"0.5"}),m.jsx("line",{x1:j,y1:j,x2:j,y2:C-j,stroke:"white",strokeOpacity:"0.06",strokeWidth:"0.5"}),m.jsx("line",{x1:X.x,y1:X.y,x2:H.x,y2:H.y,stroke:"rgba(52,211,153,0.25)",strokeWidth:"1"}),m.jsx("line",{x1:G.x,y1:G.y,x2:q.x,y2:q.y,stroke:"rgba(52,211,153,0.25)",strokeWidth:"1"}),m.jsx("path",{d:D,fill:"none",stroke:"#34d399",strokeWidth:"2",strokeLinecap:"round"}),h!==null&&m.jsx("circle",{cx:V,cy:z,r:"4",fill:"#34d399"}),m.jsx("circle",{cx:H.x,cy:H.y,r:"5",fill:"#0a0a1a",stroke:"#34d399",strokeWidth:"2",className:"cursor-grab active:cursor-grabbing",onPointerDown:P=>I("p1",P)}),m.jsx("circle",{cx:q.x,cy:q.y,r:"5",fill:"#0a0a1a",stroke:"#34d399",strokeWidth:"2",className:"cursor-grab active:cursor-grabbing",onPointerDown:P=>I("p2",P)}),e!=null&&e>0&&m.jsxs(m.Fragment,{children:[m.jsx("text",{x:j,y:C-1,textAnchor:"start",className:"fill-neutral-600 text-[8px]",children:"0s"}),m.jsxs("text",{x:j+T/2,y:C-1,textAnchor:"middle",className:"fill-neutral-600 text-[8px]",children:[(e/2).toFixed(1),"s"]}),m.jsxs("text",{x:$-j,y:C-1,textAnchor:"end",className:"fill-neutral-600 text-[8px]",children:[e,"s"]})]})]})}),m.jsx("p",{className:"mt-1 text-center text-[10px] text-neutral-500",children:F})]})}const O8=new Set(["visibility"]),DG=new Set(["filter","clipPath"]),HG=[{label:"Blur",value:"blur(4px)"},{label:"Bright",value:"brightness(1.5)"},{label:"Gray",value:"grayscale(1)"},{label:"None",value:"none"}],XG=[{label:"Circle",value:"circle(50% at 50% 50%)"},{label:"Inset",value:"inset(10%)"},{label:"None",value:"none"}];function YM(t){return r7.has(t)}function zG(t,e){return YM(t)?String(Math.round(Math.max(0,Math.min(1,Number(e)))*100)):String(e)}function FG(t,e){if(YM(t))return String(by(t,Number(e)/100));const n=Number(e);return!Number.isNaN(n)&&i7[t]?String(by(t,n)):e}function C2({onClick:t,title:e}){return m.jsx("button",{type:"button",onClick:t,className:"flex-shrink-0 rounded p-0.5 text-neutral-600 transition-colors hover:bg-neutral-800 hover:text-red-400",title:e,children:m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:m.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})}function OS({prop:t,val:e,onCommit:n,onRemove:r,removeTitle:i}){if(O8.has(t)){const l=e==="visible"||e===1;return m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-2 px-2 py-1 rounded-lg bg-neutral-900 border border-neutral-800",children:[m.jsx("span",{className:"flex-1 text-[11px] font-medium text-neutral-500",children:sl[t]??t}),m.jsx("button",{type:"button",onClick:()=>n(l?"hidden":"visible"),className:`flex-shrink-0 w-7 h-4 rounded-full transition-colors relative ${l?"bg-emerald-500/30":"bg-neutral-700"}`,title:l?"Visible — click to hide":"Hidden — click to show",children:m.jsx("span",{className:`absolute top-0.5 h-3 w-3 rounded-full transition-transform ${l?"bg-emerald-400 translate-x-3.5":"bg-neutral-500 translate-x-0.5"}`})})]}),m.jsx(C2,{onClick:r,title:i})]})}if(DG.has(t)){const l=t==="filter"?HG:t==="clipPath"?XG:[];return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-2 px-2 py-1 rounded-lg bg-neutral-900 border border-neutral-800",children:[m.jsx("span",{className:"flex-shrink-0 text-[11px] font-medium text-neutral-500",children:sl[t]??t}),m.jsx("input",{type:"text",defaultValue:String(e),className:"flex-1 bg-transparent text-[11px] text-neutral-200 outline-none",onBlur:s=>n(s.currentTarget.value),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()}})]}),m.jsx(C2,{onClick:r,title:i})]}),l.length>0&&m.jsx("div",{className:"flex gap-1 pl-1",children:l.map(s=>m.jsx("button",{type:"button",onClick:()=>n(s.value),className:"px-1.5 py-0.5 rounded text-[9px] font-medium text-neutral-500 bg-neutral-800/50 hover:bg-neutral-800 hover:text-neutral-300 transition-colors",children:s.label},s.value))})]})}return m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"min-w-0 flex-1",children:m.jsx(An,{label:sl[t]??t,value:zG(t,e),suffix:n7[t],tooltip:Uj[t],scrub:!0,liveCommit:!0,onCommit:l=>n(FG(t,l))})}),m.jsx(C2,{onClick:r,title:i})]})}function xS({adding:t,available:e,addLabel:n,addTitle:r,onAdd:i,onOpen:l,onClose:s,buttonClassName:c}){return t&&e.length>0?m.jsxs("select",{autoFocus:!0,className:"min-w-0 rounded-lg border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-100 outline-none",defaultValue:"",onChange:u=>{u.target.value&&i(u.target.value),s()},onBlur:s,children:[m.jsx("option",{value:"",disabled:!0,children:"Choose property…"}),e.map(u=>m.jsx("option",{value:u,children:sl[u]??u},u))]}):e.length===0?null:m.jsx("button",{type:"button",onClick:l,className:c,title:r,children:n})}function E2(t){const e=Number(t);return Number.isFinite(e)?e:t}const BG=d.memo(function({animation:e,defaultExpanded:n,onUpdateProperty:r,onUpdateMeta:i,onDeleteAnimation:l,onAddProperty:s,onRemoveProperty:c,onUpdateFromProperty:u,onAddFromProperty:h,onRemoveFromProperty:g,onLivePreview:O,onLivePreviewEnd:x}){var G;const[y,v]=d.useState(n),[w,A]=d.useState(!1),[k,M]=d.useState(!1),E=d.useMemo(()=>new Set(Object.keys(e.properties)),[e.properties]),$=d.useMemo(()=>pS.filter(F=>!E.has(F)&&(e.method==="set"||!O8.has(F))),[E,e.method]),C=d.useMemo(()=>new Set(Object.keys(e.fromProperties??{})),[e.fromProperties]),j=d.useMemo(()=>pS.filter(F=>!C.has(F)&&!O8.has(F)),[C]),T=d.useCallback((F,P)=>{const Z=E2(P);r(e.id,F,Z),x==null||x()},[e.id,r,x]),N=d.useCallback((F,P)=>{O==null||O(F,E2(P))},[O]),R=d.useCallback((F,P)=>{const Z=E2(P);u==null||u(e.id,F,Z),x==null||x()},[e.id,u,x]),D=d.useCallback(F=>{const P=Number(F);Number.isFinite(P)&&P>=0&&i(e.id,{duration:Math.max(0,P)})},[e.id,i]),V=d.useCallback(F=>{const P=Number(F);Number.isFinite(P)&&P>=0&&i(e.id,{position:Math.max(0,P)})},[e.id,i]),[z,I]=d.useState(!1),U=Gj[e.method]??e.method,K=e.ease??"none",H=K.startsWith("custom(")?"Custom curve":mu[K]??K,q=typeof e.position=="number"?e.position+(e.duration??0):e.position,X=d.useMemo(()=>LG(e),[e]);return m.jsxs("div",{className:"border-b border-neutral-800 pb-3",children:[m.jsxs("button",{type:"button",onClick:()=>v(F=>!F),className:"flex w-full items-center gap-2 py-1.5",children:[m.jsx("span",{className:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-[10px] font-semibold text-emerald-400",title:t7[e.method],children:U}),m.jsxs("span",{className:"text-[11px] font-medium text-neutral-400",title:"When this effect plays",children:[typeof e.position=="number"?`${parseFloat(e.position.toFixed(3))}s`:e.position," ","– ",typeof q=="number"?`${parseFloat(q.toFixed(3))}s`:q]}),m.jsx("span",{className:"ml-auto text-[10px] text-neutral-500",title:K,children:H}),m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",className:`flex-shrink-0 text-neutral-500 transition-transform ${y?"":"-rotate-90"}`,children:m.jsx("path",{d:"M2 3l3 4 3-4z"})})]}),y&&m.jsx("div",{className:"pt-2",children:m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("p",{className:"flex-1 text-[10px] leading-relaxed text-neutral-400 italic",children:X}),m.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(X),I(!0),setTimeout(()=>I(!1),1500)},className:"flex-shrink-0 rounded px-1.5 py-0.5 text-[9px] font-medium text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",title:"Copy description to clipboard — paste into agent prompts",children:z?"Copied":"Copy"})]}),m.jsxs("div",{className:qn,children:[e.method!=="set"&&m.jsx(An,{label:"Length",value:String(Math.max(0,e.duration??0)),suffix:"s",tooltip:"How long this effect lasts",onCommit:D}),m.jsx(An,{label:"Starts at",value:typeof e.position=="string"?e.position:String(parseFloat(Math.max(0,e.position).toFixed(3))),suffix:typeof e.position=="number"?"s":void 0,tooltip:"When this effect begins on the timeline",onCommit:V})]}),e.method!=="set"&&m.jsxs(m.Fragment,{children:[m.jsx(Vn,{label:"Speed",value:(G=e.ease)!=null&&G.startsWith("custom(")?"custom":e.ease??"none",options:[...VG,"custom"],onChange:F=>{if(F==="custom"){const P=hu(e.ease??"power2.out"),Z=`M0,0 C${P.x1},${P.y1} ${P.x2},${P.y2} 1,1`;i(e.id,{ease:`custom(${Z})`})}else i(e.id,{ease:F})}}),m.jsx(_G,{ease:e.ease??"none",duration:e.duration,onCustomEaseCommit:F=>i(e.id,{ease:F})})]}),e.method==="fromTo"&&m.jsxs("div",{className:"space-y-1",children:[m.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-wider text-orange-400/70",children:"From"}),m.jsx("div",{className:"space-y-1.5",children:Object.entries(e.fromProperties??{}).map(([F,P])=>m.jsx(OS,{prop:F,val:P,onCommit:Z=>R(F,Z),onRemove:()=>g==null?void 0:g(e.id,F),removeTitle:`Remove from-${sl[F]??F}`},F))}),m.jsx("div",{className:"pt-0.5",children:m.jsx(xS,{adding:k,available:j,addLabel:"+ From property",addTitle:"Add a from-state property",onAdd:F=>h==null?void 0:h(e.id,F),onOpen:()=>M(!0),onClose:()=>M(!1),buttonClassName:"text-[11px] font-medium text-orange-400/70 transition-colors hover:text-orange-300"})})]}),e.method==="fromTo"&&Object.keys(e.properties).length>0&&m.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-wider text-emerald-400/70",children:"To"}),Object.keys(e.properties).length>0&&m.jsx("div",{className:"space-y-1.5",children:Object.entries(e.properties).map(([F,P])=>m.jsx(OS,{prop:F,val:P,onCommit:Z=>{N(F,Z),T(F,Z)},onRemove:()=>c(e.id,F),removeTitle:`Remove ${sl[F]??F}`},F))}),m.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[m.jsx(xS,{adding:w,available:$,addLabel:"+ Effect",addTitle:"Add another animated property to this effect",onAdd:F=>s(e.id,F),onOpen:()=>A(!0),onClose:()=>A(!1),buttonClassName:"text-[11px] font-medium text-neutral-400 transition-colors hover:text-neutral-200"}),m.jsx("button",{type:"button",onClick:()=>l(e.id),className:"ml-auto text-[11px] font-medium text-red-400 transition-colors hover:text-red-300",title:"Remove this animation",children:"Remove"})]})]})})]})}),YG=d.memo(function({animations:e,multipleTimelines:n,unsupportedTimelinePattern:r,onUpdateProperty:i,onUpdateMeta:l,onDeleteAnimation:s,onAddProperty:c,onRemoveProperty:u,onUpdateFromProperty:h,onAddFromProperty:g,onRemoveFromProperty:O,onAddAnimation:x,onLivePreview:y,onLivePreviewEnd:v}){const[w,A]=d.useState(!1);return m.jsxs(Cr,{title:"Animation",icon:m.jsx(Jw,{size:15}),children:[n&&m.jsx("p",{className:"mb-2 rounded-lg bg-amber-500/10 px-3 py-2 text-[11px] leading-relaxed text-amber-400",children:"This file has multiple GSAP timelines. Animation editing is disabled to prevent data loss — consolidate into a single timeline to enable editing."}),r&&m.jsx("p",{className:"mb-2 rounded-lg bg-amber-500/10 px-3 py-2 text-[11px] leading-relaxed text-amber-400",children:"This composition uses a timeline assignment pattern (window.__timelines[...]) that the editor doesn't support. Use a variable declaration (const tl = gsap.timeline()) to enable editing."}),n||r?null:m.jsxs("div",{className:"space-y-2",children:[e.map((k,M)=>m.jsx(BG,{animation:k,defaultExpanded:M===0,onUpdateProperty:i,onUpdateMeta:l,onDeleteAnimation:s,onAddProperty:c,onRemoveProperty:u,onUpdateFromProperty:h,onAddFromProperty:g,onRemoveFromProperty:O,onLivePreview:y,onLivePreviewEnd:v},k.id)),m.jsx("div",{className:"relative pt-1",children:w?m.jsxs("div",{className:"flex gap-1.5",children:[Jj.map(k=>m.jsx("button",{type:"button",title:t7[k],onClick:()=>{x(k),A(!1)},className:"rounded-lg border border-neutral-700 bg-neutral-900 px-2.5 py-1.5 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white",children:eP[k]??k},k)),m.jsx("button",{type:"button",onClick:()=>A(!1),className:"px-1.5 text-[11px] text-neutral-500 hover:text-neutral-300",children:"Cancel"})]}):m.jsx("button",{type:"button",onClick:()=>A(!0),className:"text-[11px] font-medium text-neutral-400 transition-colors hover:text-neutral-200",title:"Add a new animation effect to this element",children:"+ Add effect"})})]})]})}),IG=d.memo(function({state:e,onClick:n,title:r,size:i=10}){const l=e==="active",s=e==="ghost"?.25:e==="inactive"?.6:1,c=e==="active"?"#3b82f6":"#a3a3a3";return m.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),n()},className:"flex-shrink-0 p-0.5 transition-opacity hover:opacity-100",style:{color:c,opacity:s},title:r,children:m.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",children:m.jsx("rect",{x:"5",y:"0.7",width:"6",height:"6",rx:"1",transform:"rotate(45 5 0.7)",fill:l?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.2"})})})}),T2=.5;function qG({disabled:t}){return m.jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",style:{opacity:t?.25:1},children:m.jsx("path",{d:"M5 1L1 5L5 9",stroke:"#a3a3a3",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function GG({disabled:t}){return m.jsx("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",style:{opacity:t?.25:1},children:m.jsx("path",{d:"M1 1L5 5L1 9",stroke:"#a3a3a3",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const Fs=d.memo(function({property:e,keyframes:n,currentPercentage:r,onSeek:i,onAddKeyframe:l,onRemoveKeyframe:s,onConvertToKeyframes:c}){const u=(n==null?void 0:n.filter(v=>e in v.properties))??[],h=u.filter(v=>v.percentage<r-T2).at(-1)??null,g=u.find(v=>v.percentage>r+T2)??null,O=u.find(v=>Math.abs(v.percentage-r)<=T2)??null;let x;!n||n.length===0?x="ghost":O?x="active":u.length>0?x="inactive":x="ghost";const y=()=>{x==="ghost"?c():x==="active"?s(r):l(r)};return m.jsxs("div",{className:"flex h-5 items-center gap-0.5",children:[m.jsx("button",{type:"button",disabled:!h,onClick:()=>h&&i(h.percentage),className:"flex h-5 w-3 items-center justify-center disabled:cursor-default",children:m.jsx(qG,{disabled:!h})}),m.jsx(IG,{state:x,onClick:y,size:9,title:x==="ghost"?`Convert ${e} to keyframes`:x==="active"?`Remove ${e} keyframe`:`Add ${e} keyframe`}),m.jsx("button",{type:"button",disabled:!g,onClick:()=>g&&i(g.percentage),className:"flex h-5 w-3 items-center justify-center disabled:cursor-default",children:m.jsx(GG,{disabled:!g})})]})});function $2(t){return!Number.isFinite(t)||t<0?"0.00s":`${t.toFixed(2)}s`}function j2(t){const e=t.replace(/s$/i,"").trim(),n=Number.parseFloat(e);return Number.isFinite(n)&&n>=0?n:null}function UG({element:t,onSetAttribute:e}){const n=Number.parseFloat(t.dataAttributes.start??"0")||0,r=Number.parseFloat(t.dataAttributes.duration??t.dataAttributes["hf-authored-duration"]??"0")||0,i=n+r,l=u=>{const h=j2(u);h!=null&&e("start",h.toFixed(2))},s=u=>{const h=j2(u);h==null||h<=0||e("duration",h.toFixed(2))},c=u=>{const h=j2(u);h==null||h<=n||e("duration",(h-n).toFixed(2))};return m.jsxs(Cr,{title:"Timing",icon:m.jsx(IV,{size:15}),children:[m.jsxs("div",{className:qn,children:[m.jsx(An,{label:"Start",value:$2(n),onCommit:l}),m.jsx(An,{label:"End",value:$2(i),onCommit:c})]}),m.jsx("div",{className:"mt-3",children:m.jsx(An,{label:"Duration",value:$2(r),onCommit:s})})]})}const WG=d.memo(function({projectId:e,projectDir:n,assets:r,element:i,multiSelectCount:l=0,copiedAgentPrompt:s,onClearSelection:c,onSetStyle:u,onSetAttribute:h,onSetHtmlAttribute:g,onSetManualOffset:O,onSetManualSize:x,onSetManualRotation:y,onSetText:v,onSetTextFieldStyle:w,onAddTextField:A,onRemoveTextField:k,onAskAgent:M,onImportAssets:E,fontAssets:$=[],onImportFonts:C,previewIframeRef:j,gsapAnimations:T=[],gsapMultipleTimelines:N,gsapUnsupportedTimelinePattern:R,onUpdateGsapProperty:D,onUpdateGsapMeta:V,onDeleteGsapAnimation:z,onAddGsapProperty:I,onRemoveGsapProperty:U,onUpdateGsapFromProperty:K,onAddGsapFromProperty:H,onRemoveGsapFromProperty:q,onAddGsapAnimation:X,onAddKeyframe:G,onRemoveKeyframe:F,onConvertToKeyframes:P,onCommitAnimatedProperty:Z,onSeekToTime:L}){var on,Rt,we,ht,Mt,ot;const B=(i==null?void 0:i.computedStyles)??Yq;if(!i)return m.jsx("div",{className:"flex h-full flex-col bg-neutral-900",children:m.jsx("div",{className:"flex flex-1 flex-col items-center justify-center px-6 text-center",children:l>1?m.jsxs(m.Fragment,{children:[m.jsx(Df,{size:18,className:"mb-3 text-neutral-600"}),m.jsxs("p",{className:"text-sm font-medium text-neutral-200",children:[l," elements selected"]}),m.jsx("p",{className:"mt-2 max-w-[260px] text-xs leading-5 text-neutral-500",children:"Select a single element to edit its properties. Click an element in the preview or use the timeline layer panel."})]}):m.jsxs(m.Fragment,{children:[m.jsx(Kw,{size:18,className:"mb-3 text-neutral-600"}),m.jsx("p",{className:"text-sm font-medium text-neutral-200",children:"Select an element in the preview."}),m.jsx("p",{className:"mt-2 max-w-[260px] text-xs leading-5 text-neutral-500",children:"The inspector is tuned for element edits with safer geometry controls, color picking, and cleaner grouped layer controls."})]})})});const J=!i.capabilities.canApplyManualOffset,te=!i.capabilities.canApplyManualSize,Y=i.id?`#${i.id}`:i.selector,re=i.capabilities.canEditStyles,ae=ig(i.element),ue=Rf(i.element),me=ue.width>0?ue.width:ta(B.width??"")??i.boundingBox.width,ye=ue.height>0?ue.height:ta(B.height??"")??i.boundingBox.height,Oe=(ve,ze)=>{const Ze=ta(ze);if(Ze==null)return;if(Z&&(Ye||T.length>0)){Z(i,ve,Ze);return}if(Le&&Ye&&G){const vt=Math.max(0,Math.min(100,Math.round(yt*10)/10));G(Ye,vt,ve,Ze);return}const Be=ig(i.element);O(i,{x:ve==="x"?Ze:Be.x,y:ve==="y"?Ze:Be.y})},Se=(ve,ze)=>{const Ze=ta(ze);if(Ze==null||Ze<=0)return;const Be=Rf(i.element),vt=Be.width>0?Be.width:ta(B.width??"")??i.boundingBox.width,lt=Be.height>0?Be.height:ta(B.height??"")??i.boundingBox.height;x(i,{width:ve==="width"?Ze:vt,height:ve==="height"?Ze:lt})},Ae=mw(i.element),Me=ve=>{const ze=Number.parseFloat(ve);Number.isFinite(ze)&&y(i,{angle:ze})},Ve=Number.parseFloat(((on=i==null?void 0:i.dataAttributes)==null?void 0:on.start)??"0")||0,Pe=Number.parseFloat(((Rt=i==null?void 0:i.dataAttributes)==null?void 0:Rt.duration)??"1")||0,ft=fe(ve=>ve.currentTime),yt=Pe>0?(ft-Ve)/Pe*100:0,Le=((ht=(we=T==null?void 0:T.find(ve=>ve.keyframes))==null?void 0:we.keyframes)==null?void 0:ht.keyframes)??null,Ye=((Mt=T==null?void 0:T.find(ve=>ve.keyframes))==null?void 0:Mt.id)??((ot=T==null?void 0:T[0])==null?void 0:ot.id)??null,_e=(()=>{var Ze;if(!Ye||T.length===0)return null;const ve=j==null?void 0:j.current;if(!(ve!=null&&ve.contentWindow))return null;const ze=i.id?`#${i.id}`:i.selector;if(!ze)return null;try{const Be=ve.contentWindow.gsap;if(!(Be!=null&&Be.getProperty))return null;const vt=(Ze=ve.contentDocument)==null?void 0:Ze.querySelector(ze);if(!vt)return null;const lt=new Set;for(const mt of T){if(mt.keyframes)for(const Tt of mt.keyframes.keyframes)for(const cn of Object.keys(Tt.properties))lt.add(cn);for(const Tt of Object.keys(mt.properties))lt.add(Tt)}const Je={};for(const mt of lt){const Tt=Number(Be.getProperty(vt,mt));Number.isFinite(Tt)&&(Je[mt]=Math.round(Tt*100)/100)}return Object.keys(Je).length>0?Je:null}catch{return null}})(),be=(_e==null?void 0:_e.x)??ae.x,dt=(_e==null?void 0:_e.y)??ae.y,Ue=(_e==null?void 0:_e.width)??me,bt=(_e==null?void 0:_e.height)??ye,Re=(_e==null?void 0:_e.rotation)??Ae.angle;return m.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-neutral-900 text-neutral-100",children:[m.jsxs("div",{className:"border-b border-neutral-800 px-4 py-5",children:[m.jsxs("div",{className:"flex items-start justify-between gap-4",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:Kt,children:"Document"}),m.jsx("div",{className:"mt-3 truncate text-[12px] font-semibold text-neutral-100",children:i.label}),m.jsx("div",{className:"mt-1 truncate text-[11px] text-neutral-500",children:Y})]}),m.jsx("button",{type:"button","aria-label":"Clear selection",onClick:c,className:"flex h-9 w-9 items-center justify-center rounded-full border border-neutral-700 bg-neutral-950 text-neutral-500 shadow-[0_1px_2px_rgba(0,0,0,0.2)] transition-colors hover:border-neutral-600 hover:text-neutral-200",children:m.jsx(Cd,{size:13})})]}),m.jsx("div",{className:"mt-4 flex min-w-0 flex-wrap items-center gap-2",children:m.jsxs("button",{type:"button",onClick:M,className:"inline-flex h-8 items-center justify-center gap-2 rounded-xl border border-neutral-700 bg-neutral-950 px-3.5 text-[11px] font-medium text-neutral-100 transition-colors hover:border-studio-accent/40 hover:text-studio-accent",children:[m.jsx(qV,{size:15}),m.jsx("span",{children:s?"Prompt copied":"Copy prompt to AI agent"})]})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto",children:[m.jsx(RG,{element:i,styles:B,fontAssets:$,onImportFonts:C,onSetText:v,onSetTextFieldStyle:w,onAddTextField:A,onRemoveTextField:k}),i.dataAttributes.start!=null&&m.jsx(UG,{element:i,onSetAttribute:h}),lG(i)&&m.jsx(sG,{projectDir:n,element:i,styles:B,onSetStyle:u,onSetAttribute:h,onSetHtmlAttribute:g}),m.jsxs(Cr,{title:"Layout",icon:m.jsx(GV,{size:15}),children:[m.jsxs("div",{className:qn,children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(An,{label:"X",value:zl(be),disabled:J,scrub:!0,onCommit:ve=>Oe("x",ve)})}),Ja&&Ye&&m.jsx(Fs,{property:"x",keyframes:Le,currentPercentage:yt,onSeek:ve=>L==null?void 0:L(Ve+ve/100*Pe),onAddKeyframe:()=>Z&&void Z(i,"x",be),onRemoveKeyframe:ve=>F==null?void 0:F(Ye,ve),onConvertToKeyframes:()=>P==null?void 0:P(Ye)})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(An,{label:"Y",value:zl(dt),disabled:J,scrub:!0,onCommit:ve=>Oe("y",ve)})}),Ja&&Ye&&m.jsx(Fs,{property:"y",keyframes:Le,currentPercentage:yt,onSeek:ve=>L==null?void 0:L(Ve+ve/100*Pe),onAddKeyframe:()=>Z&&void Z(i,"y",dt),onRemoveKeyframe:ve=>F==null?void 0:F(Ye,ve),onConvertToKeyframes:()=>P==null?void 0:P(Ye)})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(An,{label:"W",value:zl(Ue),disabled:te,scrub:!0,onCommit:ve=>Se("width",ve)})}),Ja&&Ye&&m.jsx(Fs,{property:"width",keyframes:Le,currentPercentage:yt,onSeek:ve=>L==null?void 0:L(Ve+ve/100*Pe),onAddKeyframe:()=>Z&&void Z(i,"width",Ue),onRemoveKeyframe:ve=>F==null?void 0:F(Ye,ve),onConvertToKeyframes:()=>P==null?void 0:P(Ye)})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(An,{label:"H",value:zl(bt),disabled:te,scrub:!0,onCommit:ve=>Se("height",ve)})}),Ja&&Ye&&m.jsx(Fs,{property:"height",keyframes:Le,currentPercentage:yt,onSeek:ve=>L==null?void 0:L(Ve+ve/100*Pe),onAddKeyframe:()=>Z&&void Z(i,"height",bt),onRemoveKeyframe:ve=>F==null?void 0:F(Ye,ve),onConvertToKeyframes:()=>P==null?void 0:P(Ye)})]}),i.capabilities.canApplyManualSize&&m.jsx("button",{type:"button",className:"flex-shrink-0 rounded p-1 text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300",title:"Fit to children",onClick:()=>{const ve=iG(i);ve&&x(i,ve)},children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.2",children:[m.jsx("rect",{x:"2",y:"2",width:"10",height:"10",strokeDasharray:"2 1.5",rx:"1"}),m.jsx("path",{d:"M2 4.5h1m-1 5h1m8-5h1m-1 5h1M4.5 2v1m5-1v1M4.5 11v1m5-1v1"})]})}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(An,{label:"R",value:`${Re}°`,onCommit:ve=>Me(ve.replace("°",""))})}),Ja&&Ye&&m.jsx(Fs,{property:"rotation",keyframes:Le,currentPercentage:yt,onSeek:ve=>L==null?void 0:L(Ve+ve/100*Pe),onAddKeyframe:()=>Z&&void Z(i,"rotation",Re),onRemoveKeyframe:ve=>F==null?void 0:F(Ye,ve),onConvertToKeyframes:()=>P==null?void 0:P(Ye)})]})]}),_e&&m.jsxs("div",{className:"mt-3 border-t border-neutral-800/40 pt-3",children:[m.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-neutral-600",children:"3D Transform"}),m.jsxs("div",{className:qn,children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"flex-1",children:m.jsx(An,{label:"Z",value:zl(_e.z??0),scrub:!0,onCommit:ve=>{const ze=ta(ve);ze!=null&&Z&&Z(i,"z",ze)}})}),Ja&&(Ye||Z)&&m.jsx(Fs,{property:"z",keyframes:Le,currentPercentage:yt,onSeek:ve=>L==null?void 0:L(Ve+ve/100*Pe),onAddKeyframe:()=>{Z&&Z(i,"z",(_e==null?void 0:_e.z)??0)},onRemoveKeyframe:ve=>Ye&&(F==null?void 0:F(Ye,ve)),onConvertToKeyframes:()=>Ye&&(P==null?void 0:P(Ye))})]}),m.jsx(An,{label:"Scale",value:String(_e.scale??1),scrub:!0,onCommit:ve=>{const ze=Number.parseFloat(ve);Number.isFinite(ze)&&Z&&Z(i,"scale",ze)}}),m.jsx(An,{label:"RotX",value:`${_e.rotationX??0}°`,onCommit:ve=>{const ze=Number.parseFloat(ve.replace("°",""));Number.isFinite(ze)&&Z&&Z(i,"rotationX",ze)}}),m.jsx(An,{label:"RotY",value:`${_e.rotationY??0}°`,onCommit:ve=>{const ze=Number.parseFloat(ve.replace("°",""));Number.isFinite(ze)&&Z&&Z(i,"rotationY",ze)}})]})]}),m.jsxs("div",{className:"mt-3",children:[m.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-neutral-600",children:"Stacking"}),m.jsx(An,{label:"Z-index",value:String(parseInt(B["z-index"]||"auto",10)||0),scrub:!0,onCommit:ve=>u("z-index",ve)})]})]}),q2&&D&&V&&z&&I&&X&&m.jsx(YG,{animations:T,multipleTimelines:N,unsupportedTimelinePattern:R,onUpdateProperty:D,onUpdateMeta:V,onDeleteAnimation:z,onAddProperty:I,onRemoveProperty:U??(()=>{}),onUpdateFromProperty:K,onAddFromProperty:H,onRemoveFromProperty:q,onAddAnimation:X}),re&&m.jsx($G,{projectId:e,element:i,styles:B,assets:r,onSetStyle:u,onImportAssets:E})]})]})}),IM="min-w-0 rounded-xl border border-neutral-800 bg-neutral-900/95 px-3 py-2 text-neutral-100 shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] transition-colors focus-within:border-neutral-600",z6="text-[11px] font-medium uppercase tracking-[0.18em] text-neutral-500",yS="grid grid-cols-[repeat(auto-fit,minmax(118px,1fr))] gap-3";function P2(t){const e=Math.round(t*100)/100;return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function Q2(t,e,n,r){return t==null||!Number.isFinite(t)?r:Math.min(n,Math.max(e,t))}function Z2(t){const e=Number.parseFloat(t.trim());return Number.isFinite(e)?e:null}function KG({value:t,disabled:e,onCommit:n}){const[r,i]=d.useState(t),l=d.useRef(!1);d.useEffect(()=>{l.current||i(t)},[t]);const s=()=>{l.current=!1;const c=r.trim();c!==t&&n(c)};return m.jsx("input",{type:"text",value:r,disabled:e,onFocus:()=>{l.current=!0},onChange:c=>i(c.target.value),onBlur:s,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()},className:"w-full min-w-0 bg-transparent text-[11px] font-medium text-neutral-100 outline-none disabled:cursor-not-allowed disabled:text-neutral-600"})}function mf({label:t,value:e,disabled:n,onCommit:r}){return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:z6,children:t}),m.jsx("div",{className:IM,children:m.jsx(KG,{value:e,disabled:n,onCommit:r})})]})}function JG({value:t,options:e,onChange:n}){return m.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-2xl border border-neutral-800 bg-neutral-950 p-1",children:e.map(r=>m.jsx("button",{type:"button",onClick:()=>n(r.value),className:`h-9 rounded-xl text-[11px] font-semibold transition-colors ${r.value===t?"bg-neutral-800 text-white shadow-sm":"text-neutral-500 hover:bg-neutral-900 hover:text-neutral-200"}`,children:r.label},r.value))})}function bS({label:t,value:e,options:n,onChange:r}){return m.jsxs("label",{className:"grid min-w-0 gap-1.5",children:[m.jsx("span",{className:z6,children:t}),m.jsx("div",{className:IM,children:m.jsx("select",{value:e,onChange:i=>r(i.target.value),className:"w-full min-w-0 appearance-none bg-transparent text-[11px] font-medium text-neutral-100 outline-none",children:n.map(i=>m.jsx("option",{value:i,children:i},i))})})]})}function vS({title:t,children:e,accessory:n}){return m.jsxs("section",{className:"border-b border-neutral-800 px-4 py-5",children:[m.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(I8,{size:15,className:"text-neutral-500"}),m.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-neutral-300",children:t})]}),n]}),e]})}function pf(t){const e=Math.round(t*100)/100;return Number.isInteger(e)?`${e}`:e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function eU(t,e){const n=1-t,r=n*n,i=t*t;return{x:3*r*t*e.x1+3*n*i*e.x2+i*t,y:3*r*t*e.y1+3*n*i*e.y2+i*t}}function tU(t,e){const n=[];for(let r=0;r<=48;r+=1){const i=e(eU(r/48,t));n.push(`${r===0?"M":"L"}${i.x.toFixed(2)},${i.y.toFixed(2)}`)}return n.join(" ")}function nU({points:t,onCommit:e}){const n=d.useRef(null),[r,i]=d.useState(t),l=d.useRef(null);d.useEffect(()=>{i(t)},[t]);const s=324,c=214,u={left:46,top:24,width:242,height:146},h=-.4,g=1.4,O=C=>({x:u.left+C.x*u.width,y:u.top+(g-C.y)/(g-h)*u.height}),x=C=>{var R;const j=(R=n.current)==null?void 0:R.getBoundingClientRect();if(!j)return null;const T=(C.clientX-j.left)/j.width*s,N=(C.clientY-j.top)/j.height*c;return T8({x1:l.current==="p1"?(T-u.left)/u.width:r.x1,y1:l.current==="p1"?g-(N-u.top)/u.height*(g-h):r.y1,x2:l.current==="p2"?(T-u.left)/u.width:r.x2,y2:l.current==="p2"?g-(N-u.top)/u.height*(g-h):r.y2})},y=O({x:0,y:0}),v=O({x:1,y:1}),w=O({x:r.x1,y:r.y1}),A=O({x:r.x2,y:r.y2}),k=tU(r,O),M=C=>{if(!l.current)return;C.preventDefault();const j=x(C);j&&i(j)},E=()=>{l.current&&(l.current=null,e(r))},$=(C,j)=>{j.preventDefault(),j.stopPropagation(),l.current=C,j.currentTarget.setPointerCapture(j.pointerId)};return m.jsxs("div",{className:"overflow-hidden rounded-2xl border border-neutral-800 bg-black/40",children:[m.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-neutral-800 px-3 py-2",children:[m.jsxs("div",{children:[m.jsx("div",{className:z6,children:"CustomEase"}),m.jsx("div",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:JS(r)})]}),m.jsxs("button",{type:"button",onClick:()=>{const C=hu("power3.out");i(C),e(C)},className:"inline-flex h-8 items-center justify-center gap-2 rounded-xl border border-neutral-800 bg-neutral-950 px-3 text-[10px] font-semibold uppercase tracking-[0.14em] text-neutral-400 transition-colors hover:border-neutral-700 hover:text-neutral-100",children:[m.jsx(q8,{size:13}),"Reset"]})]}),m.jsxs("svg",{ref:n,viewBox:`0 0 ${s} ${c}`,className:"block w-full select-none touch-none",onPointerMove:M,onPointerUp:E,onPointerCancel:E,children:[m.jsx("rect",{x:"0",y:"0",width:s,height:c,fill:"transparent"}),[0,.5,1].map(C=>{const j=O({x:0,y:C});return m.jsxs("g",{children:[m.jsx("line",{x1:u.left,x2:u.left+u.width,y1:j.y,y2:j.y,stroke:"rgba(255,255,255,0.12)",strokeDasharray:"5 8"}),m.jsx("text",{x:u.left-12,y:j.y+4,textAnchor:"end",className:"fill-neutral-500 text-[10px] font-semibold",children:C})]},C)}),m.jsx("line",{x1:u.left,x2:u.left+u.width,y1:u.top+u.height,y2:u.top+u.height,stroke:"rgba(255,255,255,0.18)"}),m.jsx("line",{x1:u.left,x2:u.left,y1:u.top,y2:u.top+u.height,stroke:"rgba(255,255,255,0.18)"}),m.jsx("line",{x1:y.x,y1:y.y,x2:w.x,y2:w.y,stroke:"rgba(255,221,87,0.34)"}),m.jsx("line",{x1:v.x,y1:v.y,x2:A.x,y2:A.y,stroke:"rgba(255,221,87,0.34)"}),m.jsx("path",{d:k,fill:"none",stroke:"#ffdd57",strokeWidth:"4",strokeLinecap:"round"}),m.jsx("circle",{cx:y.x,cy:y.y,r:"5",fill:"#ffdd57"}),m.jsx("circle",{cx:v.x,cy:v.y,r:"5",fill:"#ffdd57"}),m.jsx("circle",{cx:w.x,cy:w.y,r:"9",fill:"#141414",stroke:"#ffdd57",strokeWidth:"4",className:"cursor-grab active:cursor-grabbing",onPointerDown:C=>$("p1",C)}),m.jsx("circle",{cx:A.x,cy:A.y,r:"9",fill:"#141414",stroke:"#ffdd57",strokeWidth:"4",className:"cursor-grab active:cursor-grabbing",onPointerDown:C=>$("p2",C)}),m.jsx("text",{x:w.x+12,y:w.y-10,className:"fill-neutral-400 text-[10px] font-semibold",children:"P1"}),m.jsx("text",{x:A.x+12,y:A.y-10,className:"fill-neutral-400 text-[10px] font-semibold",children:"P2"})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-neutral-800 p-3",children:[m.jsxs("div",{className:"rounded-xl border border-neutral-800 bg-neutral-950 px-3 py-2 font-mono text-[10px] text-neutral-400",children:["P1 ",pf(r.x1),", ",pf(r.y1)]}),m.jsxs("div",{className:"rounded-xl border border-neutral-800 bg-neutral-950 px-3 py-2 font-mono text-[10px] text-neutral-400",children:["P2 ",pf(r.x2),", ",pf(r.y2)]})]})]})}const rU=[{label:"Fade Up",value:"fade-up"},{label:"Slide",value:"slide"},{label:"Pop",value:"pop"}],iU=["up","down","left","right"];function aU(t){return t?Math.max(Math.abs(t.from.x??0),Math.abs(t.from.y??0),1):32}function lU(t){return t?t.from.scale!=null||t.to.scale!=null?"pop":t.from.x!=null||t.to.x!=null?"slide":"fade-up":"fade-up"}function sU(t){if(!t)return"up";const e=t.from.x??0,n=t.from.y??0;return Math.abs(e)>Math.abs(n)?e<0?"right":"left":n<0?"down":"up"}function SS(t){return`studio-${(t.id||t.selector||t.label||"layer").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"layer"}-ease`}const oU=d.memo(function({element:e,motion:n,onClearSelection:r,onSetMotion:i,onClearMotion:l}){var $;const s=lU(n),c=sU(n),u=(n==null?void 0:n.start)??0,h=(n==null?void 0:n.duration)??.6,g=aU(n),O=(n==null?void 0:n.ease)??"power3.out",x=(($=n==null?void 0:n.customEase)==null?void 0:$.data)??"",y=x.trim().length>0,v=d.useMemo(()=>xy(x)??hu(v1.includes(O)?O:"power3.out"),[O,x]);if(!e)return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center bg-neutral-900 px-6 text-center",children:[m.jsx(I8,{size:18,className:"mb-3 text-neutral-600"}),m.jsx("p",{className:"text-sm font-medium text-neutral-200",children:"Select an element for motion."}),m.jsx("p",{className:"mt-2 max-w-[260px] text-xs leading-5 text-neutral-500",children:"Timeline layers and inspector selections can receive Studio-authored GSAP motion."})]});const w=e.id?`#${e.id}`:e.selector,A=y?"CustomEase":v1.includes(O)?O:"power3.out",k=y?["CustomEase",...v1]:v1,M=C=>{var R;const j=C.customEaseData??x,T=j.trim()?{id:((R=n==null?void 0:n.customEase)==null?void 0:R.id)??SS(e),data:j.trim()}:void 0,N=T?T.id:(C.ease??O).trim()||"none";i(e,zj(C.preset??s,{start:Q2(C.start??u,0,3600,0),duration:Q2(C.duration??h,.01,3600,.6),distance:Q2(C.distance??g,1,2e3,32),direction:C.direction??c,ease:N,customEase:T}))},E=C=>{M({ease:SS(e),customEaseData:JS(C)})};return m.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-neutral-900 text-neutral-100",children:[m.jsx("div",{className:"border-b border-neutral-800 px-4 py-5",children:m.jsxs("div",{className:"flex items-start justify-between gap-4",children:[m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-neutral-500",children:"Motion Target"}),m.jsx("div",{className:"mt-3 truncate text-[12px] font-semibold text-neutral-100",children:e.label}),m.jsx("div",{className:"mt-1 truncate text-[11px] text-neutral-500",children:w})]}),m.jsx("button",{type:"button","aria-label":"Clear selection",onClick:r,className:"flex h-9 w-9 items-center justify-center rounded-full border border-neutral-700 bg-neutral-950 text-neutral-500 shadow-[0_1px_2px_rgba(0,0,0,0.2)] transition-colors hover:border-neutral-600 hover:text-neutral-200",children:m.jsx(Cd,{size:13})})]})}),m.jsxs("div",{className:"flex-1 overflow-y-auto",children:[m.jsx(vS,{title:"GSAP Motion",accessory:m.jsx("div",{className:"rounded-full border border-studio-accent/40 bg-studio-accent/10 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-studio-accent",children:"GSAP"}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(JG,{value:s,onChange:C=>M({preset:C}),options:rU}),m.jsxs("div",{className:yS,children:[m.jsx(bS,{label:"Direction",value:c,onChange:C=>M({direction:C}),options:iU}),m.jsx(bS,{label:"Ease",value:A,onChange:C=>{C!=="CustomEase"&&M({ease:C,customEaseData:""})},options:k})]}),m.jsxs("div",{className:yS,children:[m.jsx(mf,{label:"Start",value:P2(u),onCommit:C=>M({start:Z2(C)??0})}),m.jsx(mf,{label:"Duration",value:P2(h),onCommit:C=>M({duration:Z2(C)??.6})}),m.jsx(mf,{label:"Distance",value:P2(g),onCommit:C=>M({distance:Z2(C)??32})})]})]})}),m.jsx(vS,{title:"Ease Curve",accessory:m.jsx("div",{className:"rounded-full border border-yellow-400/30 bg-yellow-400/10 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-yellow-300",children:"CustomEase"}),children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(nU,{points:v,onCommit:E}),m.jsx(mf,{label:"CustomEase path",value:x,onCommit:C=>{const j=xy(C);j&&E(j)}}),m.jsx("div",{className:"flex justify-end",children:m.jsx("button",{type:"button",onClick:()=>l(e),disabled:!n,className:"inline-flex h-8 items-center rounded-xl border border-neutral-700 bg-neutral-950 px-3 text-[11px] font-medium text-neutral-300 transition-colors hover:border-neutral-600 hover:text-white disabled:cursor-not-allowed disabled:border-neutral-800 disabled:text-neutral-600",children:"Clear motion"})})]})})]})]})}),cU=4;function qM(t){if(!(t.selector||t.id))return!1;let e=t.element;for(;e;){if(e.hasAttribute("data-timeline-locked"))return!1;e=e.parentElement}return!0}function uU(t,e){const n=t[e].depth,r=[];let i=e;for(;i>0;)if(i--,t[i].depth<n){i++;break}for(let l=i;l<t.length;l++){const s=t[l].depth;if(s<n)break;s===n&&r.push(l)}return r}function fU(t,e){const n=t.querySelectorAll("[data-layer-index]"),r=[];for(const i of e)for(const l of n)if(l.dataset.layerIndex===String(i)){r.push(l.getBoundingClientRect());break}return r}function dU(t,e){if(e.length===0||t<=e[0].top+e[0].height/2)return 0;for(let r=0;r<e.length-1;r++){const i=(e[r].bottom+e[r+1].top)/2;if(t<=i)return r+1}const n=e[e.length-1];return t<=n.top+n.height/2?e.length-1:e.length}function hU(t,e,n){return e.length===0?null:t<=0?e[0].top-n.top:t>=e.length?e[e.length-1].bottom-n.top:e[t].top-n.top}function mU({visibleLayers:t,scrollContainerRef:e,onReorder:n,onSingleSibling:r}){const i=d.useRef(null),[l,s]=d.useState(null),[c,u]=d.useState(null),h=d.useCallback((x,y)=>{if(y.button!==0)return;const v=t[x];if(!v||!qM(v))return;const w=uU(t,x);if(w.length<=1){r==null||r();return}const A=w.indexOf(x);if(A===-1)return;const k=e.current;k&&(y.preventDefault(),k.setPointerCapture(y.pointerId),i.current={pointerId:y.pointerId,startY:y.clientY,dragLayerIndex:x,siblingIndices:w,fromSiblingPos:A,insertSiblingPos:A,siblingRects:fU(k,w),activated:!1})},[t,e,r]),g=d.useCallback(x=>{var A;const y=i.current;if(!y)return;if(!y.activated){if(Math.abs(x.clientY-y.startY)<cU)return;y.activated=!0,s(((A=t[y.dragLayerIndex])==null?void 0:A.key)??null)}const v=dU(x.clientY,y.siblingRects);y.insertSiblingPos=v;const w=e.current;if(w){const k=w.getBoundingClientRect();u(hU(v,y.siblingRects,k))}},[t,e]),O=d.useCallback(()=>{const x=i.current;if(i.current=null,s(null),u(null),!x||!x.activated)return;const y=e.current;if(y)try{y.releasePointerCapture(x.pointerId)}catch{}let v=x.insertSiblingPos;if(v>x.fromSiblingPos&&v--,v===x.fromSiblingPos)return;const w=x.siblingIndices.map(A=>t[A]);n({siblingLayers:w,fromIndex:x.fromSiblingPos,toIndex:v})},[t,e,n]);return{dragKey:l,insertionLineY:c,handleRowPointerDown:h,handleContainerPointerMove:g,handleContainerPointerUp:O}}const pU={video:"Vi",audio:"Au",img:"Im",svg:"Sv",canvas:"Cn",div:"Di",section:"Se",span:"Sp",p:"P",h1:"H1",h2:"H2",h3:"H3",h4:"H4",h5:"H5",h6:"H6",a:"A",button:"Bt",ul:"Ul",ol:"Ol",li:"Li",style:"St",template:"Te"};function gU(t){return pU[t]??t.slice(0,2).toUpperCase()}function OU(t){return t.hasAttribute("data-composition-src")||t.hasAttribute("data-composition-file")}const xU=d.memo(function(){const{previewIframeRef:e,activeCompPath:n,refreshKey:r,compositionLoading:i,timelineElements:l,currentTime:s,showToast:c}=No(),{domEditSelection:u,applyDomSelection:h,updateDomEditHoverSelection:g,handleDomZIndexReorderCommit:O}=Ed(),[x,y]=d.useState([]),[v,w]=d.useState({}),A=d.useRef(0),k=d.useRef(null),M=!n||n==="index.html",E=d.useCallback(()=>{const X=e.current;if(!X)return;let G=null;try{G=X.contentDocument}catch{return}if(!G)return;const F=G.querySelector("[data-composition-id]")??G.documentElement??null;if(!F)return;const P=sR(F,{activeCompositionPath:n});y(y8(P))},[e,n,M]);d.useEffect(()=>{E()},[E,r]),d.useEffect(()=>{const X=e.current;if(!X)return;const G=()=>{A.current+=1,E()};return X.addEventListener("load",G),()=>X.removeEventListener("load",G)},[e,E]),d.useEffect(()=>{if(!i){const X=setTimeout(E,100);return()=>clearTimeout(X)}},[i,E]);const $=d.useCallback(X=>Qw(X.element,{activeCompositionPath:n,isMasterView:M,preferClipAncestor:!1}),[n,M]),C=d.useCallback(async X=>{const G=await $(X);if(!G)return;let F=og(G,l);if(!F){const P=G.sourceFile??"index.html";let Z=X.element.parentElement;for(;Z&&!F;){const L=Z.id;if(L){const B=l.find(J=>J.domId===L&&(J.sourceFile??"index.html")===P);B&&(F=B.key??B.id)}Z=Z.parentElement}}if(F){const P=l.find(Z=>(Z.key??Z.id)===F);if(P){const Z=VN(s,P);Z!=null&&fe.getState().requestSeek(Z)}}},[s,$,l]),j=d.useCallback(async X=>{const G=await $(X);G&&(h(G),await C(X))},[$,h,C]),T=d.useCallback(async X=>{if(!X){g(null);return}const G=await $(X);g(G)},[$,g]),N=d.useCallback((X,G)=>{G.stopPropagation(),w(F=>({...F,[X]:!F[X]}))},[]),R=d.useCallback(X=>{const{siblingLayers:G,fromIndex:F,toIndex:P}=X,Z=[...G],[L]=Z.splice(F,1);Z.splice(P,0,L);const J=[...G.map(ae=>x8(ae.element))].sort((ae,ue)=>ue-ae),Y=J.some((ae,ue)=>ue>0&&ae===J[ue-1])?Z.map((ae,ue)=>Z.length-ue):J,re=Z.map((ae,ue)=>({element:ae.element,zIndex:Y[ue],id:ae.id,selector:ae.selector,selectorIndex:ae.selectorIndex,sourceFile:ae.sourceFile}));O(re)},[O]),D=u?Zw(u):null,V=yU(x,v),z=d.useCallback(()=>{c("Only one layer at this level","info")},[c]),{dragKey:I,insertionLineY:U,handleRowPointerDown:K,handleContainerPointerMove:H,handleContainerPointerUp:q}=mU({visibleLayers:V,scrollContainerRef:k,onReorder:R,onSingleSibling:z});return x.length===0?m.jsxs("div",{className:"flex h-full flex-col items-center justify-center bg-neutral-900 px-6 text-center",children:[m.jsx(Df,{size:18,className:"mb-3 text-neutral-600"}),m.jsx("p",{className:"text-sm font-medium text-neutral-200",children:"No layers"}),m.jsx("p",{className:"mt-1 text-xs text-neutral-500",children:"Load a composition to see its element tree"})]}):m.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-neutral-900",onPointerLeave:()=>T(null),children:[m.jsxs("div",{className:"border-b border-white/10 px-3 py-2 text-[11px] text-neutral-500",children:[x.length," layer",x.length===1?"":"s"]}),m.jsxs("div",{ref:k,className:"relative min-h-0 flex-1 overflow-y-auto py-1",onPointerMove:H,onPointerUp:q,onPointerCancel:q,children:[V.map((X,G)=>{const F=X.key===D,P=X.key===I,Z=qM(X),L=v[X.key]??!1,B=X.childCount>0,J=OU(X.element);return m.jsxs("div",{"data-layer-index":G,role:"button",tabIndex:0,onClick:()=>!I&&j(X),onPointerDown:te=>K(G,te),onPointerEnter:()=>!I&&T(X),onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&(te.preventDefault(),j(X))},className:`group flex w-full items-center gap-1.5 px-2 py-1 text-left transition-colors ${P?"opacity-40":F?"bg-studio-accent/14 text-studio-accent":"text-neutral-300 hover:bg-white/[0.04] hover:text-neutral-100"} ${I?"cursor-grabbing":Z?"cursor-pointer":"cursor-not-allowed opacity-50"}`,style:{paddingLeft:8+X.depth*16},children:[B?m.jsx("button",{type:"button",onClick:te=>N(X.key,te),className:"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded text-neutral-500 hover:text-neutral-300",children:m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"currentColor",className:`transition-transform ${L?"":"rotate-90"}`,children:m.jsx("path",{d:"M2 1l4 3-4 3z"})})}):m.jsx("span",{className:"w-4 flex-shrink-0"}),m.jsx("span",{className:`flex h-5 w-5 flex-shrink-0 items-center justify-center rounded text-[8px] font-bold uppercase ${F?"bg-studio-accent/18 text-studio-accent":J?"bg-blue-900/40 text-blue-400":"bg-neutral-800 text-neutral-500"}`,children:gU(X.tagName)}),m.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:X.label}),B&&m.jsx("span",{className:"text-[9px] tabular-nums text-neutral-600",children:X.childCount})]},X.key)}),U!=null&&m.jsx("div",{className:"pointer-events-none absolute left-2 right-2 h-0.5 bg-studio-accent",style:{top:U}})]})]})});function x8(t){var e,n;try{const r=(e=t.style)==null?void 0:e.zIndex;if(r&&r!=="auto"){const c=parseInt(r,10);if(Number.isFinite(c))return c}const i=(n=t.ownerDocument)==null?void 0:n.defaultView;if(!i)return 0;const l=i.getComputedStyle(t).zIndex;if(l==="auto"||l==="")return 0;const s=parseInt(l,10);return Number.isFinite(s)?s:0}catch{return 0}}function y8(t){if(t.length<=1)return t;const e=t[0].depth;for(let i=1;i<t.length;i++)if(t[i].depth<e)return t;const n=[];for(let i=0;i<t.length;i++)if(t[i].depth===e){const l=[];let s=i+1;for(;s<t.length&&t[s].depth>e;)l.push(t[s]),s++;n.push({root:t[i],children:l,domIndex:n.length})}if(n.length<=1){if(n.length===1&&n[0].children.length>0){const i=y8(n[0].children);return[n[0].root,...i]}return t}n.sort((i,l)=>{const s=x8(i.root.element),c=x8(l.root.element);return s!==c?c-s:l.domIndex-i.domIndex});const r=[];for(const i of n)r.push(i.root),i.children.length>0&&r.push(...y8(i.children));return r}function yU(t,e){if(Object.keys(e).length===0)return t;const n=[];let r=-1;for(const i of t)r>=0&&i.depth>r||(r=-1,n.push(i),e[i.key]&&i.childCount>0&&(r=i.depth));return n}const ll="w-full bg-neutral-900 border border-neutral-800 rounded px-1.5 py-0.5 text-2xs text-neutral-200 font-mono outline-none focus:border-neutral-600";function b8({label:t,children:e}){return m.jsxs("div",{className:"mb-3",children:[m.jsx("div",{className:"flex items-center gap-1.5 mt-2 mb-1.5",children:m.jsx("span",{className:"text-2xs font-medium text-neutral-500 uppercase tracking-wider",children:t})}),m.jsx("div",{className:"space-y-1",children:e})]})}function ia({label:t,children:e}){return m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-2xs text-neutral-600 w-14 text-right flex-shrink-0",children:t}),m.jsx("div",{className:"flex-1 min-w-0",children:e})]})}const bU=["none","fade","slide-up","slide-down","slide-left","slide-right","pop","slam","bounce","typewriter","blur-in","flip","drop"],vU=["none","color-change","scale-pop","glow-pulse","underline-sweep","background-fill","bounce"],SU=["none","fade","slide-up","slide-down","slide-left","slide-right","scatter","drop","collapse","blur-out","shrink"],wU=["power1.out","power2.out","power3.out","power4.out","power1.in","power2.in","power3.in","power1.inOut","power2.inOut","back.out(1.7)","elastic.out(1,0.3)","bounce.out"];function N2({label:t,presets:e,animation:n,showIntensity:r,onChange:i}){const l=(n==null?void 0:n.preset)??"none",s=(n==null?void 0:n.duration)??.2,c=(n==null?void 0:n.ease)??"power2.out",u=(n==null?void 0:n.stagger)??0,h=(n==null?void 0:n.intensity)??1;return m.jsxs(b8,{label:t,children:[m.jsx(ia,{label:"Preset",children:m.jsx("select",{value:l,onChange:g=>i({preset:g.target.value}),className:ll,children:e.map(g=>m.jsx("option",{value:g,children:g},g))})}),m.jsx(ia,{label:"Duration",children:m.jsx("input",{type:"number",value:s,step:.05,min:0,max:2,onChange:g=>i({duration:Number(g.target.value)}),className:ll})}),m.jsx(ia,{label:"Ease",children:m.jsx("select",{value:c,onChange:g=>i({ease:g.target.value}),className:ll,children:wU.map(g=>m.jsx("option",{value:g,children:g},g))})}),m.jsx(ia,{label:"Stagger",children:m.jsx("input",{type:"number",value:u,step:.02,min:0,max:.5,onChange:g=>i({stagger:Number(g.target.value)}),className:ll})}),r&&m.jsx(ia,{label:"Intensity",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"range",min:0,max:1,step:.01,value:h,onChange:g=>i({intensity:Number(g.target.value)}),className:"flex-1 accent-studio-accent"}),m.jsx("span",{className:"text-2xs text-neutral-400 font-mono w-8 text-right flex-shrink-0",children:h.toFixed(2)})]})})]})}const kU=d.memo(function(){const e=Ot(y=>y.model),n=Ot(y=>y.selectedGroupId),r=Ot(y=>y.selectedSegmentIds),i=Ot(y=>y.updateGroupAnimation),l=Ot(y=>y.applyAnimationToAll);let s=n;if(!s&&e&&r.size>0){const y=[...r][0];if(y){for(const[v,w]of e.groups)if(w.segmentIds.includes(y)){s=v;break}}}const c=s?e==null?void 0:e.groups.get(s):void 0,u=c==null?void 0:c.animation,h=d.useCallback(y=>{s&&i(s,"entrance",y)},[s,i]),g=d.useCallback(y=>{s&&i(s,"highlight",y)},[s,i]),O=d.useCallback(y=>{s&&i(s,"exit",y)},[s,i]),x=d.useCallback(()=>{u&&l(u)},[u,l]);return!c||!s||!u?m.jsx("div",{className:"flex items-center justify-center h-full px-4 text-center",children:m.jsx("p",{className:"text-xs text-neutral-500",children:"Select a caption group to edit animations"})}):m.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[m.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[m.jsx(N2,{label:"Entrance",presets:bU,animation:u.entrance,onChange:h}),m.jsx(N2,{label:"Highlight",presets:vU,animation:u.highlight,showIntensity:!0,onChange:g}),m.jsx(N2,{label:"Exit",presets:SU,animation:u.exit,onChange:O})]}),m.jsx("div",{className:"flex-shrink-0 px-3 py-2 border-t border-neutral-800",children:m.jsx("button",{type:"button",onClick:x,className:"w-full py-1.5 rounded border border-neutral-700 text-2xs text-neutral-300 hover:border-studio-accent/50 hover:text-studio-accent transition-colors",children:"Apply to all groups"})})]})}),AU=d.memo(function({iframeRef:e}){var j;const n=Ot(T=>T.model),r=Ot(T=>T.selectedSegmentIds),i=Ot(T=>T.selectedGroupId),l=Ot(T=>T.updateSelectedStyle),s=Ot(T=>T.updateGroupStyle),[c,u]=d.useState("style"),h=r.size>0?[...r][0]:void 0,g=n==null?void 0:n.segments.get(h??"");let O=null;if(n&&h)for(const T of n.groupOrder){const N=n.groups.get(T);if(N&&N.segmentIds.includes(h)){O=T;break}}const x=O?(j=n==null?void 0:n.groups.get(O))==null?void 0:j.style:void 0,y=(g==null?void 0:g.style)??{},v={...x,...y},w=d.useCallback(T=>{var I,U,K;const N=e.current;if(!N||!n)return;let R=null;try{R=N.contentDocument}catch{return}if(!R)return;const D=R.querySelectorAll(".caption-group"),V=[];for(const H of r)for(let q=0;q<n.groupOrder.length;q++){const X=n.groups.get(n.groupOrder[q]);if(!X)continue;const G=X.segmentIds.indexOf(H);if(G<0)continue;const F=D[q];if(!F)continue;const P=F.children;let Z=0;for(const L of P){const B=L;if(B.dataset.captionWrapper==="true"){const J=B.querySelector(":scope > span");if(J&&Z===G){V.push(J);break}}else if(B.tagName==="SPAN"&&Z===G){V.push(B);break}Z++}break}if(T.x!==void 0||T.y!==void 0||T.scaleX!==void 0||T.scaleY!==void 0||T.rotation!==void 0)try{const H=(U=(I=e.current)==null?void 0:I.contentWindow)==null?void 0:U.gsap;if(H)for(const q of V){let X=q.parentElement;(!X||X.dataset.captionWrapper!=="true")&&(X=R.createElement("span"),X.style.display="inline-block",X.dataset.captionWrapper="true",(K=q.parentNode)==null||K.insertBefore(X,q),X.appendChild(q));const G=H.getProperty(X,"x")||0,F=H.getProperty(X,"y")||0,P=H.getProperty(X,"scale")||1,Z=H.getProperty(X,"rotation")||0;H.set(X,{x:T.x??G,y:T.y??F,scale:T.scaleX??P,rotation:T.rotation??Z})}}catch{}},[e,n,r]),A=d.useCallback(T=>{i?s(i,T):l(T),w(T)},[i,s,l,w]);if(r.size===0)return m.jsx("div",{className:"flex items-center justify-center h-full px-4 text-center",children:m.jsx("p",{className:"text-xs text-neutral-500",children:"Select caption words to edit their style"})});const k=v.x??0,M=v.y??0,E=v.rotation??0,$=v.scaleX??1,C=r.size===1?"1 word":`${r.size} words`;return m.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[m.jsxs("div",{className:"px-3 py-2 border-b border-neutral-800 flex-shrink-0",children:[m.jsx("div",{className:"flex items-center justify-between mb-1.5",children:m.jsx("span",{className:"text-2xs text-neutral-500",children:C})}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx("button",{type:"button",onClick:()=>u("style"),className:["flex-1 py-0.5 rounded text-2xs font-medium transition-colors",c==="style"?"bg-studio-accent/20 text-studio-accent border border-studio-accent/50":"text-neutral-500 border border-neutral-800 hover:text-neutral-300 hover:border-neutral-600"].join(" "),children:"Style"}),m.jsx("button",{type:"button",onClick:()=>u("animation"),className:["flex-1 py-0.5 rounded text-2xs font-medium transition-colors",c==="animation"?"bg-studio-accent/20 text-studio-accent border border-studio-accent/50":"text-neutral-500 border border-neutral-800 hover:text-neutral-300 hover:border-neutral-600"].join(" "),children:"Animation"})]})]}),c==="animation"&&m.jsx(kU,{}),c==="style"&&m.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[m.jsxs(b8,{label:"Position",children:[m.jsx(ia,{label:"X",children:m.jsx("input",{type:"number",value:k,onChange:T=>A({x:Number(T.target.value)}),className:ll})}),m.jsx(ia,{label:"Y",children:m.jsx("input",{type:"number",value:M,onChange:T=>A({y:Number(T.target.value)}),className:ll})})]}),m.jsxs(b8,{label:"Transform",children:[m.jsx(ia,{label:"Scale",children:m.jsx("input",{type:"number",value:$,step:.1,onChange:T=>A({scaleX:Number(T.target.value),scaleY:Number(T.target.value)}),className:ll})}),m.jsx(ia,{label:"Rotation",children:m.jsx("input",{type:"number",value:E,onChange:T=>A({rotation:Number(T.target.value)}),className:ll})})]})]})]})}),MU=d.memo(function({blockTitle:e,params:n,compositionPath:r,onClose:i}){const[l,s]=d.useState(()=>{const u={};for(const h of n)u[h.key]=h.default;return u}),c=d.useCallback((u,h)=>{s(g=>({...g,[u]:h})),console.log(`[BlockParams] ${r} ${u}: ${h}`)},[r]);return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-800",children:[m.jsx("div",{className:"text-[11px] font-semibold text-neutral-200 truncate",children:e}),m.jsx("button",{type:"button",onClick:i,className:"text-neutral-500 hover:text-neutral-300 transition-colors",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M18 6 6 18"}),m.jsx("path",{d:"m6 6 12 12"})]})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[m.jsx("div",{className:"text-[9px] font-medium text-neutral-500 uppercase tracking-wider",children:"Parameters"}),n.map(u=>m.jsx(CU,{param:u,value:l[u.key]??u.default,onChange:h=>c(u.key,h)},u.key))]})]})});function CU({param:t,value:e,onChange:n}){return m.jsxs("div",{className:"space-y-1",children:[m.jsx("label",{className:"text-[10px] font-medium text-neutral-400",children:t.label}),t.type==="color"&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"color",value:e,onChange:r=>n(r.target.value),className:"w-7 h-7 rounded border border-neutral-700 bg-transparent cursor-pointer"}),m.jsx("input",{type:"text",value:e,onChange:r=>n(r.target.value),className:"flex-1 bg-neutral-900 border border-neutral-800 rounded px-2 py-1 text-[10px] text-neutral-200 font-mono focus:outline-none focus:border-neutral-700"})]}),t.type==="number"&&m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"range",min:t.min??0,max:t.max??100,step:t.step??1,value:e,onChange:r=>n(r.target.value),className:"flex-1"}),m.jsx("span",{className:"text-[10px] text-neutral-400 w-8 text-right tabular-nums",children:e})]}),t.type==="text"&&m.jsx("input",{type:"text",value:e,onChange:r=>n(r.target.value),className:"w-full bg-neutral-900 border border-neutral-800 rounded px-2 py-1 text-[10px] text-neutral-200 focus:outline-none focus:border-neutral-700"}),t.type==="select"&&t.options&&m.jsx("select",{value:e,onChange:r=>n(r.target.value),className:"w-full bg-neutral-900 border border-neutral-800 rounded px-2 py-1 text-[10px] text-neutral-200 focus:outline-none focus:border-neutral-700",children:t.options.map(r=>m.jsx("option",{value:r.value,children:r.label},r.value))})]})}function EU(t){if(t<1e3)return`${t}ms`;const e=Math.round(t/1e3);return e<60?`${e}s`:`${Math.floor(e/60)}m ${e%60}s`}function TU(t){const e=Date.now()-t;return e<6e4?"just now":e<36e5?`${Math.floor(e/6e4)}m ago`:`${Math.floor(e/36e5)}h ago`}const $U=d.memo(function({job:e,projectId:n,onDelete:r}){const[i,l]=d.useState(!1),s=`/api/projects/${n}/renders/file/${e.filename}`,c=d.useCallback(()=>{window.open(s,"_blank")},[s]),u=d.useCallback(O=>{O.stopPropagation();const x=document.createElement("a");x.href=s,x.download=e.filename,x.click()},[s,e.filename]),h=s,g=e.status==="complete";return m.jsx("div",{onPointerEnter:()=>l(!0),onPointerLeave:()=>l(!1),onClick:g?c:void 0,className:["px-3 py-2.5 border-b border-neutral-800/30 last:border-0 transition-colors duration-150",g?"cursor-pointer hover:bg-neutral-800/30":""].filter(Boolean).join(" "),children:m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsxs("div",{className:"w-20 h-[45px] rounded overflow-hidden bg-neutral-900 flex-shrink-0 relative",children:[g&&m.jsxs(m.Fragment,{children:[i&&m.jsx("video",{src:h,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-contain"}),m.jsx("div",{className:"absolute inset-0 transition-opacity duration-150",style:{opacity:i?0:1},children:m.jsx(xM,{src:h})})]}),e.status==="rendering"&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsx("div",{className:"w-2 h-2 rounded-full bg-studio-accent animate-pulse"})}),e.status==="failed"&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsx("div",{className:"w-2 h-2 rounded-full bg-red-400"})}),e.status==="cancelled"&&m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:m.jsx("div",{className:"w-2 h-2 rounded-full bg-neutral-600"})})]}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"text-[11px] font-medium text-neutral-300 truncate",children:e.filename}),e.durationMs&&m.jsx("span",{className:"text-[9px] text-neutral-600 flex-shrink-0",children:EU(e.durationMs)})]}),e.status==="rendering"&&m.jsxs("div",{className:"mt-1",children:[m.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[m.jsx("span",{className:"text-[9px] text-neutral-500",children:e.stage||"Rendering"}),m.jsxs("span",{className:"text-[9px] font-mono text-studio-accent",children:[e.progress,"%"]})]}),m.jsx("div",{className:"w-full h-1 bg-neutral-800 rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-studio-accent rounded-full transition-all duration-300",style:{width:`${e.progress}%`}})})]}),e.status==="failed"&&e.error&&m.jsx("span",{className:"text-[9px] text-red-400 mt-0.5 block",children:e.error}),e.status!=="rendering"&&m.jsx("span",{className:"text-[9px] text-neutral-600",children:TU(e.createdAt)})]}),i&&m.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[g&&m.jsx("button",{onClick:u,className:"p-1 rounded text-neutral-500 hover:text-green-400 transition-colors",title:"Download",children:m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),m.jsx("polyline",{points:"7 10 12 15 17 10"}),m.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),m.jsx("button",{onClick:O=>{O.stopPropagation(),r()},className:"p-1 rounded text-neutral-500 hover:text-red-400 transition-colors",title:"Remove",children:m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:m.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]})})}),jU=["auto","1080p","4k"],wS={auto:"Auto","1080p":"1080p","4k":"4K"},GM={landscape:{width:1920,height:1080},portrait:{width:1080,height:1920},"landscape-4k":{width:3840,height:2160},"portrait-4k":{width:2160,height:3840},square:{width:1080,height:1080},"square-4k":{width:2160,height:2160}};function PU(t){return t==null?"landscape":t.width===t.height?"square":t.height>t.width?"portrait":"landscape"}function UM(t,e){if(t==="auto")return"auto";const n=PU(e);return t==="1080p"?n:n==="landscape"?"landscape-4k":n==="portrait"?"portrait-4k":"square-4k"}function QU(t,e){if(t==="auto")return e??null;const n=UM(t,e);return n==="auto"?null:GM[n]}function ZU(t,e){if(t==="auto"||e==null)return!0;const n=UM(t,e);if(n==="auto")return!0;const r=GM[n];return r.width*e.height!==r.height*e.width||r.width<e.width?!1:Number.isInteger(r.width/e.width)}function NU(t,e){const n=QU(t,e);return n?`${wS[t]} · ${n.width}×${n.height}`:wS[t]}const R2={mp4:{label:"MP4",desc:"Best for general use. Smallest file, universal playback."},mov:{label:"MOV (ProRes 4444)",desc:"Transparent video. Works in CapCut, Final Cut Pro, Premiere, DaVinci Resolve, After Effects. Large files."},webm:{label:"WebM (VP9)",desc:"Transparent video for web. Smaller than MOV but limited editor support."}};function RU({format:t}){const[e,n]=d.useState(!1),r=d.useRef(void 0),i=()=>{clearTimeout(r.current),n(!0)},l=()=>{r.current=setTimeout(()=>n(!1),120)};d.useEffect(()=>()=>clearTimeout(r.current),[]);const s=R2[t];return m.jsxs("div",{className:"relative",onPointerEnter:i,onPointerLeave:l,children:[m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-600 hover:text-neutral-400 transition-colors cursor-help",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"}),m.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e&&m.jsxs("div",{className:"absolute top-full right-0 mt-1.5 w-52 p-2 rounded bg-neutral-900 border border-neutral-700 shadow-lg z-50",children:[m.jsx("p",{className:"text-[10px] font-semibold text-neutral-200 mb-0.5",children:s.label}),m.jsx("p",{className:"text-[9px] text-neutral-400 leading-tight",children:s.desc}),m.jsx("div",{className:"mt-1.5 pt-1.5 border-t border-neutral-800",children:["mp4","mov","webm"].filter(c=>c!==t).map(c=>m.jsxs("p",{className:"text-[9px] text-neutral-500 leading-relaxed",children:[m.jsx("span",{className:"text-neutral-400 font-medium",children:R2[c].label})," — ",R2[c].desc]},c))})]})]})}const kS=[{value:"draft",label:"Draft",title:"Fast render, smaller file"},{value:"standard",label:"Standard",title:"Good quality, balanced file size"},{value:"high",label:"High Quality",title:"Best quality, larger file"}];function VU({onStartRender:t,isRendering:e,compositionDimensions:n}){var y;const r=MM(),[i,l]=d.useState(r.format),[s,c]=d.useState(r.quality),[u,h]=d.useState("auto"),[g,O]=d.useState(r.fps),x=i!=="mov";return m.jsxs("div",{className:"flex items-center gap-1 flex-wrap justify-end",children:[m.jsx(RU,{format:i}),m.jsx("select",{value:u,onChange:v=>h(v.target.value),disabled:e,className:"h-5 px-1 text-[10px] rounded-l bg-neutral-800 border border-neutral-700 text-neutral-300 outline-none disabled:opacity-50",children:jU.map(v=>m.jsx("option",{value:v,disabled:!ZU(v,n),children:NU(v,n)},v))}),x&&m.jsx("select",{value:s,onChange:v=>{const w=v.target.value;c(w),d2(i,w,g)},disabled:e,title:(y=kS.find(v=>v.value===s))==null?void 0:y.title,className:"h-5 px-1 text-[10px] bg-neutral-800 border border-neutral-700 text-neutral-300 outline-none disabled:opacity-50",children:kS.map(v=>m.jsx("option",{value:v.value,title:v.title,children:v.label},v.value))}),m.jsxs("select",{value:g,onChange:v=>{const w=Number(v.target.value);O(w),d2(i,s,w)},disabled:e,title:"Frames per second",className:"h-5 px-1 text-[10px] bg-neutral-800 border border-neutral-700 text-neutral-300 outline-none disabled:opacity-50",children:[m.jsx("option",{value:24,children:"24fps"}),m.jsx("option",{value:30,children:"30fps"}),m.jsx("option",{value:60,children:"60fps"})]}),m.jsxs("select",{value:i,onChange:v=>{const w=v.target.value;l(w),d2(w,s,g)},disabled:e,className:"h-5 px-1 text-[10px] bg-neutral-800 border border-neutral-700 text-neutral-300 outline-none disabled:opacity-50",children:[m.jsx("option",{value:"mp4",children:"MP4"}),m.jsx("option",{value:"mov",children:"MOV"}),m.jsx("option",{value:"webm",children:"WebM"})]}),m.jsx("button",{onClick:()=>{Lt("render_start",{format:i,quality:s,resolution:u,fps:g}),t(i,s,u,g)},disabled:e,className:"flex items-center gap-1 px-2 py-0.5 text-[10px] font-semibold rounded-r bg-studio-accent text-[#09090B] hover:brightness-110 transition-colors disabled:opacity-50",children:e?"Rendering...":"Export"})]})}const LU=d.memo(function({jobs:e,projectId:n,onDelete:r,onClearCompleted:i,onStartRender:l,isRendering:s,compositionDimensions:c}){const u=d.useRef(null);d.useEffect(()=>{u.current&&u.current.scrollTo({top:u.current.scrollHeight,behavior:"smooth"})},[e.length]);const h=e.filter(g=>g.status!=="rendering").length;return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsx("div",{className:"flex items-center justify-end flex-wrap gap-y-1.5 px-3 py-2 border-b border-neutral-800/50 flex-shrink-0",children:m.jsxs("div",{className:"flex items-center gap-1.5",children:[h>0&&m.jsx("button",{onClick:i,className:"text-[10px] text-neutral-600 hover:text-neutral-400 transition-colors",children:"Clear"}),m.jsx(VU,{onStartRender:l,isRendering:s,compositionDimensions:c})]})}),m.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",children:e.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-4 gap-2",children:[m.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-neutral-700",children:[m.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M7 2v20M17 2v20M2 12h20M2 7h5M2 17h5M17 17h5M17 7h5",strokeLinecap:"round",strokeLinejoin:"round"})]}),m.jsx("p",{className:"text-[10px] text-neutral-600 text-center",children:"No renders yet"})]}):e.map(g=>m.jsx($U,{job:g,projectId:n,onDelete:()=>r(g.id)},g.id))})]})});function _U({selectedStudioMotion:t,designPanelActive:e,motionPanelActive:n,activeBlockParams:r,onCloseBlockParams:i}){const{rightWidth:l,rightPanelTab:s,setRightPanelTab:c,handlePanelResizeStart:u,handlePanelResizeMove:h,handlePanelResizeEnd:g}=G8(),{captionEditMode:O,previewIframeRef:x,projectId:y,activeCompPath:v,compositionDimensions:w,waitForPendingDomEditSaves:A,renderQueue:k}=No(),{domEditSelection:M,domEditGroupSelections:E,copiedAgentPrompt:$,clearDomSelection:C,handleDomStyleCommit:j,handleDomAttributeCommit:T,handleDomHtmlAttributeCommit:N,handleDomPathOffsetCommit:R,handleDomBoxSizeCommit:D,handleDomRotationCommit:V,handleDomTextCommit:z,handleDomTextFieldStyleCommit:I,handleDomAddTextField:U,handleDomRemoveTextField:K,handleAskAgent:H,handleDomMotionCommit:q,handleDomMotionClear:X,selectedGsapAnimations:G,gsapMultipleTimelines:F,gsapUnsupportedTimelinePattern:P,handleGsapUpdateProperty:Z,handleGsapUpdateMeta:L,handleGsapDeleteAnimation:B,handleGsapAddAnimation:J,handleGsapAddProperty:te,handleGsapRemoveProperty:Y,handleGsapUpdateFromProperty:re,handleGsapAddFromProperty:ae,handleGsapRemoveFromProperty:ue,commitAnimatedProperty:me}=Ed(),{assets:ye,fontAssets:Oe,projectDir:Se,handleImportFiles:Ae,handleImportFonts:Me}=kM(),Ve=k.jobs;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"group w-2 flex-shrink-0 cursor-col-resize flex items-center justify-center",style:{touchAction:"none"},onPointerDown:Pe=>u("right",Pe),onPointerMove:h,onPointerUp:g,children:m.jsx("div",{className:"h-[52px] w-px bg-white/12 transition-colors group-hover:bg-white/18 group-active:bg-white/24"})}),m.jsx("div",{className:"flex flex-col border-l border-neutral-800 bg-neutral-900 flex-shrink-0",style:{width:l},children:O?m.jsx(AU,{iframeRef:x}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-1 border-b border-neutral-800 px-3 py-2",children:[Mn&&m.jsxs(m.Fragment,{children:[m.jsx(Yt,{label:"Element styles and properties",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>c("design"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${s==="design"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:"Design"})}),m.jsx(Yt,{label:"Composition layer stack",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>c("layers"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${s==="layers"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:"Layers"})}),E8&&m.jsx(Yt,{label:"Animation and motion",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>c("motion"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${s==="motion"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:"Motion"})})]}),m.jsx(Yt,{label:"Render queue and exports",side:"bottom",children:m.jsx("button",{type:"button",onClick:()=>c("renders"),className:`h-8 rounded-xl px-3 text-[11px] font-medium transition-colors ${s==="renders"?"bg-neutral-800 text-white":"text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"}`,children:Ve.length>0?`Renders (${Ve.length})`:"Renders"})})]}),m.jsx("div",{className:"min-h-0 flex-1",children:s==="block-params"&&r?m.jsx(MU,{blockName:r.blockName,blockTitle:r.blockTitle,params:r.params,compositionPath:r.compositionPath,onClose:i??(()=>{})}):s==="layers"?m.jsx(xU,{}):e?m.jsx(WG,{projectId:y,projectDir:Se,assets:ye,element:E.length>1?null:M,multiSelectCount:E.length,copiedAgentPrompt:$,onClearSelection:C,onSetStyle:j,onSetAttribute:T,onSetHtmlAttribute:N,onSetManualOffset:R,onSetManualSize:D,onSetManualRotation:V,onSetText:z,onSetTextFieldStyle:I,onAddTextField:U,onRemoveTextField:K,onAskAgent:H,onImportAssets:Ae,fontAssets:Oe,onImportFonts:Me,previewIframeRef:x,gsapAnimations:G,gsapMultipleTimelines:F,gsapUnsupportedTimelinePattern:P,onUpdateGsapProperty:Z,onUpdateGsapMeta:L,onDeleteGsapAnimation:B,onAddGsapProperty:te,onRemoveGsapProperty:Y,onUpdateGsapFromProperty:re,onAddGsapFromProperty:ae,onRemoveGsapFromProperty:ue,onAddGsapAnimation:J,onCommitAnimatedProperty:me}):n?m.jsx(oU,{element:E.length>1?null:M,motion:t,onClearSelection:C,onSetMotion:q,onClearMotion:X}):m.jsx(LU,{jobs:Ve,projectId:y,onDelete:k.deleteRender,onClearCompleted:k.clearCompleted,onStartRender:async(Pe,ft,yt,Le)=>{await A();const Ye=v&&v!=="index.html"?v:void 0;await k.startRender({fps:Le,quality:ft,format:Pe,resolution:yt,composition:Ye})},compositionDimensions:w,isRendering:k.isRendering})})]})})]})}function DU(t,e){const n=t.slice().sort((l,s)=>l.percentage-s.percentage),r=new Set;for(const l of n)for(const s of Object.keys(l.properties))typeof l.properties[s]=="number"&&r.add(s);const i={};for(const l of r){let s=null,c=null;for(const u of n){const h=u.properties[l];typeof h=="number"&&(u.percentage<=e&&(s={pct:u.percentage,val:h}),u.percentage>=e&&!c&&(c={pct:u.percentage,val:h}))}if(s&&c&&s.pct!==c.pct){const u=(e-s.pct)/(c.pct-s.pct);i[l]=Math.round(s.val+u*(c.val-s.val))}else s?i[l]=Math.round(s.val):c&&(i[l]=Math.round(c.val))}return i}function HU(t,e,n){if(!(t!=null&&t.contentWindow))return{};let r;try{r=t.contentWindow.gsap}catch{return{}}if(!(r!=null&&r.getProperty))return{};const i=e.id?`#${e.id}`:e.selector;if(!i)return{};let l=null;try{l=t.contentDocument}catch{return{}}const s=l==null?void 0:l.querySelector(i);if(!s)return{};const c=new Set;for(const h of n)for(const g of Object.keys(h.properties))typeof h.properties[g]=="number"&&c.add(g);const u={};for(const h of c){const g=Number(r.getProperty(s,h));Number.isFinite(g)&&(u[h]=Math.round(g))}return u}function XU(t){var u,h;const e=fe(g=>g.currentTime);if(!t)return{state:"none",onToggle:void 0};const n=t.domEditSelection,r=t.selectedGsapAnimations,i=r.find(g=>g.keyframes),l=r.find(g=>!g.keyframes);let s="none";if(i!=null&&i.keyframes&&n){const g=Number.parseFloat(((u=n.dataAttributes)==null?void 0:u.start)??"0")||0,O=Number.parseFloat(((h=n.dataAttributes)==null?void 0:h.duration)??"1")||1,x=O>0?Math.max(0,Math.min(100,Math.round((e-g)/O*1e3)/10)):0;s=i.keyframes.keyframes.some(y=>Math.abs(y.percentage-x)<=1)?"active":"inactive"}return{state:s,onToggle:n?async()=>{var O,x,y,v;const g=fe.getState().currentTime;if(i!=null&&i.keyframes){i.hasUnresolvedKeyframes&&await((O=t.handleGsapMaterializeKeyframes)==null?void 0:O.call(t,i.id));const w=Number.parseFloat(((x=n.dataAttributes)==null?void 0:x.start)??"0")||0,A=Number.parseFloat(((y=n.dataAttributes)==null?void 0:y.duration)??"1")||1,k=A>0?Math.max(0,Math.min(100,Math.round((g-w)/A*1e3)/10)):0,M=i.keyframes.keyframes.find(E=>Math.abs(E.percentage-k)<=1);if(M)t.handleGsapRemoveKeyframe(i.id,M.percentage);else{const E=HU(((v=t.previewIframeRef)==null?void 0:v.current)??null,n,i.keyframes.keyframes),$=Object.keys(E).length>0?E:DU(i.keyframes.keyframes,k);for(const[C,j]of Object.entries($))t.handleGsapAddKeyframe(i.id,k,C,j)}}else l?t.handleGsapConvertToKeyframes(l.id):t.handleGsapAddAnimation("to")}:void 0}}function zU({toggleTimelineVisibility:t,domEditSession:e,onSplitElement:n}){const r=fe(g=>g.zoomMode),i=fe(g=>g.manualZoomPercent),l=fe(g=>g.setZoomMode),s=fe(g=>g.setManualZoomPercent),c=kd(r,i),{state:u,onToggle:h}=XU(e);return m.jsx("div",{className:"border-b border-neutral-800/40 bg-neutral-950/96",children:m.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-neutral-500",children:"Timeline"}),Ja&&h&&m.jsx(Yt,{label:u==="active"?"Remove keyframe at playhead":u==="inactive"?"Add keyframe at playhead":"Enable keyframes",children:m.jsx("button",{type:"button",onClick:h,className:`flex h-7 w-7 items-center justify-center rounded transition-colors ${u==="active"?"text-studio-accent":u==="inactive"?"text-neutral-400 hover:text-studio-accent":"text-neutral-600 hover:text-neutral-400"}`,children:m.jsx("svg",{width:"18",height:"18",viewBox:"0 0 10 10",fill:"currentColor",children:u==="active"?m.jsx("path",{d:"M5 0.5L9.5 5L5 9.5L0.5 5Z"}):m.jsx("path",{d:"M5 1.2L8.8 5L5 8.8L1.2 5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})})})}),n&&(()=>{const{selectedElementId:g,elements:O,currentTime:x}=fe.getState(),y=g?O.find(A=>(A.key??A.id)===g):null;if(!(y&&!y.compositionSrc&&["video","audio","img"].includes(y.tag)))return null;const w=x>y.start&&x<y.start+y.duration;return m.jsx(Yt,{label:"Split clip at playhead (S)",children:m.jsx("button",{type:"button",disabled:!w,onClick:()=>{w&&n(y,x)},className:`flex h-7 w-7 items-center justify-center rounded transition-colors ${w?"text-neutral-500 hover:text-neutral-200":"text-neutral-700 cursor-not-allowed"}`,children:m.jsx(aL,{size:15})})})})()]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(Yt,{label:"Fit timeline to width",children:m.jsx("button",{type:"button",onClick:()=>l("fit"),className:`h-7 px-2.5 rounded-md border text-[11px] font-medium transition-colors ${r==="fit"?"border-studio-accent/30 bg-studio-accent/10 text-studio-accent":"border-neutral-800 text-neutral-400 hover:border-neutral-700 hover:text-neutral-200"}`,children:"Fit"})}),m.jsx(Yt,{label:"Zoom out",children:m.jsx("button",{type:"button",onClick:()=>{l("manual"),s(cy("out",r,i))},className:"h-7 w-7 rounded-md border border-neutral-800 text-neutral-400 transition-colors hover:border-neutral-700 hover:text-neutral-200",children:"-"})}),m.jsx("div",{className:"min-w-[58px] text-center text-[10px] font-medium tabular-nums text-neutral-500",children:`${c}%`}),m.jsx(Yt,{label:"Zoom in",children:m.jsx("button",{type:"button",onClick:()=>{l("manual"),s(cy("in",r,i))},className:"h-7 w-7 rounded-md border border-neutral-800 text-neutral-400 transition-colors hover:border-neutral-700 hover:text-neutral-200",children:"+"})}),m.jsx(Yt,{label:Xw(!0),children:m.jsx("button",{type:"button",onClick:t,className:"ml-1 flex h-7 w-7 items-center justify-center rounded-md text-neutral-500 transition-colors hover:bg-neutral-900 hover:text-neutral-200","aria-label":"Hide timeline editor",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M5 7h14"}),m.jsx("path",{d:"m8 11 4 4 4-4"})]})})})]})]})})}function FU({waiting:t}){return m.jsx("div",{className:"h-full w-full bg-neutral-950 flex items-center justify-center",children:t?m.jsxs("div",{className:"flex flex-col items-center gap-3 text-center px-6",children:[m.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-neutral-700 border-t-neutral-500 animate-spin"}),m.jsxs("p",{className:"text-xs text-neutral-600",children:["Waiting for preview server… run"," ",m.jsx("code",{className:"text-neutral-500 font-mono",children:"npm run dev"})]})]}):m.jsx("div",{className:"w-4 h-4 rounded-full bg-studio-accent animate-pulse"})})}function BU({message:t,tone:e}){return m.jsx("div",{className:`absolute bottom-6 left-1/2 -translate-x-1/2 z-[91] px-4 py-2 rounded-lg border text-sm shadow-lg animate-in fade-in slide-in-from-bottom-2 ${e==="error"?"bg-red-900/90 border-red-700/50 text-red-200":"bg-neutral-900/95 border-neutral-700/60 text-neutral-100"}`,children:t})}function YU(){const[t,e]=d.useState(null),[n,r]=d.useState(!0),[i,l]=d.useState(!1);return Xt(()=>{const s=cb(window.location.hash);let c=!1,u=null;function h(){l(!0),u=window.setTimeout(g,2e3)}function g(){fetch("/api/projects").then(O=>O.json()).then(O=>{if(!c)if(s)e(s),l(!1);else{const x=(O.projects??[])[0];x?(e(x.id),l(!1),window.location.hash=Yw(x.id)):h()}}).catch(()=>{c||h()}).finally(()=>{c||r(!1)})}return g(),()=>{c=!0,u!==null&&clearTimeout(u)}}),d.useEffect(()=>{const s=()=>{const c=cb(window.location.hash);c&&c!==t&&e(c)};return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[t]),{projectId:t,resolving:n,waitingForServer:i}}function IU(){const{projectId:t,resolving:e,waitingForServer:n}=YU(),r=d.useRef(VV());d.useEffect(()=>{e||n||wT()||(kT(),RT({has_project:t!=null}))},[t,e,n]);const[i,l]=d.useState(null),[s,c]=d.useState(()=>r.current.activeCompPath==null),[u,h]=d.useState(new Map),[g,O]=d.useState(null),[x,y]=d.useState(!0),[v,w]=d.useState(0),[,A]=d.useState(0),[k,M]=d.useState(null),[E,$]=d.useState(null),C=d.useRef(null),j=d.useRef(i);j.current=i;const T=d.useRef(null),N=DT(t),R=Ot(Ce=>Ce.isEditMode),D=Ot(Ce=>Ce.selectedSegmentIds.size>0),V=gZ(t),z=fe(Ce=>Ce.currentTime),I=fe(Ce=>Ce.elements),U=fe(Ce=>Ce.setSelectedElementId),K=fe(Ce=>Ce.duration),H=fe(Ce=>Ce.isPlaying),q=!i||i==="index.html",X=i?`/api/projects/${t}/preview/comp/${i}`:null,G=d.useMemo(()=>{const Ce=I.length>0?Math.max(...I.map(rt=>rt.start+rt.duration)):0;return Math.max(K,Ce)},[K,I]),F=d.useCallback(()=>{A(Ce=>Ce+1),window.setTimeout(()=>A(Ce=>Ce+1),80),window.setTimeout(()=>A(Ce=>Ce+1),300)},[]),[P,Z]=d.useState(()=>r.current.timelineVisible??ul().timelineVisible??!0),L=d.useCallback(()=>{Z(Ce=>(ho({timelineVisible:!Ce}),!Ce))},[]),{appToast:B,showToast:J}=jV(),te=jZ({rightCollapsed:r.current.rightCollapsed,rightPanelTab:r.current.rightPanelTab}),Y=$Z({projectId:t}),re=d.useRef(0),ae=d.useRef(new Set),ue=d.useCallback(()=>{w(Ce=>Ce+1)},[]),me=IZ({projectId:t,showToast:J,recordEdit:Y.recordEdit,domEditSaveTimestampRef:re,setRefreshKey:w});d.useEffect(()=>{if(s||!me.fileTreeLoaded)return;const Ce=QV(r.current.activeCompPath,me.fileTree);l(rt=>rt===Ce?rt:Ce),c(!0)},[s,me.fileTree,me.fileTreeLoaded]);const ye=PN({projectId:t,showToast:J,readOptionalProjectFile:me.readOptionalProjectFile,writeProjectFile:me.writeProjectFile,recordEdit:Y.recordEdit,previewIframeRef:C,activeCompPathRef:j,domEditSaveTimestampRef:re,reloadPreview:()=>w(Ce=>Ce+1),pendingTimelineEditPathRef:ae}),Oe=DN({projectId:t,activeCompPath:i,timelineElements:I,showToast:J,writeProjectFile:me.writeProjectFile,recordEdit:Y.recordEdit,domEditSaveTimestampRef:re,reloadPreview:ue,previewIframeRef:C,pendingTimelineEditPathRef:ae,uploadProjectFiles:me.uploadProjectFiles}),Se=d.useMemo(()=>({activeCompPath:i,timelineElements:I,readProjectFile:me.readProjectFile,writeProjectFile:me.writeProjectFile,recordEdit:Y.recordEdit,refreshFileTree:me.refreshFileTree,reloadPreview:ue,showToast:J}),[i,I,me,Y.recordEdit,ue,J]),Ae=d.useCallback(Ce=>{t&&(async()=>{const rt=await Ap({projectId:t,blockName:Ce,...Se,previewIframe:C.current,currentTime:fe.getState().currentTime}),bn=(rt==null?void 0:rt.block.type)==="hyperframes:block"?rt.block.params:void 0;bn!=null&&bn.length&&(M({blockName:rt.block.name,blockTitle:rt.block.title,params:bn,compositionPath:rt.compositionPath}),te.setRightCollapsed(!1),te.setRightPanelTab("block-params"))})()},[t,Se,te]),Me=d.useCallback((Ce,rt)=>{t&&Ap({projectId:t,blockName:Ce,placement:rt,...Se,previewIframe:C.current,currentTime:fe.getState().currentTime})},[t,Se]),Ve=d.useCallback((Ce,rt)=>{t&&Ap({projectId:t,blockName:Ce,visualPosition:rt,...Se,previewIframe:C.current,currentTime:fe.getState().currentTime})},[t,Se]),Pe=d.useRef(()=>{}),ft=d.useRef(null),yt=d.useRef(async()=>{}),Le=Ce=>yt.current(Ce),Ye=d.useRef(()=>!1),_e=d.useRef(()=>{}),be=d.useRef(()=>{}),{handleCopy:dt,handlePaste:Ue,handleCut:bt}=fV({projectId:t,activeCompPath:i,domEditSelectionRef:ft,showToast:J,writeProjectFile:me.writeProjectFile,recordEdit:Y.recordEdit,domEditSaveTimestampRef:re,reloadPreview:ue,handleTimelineElementDelete:Oe.handleTimelineElementDelete,handleDomEditElementDelete:Le,previewIframeRef:C}),Re=aV({toggleTimelineVisibility:L,handleTimelineElementDelete:Oe.handleTimelineElementDelete,handleTimelineElementSplit:Oe.handleTimelineElementSplit,handleDomEditElementDelete:Le,domEditSelectionRef:ft,editHistory:Y,readOptionalProjectFile:me.readOptionalProjectFile,readProjectFile:me.readProjectFile,writeProjectFile:me.writeProjectFile,domEditSaveTimestampRef:re,showToast:J,syncHistoryPreviewAfterApply:ye.syncHistoryPreviewAfterApply,waitForPendingDomEditSaves:ye.waitForPendingDomEditSaves,leftSidebarRef:T,handleCopy:dt,handlePaste:Ue,handleCut:bt,onResetKeyframes:()=>Ye.current(),onDeleteSelectedKeyframes:()=>_e.current(),onAfterUndoRedo:()=>be.current()}),on=d.useCallback(Ce=>{var rt;return(rt=T.current)==null?void 0:rt.selectTab(Ce)},[]),Rt=d.useCallback(()=>{var Ce;return((Ce=T.current)==null?void 0:Ce.getTab())??"compositions"},[]),we=rV({projectId:t,activeCompPath:i,isMasterView:q,compIdToSrc:u,captionEditMode:R,compositionLoading:x,previewIframeRef:C,timelineElements:I,currentTime:z,setSelectedTimelineElementId:U,setRightCollapsed:te.setRightCollapsed,setRightPanelTab:te.setRightPanelTab,showToast:J,refreshPreviewDocumentVersion:F,queueDomEditSave:ye.queueDomEditSave,readProjectFile:me.readProjectFile,writeProjectFile:me.writeProjectFile,domEditSaveTimestampRef:re,editHistory:{recordEdit:Y.recordEdit},fileTree:me.fileTree,importedFontAssetsRef:me.importedFontAssetsRef,projectDir:me.projectDir,projectIdRef:me.projectIdRef,previewIframe:g,refreshKey:v,rightPanelTab:te.rightPanelTab,applyStudioManualEditsToPreviewRef:ye.applyStudioManualEditsToPreviewRef,syncPreviewHistoryHotkey:Re.syncPreviewHistoryHotkey,reloadPreview:ue,setRefreshKey:w,openSourceForSelection:me.openSourceForSelection,selectSidebarTab:on,getSidebarTab:Rt});ft.current=we.domEditSelection,Pe.current=we.clearDomSelection,yt.current=we.handleDomEditElementDelete,Ye.current=we.handleResetSelectedElementKeyframes,be.current=we.invalidateGsapCache,_e.current=()=>{const Ce=fe.getState().selectedKeyframes,rt=we.selectedGsapAnimations.find(bn=>bn.keyframes);!rt||Ce.size===0||Ce.forEach(bn=>{const mr=Number(bn.split(":")[1]);Number.isFinite(mr)&&we.handleGsapRemoveKeyframe(rt.id,mr)})},OV({projectId:t,activeCompPath:i,compIdToSrc:u,captionEditMode:R,captionHasSelection:D,previewIframeRef:C,captionSync:V,setRightCollapsed:te.setRightCollapsed});const ht=wV({projectIdRef:me.projectIdRef,compIdToSrc:u,activePreviewUrl:X,effectiveTimelineDuration:G}),Mt=$V(),{lintModal:ot,linting:ve,handleLint:ze,closeLintModal:Ze}=TV(t),Be=EV({projectId:t,activeCompPath:i,showToast:J,waitForPendingDomEditSaves:ye.waitForPendingDomEditSaves}),{consoleErrors:vt,setConsoleErrors:lt,resetErrors:Je}=kV(g),mt=XV(me.handleImportFiles),Tt=d.useCallback(Ce=>{C.current=Ce,O(Ce),Re.syncPreviewTimelineHotkey(Ce),Re.syncPreviewHistoryHotkey(Ce),Je(),F()},[Re,Je,F]),cn=d.useCallback(Ce=>{l(Ce.endsWith(".html")?Ce:null),me.setEditingFile({path:Ce,content:null}),fetch(`/api/projects/${t}/files/${Ce}`).then(rt=>rt.json()).then(rt=>me.setEditingFile({path:Ce,content:rt.content})).catch(()=>{})},[t,me]),{selectedStudioMotion:Bn,designPanelActive:bl,motionPanelActive:Sa,inspectorPanelActive:Zi,inspectorButtonActive:En,shouldShowSelectedDomBounds:di}=HV(te.rightPanelTab,te.rightCollapsed,H,we.domEditSelection);_V({projectId:t,activeCompPath:i,currentTime:z,duration:G,isPlaying:H,compositionLoading:x,refreshKey:v,previewIframeRef:C,rightPanelTab:te.rightPanelTab,rightCollapsed:te.rightCollapsed,timelineVisible:P,activeCompPathHydrated:s,domEditSelection:we.domEditSelection,buildDomSelectionFromTarget:we.buildDomSelectionFromTarget,applyDomSelection:we.applyDomSelection,initialState:r.current});const wa=DV({projectId:t,activeCompPath:i,setActiveCompPath:l,showToast:J,previewIframeRef:C,captionEditMode:R,compositionLoading:x,refreshKey:v,setRefreshKey:w,currentTime:z,timelineElements:I,isPlaying:H,editHistory:Y,handleUndo:Re.handleUndo,handleRedo:Re.handleRedo,renderQueue:{jobs:N.jobs,isRendering:N.isRendering,deleteRender:N.deleteRender,clearCompleted:N.clearCompleted,startRender:N.startRender},compositionDimensions:Mt,waitForPendingDomEditSaves:ye.waitForPendingDomEditSaves,handlePreviewIframeRef:Tt,refreshPreviewDocumentVersion:F,timelineVisible:P,toggleTimelineVisibility:L});if(e||n||!t)return m.jsx(FU,{waiting:n});const ka=m.jsx(zU,{toggleTimelineVisibility:L,domEditSession:we,onSplitElement:Oe.handleTimelineElementSplit});return m.jsx(lL,{value:wa,children:m.jsx(sL,{value:te,children:m.jsx(OI,{value:me,children:m.jsx(oL,{value:we,children:m.jsxs("div",{className:"flex flex-col h-full w-full bg-neutral-950 relative",onDragOver:mt.onDragOver,onDragEnter:mt.onDragEnter,onDragLeave:mt.onDragLeave,onDrop:mt.onDrop,children:[m.jsx(uL,{captureFrameHref:Be.captureFrameHref,captureFrameFilename:Be.captureFrameFilename,handleCaptureFrameClick:Be.handleCaptureFrameClick,refreshCaptureFrameTime:Be.refreshCaptureFrameTime,inspectorButtonActive:En,inspectorPanelActive:Zi}),m.jsxs("div",{className:"flex flex-1 min-h-0",children:[m.jsx(xI,{leftSidebarRef:T,onSelectComposition:cn,onAddBlock:Ae,onPreviewBlock:$,onLint:ze,linting:ve}),m.jsx(Hq,{timelineToolbar:ka,renderClipContent:ht,handleTimelineElementDelete:Oe.handleTimelineElementDelete,handleTimelineAssetDrop:Oe.handleTimelineAssetDrop,handleTimelineBlockDrop:Me,handlePreviewBlockDrop:Ve,handleTimelineFileDrop:Oe.handleTimelineFileDrop,handleTimelineElementMove:Oe.handleTimelineElementMove,handleTimelineElementResize:Oe.handleTimelineElementResize,handleBlockedTimelineEdit:Oe.handleBlockedTimelineEdit,handleTimelineElementSplit:Oe.handleTimelineElementSplit,setCompIdToSrc:h,setCompositionLoading:y,shouldShowSelectedDomBounds:di,blockPreview:E}),!te.rightCollapsed&&m.jsx(_U,{selectedStudioMotion:Bn,designPanelActive:bl,motionPanelActive:Sa,activeBlockParams:k,onCloseBlockParams:()=>{M(null),te.setRightPanelTab("design")}})]}),ot!==null&&m.jsx(My,{findings:ot,projectId:t,onClose:Ze}),vt!==null&&vt.length>0&&m.jsx(My,{findings:vt,projectId:t,onClose:()=>lt(null)}),we.agentModalOpen&&we.domEditSelection&&m.jsx(FV,{selectionLabel:we.domEditSelection.label,contextPreview:fR(we.domEditSelection,i),anchorPoint:we.agentModalAnchorPoint,onSubmit:we.handleAgentModalSubmit,onClose:()=>{we.setAgentModalOpen(!1),we.setAgentPromptSelectionContext(void 0),we.setAgentModalAnchorPoint(null)}}),mt.active&&m.jsx(BV,{}),B&&m.jsx(BU,{message:B.message,tone:B.tone})]})})})})})}class qU extends d.Component{constructor(){super(...arguments);E5(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var i,l;console.error("[Studio] Uncaught error:",n,r.componentStack),Lt("crash",{error_message:n.message,error_name:n.name,stack_trace:((i=n.stack)==null?void 0:i.slice(0,4e3))??null,component_stack:((l=r.componentStack)==null?void 0:l.slice(0,2e3))??null})}render(){return this.state.error?m.jsxs("div",{style:{position:"fixed",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#0a0a0a",color:"#e5e5e5",fontFamily:"system-ui, -apple-system, sans-serif",gap:16},children:[m.jsx("div",{style:{fontSize:18,fontWeight:600},children:"Something went wrong"}),m.jsx("div",{style:{fontSize:13,color:"#888",maxWidth:480,textAlign:"center"},children:this.state.error.message}),m.jsx("button",{onClick:()=>this.setState({error:null}),style:{marginTop:8,padding:"8px 20px",background:"#2563eb",color:"#fff",border:"none",borderRadius:6,fontSize:14,cursor:"pointer"},children:"Try again"})]}):this.props.children}}Lt("session_start");function WM(t){var e;return t instanceof Error?{error_message:t.message,error_name:t.name,stack_trace:((e=t.stack)==null?void 0:e.slice(0,4e3))??null}:{error_message:String(t),error_name:null,stack_trace:null}}function GU(t,e){return!!(t.includes("Error fetching")&&(t.includes("404")||t.includes("Not Found"))||e==="EncodingError"||t.includes("unsupported or unrecognizable format")||t.includes("MEDIA_ERR_SRC_NOT_SUPPORTED"))}const KM=50;let V2=0,L2=0,AS=!1,MS=!1;window.addEventListener("error",t=>{var e;if((e=t.message)!=null&&e.includes("ResizeObserver loop")){t.stopImmediatePropagation(),t.preventDefault();return}if(V2++,V2>KM){AS||(AS=!0,Lt("error_cap_reached",{count:V2}));return}Lt("unhandled_error",{...WM(t.error),error_message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno})});let gf=0;window.addEventListener("unhandledrejection",t=>{const e=WM(t.reason);if(GU(e.error_message,e.error_name)){gf++,(gf===1||gf%100===0)&&Lt("composition_asset_error_filtered",{error_message:e.error_message.slice(0,200),error_name:e.error_name,total_filtered:gf});return}if(L2++,L2>KM){MS||(MS=!0,Lt("rejection_cap_reached",{count:L2}));return}Lt("unhandled_promise_rejection",e)});gT.createRoot(document.getElementById("root")).render(m.jsx(d.StrictMode,{children:m.jsx(qU,{children:m.jsx(IU,{})})}));