hurler 0.1.0

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.
@@ -0,0 +1,67 @@
1
+ function nk(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in n)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function t(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=t(o);fetch(o.href,s)}})();function mS(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var im={exports:{}},Ns={};var Jb;function ik(){if(Jb)return Ns;Jb=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var f in o)f!=="key"&&(s[f]=o[f])}else s=o;return o=s.ref,{$$typeof:n,type:r,key:c,ref:o!==void 0?o:null,props:s}}return Ns.Fragment=e,Ns.jsx=t,Ns.jsxs=t,Ns}var ex;function rk(){return ex||(ex=1,im.exports=ik()),im.exports}var S=rk(),rm={exports:{}},Ee={};var tx;function lk(){if(tx)return Ee;tx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),y=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=y&&k[y]||k["@@iterator"],typeof k=="function"?k:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,M={};function T(k,Y,te){this.props=k,this.context=Y,this.refs=M,this.updater=te||A}T.prototype.isReactComponent={},T.prototype.setState=function(k,Y){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,Y,"setState")},T.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function D(){}D.prototype=T.prototype;function N(k,Y,te){this.props=k,this.context=Y,this.refs=M,this.updater=te||A}var j=N.prototype=new D;j.constructor=N,C(j,T.prototype),j.isPureReactComponent=!0;var H=Array.isArray;function P(){}var _={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function Z(k,Y,te){var re=te.ref;return{$$typeof:n,type:k,key:Y,ref:re!==void 0?re:null,props:te}}function ie(k,Y){return Z(k.type,Y,k.props)}function ne(k){return typeof k=="object"&&k!==null&&k.$$typeof===n}function ee(k){var Y={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(te){return Y[te]})}var se=/\/+/g;function oe(k,Y){return typeof k=="object"&&k!==null&&k.key!=null?ee(""+k.key):Y.toString(36)}function ae(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(P,P):(k.status="pending",k.then(function(Y){k.status==="pending"&&(k.status="fulfilled",k.value=Y)},function(Y){k.status==="pending"&&(k.status="rejected",k.reason=Y)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function R(k,Y,te,re,me){var ye=typeof k;(ye==="undefined"||ye==="boolean")&&(k=null);var J=!1;if(k===null)J=!0;else switch(ye){case"bigint":case"string":case"number":J=!0;break;case"object":switch(k.$$typeof){case n:case e:J=!0;break;case p:return J=k._init,R(J(k._payload),Y,te,re,me)}}if(J)return me=me(k),J=re===""?"."+oe(k,0):re,H(me)?(te="",J!=null&&(te=J.replace(se,"$&/")+"/"),R(me,Y,te,"",function(Ne){return Ne})):me!=null&&(ne(me)&&(me=ie(me,te+(me.key==null||k&&k.key===me.key?"":(""+me.key).replace(se,"$&/")+"/")+J)),Y.push(me)),1;J=0;var Ae=re===""?".":re+":";if(H(k))for(var Me=0;Me<k.length;Me++)re=k[Me],ye=Ae+oe(re,Me),J+=R(re,Y,te,ye,me);else if(Me=x(k),typeof Me=="function")for(k=Me.call(k),Me=0;!(re=k.next()).done;)re=re.value,ye=Ae+oe(re,Me++),J+=R(re,Y,te,ye,me);else if(ye==="object"){if(typeof k.then=="function")return R(ae(k),Y,te,re,me);throw Y=String(k),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return J}function z(k,Y,te){if(k==null)return k;var re=[],me=0;return R(k,re,"","",function(ye){return Y.call(te,ye,me++)}),re}function L(k){if(k._status===-1){var Y=k._result;Y=Y(),Y.then(function(te){(k._status===0||k._status===-1)&&(k._status=1,k._result=te)},function(te){(k._status===0||k._status===-1)&&(k._status=2,k._result=te)}),k._status===-1&&(k._status=0,k._result=Y)}if(k._status===1)return k._result.default;throw k._result}var F=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ue={map:z,forEach:function(k,Y,te){z(k,function(){Y.apply(this,arguments)},te)},count:function(k){var Y=0;return z(k,function(){Y++}),Y},toArray:function(k){return z(k,function(Y){return Y})||[]},only:function(k){if(!ne(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ee.Activity=v,Ee.Children=ue,Ee.Component=T,Ee.Fragment=t,Ee.Profiler=o,Ee.PureComponent=N,Ee.StrictMode=r,Ee.Suspense=h,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(k){return _.H.useMemoCache(k)}},Ee.cache=function(k){return function(){return k.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(k,Y,te){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var re=C({},k.props),me=k.key;if(Y!=null)for(ye in Y.key!==void 0&&(me=""+Y.key),Y)!G.call(Y,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&Y.ref===void 0||(re[ye]=Y[ye]);var ye=arguments.length-2;if(ye===1)re.children=te;else if(1<ye){for(var J=Array(ye),Ae=0;Ae<ye;Ae++)J[Ae]=arguments[Ae+2];re.children=J}return Z(k.type,me,re)},Ee.createContext=function(k){return k={$$typeof:c,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:s,_context:k},k},Ee.createElement=function(k,Y,te){var re,me={},ye=null;if(Y!=null)for(re in Y.key!==void 0&&(ye=""+Y.key),Y)G.call(Y,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(me[re]=Y[re]);var J=arguments.length-2;if(J===1)me.children=te;else if(1<J){for(var Ae=Array(J),Me=0;Me<J;Me++)Ae[Me]=arguments[Me+2];me.children=Ae}if(k&&k.defaultProps)for(re in J=k.defaultProps,J)me[re]===void 0&&(me[re]=J[re]);return Z(k,ye,me)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(k){return{$$typeof:f,render:k}},Ee.isValidElement=ne,Ee.lazy=function(k){return{$$typeof:p,_payload:{_status:-1,_result:k},_init:L}},Ee.memo=function(k,Y){return{$$typeof:d,type:k,compare:Y===void 0?null:Y}},Ee.startTransition=function(k){var Y=_.T,te={};_.T=te;try{var re=k(),me=_.S;me!==null&&me(te,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(P,F)}catch(ye){F(ye)}finally{Y!==null&&te.types!==null&&(Y.types=te.types),_.T=Y}},Ee.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Ee.use=function(k){return _.H.use(k)},Ee.useActionState=function(k,Y,te){return _.H.useActionState(k,Y,te)},Ee.useCallback=function(k,Y){return _.H.useCallback(k,Y)},Ee.useContext=function(k){return _.H.useContext(k)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(k,Y){return _.H.useDeferredValue(k,Y)},Ee.useEffect=function(k,Y){return _.H.useEffect(k,Y)},Ee.useEffectEvent=function(k){return _.H.useEffectEvent(k)},Ee.useId=function(){return _.H.useId()},Ee.useImperativeHandle=function(k,Y,te){return _.H.useImperativeHandle(k,Y,te)},Ee.useInsertionEffect=function(k,Y){return _.H.useInsertionEffect(k,Y)},Ee.useLayoutEffect=function(k,Y){return _.H.useLayoutEffect(k,Y)},Ee.useMemo=function(k,Y){return _.H.useMemo(k,Y)},Ee.useOptimistic=function(k,Y){return _.H.useOptimistic(k,Y)},Ee.useReducer=function(k,Y,te){return _.H.useReducer(k,Y,te)},Ee.useRef=function(k){return _.H.useRef(k)},Ee.useState=function(k){return _.H.useState(k)},Ee.useSyncExternalStore=function(k,Y,te){return _.H.useSyncExternalStore(k,Y,te)},Ee.useTransition=function(){return _.H.useTransition()},Ee.version="19.2.4",Ee}var nx;function Xp(){return nx||(nx=1,rm.exports=lk()),rm.exports}var w=Xp();const xr=mS(w),pS=nk({__proto__:null,default:xr},[w]);var lm={exports:{}},_s={},om={exports:{}},sm={};var ix;function ok(){return ix||(ix=1,(function(n){function e(R,z){var L=R.length;R.push(z);e:for(;0<L;){var F=L-1>>>1,ue=R[F];if(0<o(ue,z))R[F]=z,R[L]=ue,L=F;else break e}}function t(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var z=R[0],L=R.pop();if(L!==z){R[0]=L;e:for(var F=0,ue=R.length,k=ue>>>1;F<k;){var Y=2*(F+1)-1,te=R[Y],re=Y+1,me=R[re];if(0>o(te,L))re<ue&&0>o(me,te)?(R[F]=me,R[re]=L,F=re):(R[F]=te,R[Y]=L,F=Y);else if(re<ue&&0>o(me,L))R[F]=me,R[re]=L,F=re;else break e}}return z}function o(R,z){var L=R.sortIndex-z.sortIndex;return L!==0?L:R.id-z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var c=Date,f=c.now();n.unstable_now=function(){return c.now()-f}}var h=[],d=[],p=1,v=null,y=3,x=!1,A=!1,C=!1,M=!1,T=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function j(R){for(var z=t(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=R)r(d),z.sortIndex=z.expirationTime,e(h,z);else break;z=t(d)}}function H(R){if(C=!1,j(R),!A)if(t(h)!==null)A=!0,P||(P=!0,ee());else{var z=t(d);z!==null&&ae(H,z.startTime-R)}}var P=!1,_=-1,G=5,Z=-1;function ie(){return M?!0:!(n.unstable_now()-Z<G)}function ne(){if(M=!1,P){var R=n.unstable_now();Z=R;var z=!0;try{e:{A=!1,C&&(C=!1,D(_),_=-1),x=!0;var L=y;try{t:{for(j(R),v=t(h);v!==null&&!(v.expirationTime>R&&ie());){var F=v.callback;if(typeof F=="function"){v.callback=null,y=v.priorityLevel;var ue=F(v.expirationTime<=R);if(R=n.unstable_now(),typeof ue=="function"){v.callback=ue,j(R),z=!0;break t}v===t(h)&&r(h),j(R)}else r(h);v=t(h)}if(v!==null)z=!0;else{var k=t(d);k!==null&&ae(H,k.startTime-R),z=!1}}break e}finally{v=null,y=L,x=!1}z=void 0}}finally{z?ee():P=!1}}}var ee;if(typeof N=="function")ee=function(){N(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,oe=se.port2;se.port1.onmessage=ne,ee=function(){oe.postMessage(null)}}else ee=function(){T(ne,0)};function ae(R,z){_=T(function(){R(n.unstable_now())},z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(R){R.callback=null},n.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<R?Math.floor(1e3/R):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_next=function(R){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var L=y;y=z;try{return R()}finally{y=L}},n.unstable_requestPaint=function(){M=!0},n.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var L=y;y=R;try{return z()}finally{y=L}},n.unstable_scheduleCallback=function(R,z,L){var F=n.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?F+L:F):L=F,R){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=L+ue,R={id:p++,callback:z,priorityLevel:R,startTime:L,expirationTime:ue,sortIndex:-1},L>F?(R.sortIndex=L,e(d,R),t(h)===null&&R===t(d)&&(C?(D(_),_=-1):C=!0,ae(H,L-F))):(R.sortIndex=ue,e(h,R),A||x||(A=!0,P||(P=!0,ee()))),R},n.unstable_shouldYield=ie,n.unstable_wrapCallback=function(R){var z=y;return function(){var L=y;y=z;try{return R.apply(this,arguments)}finally{y=L}}}})(sm)),sm}var rx;function sk(){return rx||(rx=1,om.exports=ok()),om.exports}var am={exports:{}},Ht={};var lx;function ak(){if(lx)return Ht;lx=1;var n=Xp();function e(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var r={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(h,d,p){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:h,containerInfo:d,implementation:p}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ht.createPortal=function(h,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(h,d,null,p)},Ht.flushSync=function(h){var d=c.T,p=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=d,r.p=p,r.d.f()}},Ht.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(h,d))},Ht.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Ht.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var p=d.as,v=f(p,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:x}):p==="script"&&r.d.X(h,{crossOrigin:v,integrity:y,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ht.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=f(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},Ht.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,v=f(p,d.crossOrigin);r.d.L(h,p,{crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ht.preloadModule=function(h,d){if(typeof h=="string")if(d){var p=f(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},Ht.requestFormReset=function(h){r.d.r(h)},Ht.unstable_batchedUpdates=function(h,d){return h(d)},Ht.useFormState=function(h,d,p){return c.H.useFormState(h,d,p)},Ht.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ht.version="19.2.4",Ht}var ox;function gS(){if(ox)return am.exports;ox=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),am.exports=ak(),am.exports}var sx;function ck(){if(sx)return _s;sx=1;var n=sk(),e=Xp(),t=gS();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)l+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var l=i,a=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(a=l.return),i=l.return;while(i)}return l.tag===3?a:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function f(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function h(i){if(s(i)!==i)throw Error(r(188))}function d(i){var l=i.alternate;if(!l){if(l=s(i),l===null)throw Error(r(188));return l!==i?null:i}for(var a=i,u=l;;){var m=a.return;if(m===null)break;var g=m.alternate;if(g===null){if(u=m.return,u!==null){a=u;continue}break}if(m.child===g.child){for(g=m.child;g;){if(g===a)return h(m),i;if(g===u)return h(m),l;g=g.sibling}throw Error(r(188))}if(a.return!==u.return)a=m,u=g;else{for(var b=!1,E=m.child;E;){if(E===a){b=!0,a=m,u=g;break}if(E===u){b=!0,u=m,a=g;break}E=E.sibling}if(!b){for(E=g.child;E;){if(E===a){b=!0,a=g,u=m;break}if(E===u){b=!0,u=g,a=m;break}E=E.sibling}if(!b)throw Error(r(189))}}if(a.alternate!==u)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?i:l}function p(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=p(i),l!==null)return l;i=i.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),N=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function ee(i){return i===null||typeof i!="object"?null:(i=ne&&i[ne]||i["@@iterator"],typeof i=="function"?i:null)}var se=Symbol.for("react.client.reference");function oe(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===se?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case T:return"Profiler";case M:return"StrictMode";case H:return"Suspense";case P:return"SuspenseList";case Z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case A:return"Portal";case N:return i.displayName||"Context";case D:return(i._context.displayName||"Context")+".Consumer";case j:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case _:return l=i.displayName||null,l!==null?l:oe(i.type)||"Memo";case G:l=i._payload,i=i._init;try{return oe(i(l))}catch{}}return null}var ae=Array.isArray,R=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},F=[],ue=-1;function k(i){return{current:i}}function Y(i){0>ue||(i.current=F[ue],F[ue]=null,ue--)}function te(i,l){ue++,F[ue]=i.current,i.current=l}var re=k(null),me=k(null),ye=k(null),J=k(null);function Ae(i,l){switch(te(ye,l),te(me,i),te(re,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?wb(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=wb(l),i=Cb(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(re),te(re,i)}function Me(){Y(re),Y(me),Y(ye)}function Ne(i){i.memoizedState!==null&&te(J,i);var l=re.current,a=Cb(l,i.type);l!==a&&(te(me,i),te(re,a))}function He(i){me.current===i&&(Y(re),Y(me)),J.current===i&&(Y(J),ks._currentValue=L)}var Ye,It;function Gt(i){if(Ye===void 0)try{throw Error()}catch(a){var l=a.stack.trim().match(/\n( *(at )?)/);Ye=l&&l[1]||"",It=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Ye+i+It}var Ur=!1;function Pr(i,l){if(!i||Ur)return"";Ur=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(l){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(K){var q=K}Reflect.construct(i,[],$)}else{try{$.call()}catch(K){q=K}i.call($.prototype)}}else{try{throw Error()}catch(K){q=K}($=i())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(K){if(K&&q&&typeof K.stack=="string")return[K.stack,q.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),b=g[0],E=g[1];if(b&&E){var O=b.split(`
4
+ `),I=E.split(`
5
+ `);for(m=u=0;u<O.length&&!O[u].includes("DetermineComponentFrameRoot");)u++;for(;m<I.length&&!I[m].includes("DetermineComponentFrameRoot");)m++;if(u===O.length||m===I.length)for(u=O.length-1,m=I.length-1;1<=u&&0<=m&&O[u]!==I[m];)m--;for(;1<=u&&0<=m;u--,m--)if(O[u]!==I[m]){if(u!==1||m!==1)do if(u--,m--,0>m||O[u]!==I[m]){var W=`
6
+ `+O[u].replace(" at new "," at ");return i.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",i.displayName)),W}while(1<=u&&0<=m);break}}}finally{Ur=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?Gt(a):""}function Uo(i,l){switch(i.tag){case 26:case 27:case 5:return Gt(i.type);case 16:return Gt("Lazy");case 13:return i.child!==l&&l!==null?Gt("Suspense Fallback"):Gt("Suspense");case 19:return Gt("SuspenseList");case 0:case 15:return Pr(i.type,!1);case 11:return Pr(i.type.render,!1);case 1:return Pr(i.type,!0);case 31:return Gt("Activity");default:return""}}function Jg(i){try{var l="",a=null;do l+=Uo(i,a),a=i,i=i.return;while(i);return l}catch(u){return`
7
+ Error generating stack: `+u.message+`
8
+ `+u.stack}}var If=Object.prototype.hasOwnProperty,Gf=n.unstable_scheduleCallback,qf=n.unstable_cancelCallback,BE=n.unstable_shouldYield,zE=n.unstable_requestPaint,rn=n.unstable_now,LE=n.unstable_getCurrentPriorityLevel,e0=n.unstable_ImmediatePriority,t0=n.unstable_UserBlockingPriority,Ma=n.unstable_NormalPriority,jE=n.unstable_LowPriority,n0=n.unstable_IdlePriority,HE=n.log,UE=n.unstable_setDisableYieldValue,Po=null,ln=null;function Wi(i){if(typeof HE=="function"&&UE(i),ln&&typeof ln.setStrictMode=="function")try{ln.setStrictMode(Po,i)}catch{}}var on=Math.clz32?Math.clz32:IE,PE=Math.log,VE=Math.LN2;function IE(i){return i>>>=0,i===0?32:31-(PE(i)/VE|0)|0}var Ta=256,ka=262144,Oa=4194304;function Vr(i){var l=i&42;if(l!==0)return l;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ra(i,l,a){var u=i.pendingLanes;if(u===0)return 0;var m=0,g=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var E=u&134217727;return E!==0?(u=E&~g,u!==0?m=Vr(u):(b&=E,b!==0?m=Vr(b):a||(a=E&~i,a!==0&&(m=Vr(a))))):(E=u&~g,E!==0?m=Vr(E):b!==0?m=Vr(b):a||(a=u&~i,a!==0&&(m=Vr(a)))),m===0?0:l!==0&&l!==m&&(l&g)===0&&(g=m&-m,a=l&-l,g>=a||g===32&&(a&4194048)!==0)?l:m}function Vo(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function GE(i,l){switch(i){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 i0(){var i=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),i}function Yf(i){for(var l=[],a=0;31>a;a++)l.push(i);return l}function Io(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function qE(i,l,a,u,m,g){var b=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var E=i.entanglements,O=i.expirationTimes,I=i.hiddenUpdates;for(a=b&~a;0<a;){var W=31-on(a),$=1<<W;E[W]=0,O[W]=-1;var q=I[W];if(q!==null)for(I[W]=null,W=0;W<q.length;W++){var K=q[W];K!==null&&(K.lane&=-536870913)}a&=~$}u!==0&&r0(i,u,0),g!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=g&~(b&~l))}function r0(i,l,a){i.pendingLanes|=l,i.suspendedLanes&=~l;var u=31-on(l);i.entangledLanes|=l,i.entanglements[u]=i.entanglements[u]|1073741824|a&261930}function l0(i,l){var a=i.entangledLanes|=l;for(i=i.entanglements;a;){var u=31-on(a),m=1<<u;m&l|i[u]&l&&(i[u]|=l),a&=~m}}function o0(i,l){var a=l&-l;return a=(a&42)!==0?1:Ff(a),(a&(i.suspendedLanes|l))!==0?0:a}function Ff(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Kf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function s0(){var i=z.p;return i!==0?i:(i=window.event,i===void 0?32:Fb(i.type))}function a0(i,l){var a=z.p;try{return z.p=i,l()}finally{z.p=a}}var Xi=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Xi,Kt="__reactProps$"+Xi,Al="__reactContainer$"+Xi,Wf="__reactEvents$"+Xi,YE="__reactListeners$"+Xi,FE="__reactHandles$"+Xi,c0="__reactResources$"+Xi,Go="__reactMarker$"+Xi;function Xf(i){delete i[Tt],delete i[Kt],delete i[Wf],delete i[YE],delete i[FE]}function El(i){var l=i[Tt];if(l)return l;for(var a=i.parentNode;a;){if(l=a[Al]||a[Tt]){if(a=l.alternate,l.child!==null||a!==null&&a.child!==null)for(i=Rb(i);i!==null;){if(a=i[Tt])return a;i=Rb(i)}return l}i=a,a=i.parentNode}return null}function Ml(i){if(i=i[Tt]||i[Al]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function qo(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function Tl(i){var l=i[c0];return l||(l=i[c0]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Ct(i){i[Go]=!0}var u0=new Set,f0={};function Ir(i,l){kl(i,l),kl(i+"Capture",l)}function kl(i,l){for(f0[i]=l,i=0;i<l.length;i++)u0.add(l[i])}var KE=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]*$"),h0={},d0={};function WE(i){return If.call(d0,i)?!0:If.call(h0,i)?!1:KE.test(i)?d0[i]=!0:(h0[i]=!0,!1)}function Da(i,l,a){if(WE(l))if(a===null)i.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var u=l.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+a)}}function Na(i,l,a){if(a===null)i.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+a)}}function wi(i,l,a,u){if(u===null)i.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(l,a,""+u)}}function xn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function m0(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function XE(i,l,a){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,g=u.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return m.call(this)},set:function(b){a=""+b,g.call(this,b)}}),Object.defineProperty(i,l,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Qf(i){if(!i._valueTracker){var l=m0(i)?"checked":"value";i._valueTracker=XE(i,l,""+i[l])}}function p0(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var a=l.getValue(),u="";return i&&(u=m0(i)?i.checked?"true":"false":i.value),i=u,i!==a?(l.setValue(i),!0):!1}function _a(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var QE=/[\n"\\]/g;function Sn(i){return i.replace(QE,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Zf(i,l,a,u,m,g,b,E){i.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?i.type=b:i.removeAttribute("type"),l!=null?b==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+xn(l)):i.value!==""+xn(l)&&(i.value=""+xn(l)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),l!=null?$f(i,b,xn(l)):a!=null?$f(i,b,xn(a)):u!=null&&i.removeAttribute("value"),m==null&&g!=null&&(i.defaultChecked=!!g),m!=null&&(i.checked=m&&typeof m!="function"&&typeof m!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.name=""+xn(E):i.removeAttribute("name")}function g0(i,l,a,u,m,g,b,E){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.type=g),l!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||l!=null)){Qf(i);return}a=a!=null?""+xn(a):"",l=l!=null?""+xn(l):a,E||l===i.value||(i.value=l),i.defaultValue=l}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=E?i.checked:!!u,i.defaultChecked=!!u,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b),Qf(i)}function $f(i,l,a){l==="number"&&_a(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function Ol(i,l,a,u){if(i=i.options,l){l={};for(var m=0;m<a.length;m++)l["$"+a[m]]=!0;for(a=0;a<i.length;a++)m=l.hasOwnProperty("$"+i[a].value),i[a].selected!==m&&(i[a].selected=m),m&&u&&(i[a].defaultSelected=!0)}else{for(a=""+xn(a),l=null,m=0;m<i.length;m++){if(i[m].value===a){i[m].selected=!0,u&&(i[m].defaultSelected=!0);return}l!==null||i[m].disabled||(l=i[m])}l!==null&&(l.selected=!0)}}function v0(i,l,a){if(l!=null&&(l=""+xn(l),l!==i.value&&(i.value=l),a==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=a!=null?""+xn(a):""}function y0(i,l,a,u){if(l==null){if(u!=null){if(a!=null)throw Error(r(92));if(ae(u)){if(1<u.length)throw Error(r(93));u=u[0]}a=u}a==null&&(a=""),l=a}a=xn(l),i.defaultValue=a,u=i.textContent,u===a&&u!==""&&u!==null&&(i.value=u),Qf(i)}function Rl(i,l){if(l){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=l;return}}i.textContent=l}var ZE=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 b0(i,l,a){var u=l.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":u?i.setProperty(l,a):typeof a!="number"||a===0||ZE.has(l)?l==="float"?i.cssFloat=a:i[l]=(""+a).trim():i[l]=a+"px"}function x0(i,l,a){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||l!=null&&l.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var m in l)u=l[m],l.hasOwnProperty(m)&&a[m]!==u&&b0(i,m,u)}else for(var g in l)l.hasOwnProperty(g)&&b0(i,g,l[g])}function Jf(i){if(i.indexOf("-")===-1)return!1;switch(i){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 $E=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"]]),JE=/^[\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 Ba(i){return JE.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ci(){}var eh=null;function th(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Dl=null,Nl=null;function S0(i){var l=Ml(i);if(l&&(i=l.stateNode)){var a=i[Kt]||null;e:switch(i=l.stateNode,l.type){case"input":if(Zf(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),l=a.name,a.type==="radio"&&l!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Sn(""+l)+'"][type="radio"]'),l=0;l<a.length;l++){var u=a[l];if(u!==i&&u.form===i.form){var m=u[Kt]||null;if(!m)throw Error(r(90));Zf(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(l=0;l<a.length;l++)u=a[l],u.form===i.form&&p0(u)}break e;case"textarea":v0(i,a.value,a.defaultValue);break e;case"select":l=a.value,l!=null&&Ol(i,!!a.multiple,l,!1)}}}var nh=!1;function w0(i,l,a){if(nh)return i(l,a);nh=!0;try{var u=i(l);return u}finally{if(nh=!1,(Dl!==null||Nl!==null)&&(Sc(),Dl&&(l=Dl,i=Nl,Nl=Dl=null,S0(l),i)))for(l=0;l<i.length;l++)S0(i[l])}}function Yo(i,l){var a=i.stateNode;if(a===null)return null;var u=a[Kt]||null;if(u===null)return null;a=u[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(r(231,l,typeof a));return a}var Ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ih=!1;if(Ai)try{var Fo={};Object.defineProperty(Fo,"passive",{get:function(){ih=!0}}),window.addEventListener("test",Fo,Fo),window.removeEventListener("test",Fo,Fo)}catch{ih=!1}var Qi=null,rh=null,za=null;function C0(){if(za)return za;var i,l=rh,a=l.length,u,m="value"in Qi?Qi.value:Qi.textContent,g=m.length;for(i=0;i<a&&l[i]===m[i];i++);var b=a-i;for(u=1;u<=b&&l[a-u]===m[g-u];u++);return za=m.slice(i,1<u?1-u:void 0)}function La(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function ja(){return!0}function A0(){return!1}function Wt(i){function l(a,u,m,g,b){this._reactName=a,this._targetInst=m,this.type=u,this.nativeEvent=g,this.target=b,this.currentTarget=null;for(var E in i)i.hasOwnProperty(E)&&(a=i[E],this[E]=a?a(g):g[E]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?ja:A0,this.isPropagationStopped=A0,this}return v(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ja)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ja)},persist:function(){},isPersistent:ja}),l}var Gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ha=Wt(Gr),Ko=v({},Gr,{view:0,detail:0}),eM=Wt(Ko),lh,oh,Wo,Ua=v({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ah,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Wo&&(Wo&&i.type==="mousemove"?(lh=i.screenX-Wo.screenX,oh=i.screenY-Wo.screenY):oh=lh=0,Wo=i),lh)},movementY:function(i){return"movementY"in i?i.movementY:oh}}),E0=Wt(Ua),tM=v({},Ua,{dataTransfer:0}),nM=Wt(tM),iM=v({},Ko,{relatedTarget:0}),sh=Wt(iM),rM=v({},Gr,{animationName:0,elapsedTime:0,pseudoElement:0}),lM=Wt(rM),oM=v({},Gr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),sM=Wt(oM),aM=v({},Gr,{data:0}),M0=Wt(aM),cM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uM={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"},fM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hM(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=fM[i])?!!l[i]:!1}function ah(){return hM}var dM=v({},Ko,{key:function(i){if(i.key){var l=cM[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=La(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?uM[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ah,charCode:function(i){return i.type==="keypress"?La(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?La(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),mM=Wt(dM),pM=v({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),T0=Wt(pM),gM=v({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ah}),vM=Wt(gM),yM=v({},Gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),bM=Wt(yM),xM=v({},Ua,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),SM=Wt(xM),wM=v({},Gr,{newState:0,oldState:0}),CM=Wt(wM),AM=[9,13,27,32],ch=Ai&&"CompositionEvent"in window,Xo=null;Ai&&"documentMode"in document&&(Xo=document.documentMode);var EM=Ai&&"TextEvent"in window&&!Xo,k0=Ai&&(!ch||Xo&&8<Xo&&11>=Xo),O0=" ",R0=!1;function D0(i,l){switch(i){case"keyup":return AM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var _l=!1;function MM(i,l){switch(i){case"compositionend":return N0(l);case"keypress":return l.which!==32?null:(R0=!0,O0);case"textInput":return i=l.data,i===O0&&R0?null:i;default:return null}}function TM(i,l){if(_l)return i==="compositionend"||!ch&&D0(i,l)?(i=C0(),za=rh=Qi=null,_l=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return k0&&l.locale!=="ko"?null:l.data;default:return null}}var kM={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 _0(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!kM[i.type]:l==="textarea"}function B0(i,l,a,u){Dl?Nl?Nl.push(u):Nl=[u]:Dl=u,l=kc(l,"onChange"),0<l.length&&(a=new Ha("onChange","change",null,a,u),i.push({event:a,listeners:l}))}var Qo=null,Zo=null;function OM(i){gb(i,0)}function Pa(i){var l=qo(i);if(p0(l))return i}function z0(i,l){if(i==="change")return l}var L0=!1;if(Ai){var uh;if(Ai){var fh="oninput"in document;if(!fh){var j0=document.createElement("div");j0.setAttribute("oninput","return;"),fh=typeof j0.oninput=="function"}uh=fh}else uh=!1;L0=uh&&(!document.documentMode||9<document.documentMode)}function H0(){Qo&&(Qo.detachEvent("onpropertychange",U0),Zo=Qo=null)}function U0(i){if(i.propertyName==="value"&&Pa(Zo)){var l=[];B0(l,Zo,i,th(i)),w0(OM,l)}}function RM(i,l,a){i==="focusin"?(H0(),Qo=l,Zo=a,Qo.attachEvent("onpropertychange",U0)):i==="focusout"&&H0()}function DM(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Pa(Zo)}function NM(i,l){if(i==="click")return Pa(l)}function _M(i,l){if(i==="input"||i==="change")return Pa(l)}function BM(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var sn=typeof Object.is=="function"?Object.is:BM;function $o(i,l){if(sn(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var a=Object.keys(i),u=Object.keys(l);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var m=a[u];if(!If.call(l,m)||!sn(i[m],l[m]))return!1}return!0}function P0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function V0(i,l){var a=P0(i);i=0;for(var u;a;){if(a.nodeType===3){if(u=i+a.textContent.length,i<=l&&u>=l)return{node:a,offset:l-i};i=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=P0(a)}}function I0(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?I0(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function G0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=_a(i.document);l instanceof i.HTMLIFrameElement;){try{var a=typeof l.contentWindow.location.href=="string"}catch{a=!1}if(a)i=l.contentWindow;else break;l=_a(i.document)}return l}function hh(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var zM=Ai&&"documentMode"in document&&11>=document.documentMode,Bl=null,dh=null,Jo=null,mh=!1;function q0(i,l,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;mh||Bl==null||Bl!==_a(u)||(u=Bl,"selectionStart"in u&&hh(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Jo&&$o(Jo,u)||(Jo=u,u=kc(dh,"onSelect"),0<u.length&&(l=new Ha("onSelect","select",null,l,a),i.push({event:l,listeners:u}),l.target=Bl)))}function qr(i,l){var a={};return a[i.toLowerCase()]=l.toLowerCase(),a["Webkit"+i]="webkit"+l,a["Moz"+i]="moz"+l,a}var zl={animationend:qr("Animation","AnimationEnd"),animationiteration:qr("Animation","AnimationIteration"),animationstart:qr("Animation","AnimationStart"),transitionrun:qr("Transition","TransitionRun"),transitionstart:qr("Transition","TransitionStart"),transitioncancel:qr("Transition","TransitionCancel"),transitionend:qr("Transition","TransitionEnd")},ph={},Y0={};Ai&&(Y0=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Yr(i){if(ph[i])return ph[i];if(!zl[i])return i;var l=zl[i],a;for(a in l)if(l.hasOwnProperty(a)&&a in Y0)return ph[i]=l[a];return i}var F0=Yr("animationend"),K0=Yr("animationiteration"),W0=Yr("animationstart"),LM=Yr("transitionrun"),jM=Yr("transitionstart"),HM=Yr("transitioncancel"),X0=Yr("transitionend"),Q0=new Map,gh="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(" ");gh.push("scrollEnd");function Pn(i,l){Q0.set(i,l),Ir(l,[i])}var Va=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},wn=[],Ll=0,vh=0;function Ia(){for(var i=Ll,l=vh=Ll=0;l<i;){var a=wn[l];wn[l++]=null;var u=wn[l];wn[l++]=null;var m=wn[l];wn[l++]=null;var g=wn[l];if(wn[l++]=null,u!==null&&m!==null){var b=u.pending;b===null?m.next=m:(m.next=b.next,b.next=m),u.pending=m}g!==0&&Z0(a,m,g)}}function Ga(i,l,a,u){wn[Ll++]=i,wn[Ll++]=l,wn[Ll++]=a,wn[Ll++]=u,vh|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function yh(i,l,a,u){return Ga(i,l,a,u),qa(i)}function Fr(i,l){return Ga(i,null,null,l),qa(i)}function Z0(i,l,a){i.lanes|=a;var u=i.alternate;u!==null&&(u.lanes|=a);for(var m=!1,g=i.return;g!==null;)g.childLanes|=a,u=g.alternate,u!==null&&(u.childLanes|=a),g.tag===22&&(i=g.stateNode,i===null||i._visibility&1||(m=!0)),i=g,g=g.return;return i.tag===3?(g=i.stateNode,m&&l!==null&&(m=31-on(a),i=g.hiddenUpdates,u=i[m],u===null?i[m]=[l]:u.push(l),l.lane=a|536870912),g):null}function qa(i){if(50<Ss)throw Ss=0,Td=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var jl={};function UM(i,l,a,u){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(i,l,a,u){return new UM(i,l,a,u)}function bh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ei(i,l){var a=i.alternate;return a===null?(a=an(i.tag,l,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=l,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,l=i.dependencies,a.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function $0(i,l){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,l=a.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function Ya(i,l,a,u,m,g){var b=0;if(u=i,typeof i=="function")bh(i)&&(b=1);else if(typeof i=="string")b=qT(i,a,re.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=an(31,a,l,m),i.elementType=Z,i.lanes=g,i;case C:return Kr(a.children,m,g,l);case M:b=8,m|=24;break;case T:return i=an(12,a,l,m|2),i.elementType=T,i.lanes=g,i;case H:return i=an(13,a,l,m),i.elementType=H,i.lanes=g,i;case P:return i=an(19,a,l,m),i.elementType=P,i.lanes=g,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case N:b=10;break e;case D:b=9;break e;case j:b=11;break e;case _:b=14;break e;case G:b=16,u=null;break e}b=29,a=Error(r(130,i===null?"null":typeof i,"")),u=null}return l=an(b,a,l,m),l.elementType=i,l.type=u,l.lanes=g,l}function Kr(i,l,a,u){return i=an(7,i,u,l),i.lanes=a,i}function xh(i,l,a){return i=an(6,i,null,l),i.lanes=a,i}function J0(i){var l=an(18,null,null,0);return l.stateNode=i,l}function Sh(i,l,a){return l=an(4,i.children!==null?i.children:[],i.key,l),l.lanes=a,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var ev=new WeakMap;function Cn(i,l){if(typeof i=="object"&&i!==null){var a=ev.get(i);return a!==void 0?a:(l={value:i,source:l,stack:Jg(l)},ev.set(i,l),l)}return{value:i,source:l,stack:Jg(l)}}var Hl=[],Ul=0,Fa=null,es=0,An=[],En=0,Zi=null,$n=1,Jn="";function Mi(i,l){Hl[Ul++]=es,Hl[Ul++]=Fa,Fa=i,es=l}function tv(i,l,a){An[En++]=$n,An[En++]=Jn,An[En++]=Zi,Zi=i;var u=$n;i=Jn;var m=32-on(u)-1;u&=~(1<<m),a+=1;var g=32-on(l)+m;if(30<g){var b=m-m%5;g=(u&(1<<b)-1).toString(32),u>>=b,m-=b,$n=1<<32-on(l)+m|a<<m|u,Jn=g+i}else $n=1<<g|a<<m|u,Jn=i}function wh(i){i.return!==null&&(Mi(i,1),tv(i,1,0))}function Ch(i){for(;i===Fa;)Fa=Hl[--Ul],Hl[Ul]=null,es=Hl[--Ul],Hl[Ul]=null;for(;i===Zi;)Zi=An[--En],An[En]=null,Jn=An[--En],An[En]=null,$n=An[--En],An[En]=null}function nv(i,l){An[En++]=$n,An[En++]=Jn,An[En++]=Zi,$n=l.id,Jn=l.overflow,Zi=i}var kt=null,tt=null,ze=!1,$i=null,Mn=!1,Ah=Error(r(519));function Ji(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ts(Cn(l,i)),Ah}function iv(i){var l=i.stateNode,a=i.type,u=i.memoizedProps;switch(l[Tt]=i,l[Kt]=u,a){case"dialog":De("cancel",l),De("close",l);break;case"iframe":case"object":case"embed":De("load",l);break;case"video":case"audio":for(a=0;a<Cs.length;a++)De(Cs[a],l);break;case"source":De("error",l);break;case"img":case"image":case"link":De("error",l),De("load",l);break;case"details":De("toggle",l);break;case"input":De("invalid",l),g0(l,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":De("invalid",l);break;case"textarea":De("invalid",l),y0(l,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||l.textContent===""+a||u.suppressHydrationWarning===!0||xb(l.textContent,a)?(u.popover!=null&&(De("beforetoggle",l),De("toggle",l)),u.onScroll!=null&&De("scroll",l),u.onScrollEnd!=null&&De("scrollend",l),u.onClick!=null&&(l.onclick=Ci),l=!0):l=!1,l||Ji(i,!0)}function rv(i){for(kt=i.return;kt;)switch(kt.tag){case 5:case 31:case 13:Mn=!1;return;case 27:case 3:Mn=!0;return;default:kt=kt.return}}function Pl(i){if(i!==kt)return!1;if(!ze)return rv(i),ze=!0,!1;var l=i.tag,a;if((a=l!==3&&l!==27)&&((a=l===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||Id(i.type,i.memoizedProps)),a=!a),a&&tt&&Ji(i),rv(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));tt=Ob(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));tt=Ob(i)}else l===27?(l=tt,dr(i.type)?(i=Kd,Kd=null,tt=i):tt=l):tt=kt?kn(i.stateNode.nextSibling):null;return!0}function Wr(){tt=kt=null,ze=!1}function Eh(){var i=$i;return i!==null&&($t===null?$t=i:$t.push.apply($t,i),$i=null),i}function ts(i){$i===null?$i=[i]:$i.push(i)}var Mh=k(null),Xr=null,Ti=null;function er(i,l,a){te(Mh,l._currentValue),l._currentValue=a}function ki(i){i._currentValue=Mh.current,Y(Mh)}function Th(i,l,a){for(;i!==null;){var u=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,u!==null&&(u.childLanes|=l)):u!==null&&(u.childLanes&l)!==l&&(u.childLanes|=l),i===a)break;i=i.return}}function kh(i,l,a,u){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var g=m.dependencies;if(g!==null){var b=m.child;g=g.firstContext;e:for(;g!==null;){var E=g;g=m;for(var O=0;O<l.length;O++)if(E.context===l[O]){g.lanes|=a,E=g.alternate,E!==null&&(E.lanes|=a),Th(g.return,a,i),u||(b=null);break e}g=E.next}}else if(m.tag===18){if(b=m.return,b===null)throw Error(r(341));b.lanes|=a,g=b.alternate,g!==null&&(g.lanes|=a),Th(b,a,i),b=null}else b=m.child;if(b!==null)b.return=m;else for(b=m;b!==null;){if(b===i){b=null;break}if(m=b.sibling,m!==null){m.return=b.return,b=m;break}b=b.return}m=b}}function Vl(i,l,a,u){i=null;for(var m=l,g=!1;m!==null;){if(!g){if((m.flags&524288)!==0)g=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var b=m.alternate;if(b===null)throw Error(r(387));if(b=b.memoizedProps,b!==null){var E=m.type;sn(m.pendingProps.value,b.value)||(i!==null?i.push(E):i=[E])}}else if(m===J.current){if(b=m.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(ks):i=[ks])}m=m.return}i!==null&&kh(l,i,a,u),l.flags|=262144}function Ka(i){for(i=i.firstContext;i!==null;){if(!sn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Qr(i){Xr=i,Ti=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ot(i){return lv(Xr,i)}function Wa(i,l){return Xr===null&&Qr(i),lv(i,l)}function lv(i,l){var a=l._currentValue;if(l={context:l,memoizedValue:a,next:null},Ti===null){if(i===null)throw Error(r(308));Ti=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else Ti=Ti.next=l;return a}var PM=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(a,u){i.push(u)}};this.abort=function(){l.aborted=!0,i.forEach(function(a){return a()})}},VM=n.unstable_scheduleCallback,IM=n.unstable_NormalPriority,dt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oh(){return{controller:new PM,data:new Map,refCount:0}}function ns(i){i.refCount--,i.refCount===0&&VM(IM,function(){i.controller.abort()})}var is=null,Rh=0,Il=0,Gl=null;function GM(i,l){if(is===null){var a=is=[];Rh=0,Il=_d(),Gl={status:"pending",value:void 0,then:function(u){a.push(u)}}}return Rh++,l.then(ov,ov),l}function ov(){if(--Rh===0&&is!==null){Gl!==null&&(Gl.status="fulfilled");var i=is;is=null,Il=0,Gl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function qM(i,l){var a=[],u={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return i.then(function(){u.status="fulfilled",u.value=l;for(var m=0;m<a.length;m++)(0,a[m])(l)},function(m){for(u.status="rejected",u.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),u}var sv=R.S;R.S=function(i,l){qy=rn(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&GM(i,l),sv!==null&&sv(i,l)};var Zr=k(null);function Dh(){var i=Zr.current;return i!==null?i:Ze.pooledCache}function Xa(i,l){l===null?te(Zr,Zr.current):te(Zr,l.pool)}function av(){var i=Dh();return i===null?null:{parent:dt._currentValue,pool:i}}var ql=Error(r(460)),Nh=Error(r(474)),Qa=Error(r(542)),Za={then:function(){}};function cv(i){return i=i.status,i==="fulfilled"||i==="rejected"}function uv(i,l,a){switch(a=i[a],a===void 0?i.push(l):a!==l&&(l.then(Ci,Ci),l=a),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,hv(i),i;default:if(typeof l.status=="string")l.then(Ci,Ci);else{if(i=Ze,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(u){if(l.status==="pending"){var m=l;m.status="fulfilled",m.value=u}},function(u){if(l.status==="pending"){var m=l;m.status="rejected",m.reason=u}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,hv(i),i}throw Jr=l,ql}}function $r(i){try{var l=i._init;return l(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Jr=a,ql):a}}var Jr=null;function fv(){if(Jr===null)throw Error(r(459));var i=Jr;return Jr=null,i}function hv(i){if(i===ql||i===Qa)throw Error(r(483))}var Yl=null,rs=0;function $a(i){var l=rs;return rs+=1,Yl===null&&(Yl=[]),uv(Yl,i,l)}function ls(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function Ja(i,l){throw l.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function dv(i){function l(U,B){if(i){var V=U.deletions;V===null?(U.deletions=[B],U.flags|=16):V.push(B)}}function a(U,B){if(!i)return null;for(;B!==null;)l(U,B),B=B.sibling;return null}function u(U){for(var B=new Map;U!==null;)U.key!==null?B.set(U.key,U):B.set(U.index,U),U=U.sibling;return B}function m(U,B){return U=Ei(U,B),U.index=0,U.sibling=null,U}function g(U,B,V){return U.index=V,i?(V=U.alternate,V!==null?(V=V.index,V<B?(U.flags|=67108866,B):V):(U.flags|=67108866,B)):(U.flags|=1048576,B)}function b(U){return i&&U.alternate===null&&(U.flags|=67108866),U}function E(U,B,V,Q){return B===null||B.tag!==6?(B=xh(V,U.mode,Q),B.return=U,B):(B=m(B,V),B.return=U,B)}function O(U,B,V,Q){var xe=V.type;return xe===C?W(U,B,V.props.children,Q,V.key):B!==null&&(B.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===G&&$r(xe)===B.type)?(B=m(B,V.props),ls(B,V),B.return=U,B):(B=Ya(V.type,V.key,V.props,null,U.mode,Q),ls(B,V),B.return=U,B)}function I(U,B,V,Q){return B===null||B.tag!==4||B.stateNode.containerInfo!==V.containerInfo||B.stateNode.implementation!==V.implementation?(B=Sh(V,U.mode,Q),B.return=U,B):(B=m(B,V.children||[]),B.return=U,B)}function W(U,B,V,Q,xe){return B===null||B.tag!==7?(B=Kr(V,U.mode,Q,xe),B.return=U,B):(B=m(B,V),B.return=U,B)}function $(U,B,V){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=xh(""+B,U.mode,V),B.return=U,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case x:return V=Ya(B.type,B.key,B.props,null,U.mode,V),ls(V,B),V.return=U,V;case A:return B=Sh(B,U.mode,V),B.return=U,B;case G:return B=$r(B),$(U,B,V)}if(ae(B)||ee(B))return B=Kr(B,U.mode,V,null),B.return=U,B;if(typeof B.then=="function")return $(U,$a(B),V);if(B.$$typeof===N)return $(U,Wa(U,B),V);Ja(U,B)}return null}function q(U,B,V,Q){var xe=B!==null?B.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return xe!==null?null:E(U,B,""+V,Q);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case x:return V.key===xe?O(U,B,V,Q):null;case A:return V.key===xe?I(U,B,V,Q):null;case G:return V=$r(V),q(U,B,V,Q)}if(ae(V)||ee(V))return xe!==null?null:W(U,B,V,Q,null);if(typeof V.then=="function")return q(U,B,$a(V),Q);if(V.$$typeof===N)return q(U,B,Wa(U,V),Q);Ja(U,V)}return null}function K(U,B,V,Q,xe){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return U=U.get(V)||null,E(B,U,""+Q,xe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return U=U.get(Q.key===null?V:Q.key)||null,O(B,U,Q,xe);case A:return U=U.get(Q.key===null?V:Q.key)||null,I(B,U,Q,xe);case G:return Q=$r(Q),K(U,B,V,Q,xe)}if(ae(Q)||ee(Q))return U=U.get(V)||null,W(B,U,Q,xe,null);if(typeof Q.then=="function")return K(U,B,V,$a(Q),xe);if(Q.$$typeof===N)return K(U,B,V,Wa(B,Q),xe);Ja(B,Q)}return null}function de(U,B,V,Q){for(var xe=null,Pe=null,ve=B,ke=B=0,Be=null;ve!==null&&ke<V.length;ke++){ve.index>ke?(Be=ve,ve=null):Be=ve.sibling;var Ve=q(U,ve,V[ke],Q);if(Ve===null){ve===null&&(ve=Be);break}i&&ve&&Ve.alternate===null&&l(U,ve),B=g(Ve,B,ke),Pe===null?xe=Ve:Pe.sibling=Ve,Pe=Ve,ve=Be}if(ke===V.length)return a(U,ve),ze&&Mi(U,ke),xe;if(ve===null){for(;ke<V.length;ke++)ve=$(U,V[ke],Q),ve!==null&&(B=g(ve,B,ke),Pe===null?xe=ve:Pe.sibling=ve,Pe=ve);return ze&&Mi(U,ke),xe}for(ve=u(ve);ke<V.length;ke++)Be=K(ve,U,ke,V[ke],Q),Be!==null&&(i&&Be.alternate!==null&&ve.delete(Be.key===null?ke:Be.key),B=g(Be,B,ke),Pe===null?xe=Be:Pe.sibling=Be,Pe=Be);return i&&ve.forEach(function(yr){return l(U,yr)}),ze&&Mi(U,ke),xe}function Se(U,B,V,Q){if(V==null)throw Error(r(151));for(var xe=null,Pe=null,ve=B,ke=B=0,Be=null,Ve=V.next();ve!==null&&!Ve.done;ke++,Ve=V.next()){ve.index>ke?(Be=ve,ve=null):Be=ve.sibling;var yr=q(U,ve,Ve.value,Q);if(yr===null){ve===null&&(ve=Be);break}i&&ve&&yr.alternate===null&&l(U,ve),B=g(yr,B,ke),Pe===null?xe=yr:Pe.sibling=yr,Pe=yr,ve=Be}if(Ve.done)return a(U,ve),ze&&Mi(U,ke),xe;if(ve===null){for(;!Ve.done;ke++,Ve=V.next())Ve=$(U,Ve.value,Q),Ve!==null&&(B=g(Ve,B,ke),Pe===null?xe=Ve:Pe.sibling=Ve,Pe=Ve);return ze&&Mi(U,ke),xe}for(ve=u(ve);!Ve.done;ke++,Ve=V.next())Ve=K(ve,U,ke,Ve.value,Q),Ve!==null&&(i&&Ve.alternate!==null&&ve.delete(Ve.key===null?ke:Ve.key),B=g(Ve,B,ke),Pe===null?xe=Ve:Pe.sibling=Ve,Pe=Ve);return i&&ve.forEach(function(tk){return l(U,tk)}),ze&&Mi(U,ke),xe}function Qe(U,B,V,Q){if(typeof V=="object"&&V!==null&&V.type===C&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case x:e:{for(var xe=V.key;B!==null;){if(B.key===xe){if(xe=V.type,xe===C){if(B.tag===7){a(U,B.sibling),Q=m(B,V.props.children),Q.return=U,U=Q;break e}}else if(B.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===G&&$r(xe)===B.type){a(U,B.sibling),Q=m(B,V.props),ls(Q,V),Q.return=U,U=Q;break e}a(U,B);break}else l(U,B);B=B.sibling}V.type===C?(Q=Kr(V.props.children,U.mode,Q,V.key),Q.return=U,U=Q):(Q=Ya(V.type,V.key,V.props,null,U.mode,Q),ls(Q,V),Q.return=U,U=Q)}return b(U);case A:e:{for(xe=V.key;B!==null;){if(B.key===xe)if(B.tag===4&&B.stateNode.containerInfo===V.containerInfo&&B.stateNode.implementation===V.implementation){a(U,B.sibling),Q=m(B,V.children||[]),Q.return=U,U=Q;break e}else{a(U,B);break}else l(U,B);B=B.sibling}Q=Sh(V,U.mode,Q),Q.return=U,U=Q}return b(U);case G:return V=$r(V),Qe(U,B,V,Q)}if(ae(V))return de(U,B,V,Q);if(ee(V)){if(xe=ee(V),typeof xe!="function")throw Error(r(150));return V=xe.call(V),Se(U,B,V,Q)}if(typeof V.then=="function")return Qe(U,B,$a(V),Q);if(V.$$typeof===N)return Qe(U,B,Wa(U,V),Q);Ja(U,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,B!==null&&B.tag===6?(a(U,B.sibling),Q=m(B,V),Q.return=U,U=Q):(a(U,B),Q=xh(V,U.mode,Q),Q.return=U,U=Q),b(U)):a(U,B)}return function(U,B,V,Q){try{rs=0;var xe=Qe(U,B,V,Q);return Yl=null,xe}catch(ve){if(ve===ql||ve===Qa)throw ve;var Pe=an(29,ve,null,U.mode);return Pe.lanes=Q,Pe.return=U,Pe}}}var el=dv(!0),mv=dv(!1),tr=!1;function _h(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bh(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function nr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ir(i,l,a){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(Ge&2)!==0){var m=u.pending;return m===null?l.next=l:(l.next=m.next,m.next=l),u.pending=l,l=qa(i),Z0(i,null,a),l}return Ga(i,u,l,a),qa(i)}function os(i,l,a){if(l=l.updateQueue,l!==null&&(l=l.shared,(a&4194048)!==0)){var u=l.lanes;u&=i.pendingLanes,a|=u,l.lanes=a,l0(i,a)}}function zh(i,l){var a=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var m=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?m=g=b:g=g.next=b,a=a.next}while(a!==null);g===null?m=g=l:g=g.next=l}else m=g=l;a={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=l:i.next=l,a.lastBaseUpdate=l}var Lh=!1;function ss(){if(Lh){var i=Gl;if(i!==null)throw i}}function as(i,l,a,u){Lh=!1;var m=i.updateQueue;tr=!1;var g=m.firstBaseUpdate,b=m.lastBaseUpdate,E=m.shared.pending;if(E!==null){m.shared.pending=null;var O=E,I=O.next;O.next=null,b===null?g=I:b.next=I,b=O;var W=i.alternate;W!==null&&(W=W.updateQueue,E=W.lastBaseUpdate,E!==b&&(E===null?W.firstBaseUpdate=I:E.next=I,W.lastBaseUpdate=O))}if(g!==null){var $=m.baseState;b=0,W=I=O=null,E=g;do{var q=E.lane&-536870913,K=q!==E.lane;if(K?(_e&q)===q:(u&q)===q){q!==0&&q===Il&&(Lh=!0),W!==null&&(W=W.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var de=i,Se=E;q=l;var Qe=a;switch(Se.tag){case 1:if(de=Se.payload,typeof de=="function"){$=de.call(Qe,$,q);break e}$=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Se.payload,q=typeof de=="function"?de.call(Qe,$,q):de,q==null)break e;$=v({},$,q);break e;case 2:tr=!0}}q=E.callback,q!==null&&(i.flags|=64,K&&(i.flags|=8192),K=m.callbacks,K===null?m.callbacks=[q]:K.push(q))}else K={lane:q,tag:E.tag,payload:E.payload,callback:E.callback,next:null},W===null?(I=W=K,O=$):W=W.next=K,b|=q;if(E=E.next,E===null){if(E=m.shared.pending,E===null)break;K=E,E=K.next,K.next=null,m.lastBaseUpdate=K,m.shared.pending=null}}while(!0);W===null&&(O=$),m.baseState=O,m.firstBaseUpdate=I,m.lastBaseUpdate=W,g===null&&(m.shared.lanes=0),ar|=b,i.lanes=b,i.memoizedState=$}}function pv(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function gv(i,l){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)pv(a[i],l)}var Fl=k(null),ec=k(0);function vv(i,l){i=ji,te(ec,i),te(Fl,l),ji=i|l.baseLanes}function jh(){te(ec,ji),te(Fl,Fl.current)}function Hh(){ji=ec.current,Y(Fl),Y(ec)}var cn=k(null),Tn=null;function rr(i){var l=i.alternate;te(at,at.current&1),te(cn,i),Tn===null&&(l===null||Fl.current!==null||l.memoizedState!==null)&&(Tn=i)}function Uh(i){te(at,at.current),te(cn,i),Tn===null&&(Tn=i)}function yv(i){i.tag===22?(te(at,at.current),te(cn,i),Tn===null&&(Tn=i)):lr()}function lr(){te(at,at.current),te(cn,cn.current)}function un(i){Y(cn),Tn===i&&(Tn=null),Y(at)}var at=k(0);function tc(i){for(var l=i;l!==null;){if(l.tag===13){var a=l.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Yd(a)||Fd(a)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Oi=0,Te=null,We=null,mt=null,nc=!1,Kl=!1,tl=!1,ic=0,cs=0,Wl=null,YM=0;function ot(){throw Error(r(321))}function Ph(i,l){if(l===null)return!1;for(var a=0;a<l.length&&a<i.length;a++)if(!sn(i[a],l[a]))return!1;return!0}function Vh(i,l,a,u,m,g){return Oi=g,Te=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,R.H=i===null||i.memoizedState===null?ty:nd,tl=!1,g=a(u,m),tl=!1,Kl&&(g=xv(l,a,u,m)),bv(i),g}function bv(i){R.H=hs;var l=We!==null&&We.next!==null;if(Oi=0,mt=We=Te=null,nc=!1,cs=0,Wl=null,l)throw Error(r(300));i===null||pt||(i=i.dependencies,i!==null&&Ka(i)&&(pt=!0))}function xv(i,l,a,u){Te=i;var m=0;do{if(Kl&&(Wl=null),cs=0,Kl=!1,25<=m)throw Error(r(301));if(m+=1,mt=We=null,i.updateQueue!=null){var g=i.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}R.H=ny,g=l(a,u)}while(Kl);return g}function FM(){var i=R.H,l=i.useState()[0];return l=typeof l.then=="function"?us(l):l,i=i.useState()[0],(We!==null?We.memoizedState:null)!==i&&(Te.flags|=1024),l}function Ih(){var i=ic!==0;return ic=0,i}function Gh(i,l,a){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~a}function qh(i){if(nc){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}nc=!1}Oi=0,mt=We=Te=null,Kl=!1,cs=ic=0,Wl=null}function qt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Te.memoizedState=mt=i:mt=mt.next=i,mt}function ct(){if(We===null){var i=Te.alternate;i=i!==null?i.memoizedState:null}else i=We.next;var l=mt===null?Te.memoizedState:mt.next;if(l!==null)mt=l,We=i;else{if(i===null)throw Te.alternate===null?Error(r(467)):Error(r(310));We=i,i={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},mt===null?Te.memoizedState=mt=i:mt=mt.next=i}return mt}function rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(i){var l=cs;return cs+=1,Wl===null&&(Wl=[]),i=uv(Wl,i,l),l=Te,(mt===null?l.memoizedState:mt.next)===null&&(l=l.alternate,R.H=l===null||l.memoizedState===null?ty:nd),i}function lc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return us(i);if(i.$$typeof===N)return Ot(i)}throw Error(r(438,String(i)))}function Yh(i){var l=null,a=Te.updateQueue;if(a!==null&&(l=a.memoCache),l==null){var u=Te.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(l={data:u.data.map(function(m){return m.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),a===null&&(a=rc(),Te.updateQueue=a),a.memoCache=l,a=l.data[l.index],a===void 0)for(a=l.data[l.index]=Array(i),u=0;u<i;u++)a[u]=ie;return l.index++,a}function Ri(i,l){return typeof l=="function"?l(i):l}function oc(i){var l=ct();return Fh(l,We,i)}function Fh(i,l,a){var u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var m=i.baseQueue,g=u.pending;if(g!==null){if(m!==null){var b=m.next;m.next=g.next,g.next=b}l.baseQueue=m=g,u.pending=null}if(g=i.baseState,m===null)i.memoizedState=g;else{l=m.next;var E=b=null,O=null,I=l,W=!1;do{var $=I.lane&-536870913;if($!==I.lane?(_e&$)===$:(Oi&$)===$){var q=I.revertLane;if(q===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),$===Il&&(W=!0);else if((Oi&q)===q){I=I.next,q===Il&&(W=!0);continue}else $={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},O===null?(E=O=$,b=g):O=O.next=$,Te.lanes|=q,ar|=q;$=I.action,tl&&a(g,$),g=I.hasEagerState?I.eagerState:a(g,$)}else q={lane:$,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},O===null?(E=O=q,b=g):O=O.next=q,Te.lanes|=$,ar|=$;I=I.next}while(I!==null&&I!==l);if(O===null?b=g:O.next=E,!sn(g,i.memoizedState)&&(pt=!0,W&&(a=Gl,a!==null)))throw a;i.memoizedState=g,i.baseState=b,i.baseQueue=O,u.lastRenderedState=g}return m===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Kh(i){var l=ct(),a=l.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=i;var u=a.dispatch,m=a.pending,g=l.memoizedState;if(m!==null){a.pending=null;var b=m=m.next;do g=i(g,b.action),b=b.next;while(b!==m);sn(g,l.memoizedState)||(pt=!0),l.memoizedState=g,l.baseQueue===null&&(l.baseState=g),a.lastRenderedState=g}return[g,u]}function Sv(i,l,a){var u=Te,m=ct(),g=ze;if(g){if(a===void 0)throw Error(r(407));a=a()}else a=l();var b=!sn((We||m).memoizedState,a);if(b&&(m.memoizedState=a,pt=!0),m=m.queue,Qh(Av.bind(null,u,m,i),[i]),m.getSnapshot!==l||b||mt!==null&&mt.memoizedState.tag&1){if(u.flags|=2048,Xl(9,{destroy:void 0},Cv.bind(null,u,m,a,l),null),Ze===null)throw Error(r(349));g||(Oi&127)!==0||wv(u,l,a)}return a}function wv(i,l,a){i.flags|=16384,i={getSnapshot:l,value:a},l=Te.updateQueue,l===null?(l=rc(),Te.updateQueue=l,l.stores=[i]):(a=l.stores,a===null?l.stores=[i]:a.push(i))}function Cv(i,l,a,u){l.value=a,l.getSnapshot=u,Ev(l)&&Mv(i)}function Av(i,l,a){return a(function(){Ev(l)&&Mv(i)})}function Ev(i){var l=i.getSnapshot;i=i.value;try{var a=l();return!sn(i,a)}catch{return!0}}function Mv(i){var l=Fr(i,2);l!==null&&Jt(l,i,2)}function Wh(i){var l=qt();if(typeof i=="function"){var a=i;if(i=a(),tl){Wi(!0);try{a()}finally{Wi(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},l}function Tv(i,l,a,u){return i.baseState=a,Fh(i,We,typeof u=="function"?u:Ri)}function KM(i,l,a,u,m){if(cc(i))throw Error(r(485));if(i=l.action,i!==null){var g={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){g.listeners.push(b)}};R.T!==null?a(!0):g.isTransition=!1,u(g),a=l.pending,a===null?(g.next=l.pending=g,kv(l,g)):(g.next=a.next,l.pending=a.next=g)}}function kv(i,l){var a=l.action,u=l.payload,m=i.state;if(l.isTransition){var g=R.T,b={};R.T=b;try{var E=a(m,u),O=R.S;O!==null&&O(b,E),Ov(i,l,E)}catch(I){Xh(i,l,I)}finally{g!==null&&b.types!==null&&(g.types=b.types),R.T=g}}else try{g=a(m,u),Ov(i,l,g)}catch(I){Xh(i,l,I)}}function Ov(i,l,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){Rv(i,l,u)},function(u){return Xh(i,l,u)}):Rv(i,l,a)}function Rv(i,l,a){l.status="fulfilled",l.value=a,Dv(l),i.state=a,l=i.pending,l!==null&&(a=l.next,a===l?i.pending=null:(a=a.next,l.next=a,kv(i,a)))}function Xh(i,l,a){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do l.status="rejected",l.reason=a,Dv(l),l=l.next;while(l!==u)}i.action=null}function Dv(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function Nv(i,l){return l}function _v(i,l){if(ze){var a=Ze.formState;if(a!==null){e:{var u=Te;if(ze){if(tt){t:{for(var m=tt,g=Mn;m.nodeType!==8;){if(!g){m=null;break t}if(m=kn(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){tt=kn(m.nextSibling),u=m.data==="F!";break e}}Ji(u)}u=!1}u&&(l=a[0])}}return a=qt(),a.memoizedState=a.baseState=l,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nv,lastRenderedState:l},a.queue=u,a=$v.bind(null,Te,u),u.dispatch=a,u=Wh(!1),g=td.bind(null,Te,!1,u.queue),u=qt(),m={state:l,dispatch:null,action:i,pending:null},u.queue=m,a=KM.bind(null,Te,m,g,a),m.dispatch=a,u.memoizedState=i,[l,a,!1]}function Bv(i){var l=ct();return zv(l,We,i)}function zv(i,l,a){if(l=Fh(i,l,Nv)[0],i=oc(Ri)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var u=us(l)}catch(b){throw b===ql?Qa:b}else u=l;l=ct();var m=l.queue,g=m.dispatch;return a!==l.memoizedState&&(Te.flags|=2048,Xl(9,{destroy:void 0},WM.bind(null,m,a),null)),[u,g,i]}function WM(i,l){i.action=l}function Lv(i){var l=ct(),a=We;if(a!==null)return zv(l,a,i);ct(),l=l.memoizedState,a=ct();var u=a.queue.dispatch;return a.memoizedState=i,[l,u,!1]}function Xl(i,l,a,u){return i={tag:i,create:a,deps:u,inst:l,next:null},l=Te.updateQueue,l===null&&(l=rc(),Te.updateQueue=l),a=l.lastEffect,a===null?l.lastEffect=i.next=i:(u=a.next,a.next=i,i.next=u,l.lastEffect=i),i}function jv(){return ct().memoizedState}function sc(i,l,a,u){var m=qt();Te.flags|=i,m.memoizedState=Xl(1|l,{destroy:void 0},a,u===void 0?null:u)}function ac(i,l,a,u){var m=ct();u=u===void 0?null:u;var g=m.memoizedState.inst;We!==null&&u!==null&&Ph(u,We.memoizedState.deps)?m.memoizedState=Xl(l,g,a,u):(Te.flags|=i,m.memoizedState=Xl(1|l,g,a,u))}function Hv(i,l){sc(8390656,8,i,l)}function Qh(i,l){ac(2048,8,i,l)}function XM(i){Te.flags|=4;var l=Te.updateQueue;if(l===null)l=rc(),Te.updateQueue=l,l.events=[i];else{var a=l.events;a===null?l.events=[i]:a.push(i)}}function Uv(i){var l=ct().memoizedState;return XM({ref:l,nextImpl:i}),function(){if((Ge&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Pv(i,l){return ac(4,2,i,l)}function Vv(i,l){return ac(4,4,i,l)}function Iv(i,l){if(typeof l=="function"){i=i();var a=l(i);return function(){typeof a=="function"?a():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Gv(i,l,a){a=a!=null?a.concat([i]):null,ac(4,4,Iv.bind(null,l,i),a)}function Zh(){}function qv(i,l){var a=ct();l=l===void 0?null:l;var u=a.memoizedState;return l!==null&&Ph(l,u[1])?u[0]:(a.memoizedState=[i,l],i)}function Yv(i,l){var a=ct();l=l===void 0?null:l;var u=a.memoizedState;if(l!==null&&Ph(l,u[1]))return u[0];if(u=i(),tl){Wi(!0);try{i()}finally{Wi(!1)}}return a.memoizedState=[u,l],u}function $h(i,l,a){return a===void 0||(Oi&1073741824)!==0&&(_e&261930)===0?i.memoizedState=l:(i.memoizedState=a,i=Fy(),Te.lanes|=i,ar|=i,a)}function Fv(i,l,a,u){return sn(a,l)?a:Fl.current!==null?(i=$h(i,a,u),sn(i,l)||(pt=!0),i):(Oi&42)===0||(Oi&1073741824)!==0&&(_e&261930)===0?(pt=!0,i.memoizedState=a):(i=Fy(),Te.lanes|=i,ar|=i,l)}function Kv(i,l,a,u,m){var g=z.p;z.p=g!==0&&8>g?g:8;var b=R.T,E={};R.T=E,td(i,!1,l,a);try{var O=m(),I=R.S;if(I!==null&&I(E,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var W=qM(O,u);fs(i,l,W,dn(i))}else fs(i,l,u,dn(i))}catch($){fs(i,l,{then:function(){},status:"rejected",reason:$},dn())}finally{z.p=g,b!==null&&E.types!==null&&(b.types=E.types),R.T=b}}function QM(){}function Jh(i,l,a,u){if(i.tag!==5)throw Error(r(476));var m=Wv(i).queue;Kv(i,m,l,L,a===null?QM:function(){return Xv(i),a(u)})}function Wv(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:L},next:null};var a={};return l.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:a},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function Xv(i){var l=Wv(i);l.next===null&&(l=i.alternate.memoizedState),fs(i,l.next.queue,{},dn())}function ed(){return Ot(ks)}function Qv(){return ct().memoizedState}function Zv(){return ct().memoizedState}function ZM(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var a=dn();i=nr(a);var u=ir(l,i,a);u!==null&&(Jt(u,l,a),os(u,l,a)),l={cache:Oh()},i.payload=l;return}l=l.return}}function $M(i,l,a){var u=dn();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},cc(i)?Jv(l,a):(a=yh(i,l,a,u),a!==null&&(Jt(a,i,u),ey(a,l,u)))}function $v(i,l,a){var u=dn();fs(i,l,a,u)}function fs(i,l,a,u){var m={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(cc(i))Jv(l,m);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=l.lastRenderedReducer,g!==null))try{var b=l.lastRenderedState,E=g(b,a);if(m.hasEagerState=!0,m.eagerState=E,sn(E,b))return Ga(i,l,m,0),Ze===null&&Ia(),!1}catch{}if(a=yh(i,l,m,u),a!==null)return Jt(a,i,u),ey(a,l,u),!0}return!1}function td(i,l,a,u){if(u={lane:2,revertLane:_d(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},cc(i)){if(l)throw Error(r(479))}else l=yh(i,a,u,2),l!==null&&Jt(l,i,2)}function cc(i){var l=i.alternate;return i===Te||l!==null&&l===Te}function Jv(i,l){Kl=nc=!0;var a=i.pending;a===null?l.next=l:(l.next=a.next,a.next=l),i.pending=l}function ey(i,l,a){if((a&4194048)!==0){var u=l.lanes;u&=i.pendingLanes,a|=u,l.lanes=a,l0(i,a)}}var hs={readContext:Ot,use:lc,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};hs.useEffectEvent=ot;var ty={readContext:Ot,use:lc,useCallback:function(i,l){return qt().memoizedState=[i,l===void 0?null:l],i},useContext:Ot,useEffect:Hv,useImperativeHandle:function(i,l,a){a=a!=null?a.concat([i]):null,sc(4194308,4,Iv.bind(null,l,i),a)},useLayoutEffect:function(i,l){return sc(4194308,4,i,l)},useInsertionEffect:function(i,l){sc(4,2,i,l)},useMemo:function(i,l){var a=qt();l=l===void 0?null:l;var u=i();if(tl){Wi(!0);try{i()}finally{Wi(!1)}}return a.memoizedState=[u,l],u},useReducer:function(i,l,a){var u=qt();if(a!==void 0){var m=a(l);if(tl){Wi(!0);try{a(l)}finally{Wi(!1)}}}else m=l;return u.memoizedState=u.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},u.queue=i,i=i.dispatch=$M.bind(null,Te,i),[u.memoizedState,i]},useRef:function(i){var l=qt();return i={current:i},l.memoizedState=i},useState:function(i){i=Wh(i);var l=i.queue,a=$v.bind(null,Te,l);return l.dispatch=a,[i.memoizedState,a]},useDebugValue:Zh,useDeferredValue:function(i,l){var a=qt();return $h(a,i,l)},useTransition:function(){var i=Wh(!1);return i=Kv.bind(null,Te,i.queue,!0,!1),qt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,a){var u=Te,m=qt();if(ze){if(a===void 0)throw Error(r(407));a=a()}else{if(a=l(),Ze===null)throw Error(r(349));(_e&127)!==0||wv(u,l,a)}m.memoizedState=a;var g={value:a,getSnapshot:l};return m.queue=g,Hv(Av.bind(null,u,g,i),[i]),u.flags|=2048,Xl(9,{destroy:void 0},Cv.bind(null,u,g,a,l),null),a},useId:function(){var i=qt(),l=Ze.identifierPrefix;if(ze){var a=Jn,u=$n;a=(u&~(1<<32-on(u)-1)).toString(32)+a,l="_"+l+"R_"+a,a=ic++,0<a&&(l+="H"+a.toString(32)),l+="_"}else a=YM++,l="_"+l+"r_"+a.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:ed,useFormState:_v,useActionState:_v,useOptimistic:function(i){var l=qt();l.memoizedState=l.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=a,l=td.bind(null,Te,!0,a),a.dispatch=l,[i,l]},useMemoCache:Yh,useCacheRefresh:function(){return qt().memoizedState=ZM.bind(null,Te)},useEffectEvent:function(i){var l=qt(),a={impl:i};return l.memoizedState=a,function(){if((Ge&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},nd={readContext:Ot,use:lc,useCallback:qv,useContext:Ot,useEffect:Qh,useImperativeHandle:Gv,useInsertionEffect:Pv,useLayoutEffect:Vv,useMemo:Yv,useReducer:oc,useRef:jv,useState:function(){return oc(Ri)},useDebugValue:Zh,useDeferredValue:function(i,l){var a=ct();return Fv(a,We.memoizedState,i,l)},useTransition:function(){var i=oc(Ri)[0],l=ct().memoizedState;return[typeof i=="boolean"?i:us(i),l]},useSyncExternalStore:Sv,useId:Qv,useHostTransitionStatus:ed,useFormState:Bv,useActionState:Bv,useOptimistic:function(i,l){var a=ct();return Tv(a,We,i,l)},useMemoCache:Yh,useCacheRefresh:Zv};nd.useEffectEvent=Uv;var ny={readContext:Ot,use:lc,useCallback:qv,useContext:Ot,useEffect:Qh,useImperativeHandle:Gv,useInsertionEffect:Pv,useLayoutEffect:Vv,useMemo:Yv,useReducer:Kh,useRef:jv,useState:function(){return Kh(Ri)},useDebugValue:Zh,useDeferredValue:function(i,l){var a=ct();return We===null?$h(a,i,l):Fv(a,We.memoizedState,i,l)},useTransition:function(){var i=Kh(Ri)[0],l=ct().memoizedState;return[typeof i=="boolean"?i:us(i),l]},useSyncExternalStore:Sv,useId:Qv,useHostTransitionStatus:ed,useFormState:Lv,useActionState:Lv,useOptimistic:function(i,l){var a=ct();return We!==null?Tv(a,We,i,l):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:Yh,useCacheRefresh:Zv};ny.useEffectEvent=Uv;function id(i,l,a,u){l=i.memoizedState,a=a(u,l),a=a==null?l:v({},l,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var rd={enqueueSetState:function(i,l,a){i=i._reactInternals;var u=dn(),m=nr(u);m.payload=l,a!=null&&(m.callback=a),l=ir(i,m,u),l!==null&&(Jt(l,i,u),os(l,i,u))},enqueueReplaceState:function(i,l,a){i=i._reactInternals;var u=dn(),m=nr(u);m.tag=1,m.payload=l,a!=null&&(m.callback=a),l=ir(i,m,u),l!==null&&(Jt(l,i,u),os(l,i,u))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var a=dn(),u=nr(a);u.tag=2,l!=null&&(u.callback=l),l=ir(i,u,a),l!==null&&(Jt(l,i,a),os(l,i,a))}};function iy(i,l,a,u,m,g,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,g,b):l.prototype&&l.prototype.isPureReactComponent?!$o(a,u)||!$o(m,g):!0}function ry(i,l,a,u){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(a,u),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(a,u),l.state!==i&&rd.enqueueReplaceState(l,l.state,null)}function nl(i,l){var a=l;if("ref"in l){a={};for(var u in l)u!=="ref"&&(a[u]=l[u])}if(i=i.defaultProps){a===l&&(a=v({},a));for(var m in i)a[m]===void 0&&(a[m]=i[m])}return a}function ly(i){Va(i)}function oy(i){console.error(i)}function sy(i){Va(i)}function uc(i,l){try{var a=i.onUncaughtError;a(l.value,{componentStack:l.stack})}catch(u){setTimeout(function(){throw u})}}function ay(i,l,a){try{var u=i.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function ld(i,l,a){return a=nr(a),a.tag=3,a.payload={element:null},a.callback=function(){uc(i,l)},a}function cy(i){return i=nr(i),i.tag=3,i}function uy(i,l,a,u){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var g=u.value;i.payload=function(){return m(g)},i.callback=function(){ay(l,a,u)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){ay(l,a,u),typeof m!="function"&&(cr===null?cr=new Set([this]):cr.add(this));var E=u.stack;this.componentDidCatch(u.value,{componentStack:E!==null?E:""})})}function JM(i,l,a,u,m){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(l=a.alternate,l!==null&&Vl(l,a,m,!0),a=cn.current,a!==null){switch(a.tag){case 31:case 13:return Tn===null?wc():a.alternate===null&&st===0&&(st=3),a.flags&=-257,a.flags|=65536,a.lanes=m,u===Za?a.flags|=16384:(l=a.updateQueue,l===null?a.updateQueue=new Set([u]):l.add(u),Rd(i,u,m)),!1;case 22:return a.flags|=65536,u===Za?a.flags|=16384:(l=a.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=l):(a=l.retryQueue,a===null?l.retryQueue=new Set([u]):a.add(u)),Rd(i,u,m)),!1}throw Error(r(435,a.tag))}return Rd(i,u,m),wc(),!1}if(ze)return l=cn.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=m,u!==Ah&&(i=Error(r(422),{cause:u}),ts(Cn(i,a)))):(u!==Ah&&(l=Error(r(423),{cause:u}),ts(Cn(l,a))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,u=Cn(u,a),m=ld(i.stateNode,u,m),zh(i,m),st!==4&&(st=2)),!1;var g=Error(r(520),{cause:u});if(g=Cn(g,a),xs===null?xs=[g]:xs.push(g),st!==4&&(st=2),l===null)return!0;u=Cn(u,a),a=l;do{switch(a.tag){case 3:return a.flags|=65536,i=m&-m,a.lanes|=i,i=ld(a.stateNode,u,i),zh(a,i),!1;case 1:if(l=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(cr===null||!cr.has(g))))return a.flags|=65536,m&=-m,a.lanes|=m,m=cy(m),uy(m,i,a,u),zh(a,m),!1}a=a.return}while(a!==null);return!1}var od=Error(r(461)),pt=!1;function Rt(i,l,a,u){l.child=i===null?mv(l,null,a,u):el(l,i.child,a,u)}function fy(i,l,a,u,m){a=a.render;var g=l.ref;if("ref"in u){var b={};for(var E in u)E!=="ref"&&(b[E]=u[E])}else b=u;return Qr(l),u=Vh(i,l,a,b,g,m),E=Ih(),i!==null&&!pt?(Gh(i,l,m),Di(i,l,m)):(ze&&E&&wh(l),l.flags|=1,Rt(i,l,u,m),l.child)}function hy(i,l,a,u,m){if(i===null){var g=a.type;return typeof g=="function"&&!bh(g)&&g.defaultProps===void 0&&a.compare===null?(l.tag=15,l.type=g,dy(i,l,g,u,m)):(i=Ya(a.type,null,u,l,l.mode,m),i.ref=l.ref,i.return=l,l.child=i)}if(g=i.child,!md(i,m)){var b=g.memoizedProps;if(a=a.compare,a=a!==null?a:$o,a(b,u)&&i.ref===l.ref)return Di(i,l,m)}return l.flags|=1,i=Ei(g,u),i.ref=l.ref,i.return=l,l.child=i}function dy(i,l,a,u,m){if(i!==null){var g=i.memoizedProps;if($o(g,u)&&i.ref===l.ref)if(pt=!1,l.pendingProps=u=g,md(i,m))(i.flags&131072)!==0&&(pt=!0);else return l.lanes=i.lanes,Di(i,l,m)}return sd(i,l,a,u,m)}function my(i,l,a,u){var m=u.children,g=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((l.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,i!==null){for(u=l.child=i.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~g}else u=0,l.child=null;return py(i,l,g,a,u)}if((a&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&Xa(l,g!==null?g.cachePool:null),g!==null?vv(l,g):jh(),yv(l);else return u=l.lanes=536870912,py(i,l,g!==null?g.baseLanes|a:a,a,u)}else g!==null?(Xa(l,g.cachePool),vv(l,g),lr(),l.memoizedState=null):(i!==null&&Xa(l,null),jh(),lr());return Rt(i,l,m,a),l.child}function ds(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function py(i,l,a,u,m){var g=Dh();return g=g===null?null:{parent:dt._currentValue,pool:g},l.memoizedState={baseLanes:a,cachePool:g},i!==null&&Xa(l,null),jh(),yv(l),i!==null&&Vl(i,l,u,!0),l.childLanes=m,null}function fc(i,l){return l=dc({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function gy(i,l,a){return el(l,i.child,null,a),i=fc(l,l.pendingProps),i.flags|=2,un(l),l.memoizedState=null,i}function eT(i,l,a){var u=l.pendingProps,m=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(ze){if(u.mode==="hidden")return i=fc(l,u),l.lanes=536870912,ds(null,i);if(Uh(l),(i=tt)?(i=kb(i,Mn),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:Zi!==null?{id:$n,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},a=J0(i),a.return=l,l.child=a,kt=l,tt=null)):i=null,i===null)throw Ji(l);return l.lanes=536870912,null}return fc(l,u)}var g=i.memoizedState;if(g!==null){var b=g.dehydrated;if(Uh(l),m)if(l.flags&256)l.flags&=-257,l=gy(i,l,a);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(r(558));else if(pt||Vl(i,l,a,!1),m=(a&i.childLanes)!==0,pt||m){if(u=Ze,u!==null&&(b=o0(u,a),b!==0&&b!==g.retryLane))throw g.retryLane=b,Fr(i,b),Jt(u,i,b),od;wc(),l=gy(i,l,a)}else i=g.treeContext,tt=kn(b.nextSibling),kt=l,ze=!0,$i=null,Mn=!1,i!==null&&nv(l,i),l=fc(l,u),l.flags|=4096;return l}return i=Ei(i.child,{mode:u.mode,children:u.children}),i.ref=l.ref,l.child=i,i.return=l,i}function hc(i,l){var a=l.ref;if(a===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(i===null||i.ref!==a)&&(l.flags|=4194816)}}function sd(i,l,a,u,m){return Qr(l),a=Vh(i,l,a,u,void 0,m),u=Ih(),i!==null&&!pt?(Gh(i,l,m),Di(i,l,m)):(ze&&u&&wh(l),l.flags|=1,Rt(i,l,a,m),l.child)}function vy(i,l,a,u,m,g){return Qr(l),l.updateQueue=null,a=xv(l,u,a,m),bv(i),u=Ih(),i!==null&&!pt?(Gh(i,l,g),Di(i,l,g)):(ze&&u&&wh(l),l.flags|=1,Rt(i,l,a,g),l.child)}function yy(i,l,a,u,m){if(Qr(l),l.stateNode===null){var g=jl,b=a.contextType;typeof b=="object"&&b!==null&&(g=Ot(b)),g=new a(u,g),l.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=rd,l.stateNode=g,g._reactInternals=l,g=l.stateNode,g.props=u,g.state=l.memoizedState,g.refs={},_h(l),b=a.contextType,g.context=typeof b=="object"&&b!==null?Ot(b):jl,g.state=l.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(id(l,a,b,u),g.state=l.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(b=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),b!==g.state&&rd.enqueueReplaceState(g,g.state,null),as(l,u,g,m),ss(),g.state=l.memoizedState),typeof g.componentDidMount=="function"&&(l.flags|=4194308),u=!0}else if(i===null){g=l.stateNode;var E=l.memoizedProps,O=nl(a,E);g.props=O;var I=g.context,W=a.contextType;b=jl,typeof W=="object"&&W!==null&&(b=Ot(W));var $=a.getDerivedStateFromProps;W=typeof $=="function"||typeof g.getSnapshotBeforeUpdate=="function",E=l.pendingProps!==E,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E||I!==b)&&ry(l,g,u,b),tr=!1;var q=l.memoizedState;g.state=q,as(l,u,g,m),ss(),I=l.memoizedState,E||q!==I||tr?(typeof $=="function"&&(id(l,a,$,u),I=l.memoizedState),(O=tr||iy(l,a,O,u,q,I,b))?(W||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(l.flags|=4194308)):(typeof g.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=u,l.memoizedState=I),g.props=u,g.state=I,g.context=b,u=O):(typeof g.componentDidMount=="function"&&(l.flags|=4194308),u=!1)}else{g=l.stateNode,Bh(i,l),b=l.memoizedProps,W=nl(a,b),g.props=W,$=l.pendingProps,q=g.context,I=a.contextType,O=jl,typeof I=="object"&&I!==null&&(O=Ot(I)),E=a.getDerivedStateFromProps,(I=typeof E=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(b!==$||q!==O)&&ry(l,g,u,O),tr=!1,q=l.memoizedState,g.state=q,as(l,u,g,m),ss();var K=l.memoizedState;b!==$||q!==K||tr||i!==null&&i.dependencies!==null&&Ka(i.dependencies)?(typeof E=="function"&&(id(l,a,E,u),K=l.memoizedState),(W=tr||iy(l,a,W,u,q,K,O)||i!==null&&i.dependencies!==null&&Ka(i.dependencies))?(I||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,K,O),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,K,O)),typeof g.componentDidUpdate=="function"&&(l.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof g.componentDidUpdate!="function"||b===i.memoizedProps&&q===i.memoizedState||(l.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&q===i.memoizedState||(l.flags|=1024),l.memoizedProps=u,l.memoizedState=K),g.props=u,g.state=K,g.context=O,u=W):(typeof g.componentDidUpdate!="function"||b===i.memoizedProps&&q===i.memoizedState||(l.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&q===i.memoizedState||(l.flags|=1024),u=!1)}return g=u,hc(i,l),u=(l.flags&128)!==0,g||u?(g=l.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:g.render(),l.flags|=1,i!==null&&u?(l.child=el(l,i.child,null,m),l.child=el(l,null,a,m)):Rt(i,l,a,m),l.memoizedState=g.state,i=l.child):i=Di(i,l,m),i}function by(i,l,a,u){return Wr(),l.flags|=256,Rt(i,l,a,u),l.child}var ad={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cd(i){return{baseLanes:i,cachePool:av()}}function ud(i,l,a){return i=i!==null?i.childLanes&~a:0,l&&(i|=hn),i}function xy(i,l,a){var u=l.pendingProps,m=!1,g=(l.flags&128)!==0,b;if((b=g)||(b=i!==null&&i.memoizedState===null?!1:(at.current&2)!==0),b&&(m=!0,l.flags&=-129),b=(l.flags&32)!==0,l.flags&=-33,i===null){if(ze){if(m?rr(l):lr(),(i=tt)?(i=kb(i,Mn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:Zi!==null?{id:$n,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},a=J0(i),a.return=l,l.child=a,kt=l,tt=null)):i=null,i===null)throw Ji(l);return Fd(i)?l.lanes=32:l.lanes=536870912,null}var E=u.children;return u=u.fallback,m?(lr(),m=l.mode,E=dc({mode:"hidden",children:E},m),u=Kr(u,m,a,null),E.return=l,u.return=l,E.sibling=u,l.child=E,u=l.child,u.memoizedState=cd(a),u.childLanes=ud(i,b,a),l.memoizedState=ad,ds(null,u)):(rr(l),fd(l,E))}var O=i.memoizedState;if(O!==null&&(E=O.dehydrated,E!==null)){if(g)l.flags&256?(rr(l),l.flags&=-257,l=hd(i,l,a)):l.memoizedState!==null?(lr(),l.child=i.child,l.flags|=128,l=null):(lr(),E=u.fallback,m=l.mode,u=dc({mode:"visible",children:u.children},m),E=Kr(E,m,a,null),E.flags|=2,u.return=l,E.return=l,u.sibling=E,l.child=u,el(l,i.child,null,a),u=l.child,u.memoizedState=cd(a),u.childLanes=ud(i,b,a),l.memoizedState=ad,l=ds(null,u));else if(rr(l),Fd(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var I=b.dgst;b=I,u=Error(r(419)),u.stack="",u.digest=b,ts({value:u,source:null,stack:null}),l=hd(i,l,a)}else if(pt||Vl(i,l,a,!1),b=(a&i.childLanes)!==0,pt||b){if(b=Ze,b!==null&&(u=o0(b,a),u!==0&&u!==O.retryLane))throw O.retryLane=u,Fr(i,u),Jt(b,i,u),od;Yd(E)||wc(),l=hd(i,l,a)}else Yd(E)?(l.flags|=192,l.child=i.child,l=null):(i=O.treeContext,tt=kn(E.nextSibling),kt=l,ze=!0,$i=null,Mn=!1,i!==null&&nv(l,i),l=fd(l,u.children),l.flags|=4096);return l}return m?(lr(),E=u.fallback,m=l.mode,O=i.child,I=O.sibling,u=Ei(O,{mode:"hidden",children:u.children}),u.subtreeFlags=O.subtreeFlags&65011712,I!==null?E=Ei(I,E):(E=Kr(E,m,a,null),E.flags|=2),E.return=l,u.return=l,u.sibling=E,l.child=u,ds(null,u),u=l.child,E=i.child.memoizedState,E===null?E=cd(a):(m=E.cachePool,m!==null?(O=dt._currentValue,m=m.parent!==O?{parent:O,pool:O}:m):m=av(),E={baseLanes:E.baseLanes|a,cachePool:m}),u.memoizedState=E,u.childLanes=ud(i,b,a),l.memoizedState=ad,ds(i.child,u)):(rr(l),a=i.child,i=a.sibling,a=Ei(a,{mode:"visible",children:u.children}),a.return=l,a.sibling=null,i!==null&&(b=l.deletions,b===null?(l.deletions=[i],l.flags|=16):b.push(i)),l.child=a,l.memoizedState=null,a)}function fd(i,l){return l=dc({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function dc(i,l){return i=an(22,i,null,l),i.lanes=0,i}function hd(i,l,a){return el(l,i.child,null,a),i=fd(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function Sy(i,l,a){i.lanes|=l;var u=i.alternate;u!==null&&(u.lanes|=l),Th(i.return,l,a)}function dd(i,l,a,u,m,g){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:m,treeForkCount:g}:(b.isBackwards=l,b.rendering=null,b.renderingStartTime=0,b.last=u,b.tail=a,b.tailMode=m,b.treeForkCount=g)}function wy(i,l,a){var u=l.pendingProps,m=u.revealOrder,g=u.tail;u=u.children;var b=at.current,E=(b&2)!==0;if(E?(b=b&1|2,l.flags|=128):b&=1,te(at,b),Rt(i,l,u,a),u=ze?es:0,!E&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Sy(i,a,l);else if(i.tag===19)Sy(i,a,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(m){case"forwards":for(a=l.child,m=null;a!==null;)i=a.alternate,i!==null&&tc(i)===null&&(m=a),a=a.sibling;a=m,a===null?(m=l.child,l.child=null):(m=a.sibling,a.sibling=null),dd(l,!1,m,a,g,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,m=l.child,l.child=null;m!==null;){if(i=m.alternate,i!==null&&tc(i)===null){l.child=m;break}i=m.sibling,m.sibling=a,a=m,m=i}dd(l,!0,a,null,g,u);break;case"together":dd(l,!1,null,null,void 0,u);break;default:l.memoizedState=null}return l.child}function Di(i,l,a){if(i!==null&&(l.dependencies=i.dependencies),ar|=l.lanes,(a&l.childLanes)===0)if(i!==null){if(Vl(i,l,a,!1),(a&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,a=Ei(i,i.pendingProps),l.child=a,a.return=l;i.sibling!==null;)i=i.sibling,a=a.sibling=Ei(i,i.pendingProps),a.return=l;a.sibling=null}return l.child}function md(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&Ka(i)))}function tT(i,l,a){switch(l.tag){case 3:Ae(l,l.stateNode.containerInfo),er(l,dt,i.memoizedState.cache),Wr();break;case 27:case 5:Ne(l);break;case 4:Ae(l,l.stateNode.containerInfo);break;case 10:er(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Uh(l),null;break;case 13:var u=l.memoizedState;if(u!==null)return u.dehydrated!==null?(rr(l),l.flags|=128,null):(a&l.child.childLanes)!==0?xy(i,l,a):(rr(l),i=Di(i,l,a),i!==null?i.sibling:null);rr(l);break;case 19:var m=(i.flags&128)!==0;if(u=(a&l.childLanes)!==0,u||(Vl(i,l,a,!1),u=(a&l.childLanes)!==0),m){if(u)return wy(i,l,a);l.flags|=128}if(m=l.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),te(at,at.current),u)break;return null;case 22:return l.lanes=0,my(i,l,a,l.pendingProps);case 24:er(l,dt,i.memoizedState.cache)}return Di(i,l,a)}function Cy(i,l,a){if(i!==null)if(i.memoizedProps!==l.pendingProps)pt=!0;else{if(!md(i,a)&&(l.flags&128)===0)return pt=!1,tT(i,l,a);pt=(i.flags&131072)!==0}else pt=!1,ze&&(l.flags&1048576)!==0&&tv(l,es,l.index);switch(l.lanes=0,l.tag){case 16:e:{var u=l.pendingProps;if(i=$r(l.elementType),l.type=i,typeof i=="function")bh(i)?(u=nl(i,u),l.tag=1,l=yy(null,l,i,u,a)):(l.tag=0,l=sd(null,l,i,u,a));else{if(i!=null){var m=i.$$typeof;if(m===j){l.tag=11,l=fy(null,l,i,u,a);break e}else if(m===_){l.tag=14,l=hy(null,l,i,u,a);break e}}throw l=oe(i)||i,Error(r(306,l,""))}}return l;case 0:return sd(i,l,l.type,l.pendingProps,a);case 1:return u=l.type,m=nl(u,l.pendingProps),yy(i,l,u,m,a);case 3:e:{if(Ae(l,l.stateNode.containerInfo),i===null)throw Error(r(387));u=l.pendingProps;var g=l.memoizedState;m=g.element,Bh(i,l),as(l,u,null,a);var b=l.memoizedState;if(u=b.cache,er(l,dt,u),u!==g.cache&&kh(l,[dt],a,!0),ss(),u=b.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:b.cache},l.updateQueue.baseState=g,l.memoizedState=g,l.flags&256){l=by(i,l,u,a);break e}else if(u!==m){m=Cn(Error(r(424)),l),ts(m),l=by(i,l,u,a);break e}else for(i=l.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,tt=kn(i.firstChild),kt=l,ze=!0,$i=null,Mn=!0,a=mv(l,null,u,a),l.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Wr(),u===m){l=Di(i,l,a);break e}Rt(i,l,u,a)}l=l.child}return l;case 26:return hc(i,l),i===null?(a=Bb(l.type,null,l.pendingProps,null))?l.memoizedState=a:ze||(a=l.type,i=l.pendingProps,u=Oc(ye.current).createElement(a),u[Tt]=l,u[Kt]=i,Dt(u,a,i),Ct(u),l.stateNode=u):l.memoizedState=Bb(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return Ne(l),i===null&&ze&&(u=l.stateNode=Db(l.type,l.pendingProps,ye.current),kt=l,Mn=!0,m=tt,dr(l.type)?(Kd=m,tt=kn(u.firstChild)):tt=m),Rt(i,l,l.pendingProps.children,a),hc(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&ze&&((m=u=tt)&&(u=DT(u,l.type,l.pendingProps,Mn),u!==null?(l.stateNode=u,kt=l,tt=kn(u.firstChild),Mn=!1,m=!0):m=!1),m||Ji(l)),Ne(l),m=l.type,g=l.pendingProps,b=i!==null?i.memoizedProps:null,u=g.children,Id(m,g)?u=null:b!==null&&Id(m,b)&&(l.flags|=32),l.memoizedState!==null&&(m=Vh(i,l,FM,null,null,a),ks._currentValue=m),hc(i,l),Rt(i,l,u,a),l.child;case 6:return i===null&&ze&&((i=a=tt)&&(a=NT(a,l.pendingProps,Mn),a!==null?(l.stateNode=a,kt=l,tt=null,i=!0):i=!1),i||Ji(l)),null;case 13:return xy(i,l,a);case 4:return Ae(l,l.stateNode.containerInfo),u=l.pendingProps,i===null?l.child=el(l,null,u,a):Rt(i,l,u,a),l.child;case 11:return fy(i,l,l.type,l.pendingProps,a);case 7:return Rt(i,l,l.pendingProps,a),l.child;case 8:return Rt(i,l,l.pendingProps.children,a),l.child;case 12:return Rt(i,l,l.pendingProps.children,a),l.child;case 10:return u=l.pendingProps,er(l,l.type,u.value),Rt(i,l,u.children,a),l.child;case 9:return m=l.type._context,u=l.pendingProps.children,Qr(l),m=Ot(m),u=u(m),l.flags|=1,Rt(i,l,u,a),l.child;case 14:return hy(i,l,l.type,l.pendingProps,a);case 15:return dy(i,l,l.type,l.pendingProps,a);case 19:return wy(i,l,a);case 31:return eT(i,l,a);case 22:return my(i,l,a,l.pendingProps);case 24:return Qr(l),u=Ot(dt),i===null?(m=Dh(),m===null&&(m=Ze,g=Oh(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=a),m=g),l.memoizedState={parent:u,cache:m},_h(l),er(l,dt,m)):((i.lanes&a)!==0&&(Bh(i,l),as(l,null,null,a),ss()),m=i.memoizedState,g=l.memoizedState,m.parent!==u?(m={parent:u,cache:u},l.memoizedState=m,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=m),er(l,dt,u)):(u=g.cache,er(l,dt,u),u!==m.cache&&kh(l,[dt],a,!0))),Rt(i,l,l.pendingProps.children,a),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Ni(i){i.flags|=4}function pd(i,l,a,u,m){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(Qy())i.flags|=8192;else throw Jr=Za,Nh}else i.flags&=-16777217}function Ay(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Ub(l))if(Qy())i.flags|=8192;else throw Jr=Za,Nh}function mc(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?i0():536870912,i.lanes|=l,Jl|=l)}function ms(i,l){if(!ze)switch(i.tailMode){case"hidden":l=i.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function nt(i){var l=i.alternate!==null&&i.alternate.child===i.child,a=0,u=0;if(l)for(var m=i.child;m!==null;)a|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)a|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=u,i.childLanes=a,l}function nT(i,l,a){var u=l.pendingProps;switch(Ch(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(l),null;case 1:return nt(l),null;case 3:return a=l.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),ki(dt),Me(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(Pl(l)?Ni(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Eh())),nt(l),null;case 26:var m=l.type,g=l.memoizedState;return i===null?(Ni(l),g!==null?(nt(l),Ay(l,g)):(nt(l),pd(l,m,null,u,a))):g?g!==i.memoizedState?(Ni(l),nt(l),Ay(l,g)):(nt(l),l.flags&=-16777217):(i=i.memoizedProps,i!==u&&Ni(l),nt(l),pd(l,m,i,u,a)),null;case 27:if(He(l),a=ye.current,m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==u&&Ni(l);else{if(!u){if(l.stateNode===null)throw Error(r(166));return nt(l),null}i=re.current,Pl(l)?iv(l):(i=Db(m,u,a),l.stateNode=i,Ni(l))}return nt(l),null;case 5:if(He(l),m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==u&&Ni(l);else{if(!u){if(l.stateNode===null)throw Error(r(166));return nt(l),null}if(g=re.current,Pl(l))iv(l);else{var b=Oc(ye.current);switch(g){case 1:g=b.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=b.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=b.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=b.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=b.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?b.createElement("select",{is:u.is}):b.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?b.createElement(m,{is:u.is}):b.createElement(m)}}g[Tt]=l,g[Kt]=u;e:for(b=l.child;b!==null;){if(b.tag===5||b.tag===6)g.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===l)break e;for(;b.sibling===null;){if(b.return===null||b.return===l)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}l.stateNode=g;e:switch(Dt(g,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ni(l)}}return nt(l),pd(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,a),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==u&&Ni(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(r(166));if(i=ye.current,Pl(l)){if(i=l.stateNode,a=l.memoizedProps,u=null,m=kt,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}i[Tt]=l,i=!!(i.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||xb(i.nodeValue,a)),i||Ji(l,!0)}else i=Oc(i).createTextNode(u),i[Tt]=l,l.stateNode=i}return nt(l),null;case 31:if(a=l.memoizedState,i===null||i.memoizedState!==null){if(u=Pl(l),a!==null){if(i===null){if(!u)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Tt]=l}else Wr(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;nt(l),i=!1}else a=Eh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return l.flags&256?(un(l),l):(un(l),null);if((l.flags&128)!==0)throw Error(r(558))}return nt(l),null;case 13:if(u=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Pl(l),u!==null&&u.dehydrated!==null){if(i===null){if(!m)throw Error(r(318));if(m=l.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[Tt]=l}else Wr(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;nt(l),m=!1}else m=Eh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return l.flags&256?(un(l),l):(un(l),null)}return un(l),(l.flags&128)!==0?(l.lanes=a,l):(a=u!==null,i=i!==null&&i.memoizedState!==null,a&&(u=l.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==m&&(u.flags|=2048)),a!==i&&a&&(l.child.flags|=8192),mc(l,l.updateQueue),nt(l),null);case 4:return Me(),i===null&&jd(l.stateNode.containerInfo),nt(l),null;case 10:return ki(l.type),nt(l),null;case 19:if(Y(at),u=l.memoizedState,u===null)return nt(l),null;if(m=(l.flags&128)!==0,g=u.rendering,g===null)if(m)ms(u,!1);else{if(st!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(g=tc(i),g!==null){for(l.flags|=128,ms(u,!1),i=g.updateQueue,l.updateQueue=i,mc(l,i),l.subtreeFlags=0,i=a,a=l.child;a!==null;)$0(a,i),a=a.sibling;return te(at,at.current&1|2),ze&&Mi(l,u.treeForkCount),l.child}i=i.sibling}u.tail!==null&&rn()>bc&&(l.flags|=128,m=!0,ms(u,!1),l.lanes=4194304)}else{if(!m)if(i=tc(g),i!==null){if(l.flags|=128,m=!0,i=i.updateQueue,l.updateQueue=i,mc(l,i),ms(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!ze)return nt(l),null}else 2*rn()-u.renderingStartTime>bc&&a!==536870912&&(l.flags|=128,m=!0,ms(u,!1),l.lanes=4194304);u.isBackwards?(g.sibling=l.child,l.child=g):(i=u.last,i!==null?i.sibling=g:l.child=g,u.last=g)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=rn(),i.sibling=null,a=at.current,te(at,m?a&1|2:a&1),ze&&Mi(l,u.treeForkCount),i):(nt(l),null);case 22:case 23:return un(l),Hh(),u=l.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?(a&536870912)!==0&&(l.flags&128)===0&&(nt(l),l.subtreeFlags&6&&(l.flags|=8192)):nt(l),a=l.updateQueue,a!==null&&mc(l,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048),i!==null&&Y(Zr),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),l.memoizedState.cache!==a&&(l.flags|=2048),ki(dt),nt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function iT(i,l){switch(Ch(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return ki(dt),Me(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return He(l),null;case 31:if(l.memoizedState!==null){if(un(l),l.alternate===null)throw Error(r(340));Wr()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(un(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Wr()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Y(at),null;case 4:return Me(),null;case 10:return ki(l.type),null;case 22:case 23:return un(l),Hh(),i!==null&&Y(Zr),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return ki(dt),null;case 25:return null;default:return null}}function Ey(i,l){switch(Ch(l),l.tag){case 3:ki(dt),Me();break;case 26:case 27:case 5:He(l);break;case 4:Me();break;case 31:l.memoizedState!==null&&un(l);break;case 13:un(l);break;case 19:Y(at);break;case 10:ki(l.type);break;case 22:case 23:un(l),Hh(),i!==null&&Y(Zr);break;case 24:ki(dt)}}function ps(i,l){try{var a=l.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var m=u.next;a=m;do{if((a.tag&i)===i){u=void 0;var g=a.create,b=a.inst;u=g(),b.destroy=u}a=a.next}while(a!==m)}}catch(E){Ke(l,l.return,E)}}function or(i,l,a){try{var u=l.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var g=m.next;u=g;do{if((u.tag&i)===i){var b=u.inst,E=b.destroy;if(E!==void 0){b.destroy=void 0,m=l;var O=a,I=E;try{I()}catch(W){Ke(m,O,W)}}}u=u.next}while(u!==g)}}catch(W){Ke(l,l.return,W)}}function My(i){var l=i.updateQueue;if(l!==null){var a=i.stateNode;try{gv(l,a)}catch(u){Ke(i,i.return,u)}}}function Ty(i,l,a){a.props=nl(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(u){Ke(i,l,u)}}function gs(i,l){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof a=="function"?i.refCleanup=a(u):a.current=u}}catch(m){Ke(i,l,m)}}function ei(i,l){var a=i.ref,u=i.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(m){Ke(i,l,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){Ke(i,l,m)}else a.current=null}function ky(i){var l=i.type,a=i.memoizedProps,u=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(m){Ke(i,i.return,m)}}function gd(i,l,a){try{var u=i.stateNode;ET(u,i.type,a,l),u[Kt]=l}catch(m){Ke(i,i.return,m)}}function Oy(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&dr(i.type)||i.tag===4}function vd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Oy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&dr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function yd(i,l,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,l?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,l):(l=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,l.appendChild(i),a=a._reactRootContainer,a!=null||l.onclick!==null||(l.onclick=Ci));else if(u!==4&&(u===27&&dr(i.type)&&(a=i.stateNode,l=null),i=i.child,i!==null))for(yd(i,l,a),i=i.sibling;i!==null;)yd(i,l,a),i=i.sibling}function pc(i,l,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,l?a.insertBefore(i,l):a.appendChild(i);else if(u!==4&&(u===27&&dr(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(pc(i,l,a),i=i.sibling;i!==null;)pc(i,l,a),i=i.sibling}function Ry(i){var l=i.stateNode,a=i.memoizedProps;try{for(var u=i.type,m=l.attributes;m.length;)l.removeAttributeNode(m[0]);Dt(l,u,a),l[Tt]=i,l[Kt]=a}catch(g){Ke(i,i.return,g)}}var _i=!1,gt=!1,bd=!1,Dy=typeof WeakSet=="function"?WeakSet:Set,At=null;function rT(i,l){if(i=i.containerInfo,Pd=Lc,i=G0(i),hh(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var m=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var b=0,E=-1,O=-1,I=0,W=0,$=i,q=null;t:for(;;){for(var K;$!==a||m!==0&&$.nodeType!==3||(E=b+m),$!==g||u!==0&&$.nodeType!==3||(O=b+u),$.nodeType===3&&(b+=$.nodeValue.length),(K=$.firstChild)!==null;)q=$,$=K;for(;;){if($===i)break t;if(q===a&&++I===m&&(E=b),q===g&&++W===u&&(O=b),(K=$.nextSibling)!==null)break;$=q,q=$.parentNode}$=K}a=E===-1||O===-1?null:{start:E,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vd={focusedElem:i,selectionRange:a},Lc=!1,At=l;At!==null;)if(l=At,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,At=i;else for(;At!==null;){switch(l=At,g=l.alternate,i=l.flags,l.tag){case 0:if((i&4)!==0&&(i=l.updateQueue,i=i!==null?i.events:null,i!==null))for(a=0;a<i.length;a++)m=i[a],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&g!==null){i=void 0,a=l,m=g.memoizedProps,g=g.memoizedState,u=a.stateNode;try{var de=nl(a.type,m);i=u.getSnapshotBeforeUpdate(de,g),u.__reactInternalSnapshotBeforeUpdate=i}catch(Se){Ke(a,a.return,Se)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,a=i.nodeType,a===9)qd(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":qd(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=l.sibling,i!==null){i.return=l.return,At=i;break}At=l.return}}function Ny(i,l,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:zi(i,a),u&4&&ps(5,a);break;case 1:if(zi(i,a),u&4)if(i=a.stateNode,l===null)try{i.componentDidMount()}catch(b){Ke(a,a.return,b)}else{var m=nl(a.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(m,l,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ke(a,a.return,b)}}u&64&&My(a),u&512&&gs(a,a.return);break;case 3:if(zi(i,a),u&64&&(i=a.updateQueue,i!==null)){if(l=null,a.child!==null)switch(a.child.tag){case 27:case 5:l=a.child.stateNode;break;case 1:l=a.child.stateNode}try{gv(i,l)}catch(b){Ke(a,a.return,b)}}break;case 27:l===null&&u&4&&Ry(a);case 26:case 5:zi(i,a),l===null&&u&4&&ky(a),u&512&&gs(a,a.return);break;case 12:zi(i,a);break;case 31:zi(i,a),u&4&&zy(i,a);break;case 13:zi(i,a),u&4&&Ly(i,a),u&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=dT.bind(null,a),_T(i,a))));break;case 22:if(u=a.memoizedState!==null||_i,!u){l=l!==null&&l.memoizedState!==null||gt,m=_i;var g=gt;_i=u,(gt=l)&&!g?Li(i,a,(a.subtreeFlags&8772)!==0):zi(i,a),_i=m,gt=g}break;case 30:break;default:zi(i,a)}}function _y(i){var l=i.alternate;l!==null&&(i.alternate=null,_y(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Xf(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var it=null,Xt=!1;function Bi(i,l,a){for(a=a.child;a!==null;)By(i,l,a),a=a.sibling}function By(i,l,a){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(Po,a)}catch{}switch(a.tag){case 26:gt||ei(a,l),Bi(i,l,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:gt||ei(a,l);var u=it,m=Xt;dr(a.type)&&(it=a.stateNode,Xt=!1),Bi(i,l,a),Es(a.stateNode),it=u,Xt=m;break;case 5:gt||ei(a,l);case 6:if(u=it,m=Xt,it=null,Bi(i,l,a),it=u,Xt=m,it!==null)if(Xt)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(a.stateNode)}catch(g){Ke(a,l,g)}else try{it.removeChild(a.stateNode)}catch(g){Ke(a,l,g)}break;case 18:it!==null&&(Xt?(i=it,Mb(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),so(i)):Mb(it,a.stateNode));break;case 4:u=it,m=Xt,it=a.stateNode.containerInfo,Xt=!0,Bi(i,l,a),it=u,Xt=m;break;case 0:case 11:case 14:case 15:or(2,a,l),gt||or(4,a,l),Bi(i,l,a);break;case 1:gt||(ei(a,l),u=a.stateNode,typeof u.componentWillUnmount=="function"&&Ty(a,l,u)),Bi(i,l,a);break;case 21:Bi(i,l,a);break;case 22:gt=(u=gt)||a.memoizedState!==null,Bi(i,l,a),gt=u;break;default:Bi(i,l,a)}}function zy(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{so(i)}catch(a){Ke(l,l.return,a)}}}function Ly(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{so(i)}catch(a){Ke(l,l.return,a)}}function lT(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new Dy),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new Dy),l;default:throw Error(r(435,i.tag))}}function gc(i,l){var a=lT(i);l.forEach(function(u){if(!a.has(u)){a.add(u);var m=mT.bind(null,i,u);u.then(m,m)}})}function Qt(i,l){var a=l.deletions;if(a!==null)for(var u=0;u<a.length;u++){var m=a[u],g=i,b=l,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(dr(E.type)){it=E.stateNode,Xt=!1;break e}break;case 5:it=E.stateNode,Xt=!1;break e;case 3:case 4:it=E.stateNode.containerInfo,Xt=!0;break e}E=E.return}if(it===null)throw Error(r(160));By(g,b,m),it=null,Xt=!1,g=m.alternate,g!==null&&(g.return=null),m.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)jy(l,i),l=l.sibling}var Vn=null;function jy(i,l){var a=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Qt(l,i),Zt(i),u&4&&(or(3,i,i.return),ps(3,i),or(5,i,i.return));break;case 1:Qt(l,i),Zt(i),u&512&&(gt||a===null||ei(a,a.return)),u&64&&_i&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var m=Vn;if(Qt(l,i),Zt(i),u&512&&(gt||a===null||ei(a,a.return)),u&4){var g=a!==null?a.memoizedState:null;if(u=i.memoizedState,a===null)if(u===null)if(i.stateNode===null){e:{u=i.type,a=i.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":g=m.getElementsByTagName("title")[0],(!g||g[Go]||g[Tt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=m.createElement(u),m.head.insertBefore(g,m.querySelector("head > title"))),Dt(g,u,a),g[Tt]=i,Ct(g),u=g;break e;case"link":var b=jb("link","href",m).get(u+(a.href||""));if(b){for(var E=0;E<b.length;E++)if(g=b[E],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(E,1);break t}}g=m.createElement(u),Dt(g,u,a),m.head.appendChild(g);break;case"meta":if(b=jb("meta","content",m).get(u+(a.content||""))){for(E=0;E<b.length;E++)if(g=b[E],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(E,1);break t}}g=m.createElement(u),Dt(g,u,a),m.head.appendChild(g);break;default:throw Error(r(468,u))}g[Tt]=i,Ct(g),u=g}i.stateNode=u}else Hb(m,i.type,i.stateNode);else i.stateNode=Lb(m,u,i.memoizedProps);else g!==u?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,u===null?Hb(m,i.type,i.stateNode):Lb(m,u,i.memoizedProps)):u===null&&i.stateNode!==null&&gd(i,i.memoizedProps,a.memoizedProps)}break;case 27:Qt(l,i),Zt(i),u&512&&(gt||a===null||ei(a,a.return)),a!==null&&u&4&&gd(i,i.memoizedProps,a.memoizedProps);break;case 5:if(Qt(l,i),Zt(i),u&512&&(gt||a===null||ei(a,a.return)),i.flags&32){m=i.stateNode;try{Rl(m,"")}catch(de){Ke(i,i.return,de)}}u&4&&i.stateNode!=null&&(m=i.memoizedProps,gd(i,m,a!==null?a.memoizedProps:m)),u&1024&&(bd=!0);break;case 6:if(Qt(l,i),Zt(i),u&4){if(i.stateNode===null)throw Error(r(162));u=i.memoizedProps,a=i.stateNode;try{a.nodeValue=u}catch(de){Ke(i,i.return,de)}}break;case 3:if(Nc=null,m=Vn,Vn=Rc(l.containerInfo),Qt(l,i),Vn=m,Zt(i),u&4&&a!==null&&a.memoizedState.isDehydrated)try{so(l.containerInfo)}catch(de){Ke(i,i.return,de)}bd&&(bd=!1,Hy(i));break;case 4:u=Vn,Vn=Rc(i.stateNode.containerInfo),Qt(l,i),Zt(i),Vn=u;break;case 12:Qt(l,i),Zt(i);break;case 31:Qt(l,i),Zt(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,gc(i,u)));break;case 13:Qt(l,i),Zt(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(yc=rn()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,gc(i,u)));break;case 22:m=i.memoizedState!==null;var O=a!==null&&a.memoizedState!==null,I=_i,W=gt;if(_i=I||m,gt=W||O,Qt(l,i),gt=W,_i=I,Zt(i),u&8192)e:for(l=i.stateNode,l._visibility=m?l._visibility&-2:l._visibility|1,m&&(a===null||O||_i||gt||il(i)),a=null,l=i;;){if(l.tag===5||l.tag===26){if(a===null){O=a=l;try{if(g=O.stateNode,m)b=g.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=O.stateNode;var $=O.memoizedProps.style,q=$!=null&&$.hasOwnProperty("display")?$.display:null;E.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(de){Ke(O,O.return,de)}}}else if(l.tag===6){if(a===null){O=l;try{O.stateNode.nodeValue=m?"":O.memoizedProps}catch(de){Ke(O,O.return,de)}}}else if(l.tag===18){if(a===null){O=l;try{var K=O.stateNode;m?Tb(K,!0):Tb(O.stateNode,!1)}catch(de){Ke(O,O.return,de)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;a===l&&(a=null),l=l.return}a===l&&(a=null),l.sibling.return=l.return,l=l.sibling}u&4&&(u=i.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,gc(i,a))));break;case 19:Qt(l,i),Zt(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,gc(i,u)));break;case 30:break;case 21:break;default:Qt(l,i),Zt(i)}}function Zt(i){var l=i.flags;if(l&2){try{for(var a,u=i.return;u!==null;){if(Oy(u)){a=u;break}u=u.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var m=a.stateNode,g=vd(i);pc(i,g,m);break;case 5:var b=a.stateNode;a.flags&32&&(Rl(b,""),a.flags&=-33);var E=vd(i);pc(i,E,b);break;case 3:case 4:var O=a.stateNode.containerInfo,I=vd(i);yd(i,I,O);break;default:throw Error(r(161))}}catch(W){Ke(i,i.return,W)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function Hy(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;Hy(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function zi(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Ny(i,l.alternate,l),l=l.sibling}function il(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:or(4,l,l.return),il(l);break;case 1:ei(l,l.return);var a=l.stateNode;typeof a.componentWillUnmount=="function"&&Ty(l,l.return,a),il(l);break;case 27:Es(l.stateNode);case 26:case 5:ei(l,l.return),il(l);break;case 22:l.memoizedState===null&&il(l);break;case 30:il(l);break;default:il(l)}i=i.sibling}}function Li(i,l,a){for(a=a&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var u=l.alternate,m=i,g=l,b=g.flags;switch(g.tag){case 0:case 11:case 15:Li(m,g,a),ps(4,g);break;case 1:if(Li(m,g,a),u=g,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(I){Ke(u,u.return,I)}if(u=g,m=u.updateQueue,m!==null){var E=u.stateNode;try{var O=m.shared.hiddenCallbacks;if(O!==null)for(m.shared.hiddenCallbacks=null,m=0;m<O.length;m++)pv(O[m],E)}catch(I){Ke(u,u.return,I)}}a&&b&64&&My(g),gs(g,g.return);break;case 27:Ry(g);case 26:case 5:Li(m,g,a),a&&u===null&&b&4&&ky(g),gs(g,g.return);break;case 12:Li(m,g,a);break;case 31:Li(m,g,a),a&&b&4&&zy(m,g);break;case 13:Li(m,g,a),a&&b&4&&Ly(m,g);break;case 22:g.memoizedState===null&&Li(m,g,a),gs(g,g.return);break;case 30:break;default:Li(m,g,a)}l=l.sibling}}function xd(i,l){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&ns(a))}function Sd(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&ns(i))}function In(i,l,a,u){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Uy(i,l,a,u),l=l.sibling}function Uy(i,l,a,u){var m=l.flags;switch(l.tag){case 0:case 11:case 15:In(i,l,a,u),m&2048&&ps(9,l);break;case 1:In(i,l,a,u);break;case 3:In(i,l,a,u),m&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&ns(i)));break;case 12:if(m&2048){In(i,l,a,u),i=l.stateNode;try{var g=l.memoizedProps,b=g.id,E=g.onPostCommit;typeof E=="function"&&E(b,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(O){Ke(l,l.return,O)}}else In(i,l,a,u);break;case 31:In(i,l,a,u);break;case 13:In(i,l,a,u);break;case 23:break;case 22:g=l.stateNode,b=l.alternate,l.memoizedState!==null?g._visibility&2?In(i,l,a,u):vs(i,l):g._visibility&2?In(i,l,a,u):(g._visibility|=2,Ql(i,l,a,u,(l.subtreeFlags&10256)!==0||!1)),m&2048&&xd(b,l);break;case 24:In(i,l,a,u),m&2048&&Sd(l.alternate,l);break;default:In(i,l,a,u)}}function Ql(i,l,a,u,m){for(m=m&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var g=i,b=l,E=a,O=u,I=b.flags;switch(b.tag){case 0:case 11:case 15:Ql(g,b,E,O,m),ps(8,b);break;case 23:break;case 22:var W=b.stateNode;b.memoizedState!==null?W._visibility&2?Ql(g,b,E,O,m):vs(g,b):(W._visibility|=2,Ql(g,b,E,O,m)),m&&I&2048&&xd(b.alternate,b);break;case 24:Ql(g,b,E,O,m),m&&I&2048&&Sd(b.alternate,b);break;default:Ql(g,b,E,O,m)}l=l.sibling}}function vs(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var a=i,u=l,m=u.flags;switch(u.tag){case 22:vs(a,u),m&2048&&xd(u.alternate,u);break;case 24:vs(a,u),m&2048&&Sd(u.alternate,u);break;default:vs(a,u)}l=l.sibling}}var ys=8192;function Zl(i,l,a){if(i.subtreeFlags&ys)for(i=i.child;i!==null;)Py(i,l,a),i=i.sibling}function Py(i,l,a){switch(i.tag){case 26:Zl(i,l,a),i.flags&ys&&i.memoizedState!==null&&YT(a,Vn,i.memoizedState,i.memoizedProps);break;case 5:Zl(i,l,a);break;case 3:case 4:var u=Vn;Vn=Rc(i.stateNode.containerInfo),Zl(i,l,a),Vn=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=ys,ys=16777216,Zl(i,l,a),ys=u):Zl(i,l,a));break;default:Zl(i,l,a)}}function Vy(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function bs(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var a=0;a<l.length;a++){var u=l[a];At=u,Gy(u,i)}Vy(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Iy(i),i=i.sibling}function Iy(i){switch(i.tag){case 0:case 11:case 15:bs(i),i.flags&2048&&or(9,i,i.return);break;case 3:bs(i);break;case 12:bs(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,vc(i)):bs(i);break;default:bs(i)}}function vc(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var a=0;a<l.length;a++){var u=l[a];At=u,Gy(u,i)}Vy(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:or(8,l,l.return),vc(l);break;case 22:a=l.stateNode,a._visibility&2&&(a._visibility&=-3,vc(l));break;default:vc(l)}i=i.sibling}}function Gy(i,l){for(;At!==null;){var a=At;switch(a.tag){case 0:case 11:case 15:or(8,a,l);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:ns(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,At=u;else e:for(a=i;At!==null;){u=At;var m=u.sibling,g=u.return;if(_y(u),u===a){At=null;break e}if(m!==null){m.return=g,At=m;break e}At=g}}}var oT={getCacheForType:function(i){var l=Ot(dt),a=l.data.get(i);return a===void 0&&(a=i(),l.data.set(i,a)),a},cacheSignal:function(){return Ot(dt).controller.signal}},sT=typeof WeakMap=="function"?WeakMap:Map,Ge=0,Ze=null,Re=null,_e=0,Fe=0,fn=null,sr=!1,$l=!1,wd=!1,ji=0,st=0,ar=0,rl=0,Cd=0,hn=0,Jl=0,xs=null,$t=null,Ad=!1,yc=0,qy=0,bc=1/0,xc=null,cr=null,bt=0,ur=null,eo=null,Hi=0,Ed=0,Md=null,Yy=null,Ss=0,Td=null;function dn(){return(Ge&2)!==0&&_e!==0?_e&-_e:R.T!==null?_d():s0()}function Fy(){if(hn===0)if((_e&536870912)===0||ze){var i=ka;ka<<=1,(ka&3932160)===0&&(ka=262144),hn=i}else hn=536870912;return i=cn.current,i!==null&&(i.flags|=32),hn}function Jt(i,l,a){(i===Ze&&(Fe===2||Fe===9)||i.cancelPendingCommit!==null)&&(to(i,0),fr(i,_e,hn,!1)),Io(i,a),((Ge&2)===0||i!==Ze)&&(i===Ze&&((Ge&2)===0&&(rl|=a),st===4&&fr(i,_e,hn,!1)),ti(i))}function Ky(i,l,a){if((Ge&6)!==0)throw Error(r(327));var u=!a&&(l&127)===0&&(l&i.expiredLanes)===0||Vo(i,l),m=u?uT(i,l):Od(i,l,!0),g=u;do{if(m===0){$l&&!u&&fr(i,l,0,!1);break}else{if(a=i.current.alternate,g&&!aT(a)){m=Od(i,l,!1),g=!1;continue}if(m===2){if(g=l,i.errorRecoveryDisabledLanes&g)var b=0;else b=i.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){l=b;e:{var E=i;m=xs;var O=E.current.memoizedState.isDehydrated;if(O&&(to(E,b).flags|=256),b=Od(E,b,!1),b!==2){if(wd&&!O){E.errorRecoveryDisabledLanes|=g,rl|=g,m=4;break e}g=$t,$t=m,g!==null&&($t===null?$t=g:$t.push.apply($t,g))}m=b}if(g=!1,m!==2)continue}}if(m===1){to(i,0),fr(i,l,0,!0);break}e:{switch(u=i,g=m,g){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:fr(u,l,hn,!sr);break e;case 2:$t=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(m=yc+300-rn(),10<m)){if(fr(u,l,hn,!sr),Ra(u,0,!0)!==0)break e;Hi=l,u.timeoutHandle=Ab(Wy.bind(null,u,a,$t,xc,Ad,l,hn,rl,Jl,sr,g,"Throttled",-0,0),m);break e}Wy(u,a,$t,xc,Ad,l,hn,rl,Jl,sr,g,null,-0,0)}}break}while(!0);ti(i)}function Wy(i,l,a,u,m,g,b,E,O,I,W,$,q,K){if(i.timeoutHandle=-1,$=l.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ci},Py(l,g,$);var de=(g&62914560)===g?yc-rn():(g&4194048)===g?qy-rn():0;if(de=FT($,de),de!==null){Hi=g,i.cancelPendingCommit=de(nb.bind(null,i,l,g,a,u,m,b,E,O,W,$,null,q,K)),fr(i,g,b,!I);return}}nb(i,l,g,a,u,m,b,E,O)}function aT(i){for(var l=i;;){var a=l.tag;if((a===0||a===11||a===15)&&l.flags&16384&&(a=l.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var m=a[u],g=m.getSnapshot;m=m.value;try{if(!sn(g(),m))return!1}catch{return!1}}if(a=l.child,l.subtreeFlags&16384&&a!==null)a.return=l,l=a;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function fr(i,l,a,u){l&=~Cd,l&=~rl,i.suspendedLanes|=l,i.pingedLanes&=~l,u&&(i.warmLanes|=l),u=i.expirationTimes;for(var m=l;0<m;){var g=31-on(m),b=1<<g;u[g]=-1,m&=~b}a!==0&&r0(i,a,l)}function Sc(){return(Ge&6)===0?(ws(0),!1):!0}function kd(){if(Re!==null){if(Fe===0)var i=Re.return;else i=Re,Ti=Xr=null,qh(i),Yl=null,rs=0,i=Re;for(;i!==null;)Ey(i.alternate,i),i=i.return;Re=null}}function to(i,l){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,kT(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),Hi=0,kd(),Ze=i,Re=a=Ei(i.current,null),_e=l,Fe=0,fn=null,sr=!1,$l=Vo(i,l),wd=!1,Jl=hn=Cd=rl=ar=st=0,$t=xs=null,Ad=!1,(l&8)!==0&&(l|=l&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=l;0<u;){var m=31-on(u),g=1<<m;l|=i[m],u&=~g}return ji=l,Ia(),a}function Xy(i,l){Te=null,R.H=hs,l===ql||l===Qa?(l=fv(),Fe=3):l===Nh?(l=fv(),Fe=4):Fe=l===od?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,fn=l,Re===null&&(st=1,uc(i,Cn(l,i.current)))}function Qy(){var i=cn.current;return i===null?!0:(_e&4194048)===_e?Tn===null:(_e&62914560)===_e||(_e&536870912)!==0?i===Tn:!1}function Zy(){var i=R.H;return R.H=hs,i===null?hs:i}function $y(){var i=R.A;return R.A=oT,i}function wc(){st=4,sr||(_e&4194048)!==_e&&cn.current!==null||($l=!0),(ar&134217727)===0&&(rl&134217727)===0||Ze===null||fr(Ze,_e,hn,!1)}function Od(i,l,a){var u=Ge;Ge|=2;var m=Zy(),g=$y();(Ze!==i||_e!==l)&&(xc=null,to(i,l)),l=!1;var b=st;e:do try{if(Fe!==0&&Re!==null){var E=Re,O=fn;switch(Fe){case 8:kd(),b=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(l=!0);var I=Fe;if(Fe=0,fn=null,no(i,E,O,I),a&&$l){b=0;break e}break;default:I=Fe,Fe=0,fn=null,no(i,E,O,I)}}cT(),b=st;break}catch(W){Xy(i,W)}while(!0);return l&&i.shellSuspendCounter++,Ti=Xr=null,Ge=u,R.H=m,R.A=g,Re===null&&(Ze=null,_e=0,Ia()),b}function cT(){for(;Re!==null;)Jy(Re)}function uT(i,l){var a=Ge;Ge|=2;var u=Zy(),m=$y();Ze!==i||_e!==l?(xc=null,bc=rn()+500,to(i,l)):$l=Vo(i,l);e:do try{if(Fe!==0&&Re!==null){l=Re;var g=fn;t:switch(Fe){case 1:Fe=0,fn=null,no(i,l,g,1);break;case 2:case 9:if(cv(g)){Fe=0,fn=null,eb(l);break}l=function(){Fe!==2&&Fe!==9||Ze!==i||(Fe=7),ti(i)},g.then(l,l);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:cv(g)?(Fe=0,fn=null,eb(l)):(Fe=0,fn=null,no(i,l,g,7));break;case 5:var b=null;switch(Re.tag){case 26:b=Re.memoizedState;case 5:case 27:var E=Re;if(b?Ub(b):E.stateNode.complete){Fe=0,fn=null;var O=E.sibling;if(O!==null)Re=O;else{var I=E.return;I!==null?(Re=I,Cc(I)):Re=null}break t}}Fe=0,fn=null,no(i,l,g,5);break;case 6:Fe=0,fn=null,no(i,l,g,6);break;case 8:kd(),st=6;break e;default:throw Error(r(462))}}fT();break}catch(W){Xy(i,W)}while(!0);return Ti=Xr=null,R.H=u,R.A=m,Ge=a,Re!==null?0:(Ze=null,_e=0,Ia(),st)}function fT(){for(;Re!==null&&!BE();)Jy(Re)}function Jy(i){var l=Cy(i.alternate,i,ji);i.memoizedProps=i.pendingProps,l===null?Cc(i):Re=l}function eb(i){var l=i,a=l.alternate;switch(l.tag){case 15:case 0:l=vy(a,l,l.pendingProps,l.type,void 0,_e);break;case 11:l=vy(a,l,l.pendingProps,l.type.render,l.ref,_e);break;case 5:qh(l);default:Ey(a,l),l=Re=$0(l,ji),l=Cy(a,l,ji)}i.memoizedProps=i.pendingProps,l===null?Cc(i):Re=l}function no(i,l,a,u){Ti=Xr=null,qh(l),Yl=null,rs=0;var m=l.return;try{if(JM(i,m,l,a,_e)){st=1,uc(i,Cn(a,i.current)),Re=null;return}}catch(g){if(m!==null)throw Re=m,g;st=1,uc(i,Cn(a,i.current)),Re=null;return}l.flags&32768?(ze||u===1?i=!0:$l||(_e&536870912)!==0?i=!1:(sr=i=!0,(u===2||u===9||u===3||u===6)&&(u=cn.current,u!==null&&u.tag===13&&(u.flags|=16384))),tb(l,i)):Cc(l)}function Cc(i){var l=i;do{if((l.flags&32768)!==0){tb(l,sr);return}i=l.return;var a=nT(l.alternate,l,ji);if(a!==null){Re=a;return}if(l=l.sibling,l!==null){Re=l;return}Re=l=i}while(l!==null);st===0&&(st=5)}function tb(i,l){do{var a=iT(i.alternate,i);if(a!==null){a.flags&=32767,Re=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!l&&(i=i.sibling,i!==null)){Re=i;return}Re=i=a}while(i!==null);st=6,Re=null}function nb(i,l,a,u,m,g,b,E,O){i.cancelPendingCommit=null;do Ac();while(bt!==0);if((Ge&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(g=l.lanes|l.childLanes,g|=vh,qE(i,a,g,b,E,O),i===Ze&&(Re=Ze=null,_e=0),eo=l,ur=i,Hi=a,Ed=g,Md=m,Yy=u,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,pT(Ma,function(){return sb(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||u){u=R.T,R.T=null,m=z.p,z.p=2,b=Ge,Ge|=4;try{rT(i,l,a)}finally{Ge=b,z.p=m,R.T=u}}bt=1,ib(),rb(),lb()}}function ib(){if(bt===1){bt=0;var i=ur,l=eo,a=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||a){a=R.T,R.T=null;var u=z.p;z.p=2;var m=Ge;Ge|=4;try{jy(l,i);var g=Vd,b=G0(i.containerInfo),E=g.focusedElem,O=g.selectionRange;if(b!==E&&E&&E.ownerDocument&&I0(E.ownerDocument.documentElement,E)){if(O!==null&&hh(E)){var I=O.start,W=O.end;if(W===void 0&&(W=I),"selectionStart"in E)E.selectionStart=I,E.selectionEnd=Math.min(W,E.value.length);else{var $=E.ownerDocument||document,q=$&&$.defaultView||window;if(q.getSelection){var K=q.getSelection(),de=E.textContent.length,Se=Math.min(O.start,de),Qe=O.end===void 0?Se:Math.min(O.end,de);!K.extend&&Se>Qe&&(b=Qe,Qe=Se,Se=b);var U=V0(E,Se),B=V0(E,Qe);if(U&&B&&(K.rangeCount!==1||K.anchorNode!==U.node||K.anchorOffset!==U.offset||K.focusNode!==B.node||K.focusOffset!==B.offset)){var V=$.createRange();V.setStart(U.node,U.offset),K.removeAllRanges(),Se>Qe?(K.addRange(V),K.extend(B.node,B.offset)):(V.setEnd(B.node,B.offset),K.addRange(V))}}}}for($=[],K=E;K=K.parentNode;)K.nodeType===1&&$.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<$.length;E++){var Q=$[E];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Lc=!!Pd,Vd=Pd=null}finally{Ge=m,z.p=u,R.T=a}}i.current=l,bt=2}}function rb(){if(bt===2){bt=0;var i=ur,l=eo,a=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||a){a=R.T,R.T=null;var u=z.p;z.p=2;var m=Ge;Ge|=4;try{Ny(i,l.alternate,l)}finally{Ge=m,z.p=u,R.T=a}}bt=3}}function lb(){if(bt===4||bt===3){bt=0,zE();var i=ur,l=eo,a=Hi,u=Yy;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?bt=5:(bt=0,eo=ur=null,ob(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(cr=null),Kf(a),l=l.stateNode,ln&&typeof ln.onCommitFiberRoot=="function")try{ln.onCommitFiberRoot(Po,l,void 0,(l.current.flags&128)===128)}catch{}if(u!==null){l=R.T,m=z.p,z.p=2,R.T=null;try{for(var g=i.onRecoverableError,b=0;b<u.length;b++){var E=u[b];g(E.value,{componentStack:E.stack})}}finally{R.T=l,z.p=m}}(Hi&3)!==0&&Ac(),ti(i),m=i.pendingLanes,(a&261930)!==0&&(m&42)!==0?i===Td?Ss++:(Ss=0,Td=i):Ss=0,ws(0)}}function ob(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,ns(l)))}function Ac(){return ib(),rb(),lb(),sb()}function sb(){if(bt!==5)return!1;var i=ur,l=Ed;Ed=0;var a=Kf(Hi),u=R.T,m=z.p;try{z.p=32>a?32:a,R.T=null,a=Md,Md=null;var g=ur,b=Hi;if(bt=0,eo=ur=null,Hi=0,(Ge&6)!==0)throw Error(r(331));var E=Ge;if(Ge|=4,Iy(g.current),Uy(g,g.current,b,a),Ge=E,ws(0,!1),ln&&typeof ln.onPostCommitFiberRoot=="function")try{ln.onPostCommitFiberRoot(Po,g)}catch{}return!0}finally{z.p=m,R.T=u,ob(i,l)}}function ab(i,l,a){l=Cn(a,l),l=ld(i.stateNode,l,2),i=ir(i,l,2),i!==null&&(Io(i,2),ti(i))}function Ke(i,l,a){if(i.tag===3)ab(i,i,a);else for(;l!==null;){if(l.tag===3){ab(l,i,a);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(cr===null||!cr.has(u))){i=Cn(a,i),a=cy(2),u=ir(l,a,2),u!==null&&(uy(a,u,l,i),Io(u,2),ti(u));break}}l=l.return}}function Rd(i,l,a){var u=i.pingCache;if(u===null){u=i.pingCache=new sT;var m=new Set;u.set(l,m)}else m=u.get(l),m===void 0&&(m=new Set,u.set(l,m));m.has(a)||(wd=!0,m.add(a),i=hT.bind(null,i,l,a),l.then(i,i))}function hT(i,l,a){var u=i.pingCache;u!==null&&u.delete(l),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,Ze===i&&(_e&a)===a&&(st===4||st===3&&(_e&62914560)===_e&&300>rn()-yc?(Ge&2)===0&&to(i,0):Cd|=a,Jl===_e&&(Jl=0)),ti(i)}function cb(i,l){l===0&&(l=i0()),i=Fr(i,l),i!==null&&(Io(i,l),ti(i))}function dT(i){var l=i.memoizedState,a=0;l!==null&&(a=l.retryLane),cb(i,a)}function mT(i,l){var a=0;switch(i.tag){case 31:case 13:var u=i.stateNode,m=i.memoizedState;m!==null&&(a=m.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(l),cb(i,a)}function pT(i,l){return Gf(i,l)}var Ec=null,io=null,Dd=!1,Mc=!1,Nd=!1,hr=0;function ti(i){i!==io&&i.next===null&&(io===null?Ec=io=i:io=io.next=i),Mc=!0,Dd||(Dd=!0,vT())}function ws(i,l){if(!Nd&&Mc){Nd=!0;do for(var a=!1,u=Ec;u!==null;){if(i!==0){var m=u.pendingLanes;if(m===0)var g=0;else{var b=u.suspendedLanes,E=u.pingedLanes;g=(1<<31-on(42|i)+1)-1,g&=m&~(b&~E),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,db(u,g))}else g=_e,g=Ra(u,u===Ze?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||Vo(u,g)||(a=!0,db(u,g));u=u.next}while(a);Nd=!1}}function gT(){ub()}function ub(){Mc=Dd=!1;var i=0;hr!==0&&TT()&&(i=hr);for(var l=rn(),a=null,u=Ec;u!==null;){var m=u.next,g=fb(u,l);g===0?(u.next=null,a===null?Ec=m:a.next=m,m===null&&(io=a)):(a=u,(i!==0||(g&3)!==0)&&(Mc=!0)),u=m}bt!==0&&bt!==5||ws(i),hr!==0&&(hr=0)}function fb(i,l){for(var a=i.suspendedLanes,u=i.pingedLanes,m=i.expirationTimes,g=i.pendingLanes&-62914561;0<g;){var b=31-on(g),E=1<<b,O=m[b];O===-1?((E&a)===0||(E&u)!==0)&&(m[b]=GE(E,l)):O<=l&&(i.expiredLanes|=E),g&=~E}if(l=Ze,a=_e,a=Ra(i,i===l?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,a===0||i===l&&(Fe===2||Fe===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&qf(u),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||Vo(i,a)){if(l=a&-a,l===i.callbackPriority)return l;switch(u!==null&&qf(u),Kf(a)){case 2:case 8:a=t0;break;case 32:a=Ma;break;case 268435456:a=n0;break;default:a=Ma}return u=hb.bind(null,i),a=Gf(a,u),i.callbackPriority=l,i.callbackNode=a,l}return u!==null&&u!==null&&qf(u),i.callbackPriority=2,i.callbackNode=null,2}function hb(i,l){if(bt!==0&&bt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(Ac()&&i.callbackNode!==a)return null;var u=_e;return u=Ra(i,i===Ze?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(Ky(i,u,l),fb(i,rn()),i.callbackNode!=null&&i.callbackNode===a?hb.bind(null,i):null)}function db(i,l){if(Ac())return null;Ky(i,l,!0)}function vT(){OT(function(){(Ge&6)!==0?Gf(e0,gT):ub()})}function _d(){if(hr===0){var i=Il;i===0&&(i=Ta,Ta<<=1,(Ta&261888)===0&&(Ta=256)),hr=i}return hr}function mb(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ba(""+i)}function pb(i,l){var a=l.ownerDocument.createElement("input");return a.name=l.name,a.value=l.value,i.id&&a.setAttribute("form",i.id),l.parentNode.insertBefore(a,l),i=new FormData(i),a.parentNode.removeChild(a),i}function yT(i,l,a,u,m){if(l==="submit"&&a&&a.stateNode===m){var g=mb((m[Kt]||null).action),b=u.submitter;b&&(l=(l=b[Kt]||null)?mb(l.formAction):b.getAttribute("formAction"),l!==null&&(g=l,b=null));var E=new Ha("action","action",null,u,m);i.push({event:E,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(hr!==0){var O=b?pb(m,b):new FormData(m);Jh(a,{pending:!0,data:O,method:m.method,action:g},null,O)}}else typeof g=="function"&&(E.preventDefault(),O=b?pb(m,b):new FormData(m),Jh(a,{pending:!0,data:O,method:m.method,action:g},g,O))},currentTarget:m}]})}}for(var Bd=0;Bd<gh.length;Bd++){var zd=gh[Bd],bT=zd.toLowerCase(),xT=zd[0].toUpperCase()+zd.slice(1);Pn(bT,"on"+xT)}Pn(F0,"onAnimationEnd"),Pn(K0,"onAnimationIteration"),Pn(W0,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(LM,"onTransitionRun"),Pn(jM,"onTransitionStart"),Pn(HM,"onTransitionCancel"),Pn(X0,"onTransitionEnd"),kl("onMouseEnter",["mouseout","mouseover"]),kl("onMouseLeave",["mouseout","mouseover"]),kl("onPointerEnter",["pointerout","pointerover"]),kl("onPointerLeave",["pointerout","pointerover"]),Ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ir("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cs="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(" "),ST=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cs));function gb(i,l){l=(l&4)!==0;for(var a=0;a<i.length;a++){var u=i[a],m=u.event;u=u.listeners;e:{var g=void 0;if(l)for(var b=u.length-1;0<=b;b--){var E=u[b],O=E.instance,I=E.currentTarget;if(E=E.listener,O!==g&&m.isPropagationStopped())break e;g=E,m.currentTarget=I;try{g(m)}catch(W){Va(W)}m.currentTarget=null,g=O}else for(b=0;b<u.length;b++){if(E=u[b],O=E.instance,I=E.currentTarget,E=E.listener,O!==g&&m.isPropagationStopped())break e;g=E,m.currentTarget=I;try{g(m)}catch(W){Va(W)}m.currentTarget=null,g=O}}}}function De(i,l){var a=l[Wf];a===void 0&&(a=l[Wf]=new Set);var u=i+"__bubble";a.has(u)||(vb(l,i,2,!1),a.add(u))}function Ld(i,l,a){var u=0;l&&(u|=4),vb(a,i,u,l)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function jd(i){if(!i[Tc]){i[Tc]=!0,u0.forEach(function(a){a!=="selectionchange"&&(ST.has(a)||Ld(a,!1,i),Ld(a,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Tc]||(l[Tc]=!0,Ld("selectionchange",!1,l))}}function vb(i,l,a,u){switch(Fb(l)){case 2:var m=XT;break;case 8:m=QT;break;default:m=$d}a=m.bind(null,l,a,i),m=void 0,!ih||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(m=!0),u?m!==void 0?i.addEventListener(l,a,{capture:!0,passive:m}):i.addEventListener(l,a,!0):m!==void 0?i.addEventListener(l,a,{passive:m}):i.addEventListener(l,a,!1)}function Hd(i,l,a,u,m){var g=u;if((l&1)===0&&(l&2)===0&&u!==null)e:for(;;){if(u===null)return;var b=u.tag;if(b===3||b===4){var E=u.stateNode.containerInfo;if(E===m)break;if(b===4)for(b=u.return;b!==null;){var O=b.tag;if((O===3||O===4)&&b.stateNode.containerInfo===m)return;b=b.return}for(;E!==null;){if(b=El(E),b===null)return;if(O=b.tag,O===5||O===6||O===26||O===27){u=g=b;continue e}E=E.parentNode}}u=u.return}w0(function(){var I=g,W=th(a),$=[];e:{var q=Q0.get(i);if(q!==void 0){var K=Ha,de=i;switch(i){case"keypress":if(La(a)===0)break e;case"keydown":case"keyup":K=mM;break;case"focusin":de="focus",K=sh;break;case"focusout":de="blur",K=sh;break;case"beforeblur":case"afterblur":K=sh;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=E0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=nM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=vM;break;case F0:case K0:case W0:K=lM;break;case X0:K=bM;break;case"scroll":case"scrollend":K=eM;break;case"wheel":K=SM;break;case"copy":case"cut":case"paste":K=sM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=T0;break;case"toggle":case"beforetoggle":K=CM}var Se=(l&4)!==0,Qe=!Se&&(i==="scroll"||i==="scrollend"),U=Se?q!==null?q+"Capture":null:q;Se=[];for(var B=I,V;B!==null;){var Q=B;if(V=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||V===null||U===null||(Q=Yo(B,U),Q!=null&&Se.push(As(B,Q,V))),Qe)break;B=B.return}0<Se.length&&(q=new K(q,de,null,a,W),$.push({event:q,listeners:Se}))}}if((l&7)===0){e:{if(q=i==="mouseover"||i==="pointerover",K=i==="mouseout"||i==="pointerout",q&&a!==eh&&(de=a.relatedTarget||a.fromElement)&&(El(de)||de[Al]))break e;if((K||q)&&(q=W.window===W?W:(q=W.ownerDocument)?q.defaultView||q.parentWindow:window,K?(de=a.relatedTarget||a.toElement,K=I,de=de?El(de):null,de!==null&&(Qe=s(de),Se=de.tag,de!==Qe||Se!==5&&Se!==27&&Se!==6)&&(de=null)):(K=null,de=I),K!==de)){if(Se=E0,Q="onMouseLeave",U="onMouseEnter",B="mouse",(i==="pointerout"||i==="pointerover")&&(Se=T0,Q="onPointerLeave",U="onPointerEnter",B="pointer"),Qe=K==null?q:qo(K),V=de==null?q:qo(de),q=new Se(Q,B+"leave",K,a,W),q.target=Qe,q.relatedTarget=V,Q=null,El(W)===I&&(Se=new Se(U,B+"enter",de,a,W),Se.target=V,Se.relatedTarget=Qe,Q=Se),Qe=Q,K&&de)t:{for(Se=wT,U=K,B=de,V=0,Q=U;Q;Q=Se(Q))V++;Q=0;for(var xe=B;xe;xe=Se(xe))Q++;for(;0<V-Q;)U=Se(U),V--;for(;0<Q-V;)B=Se(B),Q--;for(;V--;){if(U===B||B!==null&&U===B.alternate){Se=U;break t}U=Se(U),B=Se(B)}Se=null}else Se=null;K!==null&&yb($,q,K,Se,!1),de!==null&&Qe!==null&&yb($,Qe,de,Se,!0)}}e:{if(q=I?qo(I):window,K=q.nodeName&&q.nodeName.toLowerCase(),K==="select"||K==="input"&&q.type==="file")var Pe=z0;else if(_0(q))if(L0)Pe=_M;else{Pe=DM;var ve=RM}else K=q.nodeName,!K||K.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?I&&Jf(I.elementType)&&(Pe=z0):Pe=NM;if(Pe&&(Pe=Pe(i,I))){B0($,Pe,a,W);break e}ve&&ve(i,q,I),i==="focusout"&&I&&q.type==="number"&&I.memoizedProps.value!=null&&$f(q,"number",q.value)}switch(ve=I?qo(I):window,i){case"focusin":(_0(ve)||ve.contentEditable==="true")&&(Bl=ve,dh=I,Jo=null);break;case"focusout":Jo=dh=Bl=null;break;case"mousedown":mh=!0;break;case"contextmenu":case"mouseup":case"dragend":mh=!1,q0($,a,W);break;case"selectionchange":if(zM)break;case"keydown":case"keyup":q0($,a,W)}var ke;if(ch)e:{switch(i){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else _l?D0(i,a)&&(Be="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(Be="onCompositionStart");Be&&(k0&&a.locale!=="ko"&&(_l||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&_l&&(ke=C0()):(Qi=W,rh="value"in Qi?Qi.value:Qi.textContent,_l=!0)),ve=kc(I,Be),0<ve.length&&(Be=new M0(Be,i,null,a,W),$.push({event:Be,listeners:ve}),ke?Be.data=ke:(ke=N0(a),ke!==null&&(Be.data=ke)))),(ke=EM?MM(i,a):TM(i,a))&&(Be=kc(I,"onBeforeInput"),0<Be.length&&(ve=new M0("onBeforeInput","beforeinput",null,a,W),$.push({event:ve,listeners:Be}),ve.data=ke)),yT($,i,I,a,W)}gb($,l)})}function As(i,l,a){return{instance:i,listener:l,currentTarget:a}}function kc(i,l){for(var a=l+"Capture",u=[];i!==null;){var m=i,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=Yo(i,a),m!=null&&u.unshift(As(i,m,g)),m=Yo(i,l),m!=null&&u.push(As(i,m,g))),i.tag===3)return u;i=i.return}return[]}function wT(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function yb(i,l,a,u,m){for(var g=l._reactName,b=[];a!==null&&a!==u;){var E=a,O=E.alternate,I=E.stateNode;if(E=E.tag,O!==null&&O===u)break;E!==5&&E!==26&&E!==27||I===null||(O=I,m?(I=Yo(a,g),I!=null&&b.unshift(As(a,I,O))):m||(I=Yo(a,g),I!=null&&b.push(As(a,I,O)))),a=a.return}b.length!==0&&i.push({event:l,listeners:b})}var CT=/\r\n?/g,AT=/\u0000|\uFFFD/g;function bb(i){return(typeof i=="string"?i:""+i).replace(CT,`
9
+ `).replace(AT,"")}function xb(i,l){return l=bb(l),bb(i)===l}function Xe(i,l,a,u,m,g){switch(a){case"children":typeof u=="string"?l==="body"||l==="textarea"&&u===""||Rl(i,u):(typeof u=="number"||typeof u=="bigint")&&l!=="body"&&Rl(i,""+u);break;case"className":Na(i,"class",u);break;case"tabIndex":Na(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Na(i,a,u);break;case"style":x0(i,u,g);break;case"data":if(l!=="object"){Na(i,"data",u);break}case"src":case"href":if(u===""&&(l!=="a"||a!=="href")){i.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Ba(""+u),i.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(a,"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 g=="function"&&(a==="formAction"?(l!=="input"&&Xe(i,l,"name",m.name,m,null),Xe(i,l,"formEncType",m.formEncType,m,null),Xe(i,l,"formMethod",m.formMethod,m,null),Xe(i,l,"formTarget",m.formTarget,m,null)):(Xe(i,l,"encType",m.encType,m,null),Xe(i,l,"method",m.method,m,null),Xe(i,l,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Ba(""+u),i.setAttribute(a,u);break;case"onClick":u!=null&&(i.onclick=Ci);break;case"onScroll":u!=null&&De("scroll",i);break;case"onScrollEnd":u!=null&&De("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(a=u.__html,a!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}a=Ba(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,""+u):i.removeAttribute(a);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":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":u===!0?i.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,u):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(a,u):i.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(a):i.setAttribute(a,u);break;case"popover":De("beforetoggle",i),De("toggle",i),Da(i,"popover",u);break;case"xlinkActuate":wi(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":wi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":wi(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":wi(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":wi(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":wi(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":wi(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":wi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":wi(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Da(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=$E.get(a)||a,Da(i,a,u))}}function Ud(i,l,a,u,m,g){switch(a){case"style":x0(i,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(a=u.__html,a!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"children":typeof u=="string"?Rl(i,u):(typeof u=="number"||typeof u=="bigint")&&Rl(i,""+u);break;case"onScroll":u!=null&&De("scroll",i);break;case"onScrollEnd":u!=null&&De("scrollend",i);break;case"onClick":u!=null&&(i.onclick=Ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!f0.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),l=a.slice(2,m?a.length-7:void 0),g=i[Kt]||null,g=g!=null?g[a]:null,typeof g=="function"&&i.removeEventListener(l,g,m),typeof u=="function")){typeof g!="function"&&g!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(l,u,m);break e}a in i?i[a]=u:u===!0?i.setAttribute(a,""):Da(i,a,u)}}}function Dt(i,l,a){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",i),De("load",i);var u=!1,m=!1,g;for(g in a)if(a.hasOwnProperty(g)){var b=a[g];if(b!=null)switch(g){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Xe(i,l,g,b,a,null)}}m&&Xe(i,l,"srcSet",a.srcSet,a,null),u&&Xe(i,l,"src",a.src,a,null);return;case"input":De("invalid",i);var E=g=b=m=null,O=null,I=null;for(u in a)if(a.hasOwnProperty(u)){var W=a[u];if(W!=null)switch(u){case"name":m=W;break;case"type":b=W;break;case"checked":O=W;break;case"defaultChecked":I=W;break;case"value":g=W;break;case"defaultValue":E=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,l));break;default:Xe(i,l,u,W,a,null)}}g0(i,g,E,O,I,b,m,!1);return;case"select":De("invalid",i),u=b=g=null;for(m in a)if(a.hasOwnProperty(m)&&(E=a[m],E!=null))switch(m){case"value":g=E;break;case"defaultValue":b=E;break;case"multiple":u=E;default:Xe(i,l,m,E,a,null)}l=g,a=b,i.multiple=!!u,l!=null?Ol(i,!!u,l,!1):a!=null&&Ol(i,!!u,a,!0);return;case"textarea":De("invalid",i),g=m=u=null;for(b in a)if(a.hasOwnProperty(b)&&(E=a[b],E!=null))switch(b){case"value":u=E;break;case"defaultValue":m=E;break;case"children":g=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:Xe(i,l,b,E,a,null)}y0(i,u,m,g);return;case"option":for(O in a)a.hasOwnProperty(O)&&(u=a[O],u!=null)&&(O==="selected"?i.selected=u&&typeof u!="function"&&typeof u!="symbol":Xe(i,l,O,u,a,null));return;case"dialog":De("beforetoggle",i),De("toggle",i),De("cancel",i),De("close",i);break;case"iframe":case"object":De("load",i);break;case"video":case"audio":for(u=0;u<Cs.length;u++)De(Cs[u],i);break;case"image":De("error",i),De("load",i);break;case"details":De("toggle",i);break;case"embed":case"source":case"link":De("error",i),De("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(I in a)if(a.hasOwnProperty(I)&&(u=a[I],u!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Xe(i,l,I,u,a,null)}return;default:if(Jf(l)){for(W in a)a.hasOwnProperty(W)&&(u=a[W],u!==void 0&&Ud(i,l,W,u,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(u=a[E],u!=null&&Xe(i,l,E,u,a,null))}function ET(i,l,a,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,b=null,E=null,O=null,I=null,W=null;for(K in a){var $=a[K];if(a.hasOwnProperty(K)&&$!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":O=$;default:u.hasOwnProperty(K)||Xe(i,l,K,null,u,$)}}for(var q in u){var K=u[q];if($=a[q],u.hasOwnProperty(q)&&(K!=null||$!=null))switch(q){case"type":g=K;break;case"name":m=K;break;case"checked":I=K;break;case"defaultChecked":W=K;break;case"value":b=K;break;case"defaultValue":E=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,l));break;default:K!==$&&Xe(i,l,q,K,u,$)}}Zf(i,b,E,O,I,W,g,m);return;case"select":K=b=E=q=null;for(g in a)if(O=a[g],a.hasOwnProperty(g)&&O!=null)switch(g){case"value":break;case"multiple":K=O;default:u.hasOwnProperty(g)||Xe(i,l,g,null,u,O)}for(m in u)if(g=u[m],O=a[m],u.hasOwnProperty(m)&&(g!=null||O!=null))switch(m){case"value":q=g;break;case"defaultValue":E=g;break;case"multiple":b=g;default:g!==O&&Xe(i,l,m,g,u,O)}l=E,a=b,u=K,q!=null?Ol(i,!!a,q,!1):!!u!=!!a&&(l!=null?Ol(i,!!a,l,!0):Ol(i,!!a,a?[]:"",!1));return;case"textarea":K=q=null;for(E in a)if(m=a[E],a.hasOwnProperty(E)&&m!=null&&!u.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Xe(i,l,E,null,u,m)}for(b in u)if(m=u[b],g=a[b],u.hasOwnProperty(b)&&(m!=null||g!=null))switch(b){case"value":q=m;break;case"defaultValue":K=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==g&&Xe(i,l,b,m,u,g)}v0(i,q,K);return;case"option":for(var de in a)q=a[de],a.hasOwnProperty(de)&&q!=null&&!u.hasOwnProperty(de)&&(de==="selected"?i.selected=!1:Xe(i,l,de,null,u,q));for(O in u)q=u[O],K=a[O],u.hasOwnProperty(O)&&q!==K&&(q!=null||K!=null)&&(O==="selected"?i.selected=q&&typeof q!="function"&&typeof q!="symbol":Xe(i,l,O,q,u,K));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 Se in a)q=a[Se],a.hasOwnProperty(Se)&&q!=null&&!u.hasOwnProperty(Se)&&Xe(i,l,Se,null,u,q);for(I in u)if(q=u[I],K=a[I],u.hasOwnProperty(I)&&q!==K&&(q!=null||K!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(137,l));break;default:Xe(i,l,I,q,u,K)}return;default:if(Jf(l)){for(var Qe in a)q=a[Qe],a.hasOwnProperty(Qe)&&q!==void 0&&!u.hasOwnProperty(Qe)&&Ud(i,l,Qe,void 0,u,q);for(W in u)q=u[W],K=a[W],!u.hasOwnProperty(W)||q===K||q===void 0&&K===void 0||Ud(i,l,W,q,u,K);return}}for(var U in a)q=a[U],a.hasOwnProperty(U)&&q!=null&&!u.hasOwnProperty(U)&&Xe(i,l,U,null,u,q);for($ in u)q=u[$],K=a[$],!u.hasOwnProperty($)||q===K||q==null&&K==null||Xe(i,l,$,q,u,K)}function Sb(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function MT(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var m=a[u],g=m.transferSize,b=m.initiatorType,E=m.duration;if(g&&E&&Sb(b)){for(b=0,E=m.responseEnd,u+=1;u<a.length;u++){var O=a[u],I=O.startTime;if(I>E)break;var W=O.transferSize,$=O.initiatorType;W&&Sb($)&&(O=O.responseEnd,b+=W*(O<E?1:(E-I)/(O-I)))}if(--u,l+=8*(g+b)/(m.duration/1e3),i++,10<i)break}}if(0<i)return l/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Pd=null,Vd=null;function Oc(i){return i.nodeType===9?i:i.ownerDocument}function wb(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cb(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function Id(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Gd=null;function TT(){var i=window.event;return i&&i.type==="popstate"?i===Gd?!1:(Gd=i,!0):(Gd=null,!1)}var Ab=typeof setTimeout=="function"?setTimeout:void 0,kT=typeof clearTimeout=="function"?clearTimeout:void 0,Eb=typeof Promise=="function"?Promise:void 0,OT=typeof queueMicrotask=="function"?queueMicrotask:typeof Eb<"u"?function(i){return Eb.resolve(null).then(i).catch(RT)}:Ab;function RT(i){setTimeout(function(){throw i})}function dr(i){return i==="head"}function Mb(i,l){var a=l,u=0;do{var m=a.nextSibling;if(i.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"||a==="/&"){if(u===0){i.removeChild(m),so(l);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")Es(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,Es(a);for(var g=a.firstChild;g;){var b=g.nextSibling,E=g.nodeName;g[Go]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=b}}else a==="body"&&Es(i.ownerDocument.body);a=m}while(a);so(l)}function Tb(i,l){var a=i;i=0;do{var u=a.nextSibling;if(a.nodeType===1?l?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(l?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(i===0)break;i--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||i++;a=u}while(a)}function qd(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var a=l;switch(l=l.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":qd(a),Xf(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function DT(i,l,a,u){for(;i.nodeType===1;){var m=a;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[Go])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(g=i.getAttribute("rel"),g==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(g!==m.rel||i.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||i.getAttribute("title")!==(m.title==null?null:m.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(g=i.getAttribute("src"),(g!==(m.src==null?null:m.src)||i.getAttribute("type")!==(m.type==null?null:m.type)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&g&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var g=m.name==null?null:""+m.name;if(m.type==="hidden"&&i.getAttribute("name")===g)return i}else return i;if(i=kn(i.nextSibling),i===null)break}return null}function NT(i,l,a){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=kn(i.nextSibling),i===null))return null;return i}function kb(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=kn(i.nextSibling),i===null))return null;return i}function Yd(i){return i.data==="$?"||i.data==="$~"}function Fd(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function _T(i,l){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||a.readyState!=="loading")l();else{var u=function(){l(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function kn(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return i}var Kd=null;function Ob(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(l===0)return kn(i.nextSibling);l--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||l++}i=i.nextSibling}return null}function Rb(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(l===0)return i;l--}else a!=="/$"&&a!=="/&"||l++}i=i.previousSibling}return null}function Db(i,l,a){switch(l=Oc(a),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Es(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Xf(i)}var On=new Map,Nb=new Set;function Rc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ui=z.d;z.d={f:BT,r:zT,D:LT,C:jT,L:HT,m:UT,X:VT,S:PT,M:IT};function BT(){var i=Ui.f(),l=Sc();return i||l}function zT(i){var l=Ml(i);l!==null&&l.tag===5&&l.type==="form"?Xv(l):Ui.r(i)}var ro=typeof document>"u"?null:document;function _b(i,l,a){var u=ro;if(u&&typeof l=="string"&&l){var m=Sn(l);m='link[rel="'+i+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),Nb.has(m)||(Nb.add(m),i={rel:i,crossOrigin:a,href:l},u.querySelector(m)===null&&(l=u.createElement("link"),Dt(l,"link",i),Ct(l),u.head.appendChild(l)))}}function LT(i){Ui.D(i),_b("dns-prefetch",i,null)}function jT(i,l){Ui.C(i,l),_b("preconnect",i,l)}function HT(i,l,a){Ui.L(i,l,a);var u=ro;if(u&&i&&l){var m='link[rel="preload"][as="'+Sn(l)+'"]';l==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+Sn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+Sn(a.imageSizes)+'"]')):m+='[href="'+Sn(i)+'"]';var g=m;switch(l){case"style":g=lo(i);break;case"script":g=oo(i)}On.has(g)||(i=v({rel:"preload",href:l==="image"&&a&&a.imageSrcSet?void 0:i,as:l},a),On.set(g,i),u.querySelector(m)!==null||l==="style"&&u.querySelector(Ms(g))||l==="script"&&u.querySelector(Ts(g))||(l=u.createElement("link"),Dt(l,"link",i),Ct(l),u.head.appendChild(l)))}}function UT(i,l){Ui.m(i,l);var a=ro;if(a&&i){var u=l&&typeof l.as=="string"?l.as:"script",m='link[rel="modulepreload"][as="'+Sn(u)+'"][href="'+Sn(i)+'"]',g=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=oo(i)}if(!On.has(g)&&(i=v({rel:"modulepreload",href:i},l),On.set(g,i),a.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ts(g)))return}u=a.createElement("link"),Dt(u,"link",i),Ct(u),a.head.appendChild(u)}}}function PT(i,l,a){Ui.S(i,l,a);var u=ro;if(u&&i){var m=Tl(u).hoistableStyles,g=lo(i);l=l||"default";var b=m.get(g);if(!b){var E={loading:0,preload:null};if(b=u.querySelector(Ms(g)))E.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":l},a),(a=On.get(g))&&Wd(i,a);var O=b=u.createElement("link");Ct(O),Dt(O,"link",i),O._p=new Promise(function(I,W){O.onload=I,O.onerror=W}),O.addEventListener("load",function(){E.loading|=1}),O.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Dc(b,l,u)}b={type:"stylesheet",instance:b,count:1,state:E},m.set(g,b)}}}function VT(i,l){Ui.X(i,l);var a=ro;if(a&&i){var u=Tl(a).hoistableScripts,m=oo(i),g=u.get(m);g||(g=a.querySelector(Ts(m)),g||(i=v({src:i,async:!0},l),(l=On.get(m))&&Xd(i,l),g=a.createElement("script"),Ct(g),Dt(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(m,g))}}function IT(i,l){Ui.M(i,l);var a=ro;if(a&&i){var u=Tl(a).hoistableScripts,m=oo(i),g=u.get(m);g||(g=a.querySelector(Ts(m)),g||(i=v({src:i,async:!0,type:"module"},l),(l=On.get(m))&&Xd(i,l),g=a.createElement("script"),Ct(g),Dt(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(m,g))}}function Bb(i,l,a,u){var m=(m=ye.current)?Rc(m):null;if(!m)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(l=lo(a.href),a=Tl(m).hoistableStyles,u=a.get(l),u||(u={type:"style",instance:null,count:0,state:null},a.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=lo(a.href);var g=Tl(m).hoistableStyles,b=g.get(i);if(b||(m=m.ownerDocument||m,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(i,b),(g=m.querySelector(Ms(i)))&&!g._p&&(b.instance=g,b.state.loading=5),On.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},On.set(i,a),g||GT(m,i,a,b.state))),l&&u===null)throw Error(r(528,""));return b}if(l&&u!==null)throw Error(r(529,""));return null;case"script":return l=a.async,a=a.src,typeof a=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=oo(a),a=Tl(m).hoistableScripts,u=a.get(l),u||(u={type:"script",instance:null,count:0,state:null},a.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function lo(i){return'href="'+Sn(i)+'"'}function Ms(i){return'link[rel="stylesheet"]['+i+"]"}function zb(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function GT(i,l,a,u){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=i.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),Dt(l,"link",a),Ct(l),i.head.appendChild(l))}function oo(i){return'[src="'+Sn(i)+'"]'}function Ts(i){return"script[async]"+i}function Lb(i,l,a){if(l.count++,l.instance===null)switch(l.type){case"style":var u=i.querySelector('style[data-href~="'+Sn(a.href)+'"]');if(u)return l.instance=u,Ct(u),u;var m=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Ct(u),Dt(u,"style",m),Dc(u,a.precedence,i),l.instance=u;case"stylesheet":m=lo(a.href);var g=i.querySelector(Ms(m));if(g)return l.state.loading|=4,l.instance=g,Ct(g),g;u=zb(a),(m=On.get(m))&&Wd(u,m),g=(i.ownerDocument||i).createElement("link"),Ct(g);var b=g;return b._p=new Promise(function(E,O){b.onload=E,b.onerror=O}),Dt(g,"link",u),l.state.loading|=4,Dc(g,a.precedence,i),l.instance=g;case"script":return g=oo(a.src),(m=i.querySelector(Ts(g)))?(l.instance=m,Ct(m),m):(u=a,(m=On.get(g))&&(u=v({},a),Xd(u,m)),i=i.ownerDocument||i,m=i.createElement("script"),Ct(m),Dt(m,"link",u),i.head.appendChild(m),l.instance=m);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(u=l.instance,l.state.loading|=4,Dc(u,a.precedence,i));return l.instance}function Dc(i,l,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,g=m,b=0;b<u.length;b++){var E=u[b];if(E.dataset.precedence===l)g=E;else if(g!==m)break}g?g.parentNode.insertBefore(i,g.nextSibling):(l=a.nodeType===9?a.head:a,l.insertBefore(i,l.firstChild))}function Wd(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function Xd(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Nc=null;function jb(i,l,a){if(Nc===null){var u=new Map,m=Nc=new Map;m.set(a,u)}else m=Nc,u=m.get(a),u||(u=new Map,m.set(a,u));if(u.has(i))return u;for(u.set(i,null),a=a.getElementsByTagName(i),m=0;m<a.length;m++){var g=a[m];if(!(g[Go]||g[Tt]||i==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var b=g.getAttribute(l)||"";b=i+b;var E=u.get(b);E?E.push(g):u.set(b,[g])}}return u}function Hb(i,l,a){i=i.ownerDocument||i,i.head.insertBefore(a,l==="title"?i.querySelector("head > title"):null)}function qT(i,l,a){if(a===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(i=l.disabled,typeof l.precedence=="string"&&i==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Ub(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function YT(i,l,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var m=lo(u.href),g=l.querySelector(Ms(m));if(g){l=g._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=_c.bind(i),l.then(i,i)),a.state.loading|=4,a.instance=g,Ct(g);return}g=l.ownerDocument||l,u=zb(u),(m=On.get(m))&&Wd(u,m),g=g.createElement("link"),Ct(g);var b=g;b._p=new Promise(function(E,O){b.onload=E,b.onerror=O}),Dt(g,"link",u),a.instance=g}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,l),(l=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=_c.bind(i),l.addEventListener("load",a),l.addEventListener("error",a))}}var Qd=0;function FT(i,l){return i.stylesheets&&i.count===0&&zc(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var u=setTimeout(function(){if(i.stylesheets&&zc(i,i.stylesheets),i.unsuspend){var g=i.unsuspend;i.unsuspend=null,g()}},6e4+l);0<i.imgBytes&&Qd===0&&(Qd=62500*MT());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&zc(i,i.stylesheets),i.unsuspend)){var g=i.unsuspend;i.unsuspend=null,g()}},(i.imgBytes>Qd?50:800)+l);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function _c(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Bc=null;function zc(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Bc=new Map,l.forEach(KT,i),Bc=null,_c.call(i))}function KT(i,l){if(!(l.state.loading&4)){var a=Bc.get(i);if(a)var u=a.get(null);else{a=new Map,Bc.set(i,a);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var b=m[g];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),u=b)}u&&a.set(null,u)}m=l.instance,b=m.getAttribute("data-precedence"),g=a.get(b)||u,g===u&&a.set(null,m),a.set(b,m),this.count++,u=_c.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),g?g.parentNode.insertBefore(m,g.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),l.state.loading|=4}}var ks={$$typeof:N,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function WT(i,l,a,u,m,g,b,E,O){this.tag=1,this.containerInfo=i,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=Yf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yf(0),this.hiddenUpdates=Yf(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Pb(i,l,a,u,m,g,b,E,O,I,W,$){return i=new WT(i,l,a,b,O,I,W,$,E),l=1,g===!0&&(l|=24),g=an(3,null,null,l),i.current=g,g.stateNode=i,l=Oh(),l.refCount++,i.pooledCache=l,l.refCount++,g.memoizedState={element:u,isDehydrated:a,cache:l},_h(g),i}function Vb(i){return i?(i=jl,i):jl}function Ib(i,l,a,u,m,g){m=Vb(m),u.context===null?u.context=m:u.pendingContext=m,u=nr(l),u.payload={element:a},g=g===void 0?null:g,g!==null&&(u.callback=g),a=ir(i,u,l),a!==null&&(Jt(a,i,l),os(a,i,l))}function Gb(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<l?a:l}}function Zd(i,l){Gb(i,l),(i=i.alternate)&&Gb(i,l)}function qb(i){if(i.tag===13||i.tag===31){var l=Fr(i,67108864);l!==null&&Jt(l,i,67108864),Zd(i,67108864)}}function Yb(i){if(i.tag===13||i.tag===31){var l=dn();l=Ff(l);var a=Fr(i,l);a!==null&&Jt(a,i,l),Zd(i,l)}}var Lc=!0;function XT(i,l,a,u){var m=R.T;R.T=null;var g=z.p;try{z.p=2,$d(i,l,a,u)}finally{z.p=g,R.T=m}}function QT(i,l,a,u){var m=R.T;R.T=null;var g=z.p;try{z.p=8,$d(i,l,a,u)}finally{z.p=g,R.T=m}}function $d(i,l,a,u){if(Lc){var m=Jd(u);if(m===null)Hd(i,l,u,jc,a),Kb(i,u);else if($T(m,i,l,a,u))u.stopPropagation();else if(Kb(i,u),l&4&&-1<ZT.indexOf(i)){for(;m!==null;){var g=Ml(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var b=Vr(g.pendingLanes);if(b!==0){var E=g;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var O=1<<31-on(b);E.entanglements[1]|=O,b&=~O}ti(g),(Ge&6)===0&&(bc=rn()+500,ws(0))}}break;case 31:case 13:E=Fr(g,2),E!==null&&Jt(E,g,2),Sc(),Zd(g,2)}if(g=Jd(u),g===null&&Hd(i,l,u,jc,a),g===m)break;m=g}m!==null&&u.stopPropagation()}else Hd(i,l,u,null,a)}}function Jd(i){return i=th(i),em(i)}var jc=null;function em(i){if(jc=null,i=El(i),i!==null){var l=s(i);if(l===null)i=null;else{var a=l.tag;if(a===13){if(i=c(l),i!==null)return i;i=null}else if(a===31){if(i=f(l),i!==null)return i;i=null}else if(a===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return jc=i,null}function Fb(i){switch(i){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(LE()){case e0:return 2;case t0:return 8;case Ma:case jE:return 32;case n0:return 268435456;default:return 32}default:return 32}}var tm=!1,mr=null,pr=null,gr=null,Os=new Map,Rs=new Map,vr=[],ZT="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 Kb(i,l){switch(i){case"focusin":case"focusout":mr=null;break;case"dragenter":case"dragleave":pr=null;break;case"mouseover":case"mouseout":gr=null;break;case"pointerover":case"pointerout":Os.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rs.delete(l.pointerId)}}function Ds(i,l,a,u,m,g){return i===null||i.nativeEvent!==g?(i={blockedOn:l,domEventName:a,eventSystemFlags:u,nativeEvent:g,targetContainers:[m]},l!==null&&(l=Ml(l),l!==null&&qb(l)),i):(i.eventSystemFlags|=u,l=i.targetContainers,m!==null&&l.indexOf(m)===-1&&l.push(m),i)}function $T(i,l,a,u,m){switch(l){case"focusin":return mr=Ds(mr,i,l,a,u,m),!0;case"dragenter":return pr=Ds(pr,i,l,a,u,m),!0;case"mouseover":return gr=Ds(gr,i,l,a,u,m),!0;case"pointerover":var g=m.pointerId;return Os.set(g,Ds(Os.get(g)||null,i,l,a,u,m)),!0;case"gotpointercapture":return g=m.pointerId,Rs.set(g,Ds(Rs.get(g)||null,i,l,a,u,m)),!0}return!1}function Wb(i){var l=El(i.target);if(l!==null){var a=s(l);if(a!==null){if(l=a.tag,l===13){if(l=c(a),l!==null){i.blockedOn=l,a0(i.priority,function(){Yb(a)});return}}else if(l===31){if(l=f(a),l!==null){i.blockedOn=l,a0(i.priority,function(){Yb(a)});return}}else if(l===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Hc(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var a=Jd(i.nativeEvent);if(a===null){a=i.nativeEvent;var u=new a.constructor(a.type,a);eh=u,a.target.dispatchEvent(u),eh=null}else return l=Ml(a),l!==null&&qb(l),i.blockedOn=a,!1;l.shift()}return!0}function Xb(i,l,a){Hc(i)&&a.delete(l)}function JT(){tm=!1,mr!==null&&Hc(mr)&&(mr=null),pr!==null&&Hc(pr)&&(pr=null),gr!==null&&Hc(gr)&&(gr=null),Os.forEach(Xb),Rs.forEach(Xb)}function Uc(i,l){i.blockedOn===l&&(i.blockedOn=null,tm||(tm=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,JT)))}var Pc=null;function Qb(i){Pc!==i&&(Pc=i,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Pc===i&&(Pc=null);for(var l=0;l<i.length;l+=3){var a=i[l],u=i[l+1],m=i[l+2];if(typeof u!="function"){if(em(u||a)===null)continue;break}var g=Ml(a);g!==null&&(i.splice(l,3),l-=3,Jh(g,{pending:!0,data:m,method:a.method,action:u},u,m))}}))}function so(i){function l(O){return Uc(O,i)}mr!==null&&Uc(mr,i),pr!==null&&Uc(pr,i),gr!==null&&Uc(gr,i),Os.forEach(l),Rs.forEach(l);for(var a=0;a<vr.length;a++){var u=vr[a];u.blockedOn===i&&(u.blockedOn=null)}for(;0<vr.length&&(a=vr[0],a.blockedOn===null);)Wb(a),a.blockedOn===null&&vr.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var m=a[u],g=a[u+1],b=m[Kt]||null;if(typeof g=="function")b||Qb(a);else if(b){var E=null;if(g&&g.hasAttribute("formAction")){if(m=g,b=g[Kt]||null)E=b.formAction;else if(em(m)!==null)continue}else E=b.action;typeof E=="function"?a[u+1]=E:(a.splice(u,3),u-=3),Qb(a)}}}function Zb(){function i(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(b){return m=b})},focusReset:"manual",scroll:"manual"})}function l(){m!==null&&(m(),m=null),u||setTimeout(a,20)}function a(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),m!==null&&(m(),m=null)}}}function nm(i){this._internalRoot=i}Vc.prototype.render=nm.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var a=l.current,u=dn();Ib(a,u,i,l,null,null)},Vc.prototype.unmount=nm.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Ib(i.current,2,null,i,null,null),Sc(),l[Al]=null}};function Vc(i){this._internalRoot=i}Vc.prototype.unstable_scheduleHydration=function(i){if(i){var l=s0();i={blockedOn:null,target:i,priority:l};for(var a=0;a<vr.length&&l!==0&&l<vr[a].priority;a++);vr.splice(a,0,i),a===0&&Wb(i)}};var $b=e.version;if($b!=="19.2.4")throw Error(r(527,$b,"19.2.4"));z.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(l),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var ek={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ic.isDisabled&&Ic.supportsFiber)try{Po=Ic.inject(ek),ln=Ic}catch{}}return _s.createRoot=function(i,l){if(!o(i))throw Error(r(299));var a=!1,u="",m=ly,g=oy,b=sy;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(u=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(g=l.onCaughtError),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=Pb(i,1,!1,null,null,a,u,null,m,g,b,Zb),i[Al]=l.current,jd(i),new nm(l)},_s.hydrateRoot=function(i,l,a){if(!o(i))throw Error(r(299));var u=!1,m="",g=ly,b=oy,E=sy,O=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),l=Pb(i,1,!0,l,a??null,u,m,O,g,b,E,Zb),l.context=Vb(null),a=l.current,u=dn(),u=Ff(u),m=nr(u),m.callback=null,ir(a,m,u),a=u,l.current.lanes=a,Io(l,a),ti(l),i[Al]=l.current,jd(i),new Vc(l)},_s.version="19.2.4",_s}var ax;function uk(){if(ax)return lm.exports;ax=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),lm.exports=ck(),lm.exports}var fk=uk(),ha=gS();const hk=mS(ha);function cx(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function of(...n){return e=>{let t=!1;const r=n.map(o=>{const s=cx(o,e);return!t&&typeof s=="function"&&(t=!0),s});if(t)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():cx(n[o],null)}}}}function Le(...n){return w.useCallback(of(...n),n)}function hl(n){const e=dk(n),t=w.forwardRef((r,o)=>{const{children:s,...c}=r,f=w.Children.toArray(s),h=f.find(pk);if(h){const d=h.props.children,p=f.map(v=>v===h?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:v);return S.jsx(e,{...c,ref:o,children:w.isValidElement(d)?w.cloneElement(d,void 0,p):null})}return S.jsx(e,{...c,ref:o,children:s})});return t.displayName=`${n}.Slot`,t}var vS=hl("Slot");function dk(n){const e=w.forwardRef((t,r)=>{const{children:o,...s}=t;if(w.isValidElement(o)){const c=vk(o),f=gk(s,o.props);return o.type!==w.Fragment&&(f.ref=r?of(r,c):c),w.cloneElement(o,f)}return w.Children.count(o)>1?w.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var yS=Symbol("radix.slottable");function mk(n){const e=({children:t})=>S.jsx(S.Fragment,{children:t});return e.displayName=`${n}.Slottable`,e.__radixId=yS,e}function pk(n){return w.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===yS}function gk(n,e){const t={...e};for(const r in e){const o=n[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?t[r]=(...f)=>{const h=s(...f);return o(...f),h}:o&&(t[r]=o):r==="style"?t[r]={...o,...s}:r==="className"&&(t[r]=[o,s].filter(Boolean).join(" "))}return{...n,...t}}function vk(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var yk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=yk.reduce((n,e)=>{const t=hl(`Primitive.${e}`),r=w.forwardRef((o,s)=>{const{asChild:c,...f}=o,h=c?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(h,{...f,ref:s})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function bS(n,e){n&&ha.flushSync(()=>n.dispatchEvent(e))}var xS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bk="VisuallyHidden",SS=w.forwardRef((n,e)=>S.jsx(Ce.span,{...n,ref:e,style:{...xS,...n.style}}));SS.displayName=bk;var xk=SS;function Sk(n,e){const t=w.createContext(e),r=s=>{const{children:c,...f}=s,h=w.useMemo(()=>f,Object.values(f));return S.jsx(t.Provider,{value:h,children:c})};r.displayName=n+"Provider";function o(s){const c=w.useContext(t);if(c)return c;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${n}\``)}return[r,o]}function bi(n,e=[]){let t=[];function r(s,c){const f=w.createContext(c),h=t.length;t=[...t,c];const d=v=>{const{scope:y,children:x,...A}=v,C=y?.[n]?.[h]||f,M=w.useMemo(()=>A,Object.values(A));return S.jsx(C.Provider,{value:M,children:x})};d.displayName=s+"Provider";function p(v,y){const x=y?.[n]?.[h]||f,A=w.useContext(x);if(A)return A;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=t.map(c=>w.createContext(c));return function(f){const h=f?.[n]||s;return w.useMemo(()=>({[`__scope${n}`]:{...f,[n]:h}}),[f,h])}};return o.scopeName=n,[r,wk(o,...e)]}function wk(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((f,{useScope:h,scopeName:d})=>{const v=h(s)[`__scope${d}`];return{...f,...v}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return t.scopeName=e.scopeName,t}function Qp(n){const e=n+"CollectionProvider",[t,r]=bi(e),[o,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:M,children:T}=C,D=xr.useRef(null),N=xr.useRef(new Map).current;return S.jsx(o,{scope:M,itemMap:N,collectionRef:D,children:T})};c.displayName=e;const f=n+"CollectionSlot",h=hl(f),d=xr.forwardRef((C,M)=>{const{scope:T,children:D}=C,N=s(f,T),j=Le(M,N.collectionRef);return S.jsx(h,{ref:j,children:D})});d.displayName=f;const p=n+"CollectionItemSlot",v="data-radix-collection-item",y=hl(p),x=xr.forwardRef((C,M)=>{const{scope:T,children:D,...N}=C,j=xr.useRef(null),H=Le(M,j),P=s(p,T);return xr.useEffect(()=>(P.itemMap.set(j,{ref:j,...N}),()=>{P.itemMap.delete(j)})),S.jsx(y,{[v]:"",ref:H,children:D})});x.displayName=p;function A(C){const M=s(n+"CollectionConsumer",C);return xr.useCallback(()=>{const D=M.collectionRef.current;if(!D)return[];const N=Array.from(D.querySelectorAll(`[${v}]`));return Array.from(M.itemMap.values()).sort((P,_)=>N.indexOf(P.ref.current)-N.indexOf(_.ref.current))},[M.collectionRef,M.itemMap])}return[{Provider:c,Slot:d,ItemSlot:x},A,r]}function fe(n,e,{checkForDefaultPrevented:t=!0}={}){return function(o){if(n?.(o),t===!1||!o.defaultPrevented)return e?.(o)}}var jt=globalThis?.document?w.useLayoutEffect:()=>{},Ck=pS[" useInsertionEffect ".trim().toString()]||jt;function dl({prop:n,defaultProp:e,onChange:t=()=>{},caller:r}){const[o,s,c]=Ak({defaultProp:e,onChange:t}),f=n!==void 0,h=f?n:o;{const p=w.useRef(n!==void 0);w.useEffect(()=>{const v=p.current;v!==f&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=f},[f,r])}const d=w.useCallback(p=>{if(f){const v=Ek(p)?p(n):p;v!==n&&c.current?.(v)}else s(p)},[f,n,s,c]);return[h,d]}function Ak({defaultProp:n,onChange:e}){const[t,r]=w.useState(n),o=w.useRef(t),s=w.useRef(e);return Ck(()=>{s.current=e},[e]),w.useEffect(()=>{o.current!==t&&(s.current?.(t),o.current=t)},[t,o]),[t,r,s]}function Ek(n){return typeof n=="function"}function Mk(n,e){return w.useReducer((t,r)=>e[t][r]??t,n)}var nn=n=>{const{present:e,children:t}=n,r=Tk(e),o=typeof t=="function"?t({present:r.isPresent}):w.Children.only(t),s=Le(r.ref,kk(o));return typeof t=="function"||r.isPresent?w.cloneElement(o,{ref:s}):null};nn.displayName="Presence";function Tk(n){const[e,t]=w.useState(),r=w.useRef(null),o=w.useRef(n),s=w.useRef("none"),c=n?"mounted":"unmounted",[f,h]=Mk(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Gc(r.current);s.current=f==="mounted"?d:"none"},[f]),jt(()=>{const d=r.current,p=o.current;if(p!==n){const y=s.current,x=Gc(d);n?h("MOUNT"):x==="none"||d?.display==="none"?h("UNMOUNT"):h(p&&y!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=n}},[n,h]),jt(()=>{if(e){let d;const p=e.ownerDocument.defaultView??window,v=x=>{const C=Gc(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&C&&(h("ANIMATION_END"),!o.current)){const M=e.style.animationFillMode;e.style.animationFillMode="forwards",d=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=M)})}},y=x=>{x.target===e&&(s.current=Gc(r.current))};return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{p.clearTimeout(d),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[e,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:w.useCallback(d=>{r.current=d?getComputedStyle(d):null,t(d)},[])}}function Gc(n){return n?.animationName||"none"}function kk(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Ok=pS[" useId ".trim().toString()]||(()=>{}),Rk=0;function _n(n){const[e,t]=w.useState(Ok());return jt(()=>{t(r=>r??String(Rk++))},[n]),n||(e?`radix-${e}`:"")}var Dk=w.createContext(void 0);function da(n){const e=w.useContext(Dk);return n||e||"ltr"}function Et(n){const e=w.useRef(n);return w.useEffect(()=>{e.current=n}),w.useMemo(()=>(...t)=>e.current?.(...t),[])}function Nk(n,e=globalThis?.document){const t=Et(n);w.useEffect(()=>{const r=o=>{o.key==="Escape"&&t(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[t,e])}var _k="DismissableLayer",Gm="dismissableLayer.update",Bk="dismissableLayer.pointerDownOutside",zk="dismissableLayer.focusOutside",ux,wS=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ma=w.forwardRef((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:f,...h}=n,d=w.useContext(wS),[p,v]=w.useState(null),y=p?.ownerDocument??globalThis?.document,[,x]=w.useState({}),A=Le(e,_=>v(_)),C=Array.from(d.layers),[M]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=C.indexOf(M),D=p?C.indexOf(p):-1,N=d.layersWithOutsidePointerEventsDisabled.size>0,j=D>=T,H=Hk(_=>{const G=_.target,Z=[...d.branches].some(ie=>ie.contains(G));!j||Z||(o?.(_),c?.(_),_.defaultPrevented||f?.())},y),P=Uk(_=>{const G=_.target;[...d.branches].some(ie=>ie.contains(G))||(s?.(_),c?.(_),_.defaultPrevented||f?.())},y);return Nk(_=>{D===d.layers.size-1&&(r?.(_),!_.defaultPrevented&&f&&(_.preventDefault(),f()))},y),w.useEffect(()=>{if(p)return t&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ux=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),fx(),()=>{t&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=ux)}},[p,y,t,d]),w.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),fx())},[p,d]),w.useEffect(()=>{const _=()=>x({});return document.addEventListener(Gm,_),()=>document.removeEventListener(Gm,_)},[]),S.jsx(Ce.div,{...h,ref:A,style:{pointerEvents:N?j?"auto":"none":void 0,...n.style},onFocusCapture:fe(n.onFocusCapture,P.onFocusCapture),onBlurCapture:fe(n.onBlurCapture,P.onBlurCapture),onPointerDownCapture:fe(n.onPointerDownCapture,H.onPointerDownCapture)})});ma.displayName=_k;var Lk="DismissableLayerBranch",jk=w.forwardRef((n,e)=>{const t=w.useContext(wS),r=w.useRef(null),o=Le(e,r);return w.useEffect(()=>{const s=r.current;if(s)return t.branches.add(s),()=>{t.branches.delete(s)}},[t.branches]),S.jsx(Ce.div,{...n,ref:o})});jk.displayName=Lk;function Hk(n,e=globalThis?.document){const t=Et(n),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=f=>{if(f.target&&!r.current){let h=function(){CS(Bk,t,d,{discrete:!0})};const d={originalEvent:f};f.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=h,e.addEventListener("click",o.current,{once:!0})):h()}else e.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),e.removeEventListener("pointerdown",s),e.removeEventListener("click",o.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function Uk(n,e=globalThis?.document){const t=Et(n),r=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!r.current&&CS(zk,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fx(){const n=new CustomEvent(Gm);document.dispatchEvent(n)}function CS(n,e,t,{discrete:r}){const o=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&o.addEventListener(n,e,{once:!0}),r?bS(o,s):o.dispatchEvent(s)}var cm="focusScope.autoFocusOnMount",um="focusScope.autoFocusOnUnmount",hx={bubbles:!1,cancelable:!0},Pk="FocusScope",sf=w.forwardRef((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=n,[f,h]=w.useState(null),d=Et(o),p=Et(s),v=w.useRef(null),y=Le(e,C=>h(C)),x=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let C=function(N){if(x.paused||!f)return;const j=N.target;f.contains(j)?v.current=j:Sr(v.current,{select:!0})},M=function(N){if(x.paused||!f)return;const j=N.relatedTarget;j!==null&&(f.contains(j)||Sr(v.current,{select:!0}))},T=function(N){if(document.activeElement===document.body)for(const H of N)H.removedNodes.length>0&&Sr(f)};document.addEventListener("focusin",C),document.addEventListener("focusout",M);const D=new MutationObserver(T);return f&&D.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",M),D.disconnect()}}},[r,f,x.paused]),w.useEffect(()=>{if(f){mx.add(x);const C=document.activeElement;if(!f.contains(C)){const T=new CustomEvent(cm,hx);f.addEventListener(cm,d),f.dispatchEvent(T),T.defaultPrevented||(Vk(Fk(AS(f)),{select:!0}),document.activeElement===C&&Sr(f))}return()=>{f.removeEventListener(cm,d),setTimeout(()=>{const T=new CustomEvent(um,hx);f.addEventListener(um,p),f.dispatchEvent(T),T.defaultPrevented||Sr(C??document.body,{select:!0}),f.removeEventListener(um,p),mx.remove(x)},0)}}},[f,d,p,x]);const A=w.useCallback(C=>{if(!t&&!r||x.paused)return;const M=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(M&&T){const D=C.currentTarget,[N,j]=Ik(D);N&&j?!C.shiftKey&&T===j?(C.preventDefault(),t&&Sr(N,{select:!0})):C.shiftKey&&T===N&&(C.preventDefault(),t&&Sr(j,{select:!0})):T===D&&C.preventDefault()}},[t,r,x.paused]);return S.jsx(Ce.div,{tabIndex:-1,...c,ref:y,onKeyDown:A})});sf.displayName=Pk;function Vk(n,{select:e=!1}={}){const t=document.activeElement;for(const r of n)if(Sr(r,{select:e}),document.activeElement!==t)return}function Ik(n){const e=AS(n),t=dx(e,n),r=dx(e.reverse(),n);return[t,r]}function AS(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function dx(n,e){for(const t of n)if(!Gk(t,{upTo:e}))return t}function Gk(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function qk(n){return n instanceof HTMLInputElement&&"select"in n}function Sr(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&qk(n)&&e&&n.select()}}var mx=Yk();function Yk(){let n=[];return{add(e){const t=n[0];e!==t&&t?.pause(),n=px(n,e),n.unshift(e)},remove(e){n=px(n,e),n[0]?.resume()}}}function px(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}function Fk(n){return n.filter(e=>e.tagName!=="A")}var Kk="Portal",af=w.forwardRef((n,e)=>{const{container:t,...r}=n,[o,s]=w.useState(!1);jt(()=>s(!0),[]);const c=t||o&&globalThis?.document?.body;return c?hk.createPortal(S.jsx(Ce.div,{...r,ref:e}),c):null});af.displayName=Kk;var fm=0;function Zp(){w.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??gx()),document.body.insertAdjacentElement("beforeend",n[1]??gx()),fm++,()=>{fm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),fm--}},[])}function gx(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var oi=function(){return oi=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},oi.apply(this,arguments)};function ES(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t}function Wk(n,e,t){if(t||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}var pu="right-scroll-bar-position",gu="width-before-scroll-bar",Xk="with-scroll-bars-hidden",Qk="--removed-body-scroll-bar-size";function hm(n,e){return typeof n=="function"?n(e):n&&(n.current=e),n}function Zk(n,e){var t=w.useState(function(){return{value:n,callback:e,facade:{get current(){return t.value},set current(r){var o=t.value;o!==r&&(t.value=r,t.callback(r,o))}}}})[0];return t.callback=e,t.facade}var $k=typeof window<"u"?w.useLayoutEffect:w.useEffect,vx=new WeakMap;function Jk(n,e){var t=Zk(null,function(r){return n.forEach(function(o){return hm(o,r)})});return $k(function(){var r=vx.get(t);if(r){var o=new Set(r),s=new Set(n),c=t.current;o.forEach(function(f){s.has(f)||hm(f,null)}),s.forEach(function(f){o.has(f)||hm(f,c)})}vx.set(t,n)},[n]),t}function eO(n){return n}function tO(n,e){e===void 0&&(e=eO);var t=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:n},useMedium:function(s){var c=e(s,r);return t.push(c),function(){t=t.filter(function(f){return f!==c})}},assignSyncMedium:function(s){for(r=!0;t.length;){var c=t;t=[],c.forEach(s)}t={push:function(f){return s(f)},filter:function(){return t}}},assignMedium:function(s){r=!0;var c=[];if(t.length){var f=t;t=[],f.forEach(s),c=t}var h=function(){var p=c;c=[],p.forEach(s)},d=function(){return Promise.resolve().then(h)};d(),t={push:function(p){c.push(p),d()},filter:function(p){return c=c.filter(p),t}}}};return o}function nO(n){n===void 0&&(n={});var e=tO(null);return e.options=oi({async:!0,ssr:!1},n),e}var MS=function(n){var e=n.sideCar,t=ES(n,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,oi({},t))};MS.isSideCarExport=!0;function iO(n,e){return n.useMedium(e),MS}var TS=nO(),dm=function(){},cf=w.forwardRef(function(n,e){var t=w.useRef(null),r=w.useState({onScrollCapture:dm,onWheelCapture:dm,onTouchMoveCapture:dm}),o=r[0],s=r[1],c=n.forwardProps,f=n.children,h=n.className,d=n.removeScrollBar,p=n.enabled,v=n.shards,y=n.sideCar,x=n.noRelative,A=n.noIsolation,C=n.inert,M=n.allowPinchZoom,T=n.as,D=T===void 0?"div":T,N=n.gapMode,j=ES(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),H=y,P=Jk([t,e]),_=oi(oi({},j),o);return w.createElement(w.Fragment,null,p&&w.createElement(H,{sideCar:TS,removeScrollBar:d,shards:v,noRelative:x,noIsolation:A,inert:C,setCallbacks:s,allowPinchZoom:!!M,lockRef:t,gapMode:N}),c?w.cloneElement(w.Children.only(f),oi(oi({},_),{ref:P})):w.createElement(D,oi({},_,{className:h,ref:P}),f))});cf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cf.classNames={fullWidth:gu,zeroRight:pu};var rO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lO(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var e=rO();return e&&n.setAttribute("nonce",e),n}function oO(n,e){n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}function sO(n){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(n)}var aO=function(){var n=0,e=null;return{add:function(t){n==0&&(e=lO())&&(oO(e,t),sO(e)),n++},remove:function(){n--,!n&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},cO=function(){var n=aO();return function(e,t){w.useEffect(function(){return n.add(e),function(){n.remove()}},[e&&t])}},kS=function(){var n=cO(),e=function(t){var r=t.styles,o=t.dynamic;return n(r,o),null};return e},uO={left:0,top:0,right:0,gap:0},mm=function(n){return parseInt(n||"",10)||0},fO=function(n){var e=window.getComputedStyle(document.body),t=e[n==="padding"?"paddingLeft":"marginLeft"],r=e[n==="padding"?"paddingTop":"marginTop"],o=e[n==="padding"?"paddingRight":"marginRight"];return[mm(t),mm(r),mm(o)]},hO=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return uO;var e=fO(n),t=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-t+e[2]-e[0])}},dO=kS(),go="data-scroll-locked",mO=function(n,e,t,r){var o=n.left,s=n.top,c=n.right,f=n.gap;return t===void 0&&(t="margin"),`
10
+ .`.concat(Xk,` {
11
+ overflow: hidden `).concat(r,`;
12
+ padding-right: `).concat(f,"px ").concat(r,`;
13
+ }
14
+ body[`).concat(go,`] {
15
+ overflow: hidden `).concat(r,`;
16
+ overscroll-behavior: contain;
17
+ `).concat([e&&"position: relative ".concat(r,";"),t==="margin"&&`
18
+ padding-left: `.concat(o,`px;
19
+ padding-top: `).concat(s,`px;
20
+ padding-right: `).concat(c,`px;
21
+ margin-left:0;
22
+ margin-top:0;
23
+ margin-right: `).concat(f,"px ").concat(r,`;
24
+ `),t==="padding"&&"padding-right: ".concat(f,"px ").concat(r,";")].filter(Boolean).join(""),`
25
+ }
26
+
27
+ .`).concat(pu,` {
28
+ right: `).concat(f,"px ").concat(r,`;
29
+ }
30
+
31
+ .`).concat(gu,` {
32
+ margin-right: `).concat(f,"px ").concat(r,`;
33
+ }
34
+
35
+ .`).concat(pu," .").concat(pu,` {
36
+ right: 0 `).concat(r,`;
37
+ }
38
+
39
+ .`).concat(gu," .").concat(gu,` {
40
+ margin-right: 0 `).concat(r,`;
41
+ }
42
+
43
+ body[`).concat(go,`] {
44
+ `).concat(Qk,": ").concat(f,`px;
45
+ }
46
+ `)},yx=function(){var n=parseInt(document.body.getAttribute(go)||"0",10);return isFinite(n)?n:0},pO=function(){w.useEffect(function(){return document.body.setAttribute(go,(yx()+1).toString()),function(){var n=yx()-1;n<=0?document.body.removeAttribute(go):document.body.setAttribute(go,n.toString())}},[])},gO=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,o=r===void 0?"margin":r;pO();var s=w.useMemo(function(){return hO(o)},[o]);return w.createElement(dO,{styles:mO(s,!e,o,t?"":"!important")})},qm=!1;if(typeof window<"u")try{var qc=Object.defineProperty({},"passive",{get:function(){return qm=!0,!0}});window.addEventListener("test",qc,qc),window.removeEventListener("test",qc,qc)}catch{qm=!1}var ao=qm?{passive:!1}:!1,vO=function(n){return n.tagName==="TEXTAREA"},OS=function(n,e){if(!(n instanceof Element))return!1;var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!vO(n)&&t[e]==="visible")},yO=function(n){return OS(n,"overflowY")},bO=function(n){return OS(n,"overflowX")},bx=function(n,e){var t=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=RS(n,r);if(o){var s=DS(n,r),c=s[1],f=s[2];if(c>f)return!0}r=r.parentNode}while(r&&r!==t.body);return!1},xO=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},SO=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},RS=function(n,e){return n==="v"?yO(e):bO(e)},DS=function(n,e){return n==="v"?xO(e):SO(e)},wO=function(n,e){return n==="h"&&e==="rtl"?-1:1},CO=function(n,e,t,r,o){var s=wO(n,window.getComputedStyle(e).direction),c=s*r,f=t.target,h=e.contains(f),d=!1,p=c>0,v=0,y=0;do{if(!f)break;var x=DS(n,f),A=x[0],C=x[1],M=x[2],T=C-M-s*A;(A||T)&&RS(n,f)&&(v+=T,y+=A);var D=f.parentNode;f=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!h&&f!==document.body||h&&(e.contains(f)||e===f));return(p&&Math.abs(v)<1||!p&&Math.abs(y)<1)&&(d=!0),d},Yc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},xx=function(n){return[n.deltaX,n.deltaY]},Sx=function(n){return n&&"current"in n?n.current:n},AO=function(n,e){return n[0]===e[0]&&n[1]===e[1]},EO=function(n){return`
47
+ .block-interactivity-`.concat(n,` {pointer-events: none;}
48
+ .allow-interactivity-`).concat(n,` {pointer-events: all;}
49
+ `)},MO=0,co=[];function TO(n){var e=w.useRef([]),t=w.useRef([0,0]),r=w.useRef(),o=w.useState(MO++)[0],s=w.useState(kS)[0],c=w.useRef(n);w.useEffect(function(){c.current=n},[n]),w.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(o));var C=Wk([n.lockRef.current],(n.shards||[]).map(Sx),!0).filter(Boolean);return C.forEach(function(M){return M.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),C.forEach(function(M){return M.classList.remove("allow-interactivity-".concat(o))})}}},[n.inert,n.lockRef.current,n.shards]);var f=w.useCallback(function(C,M){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var T=Yc(C),D=t.current,N="deltaX"in C?C.deltaX:D[0]-T[0],j="deltaY"in C?C.deltaY:D[1]-T[1],H,P=C.target,_=Math.abs(N)>Math.abs(j)?"h":"v";if("touches"in C&&_==="h"&&P.type==="range")return!1;var G=window.getSelection(),Z=G&&G.anchorNode,ie=Z?Z===P||Z.contains(P):!1;if(ie)return!1;var ne=bx(_,P);if(!ne)return!0;if(ne?H=_:(H=_==="v"?"h":"v",ne=bx(_,P)),!ne)return!1;if(!r.current&&"changedTouches"in C&&(N||j)&&(r.current=H),!H)return!0;var ee=r.current||H;return CO(ee,M,C,ee==="h"?N:j)},[]),h=w.useCallback(function(C){var M=C;if(!(!co.length||co[co.length-1]!==s)){var T="deltaY"in M?xx(M):Yc(M),D=e.current.filter(function(H){return H.name===M.type&&(H.target===M.target||M.target===H.shadowParent)&&AO(H.delta,T)})[0];if(D&&D.should){M.cancelable&&M.preventDefault();return}if(!D){var N=(c.current.shards||[]).map(Sx).filter(Boolean).filter(function(H){return H.contains(M.target)}),j=N.length>0?f(M,N[0]):!c.current.noIsolation;j&&M.cancelable&&M.preventDefault()}}},[]),d=w.useCallback(function(C,M,T,D){var N={name:C,delta:M,target:T,should:D,shadowParent:kO(T)};e.current.push(N),setTimeout(function(){e.current=e.current.filter(function(j){return j!==N})},1)},[]),p=w.useCallback(function(C){t.current=Yc(C),r.current=void 0},[]),v=w.useCallback(function(C){d(C.type,xx(C),C.target,f(C,n.lockRef.current))},[]),y=w.useCallback(function(C){d(C.type,Yc(C),C.target,f(C,n.lockRef.current))},[]);w.useEffect(function(){return co.push(s),n.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:y}),document.addEventListener("wheel",h,ao),document.addEventListener("touchmove",h,ao),document.addEventListener("touchstart",p,ao),function(){co=co.filter(function(C){return C!==s}),document.removeEventListener("wheel",h,ao),document.removeEventListener("touchmove",h,ao),document.removeEventListener("touchstart",p,ao)}},[]);var x=n.removeScrollBar,A=n.inert;return w.createElement(w.Fragment,null,A?w.createElement(s,{styles:EO(o)}):null,x?w.createElement(gO,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function kO(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const OO=iO(TS,TO);var uf=w.forwardRef(function(n,e){return w.createElement(cf,oi({},n,{ref:e,sideCar:OO}))});uf.classNames=cf.classNames;var RO=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},uo=new WeakMap,Fc=new WeakMap,Kc={},pm=0,NS=function(n){return n&&(n.host||NS(n.parentNode))},DO=function(n,e){return e.map(function(t){if(n.contains(t))return t;var r=NS(t);return r&&n.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},NO=function(n,e,t,r){var o=DO(e,Array.isArray(n)?n:[n]);Kc[t]||(Kc[t]=new WeakMap);var s=Kc[t],c=[],f=new Set,h=new Set(o),d=function(v){!v||f.has(v)||(f.add(v),d(v.parentNode))};o.forEach(d);var p=function(v){!v||h.has(v)||Array.prototype.forEach.call(v.children,function(y){if(f.has(y))p(y);else try{var x=y.getAttribute(r),A=x!==null&&x!=="false",C=(uo.get(y)||0)+1,M=(s.get(y)||0)+1;uo.set(y,C),s.set(y,M),c.push(y),C===1&&A&&Fc.set(y,!0),M===1&&y.setAttribute(t,"true"),A||y.setAttribute(r,"true")}catch(T){console.error("aria-hidden: cannot operate on ",y,T)}})};return p(e),f.clear(),pm++,function(){c.forEach(function(v){var y=uo.get(v)-1,x=s.get(v)-1;uo.set(v,y),s.set(v,x),y||(Fc.has(v)||v.removeAttribute(r),Fc.delete(v)),x||v.removeAttribute(t)}),pm--,pm||(uo=new WeakMap,uo=new WeakMap,Fc=new WeakMap,Kc={})}},$p=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),o=RO(n);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),NO(r,o,t,"aria-hidden")):function(){return null}},ff="Dialog",[_S]=bi(ff),[_O,Xn]=_S(ff),BS=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:o,onOpenChange:s,modal:c=!0}=n,f=w.useRef(null),h=w.useRef(null),[d,p]=dl({prop:r,defaultProp:o??!1,onChange:s,caller:ff});return S.jsx(_O,{scope:e,triggerRef:f,contentRef:h,contentId:_n(),titleId:_n(),descriptionId:_n(),open:d,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(v=>!v),[p]),modal:c,children:t})};BS.displayName=ff;var zS="DialogTrigger",BO=w.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,o=Xn(zS,t),s=Le(e,o.triggerRef);return S.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tg(o.open),...r,ref:s,onClick:fe(n.onClick,o.onOpenToggle)})});BO.displayName=zS;var Jp="DialogPortal",[zO,LS]=_S(Jp,{forceMount:void 0}),jS=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:o}=n,s=Xn(Jp,e);return S.jsx(zO,{scope:e,forceMount:t,children:w.Children.map(r,c=>S.jsx(nn,{present:t||s.open,children:S.jsx(af,{asChild:!0,container:o,children:c})}))})};jS.displayName=Jp;var Mu="DialogOverlay",HS=w.forwardRef((n,e)=>{const t=LS(Mu,n.__scopeDialog),{forceMount:r=t.forceMount,...o}=n,s=Xn(Mu,n.__scopeDialog);return s.modal?S.jsx(nn,{present:r||s.open,children:S.jsx(jO,{...o,ref:e})}):null});HS.displayName=Mu;var LO=hl("DialogOverlay.RemoveScroll"),jO=w.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,o=Xn(Mu,t);return S.jsx(uf,{as:LO,allowPinchZoom:!0,shards:[o.contentRef],children:S.jsx(Ce.div,{"data-state":tg(o.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),ml="DialogContent",US=w.forwardRef((n,e)=>{const t=LS(ml,n.__scopeDialog),{forceMount:r=t.forceMount,...o}=n,s=Xn(ml,n.__scopeDialog);return S.jsx(nn,{present:r||s.open,children:s.modal?S.jsx(HO,{...o,ref:e}):S.jsx(UO,{...o,ref:e})})});US.displayName=ml;var HO=w.forwardRef((n,e)=>{const t=Xn(ml,n.__scopeDialog),r=w.useRef(null),o=Le(e,t.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return $p(s)},[]),S.jsx(PS,{...n,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(n.onCloseAutoFocus,s=>{s.preventDefault(),t.triggerRef.current?.focus()}),onPointerDownOutside:fe(n.onPointerDownOutside,s=>{const c=s.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&s.preventDefault()}),onFocusOutside:fe(n.onFocusOutside,s=>s.preventDefault())})}),UO=w.forwardRef((n,e)=>{const t=Xn(ml,n.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return S.jsx(PS,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{n.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||t.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{n.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;t.triggerRef.current?.contains(c)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),PS=w.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,f=Xn(ml,t),h=w.useRef(null),d=Le(e,h);return Zp(),S.jsxs(S.Fragment,{children:[S.jsx(sf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:S.jsx(ma,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":tg(f.open),...c,ref:d,onDismiss:()=>f.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(PO,{titleId:f.titleId}),S.jsx(IO,{contentRef:h,descriptionId:f.descriptionId})]})]})}),eg="DialogTitle",VS=w.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,o=Xn(eg,t);return S.jsx(Ce.h2,{id:o.titleId,...r,ref:e})});VS.displayName=eg;var IS="DialogDescription",GS=w.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,o=Xn(IS,t);return S.jsx(Ce.p,{id:o.descriptionId,...r,ref:e})});GS.displayName=IS;var qS="DialogClose",YS=w.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,o=Xn(qS,t);return S.jsx(Ce.button,{type:"button",...r,ref:e,onClick:fe(n.onClick,()=>o.onOpenChange(!1))})});YS.displayName=qS;function tg(n){return n?"open":"closed"}var FS="DialogTitleWarning",[b8,KS]=Sk(FS,{contentName:ml,titleName:eg,docsSlug:"dialog"}),PO=({titleId:n})=>{const e=KS(FS),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
50
+
51
+ If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
52
+
53
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return w.useEffect(()=>{n&&(document.getElementById(n)||console.error(t))},[t,n]),null},VO="DialogDescriptionWarning",IO=({contentRef:n,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${KS(VO).contentName}}.`;return w.useEffect(()=>{const o=n.current?.getAttribute("aria-describedby");e&&o&&(document.getElementById(e)||console.warn(r))},[r,n,e]),null},GO=BS,qO=jS,YO=HS,FO=US,KO=VS,WO=GS,WS=YS;function XO(n){const e=w.useRef({value:n,previous:n});return w.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}function QO(n){const[e,t]=w.useState(void 0);return jt(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,f;if("borderBoxSize"in s){const h=s.borderBoxSize,d=Array.isArray(h)?h[0]:h;c=d.inlineSize,f=d.blockSize}else c=n.offsetWidth,f=n.offsetHeight;t({width:c,height:f})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}else t(void 0)},[n]),e}const ZO=["top","right","bottom","left"],kr=Math.min,pn=Math.max,Tu=Math.round,Wc=Math.floor,mi=n=>({x:n,y:n}),$O={left:"right",right:"left",bottom:"top",top:"bottom"},JO={start:"end",end:"start"};function Ym(n,e,t){return pn(n,kr(e,t))}function qi(n,e){return typeof n=="function"?n(e):n}function Yi(n){return n.split("-")[0]}function No(n){return n.split("-")[1]}function ng(n){return n==="x"?"y":"x"}function ig(n){return n==="y"?"height":"width"}const eR=new Set(["top","bottom"]);function ci(n){return eR.has(Yi(n))?"y":"x"}function rg(n){return ng(ci(n))}function tR(n,e,t){t===void 0&&(t=!1);const r=No(n),o=rg(n),s=ig(o);let c=o==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(c=ku(c)),[c,ku(c)]}function nR(n){const e=ku(n);return[Fm(n),e,Fm(e)]}function Fm(n){return n.replace(/start|end/g,e=>JO[e])}const wx=["left","right"],Cx=["right","left"],iR=["top","bottom"],rR=["bottom","top"];function lR(n,e,t){switch(n){case"top":case"bottom":return t?e?Cx:wx:e?wx:Cx;case"left":case"right":return e?iR:rR;default:return[]}}function oR(n,e,t,r){const o=No(n);let s=lR(Yi(n),t==="start",r);return o&&(s=s.map(c=>c+"-"+o),e&&(s=s.concat(s.map(Fm)))),s}function ku(n){return n.replace(/left|right|bottom|top/g,e=>$O[e])}function sR(n){return{top:0,right:0,bottom:0,left:0,...n}}function XS(n){return typeof n!="number"?sR(n):{top:n,right:n,bottom:n,left:n}}function Ou(n){const{x:e,y:t,width:r,height:o}=n;return{width:r,height:o,top:t,left:e,right:e+r,bottom:t+o,x:e,y:t}}function Ax(n,e,t){let{reference:r,floating:o}=n;const s=ci(e),c=rg(e),f=ig(c),h=Yi(e),d=s==="y",p=r.x+r.width/2-o.width/2,v=r.y+r.height/2-o.height/2,y=r[f]/2-o[f]/2;let x;switch(h){case"top":x={x:p,y:r.y-o.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:v};break;case"left":x={x:r.x-o.width,y:v};break;default:x={x:r.x,y:r.y}}switch(No(e)){case"start":x[c]-=y*(t&&d?-1:1);break;case"end":x[c]+=y*(t&&d?-1:1);break}return x}async function aR(n,e){var t;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:c,elements:f,strategy:h}=n,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:v="floating",altBoundary:y=!1,padding:x=0}=qi(e,n),A=XS(x),M=f[y?v==="floating"?"reference":"floating":v],T=Ou(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(M)))==null||t?M:M.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(f.floating)),boundary:d,rootBoundary:p,strategy:h})),D=v==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f.floating)),j=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},H=Ou(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:D,offsetParent:N,strategy:h}):D);return{top:(T.top-H.top+A.top)/j.y,bottom:(H.bottom-T.bottom+A.bottom)/j.y,left:(T.left-H.left+A.left)/j.x,right:(H.right-T.right+A.right)/j.x}}const cR=async(n,e,t)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:c}=t,f=s.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(e));let d=await c.getElementRects({reference:n,floating:e,strategy:o}),{x:p,y:v}=Ax(d,r,h),y=r,x={},A=0;for(let M=0;M<f.length;M++){var C;const{name:T,fn:D}=f[M],{x:N,y:j,data:H,reset:P}=await D({x:p,y:v,initialPlacement:r,placement:y,strategy:o,middlewareData:x,rects:d,platform:{...c,detectOverflow:(C=c.detectOverflow)!=null?C:aR},elements:{reference:n,floating:e}});p=N??p,v=j??v,x={...x,[T]:{...x[T],...H}},P&&A<=50&&(A++,typeof P=="object"&&(P.placement&&(y=P.placement),P.rects&&(d=P.rects===!0?await c.getElementRects({reference:n,floating:e,strategy:o}):P.rects),{x:p,y:v}=Ax(d,y,h)),M=-1)}return{x:p,y:v,placement:y,strategy:o,middlewareData:x}},uR=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:o,rects:s,platform:c,elements:f,middlewareData:h}=e,{element:d,padding:p=0}=qi(n,e)||{};if(d==null)return{};const v=XS(p),y={x:t,y:r},x=rg(o),A=ig(x),C=await c.getDimensions(d),M=x==="y",T=M?"top":"left",D=M?"bottom":"right",N=M?"clientHeight":"clientWidth",j=s.reference[A]+s.reference[x]-y[x]-s.floating[A],H=y[x]-s.reference[x],P=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let _=P?P[N]:0;(!_||!await(c.isElement==null?void 0:c.isElement(P)))&&(_=f.floating[N]||s.floating[A]);const G=j/2-H/2,Z=_/2-C[A]/2-1,ie=kr(v[T],Z),ne=kr(v[D],Z),ee=ie,se=_-C[A]-ne,oe=_/2-C[A]/2+G,ae=Ym(ee,oe,se),R=!h.arrow&&No(o)!=null&&oe!==ae&&s.reference[A]/2-(oe<ee?ie:ne)-C[A]/2<0,z=R?oe<ee?oe-ee:oe-se:0;return{[x]:y[x]+z,data:{[x]:ae,centerOffset:oe-ae-z,...R&&{alignmentOffset:z}},reset:R}}}),fR=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:o,middlewareData:s,rects:c,initialPlacement:f,platform:h,elements:d}=e,{mainAxis:p=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:C=!0,...M}=qi(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const T=Yi(o),D=ci(f),N=Yi(f)===f,j=await(h.isRTL==null?void 0:h.isRTL(d.floating)),H=y||(N||!C?[ku(f)]:nR(f)),P=A!=="none";!y&&P&&H.push(...oR(f,C,A,j));const _=[f,...H],G=await h.detectOverflow(e,M),Z=[];let ie=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&Z.push(G[T]),v){const oe=tR(o,c,j);Z.push(G[oe[0]],G[oe[1]])}if(ie=[...ie,{placement:o,overflows:Z}],!Z.every(oe=>oe<=0)){var ne,ee;const oe=(((ne=s.flip)==null?void 0:ne.index)||0)+1,ae=_[oe];if(ae&&(!(v==="alignment"?D!==ci(ae):!1)||ie.every(L=>ci(L.placement)===D?L.overflows[0]>0:!0)))return{data:{index:oe,overflows:ie},reset:{placement:ae}};let R=(ee=ie.filter(z=>z.overflows[0]<=0).sort((z,L)=>z.overflows[1]-L.overflows[1])[0])==null?void 0:ee.placement;if(!R)switch(x){case"bestFit":{var se;const z=(se=ie.filter(L=>{if(P){const F=ci(L.placement);return F===D||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,ue)=>F+ue,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:se[0];z&&(R=z);break}case"initialPlacement":R=f;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function Ex(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Mx(n){return ZO.some(e=>n[e]>=0)}const hR=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:r}=e,{strategy:o="referenceHidden",...s}=qi(n,e);switch(o){case"referenceHidden":{const c=await r.detectOverflow(e,{...s,elementContext:"reference"}),f=Ex(c,t.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Mx(f)}}}case"escaped":{const c=await r.detectOverflow(e,{...s,altBoundary:!0}),f=Ex(c,t.floating);return{data:{escapedOffsets:f,escaped:Mx(f)}}}default:return{}}}}},QS=new Set(["left","top"]);async function dR(n,e){const{placement:t,platform:r,elements:o}=n,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Yi(t),f=No(t),h=ci(t)==="y",d=QS.has(c)?-1:1,p=s&&h?-1:1,v=qi(e,n);let{mainAxis:y,crossAxis:x,alignmentAxis:A}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof A=="number"&&(x=f==="end"?A*-1:A),h?{x:x*p,y:y*d}:{x:y*d,y:x*p}}const mR=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:o,y:s,placement:c,middlewareData:f}=e,h=await dR(e,n);return c===((t=f.offset)==null?void 0:t.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:o+h.x,y:s+h.y,data:{...h,placement:c}}}}},pR=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:o,platform:s}=e,{mainAxis:c=!0,crossAxis:f=!1,limiter:h={fn:T=>{let{x:D,y:N}=T;return{x:D,y:N}}},...d}=qi(n,e),p={x:t,y:r},v=await s.detectOverflow(e,d),y=ci(Yi(o)),x=ng(y);let A=p[x],C=p[y];if(c){const T=x==="y"?"top":"left",D=x==="y"?"bottom":"right",N=A+v[T],j=A-v[D];A=Ym(N,A,j)}if(f){const T=y==="y"?"top":"left",D=y==="y"?"bottom":"right",N=C+v[T],j=C-v[D];C=Ym(N,C,j)}const M=h.fn({...e,[x]:A,[y]:C});return{...M,data:{x:M.x-t,y:M.y-r,enabled:{[x]:c,[y]:f}}}}}},gR=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:o,rects:s,middlewareData:c}=e,{offset:f=0,mainAxis:h=!0,crossAxis:d=!0}=qi(n,e),p={x:t,y:r},v=ci(o),y=ng(v);let x=p[y],A=p[v];const C=qi(f,e),M=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const N=y==="y"?"height":"width",j=s.reference[y]-s.floating[N]+M.mainAxis,H=s.reference[y]+s.reference[N]-M.mainAxis;x<j?x=j:x>H&&(x=H)}if(d){var T,D;const N=y==="y"?"width":"height",j=QS.has(Yi(o)),H=s.reference[v]-s.floating[N]+(j&&((T=c.offset)==null?void 0:T[v])||0)+(j?0:M.crossAxis),P=s.reference[v]+s.reference[N]+(j?0:((D=c.offset)==null?void 0:D[v])||0)-(j?M.crossAxis:0);A<H?A=H:A>P&&(A=P)}return{[y]:x,[v]:A}}}},vR=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:o,rects:s,platform:c,elements:f}=e,{apply:h=()=>{},...d}=qi(n,e),p=await c.detectOverflow(e,d),v=Yi(o),y=No(o),x=ci(o)==="y",{width:A,height:C}=s.floating;let M,T;v==="top"||v==="bottom"?(M=v,T=y===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(T=v,M=y==="end"?"top":"bottom");const D=C-p.top-p.bottom,N=A-p.left-p.right,j=kr(C-p[M],D),H=kr(A-p[T],N),P=!e.middlewareData.shift;let _=j,G=H;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(G=N),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=D),P&&!y){const ie=pn(p.left,0),ne=pn(p.right,0),ee=pn(p.top,0),se=pn(p.bottom,0);x?G=A-2*(ie!==0||ne!==0?ie+ne:pn(p.left,p.right)):_=C-2*(ee!==0||se!==0?ee+se:pn(p.top,p.bottom))}await h({...e,availableWidth:G,availableHeight:_});const Z=await c.getDimensions(f.floating);return A!==Z.width||C!==Z.height?{reset:{rects:!0}}:{}}}};function hf(){return typeof window<"u"}function _o(n){return ZS(n)?(n.nodeName||"").toLowerCase():"#document"}function vn(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function xi(n){var e;return(e=(ZS(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function ZS(n){return hf()?n instanceof Node||n instanceof vn(n).Node:!1}function Fn(n){return hf()?n instanceof Element||n instanceof vn(n).Element:!1}function gi(n){return hf()?n instanceof HTMLElement||n instanceof vn(n).HTMLElement:!1}function Tx(n){return!hf()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof vn(n).ShadowRoot}const yR=new Set(["inline","contents"]);function pa(n){const{overflow:e,overflowX:t,overflowY:r,display:o}=Kn(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!yR.has(o)}const bR=new Set(["table","td","th"]);function xR(n){return bR.has(_o(n))}const SR=[":popover-open",":modal"];function df(n){return SR.some(e=>{try{return n.matches(e)}catch{return!1}})}const wR=["transform","translate","scale","rotate","perspective"],CR=["transform","translate","scale","rotate","perspective","filter"],AR=["paint","layout","strict","content"];function lg(n){const e=og(),t=Fn(n)?Kn(n):n;return wR.some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||CR.some(r=>(t.willChange||"").includes(r))||AR.some(r=>(t.contain||"").includes(r))}function ER(n){let e=Or(n);for(;gi(e)&&!wo(e);){if(lg(e))return e;if(df(e))return null;e=Or(e)}return null}function og(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MR=new Set(["html","body","#document"]);function wo(n){return MR.has(_o(n))}function Kn(n){return vn(n).getComputedStyle(n)}function mf(n){return Fn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Or(n){if(_o(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Tx(n)&&n.host||xi(n);return Tx(e)?e.host:e}function $S(n){const e=Or(n);return wo(e)?n.ownerDocument?n.ownerDocument.body:n.body:gi(e)&&pa(e)?e:$S(e)}function ea(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const o=$S(n),s=o===((r=n.ownerDocument)==null?void 0:r.body),c=vn(o);if(s){const f=Km(c);return e.concat(c,c.visualViewport||[],pa(o)?o:[],f&&t?ea(f):[])}return e.concat(o,ea(o,[],t))}function Km(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function JS(n){const e=Kn(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=gi(n),s=o?n.offsetWidth:t,c=o?n.offsetHeight:r,f=Tu(t)!==s||Tu(r)!==c;return f&&(t=s,r=c),{width:t,height:r,$:f}}function sg(n){return Fn(n)?n:n.contextElement}function vo(n){const e=sg(n);if(!gi(e))return mi(1);const t=e.getBoundingClientRect(),{width:r,height:o,$:s}=JS(e);let c=(s?Tu(t.width):t.width)/r,f=(s?Tu(t.height):t.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const TR=mi(0);function ew(n){const e=vn(n);return!og()||!e.visualViewport?TR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kR(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==vn(n)?!1:e}function pl(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const o=n.getBoundingClientRect(),s=sg(n);let c=mi(1);e&&(r?Fn(r)&&(c=vo(r)):c=vo(n));const f=kR(s,t,r)?ew(s):mi(0);let h=(o.left+f.x)/c.x,d=(o.top+f.y)/c.y,p=o.width/c.x,v=o.height/c.y;if(s){const y=vn(s),x=r&&Fn(r)?vn(r):r;let A=y,C=Km(A);for(;C&&r&&x!==A;){const M=vo(C),T=C.getBoundingClientRect(),D=Kn(C),N=T.left+(C.clientLeft+parseFloat(D.paddingLeft))*M.x,j=T.top+(C.clientTop+parseFloat(D.paddingTop))*M.y;h*=M.x,d*=M.y,p*=M.x,v*=M.y,h+=N,d+=j,A=vn(C),C=Km(A)}}return Ou({width:p,height:v,x:h,y:d})}function pf(n,e){const t=mf(n).scrollLeft;return e?e.left+t:pl(xi(n)).left+t}function tw(n,e){const t=n.getBoundingClientRect(),r=t.left+e.scrollLeft-pf(n,t),o=t.top+e.scrollTop;return{x:r,y:o}}function OR(n){let{elements:e,rect:t,offsetParent:r,strategy:o}=n;const s=o==="fixed",c=xi(r),f=e?df(e.floating):!1;if(r===c||f&&s)return t;let h={scrollLeft:0,scrollTop:0},d=mi(1);const p=mi(0),v=gi(r);if((v||!v&&!s)&&((_o(r)!=="body"||pa(c))&&(h=mf(r)),gi(r))){const x=pl(r);d=vo(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const y=c&&!v&&!s?tw(c,h):mi(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-h.scrollLeft*d.x+p.x+y.x,y:t.y*d.y-h.scrollTop*d.y+p.y+y.y}}function RR(n){return Array.from(n.getClientRects())}function DR(n){const e=xi(n),t=mf(n),r=n.ownerDocument.body,o=pn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=pn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-t.scrollLeft+pf(n);const f=-t.scrollTop;return Kn(r).direction==="rtl"&&(c+=pn(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:f}}const kx=25;function NR(n,e){const t=vn(n),r=xi(n),o=t.visualViewport;let s=r.clientWidth,c=r.clientHeight,f=0,h=0;if(o){s=o.width,c=o.height;const p=og();(!p||p&&e==="fixed")&&(f=o.offsetLeft,h=o.offsetTop)}const d=pf(r);if(d<=0){const p=r.ownerDocument,v=p.body,y=getComputedStyle(v),x=p.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,A=Math.abs(r.clientWidth-v.clientWidth-x);A<=kx&&(s-=A)}else d<=kx&&(s+=d);return{width:s,height:c,x:f,y:h}}const _R=new Set(["absolute","fixed"]);function BR(n,e){const t=pl(n,!0,e==="fixed"),r=t.top+n.clientTop,o=t.left+n.clientLeft,s=gi(n)?vo(n):mi(1),c=n.clientWidth*s.x,f=n.clientHeight*s.y,h=o*s.x,d=r*s.y;return{width:c,height:f,x:h,y:d}}function Ox(n,e,t){let r;if(e==="viewport")r=NR(n,t);else if(e==="document")r=DR(xi(n));else if(Fn(e))r=BR(e,t);else{const o=ew(n);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Ou(r)}function nw(n,e){const t=Or(n);return t===e||!Fn(t)||wo(t)?!1:Kn(t).position==="fixed"||nw(t,e)}function zR(n,e){const t=e.get(n);if(t)return t;let r=ea(n,[],!1).filter(f=>Fn(f)&&_o(f)!=="body"),o=null;const s=Kn(n).position==="fixed";let c=s?Or(n):n;for(;Fn(c)&&!wo(c);){const f=Kn(c),h=lg(c);!h&&f.position==="fixed"&&(o=null),(s?!h&&!o:!h&&f.position==="static"&&!!o&&_R.has(o.position)||pa(c)&&!h&&nw(n,c))?r=r.filter(p=>p!==c):o=f,c=Or(c)}return e.set(n,r),r}function LR(n){let{element:e,boundary:t,rootBoundary:r,strategy:o}=n;const c=[...t==="clippingAncestors"?df(e)?[]:zR(e,this._c):[].concat(t),r],f=c[0],h=c.reduce((d,p)=>{const v=Ox(e,p,o);return d.top=pn(v.top,d.top),d.right=kr(v.right,d.right),d.bottom=kr(v.bottom,d.bottom),d.left=pn(v.left,d.left),d},Ox(e,f,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function jR(n){const{width:e,height:t}=JS(n);return{width:e,height:t}}function HR(n,e,t){const r=gi(e),o=xi(e),s=t==="fixed",c=pl(n,!0,s,e);let f={scrollLeft:0,scrollTop:0};const h=mi(0);function d(){h.x=pf(o)}if(r||!r&&!s)if((_o(e)!=="body"||pa(o))&&(f=mf(e)),r){const x=pl(e,!0,s,e);h.x=x.x+e.clientLeft,h.y=x.y+e.clientTop}else o&&d();s&&!r&&o&&d();const p=o&&!r&&!s?tw(o,f):mi(0),v=c.left+f.scrollLeft-h.x-p.x,y=c.top+f.scrollTop-h.y-p.y;return{x:v,y,width:c.width,height:c.height}}function gm(n){return Kn(n).position==="static"}function Rx(n,e){if(!gi(n)||Kn(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return xi(n)===t&&(t=t.ownerDocument.body),t}function iw(n,e){const t=vn(n);if(df(n))return t;if(!gi(n)){let o=Or(n);for(;o&&!wo(o);){if(Fn(o)&&!gm(o))return o;o=Or(o)}return t}let r=Rx(n,e);for(;r&&xR(r)&&gm(r);)r=Rx(r,e);return r&&wo(r)&&gm(r)&&!lg(r)?t:r||ER(n)||t}const UR=async function(n){const e=this.getOffsetParent||iw,t=this.getDimensions,r=await t(n.floating);return{reference:HR(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function PR(n){return Kn(n).direction==="rtl"}const VR={convertOffsetParentRelativeRectToViewportRelativeRect:OR,getDocumentElement:xi,getClippingRect:LR,getOffsetParent:iw,getElementRects:UR,getClientRects:RR,getDimensions:jR,getScale:vo,isElement:Fn,isRTL:PR};function rw(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function IR(n,e){let t=null,r;const o=xi(n);function s(){var f;clearTimeout(r),(f=t)==null||f.disconnect(),t=null}function c(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),s();const d=n.getBoundingClientRect(),{left:p,top:v,width:y,height:x}=d;if(f||e(),!y||!x)return;const A=Wc(v),C=Wc(o.clientWidth-(p+y)),M=Wc(o.clientHeight-(v+x)),T=Wc(p),N={rootMargin:-A+"px "+-C+"px "+-M+"px "+-T+"px",threshold:pn(0,kr(1,h))||1};let j=!0;function H(P){const _=P[0].intersectionRatio;if(_!==h){if(!j)return c();_?c(!1,_):r=setTimeout(()=>{c(!1,1e-7)},1e3)}_===1&&!rw(d,n.getBoundingClientRect())&&c(),j=!1}try{t=new IntersectionObserver(H,{...N,root:o.ownerDocument})}catch{t=new IntersectionObserver(H,N)}t.observe(n)}return c(!0),s}function GR(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=sg(n),p=o||s?[...d?ea(d):[],...ea(e)]:[];p.forEach(T=>{o&&T.addEventListener("scroll",t,{passive:!0}),s&&T.addEventListener("resize",t)});const v=d&&f?IR(d,t):null;let y=-1,x=null;c&&(x=new ResizeObserver(T=>{let[D]=T;D&&D.target===d&&x&&(x.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(e)})),t()}),d&&!h&&x.observe(d),x.observe(e));let A,C=h?pl(n):null;h&&M();function M(){const T=pl(n);C&&!rw(C,T)&&t(),C=T,A=requestAnimationFrame(M)}return t(),()=>{var T;p.forEach(D=>{o&&D.removeEventListener("scroll",t),s&&D.removeEventListener("resize",t)}),v?.(),(T=x)==null||T.disconnect(),x=null,h&&cancelAnimationFrame(A)}}const qR=mR,YR=pR,FR=fR,KR=vR,WR=hR,Dx=uR,XR=gR,QR=(n,e,t)=>{const r=new Map,o={platform:VR,...t},s={...o.platform,_c:r};return cR(n,e,{...o,platform:s})};var ZR=typeof document<"u",$R=function(){},vu=ZR?w.useLayoutEffect:$R;function Ru(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,o;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!Ru(n[r],e[r]))return!1;return!0}if(o=Object.keys(n),t=o.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=t;r--!==0;){const s=o[r];if(!(s==="_owner"&&n.$$typeof)&&!Ru(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function lw(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Nx(n,e){const t=lw(n);return Math.round(e*t)/t}function vm(n){const e=w.useRef(n);return vu(()=>{e.current=n}),e}function JR(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:f=!0,whileElementsMounted:h,open:d}=n,[p,v]=w.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[y,x]=w.useState(r);Ru(y,r)||x(r);const[A,C]=w.useState(null),[M,T]=w.useState(null),D=w.useCallback(L=>{L!==P.current&&(P.current=L,C(L))},[]),N=w.useCallback(L=>{L!==_.current&&(_.current=L,T(L))},[]),j=s||A,H=c||M,P=w.useRef(null),_=w.useRef(null),G=w.useRef(p),Z=h!=null,ie=vm(h),ne=vm(o),ee=vm(d),se=w.useCallback(()=>{if(!P.current||!_.current)return;const L={placement:e,strategy:t,middleware:y};ne.current&&(L.platform=ne.current),QR(P.current,_.current,L).then(F=>{const ue={...F,isPositioned:ee.current!==!1};oe.current&&!Ru(G.current,ue)&&(G.current=ue,ha.flushSync(()=>{v(ue)}))})},[y,e,t,ne,ee]);vu(()=>{d===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,v(L=>({...L,isPositioned:!1})))},[d]);const oe=w.useRef(!1);vu(()=>(oe.current=!0,()=>{oe.current=!1}),[]),vu(()=>{if(j&&(P.current=j),H&&(_.current=H),j&&H){if(ie.current)return ie.current(j,H,se);se()}},[j,H,se,ie,Z]);const ae=w.useMemo(()=>({reference:P,floating:_,setReference:D,setFloating:N}),[D,N]),R=w.useMemo(()=>({reference:j,floating:H}),[j,H]),z=w.useMemo(()=>{const L={position:t,left:0,top:0};if(!R.floating)return L;const F=Nx(R.floating,p.x),ue=Nx(R.floating,p.y);return f?{...L,transform:"translate("+F+"px, "+ue+"px)",...lw(R.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:F,top:ue}},[t,f,R.floating,p.x,p.y]);return w.useMemo(()=>({...p,update:se,refs:ae,elements:R,floatingStyles:z}),[p,se,ae,R,z])}const eD=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:r,padding:o}=typeof n=="function"?n(t):n;return r&&e(r)?r.current!=null?Dx({element:r.current,padding:o}).fn(t):{}:r?Dx({element:r,padding:o}).fn(t):{}}}},tD=(n,e)=>({...qR(n),options:[n,e]}),nD=(n,e)=>({...YR(n),options:[n,e]}),iD=(n,e)=>({...XR(n),options:[n,e]}),rD=(n,e)=>({...FR(n),options:[n,e]}),lD=(n,e)=>({...KR(n),options:[n,e]}),oD=(n,e)=>({...WR(n),options:[n,e]}),sD=(n,e)=>({...eD(n),options:[n,e]});var aD="Arrow",ow=w.forwardRef((n,e)=>{const{children:t,width:r=10,height:o=5,...s}=n;return S.jsx(Ce.svg,{...s,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});ow.displayName=aD;var cD=ow,ag="Popper",[sw,Bo]=bi(ag),[uD,aw]=sw(ag),cw=n=>{const{__scopePopper:e,children:t}=n,[r,o]=w.useState(null);return S.jsx(uD,{scope:e,anchor:r,onAnchorChange:o,children:t})};cw.displayName=ag;var uw="PopperAnchor",fw=w.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:r,...o}=n,s=aw(uw,t),c=w.useRef(null),f=Le(e,c),h=w.useRef(null);return w.useEffect(()=>{const d=h.current;h.current=r?.current||c.current,d!==h.current&&s.onAnchorChange(h.current)}),r?null:S.jsx(Ce.div,{...o,ref:f})});fw.displayName=uw;var cg="PopperContent",[fD,hD]=sw(cg),hw=w.forwardRef((n,e)=>{const{__scopePopper:t,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:v="partial",hideWhenDetached:y=!1,updatePositionStrategy:x="optimized",onPlaced:A,...C}=n,M=aw(cg,t),[T,D]=w.useState(null),N=Le(e,J=>D(J)),[j,H]=w.useState(null),P=QO(j),_=P?.width??0,G=P?.height??0,Z=r+(s!=="center"?"-"+s:""),ie=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ne=Array.isArray(d)?d:[d],ee=ne.length>0,se={padding:ie,boundary:ne.filter(mD),altBoundary:ee},{refs:oe,floatingStyles:ae,placement:R,isPositioned:z,middlewareData:L}=JR({strategy:"fixed",placement:Z,whileElementsMounted:(...J)=>GR(...J,{animationFrame:x==="always"}),elements:{reference:M.anchor},middleware:[tD({mainAxis:o+G,alignmentAxis:c}),h&&nD({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?iD():void 0,...se}),h&&rD({...se}),lD({...se,apply:({elements:J,rects:Ae,availableWidth:Me,availableHeight:Ne})=>{const{width:He,height:Ye}=Ae.reference,It=J.floating.style;It.setProperty("--radix-popper-available-width",`${Me}px`),It.setProperty("--radix-popper-available-height",`${Ne}px`),It.setProperty("--radix-popper-anchor-width",`${He}px`),It.setProperty("--radix-popper-anchor-height",`${Ye}px`)}}),j&&sD({element:j,padding:f}),pD({arrowWidth:_,arrowHeight:G}),y&&oD({strategy:"referenceHidden",...se})]}),[F,ue]=pw(R),k=Et(A);jt(()=>{z&&k?.()},[z,k]);const Y=L.arrow?.x,te=L.arrow?.y,re=L.arrow?.centerOffset!==0,[me,ye]=w.useState();return jt(()=>{T&&ye(window.getComputedStyle(T).zIndex)},[T]),S.jsx("div",{ref:oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...ae,transform:z?ae.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:S.jsx(fD,{scope:t,placedSide:F,onArrowChange:H,arrowX:Y,arrowY:te,shouldHideArrow:re,children:S.jsx(Ce.div,{"data-side":F,"data-align":ue,...C,ref:N,style:{...C.style,animation:z?void 0:"none"}})})})});hw.displayName=cg;var dw="PopperArrow",dD={top:"bottom",right:"left",bottom:"top",left:"right"},mw=w.forwardRef(function(e,t){const{__scopePopper:r,...o}=e,s=hD(dw,r),c=dD[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(cD,{...o,ref:t,style:{...o.style,display:"block"}})})});mw.displayName=dw;function mD(n){return n!==null}var pD=n=>({name:"transformOrigin",options:n,fn(e){const{placement:t,rects:r,middlewareData:o}=e,c=o.arrow?.centerOffset!==0,f=c?0:n.arrowWidth,h=c?0:n.arrowHeight,[d,p]=pw(t),v={start:"0%",center:"50%",end:"100%"}[p],y=(o.arrow?.x??0)+f/2,x=(o.arrow?.y??0)+h/2;let A="",C="";return d==="bottom"?(A=c?v:`${y}px`,C=`${-h}px`):d==="top"?(A=c?v:`${y}px`,C=`${r.floating.height+h}px`):d==="right"?(A=`${-h}px`,C=c?v:`${x}px`):d==="left"&&(A=`${r.floating.width+h}px`,C=c?v:`${x}px`),{data:{x:A,y:C}}}});function pw(n){const[e,t="center"]=n.split("-");return[e,t]}var ug=cw,fg=fw,hg=hw,dg=mw,ym="rovingFocusGroup.onEntryFocus",gD={bubbles:!1,cancelable:!0},ga="RovingFocusGroup",[Wm,gw,vD]=Qp(ga),[yD,gf]=bi(ga,[vD]),[bD,xD]=yD(ga),vw=w.forwardRef((n,e)=>S.jsx(Wm.Provider,{scope:n.__scopeRovingFocusGroup,children:S.jsx(Wm.Slot,{scope:n.__scopeRovingFocusGroup,children:S.jsx(SD,{...n,ref:e})})}));vw.displayName=ga;var SD=w.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...v}=n,y=w.useRef(null),x=Le(e,y),A=da(s),[C,M]=dl({prop:c,defaultProp:f??null,onChange:h,caller:ga}),[T,D]=w.useState(!1),N=Et(d),j=gw(t),H=w.useRef(!1),[P,_]=w.useState(0);return w.useEffect(()=>{const G=y.current;if(G)return G.addEventListener(ym,N),()=>G.removeEventListener(ym,N)},[N]),S.jsx(bD,{scope:t,orientation:r,dir:A,loop:o,currentTabStopId:C,onItemFocus:w.useCallback(G=>M(G),[M]),onItemShiftTab:w.useCallback(()=>D(!0),[]),onFocusableItemAdd:w.useCallback(()=>_(G=>G+1),[]),onFocusableItemRemove:w.useCallback(()=>_(G=>G-1),[]),children:S.jsx(Ce.div,{tabIndex:T||P===0?-1:0,"data-orientation":r,...v,ref:x,style:{outline:"none",...n.style},onMouseDown:fe(n.onMouseDown,()=>{H.current=!0}),onFocus:fe(n.onFocus,G=>{const Z=!H.current;if(G.target===G.currentTarget&&Z&&!T){const ie=new CustomEvent(ym,gD);if(G.currentTarget.dispatchEvent(ie),!ie.defaultPrevented){const ne=j().filter(R=>R.focusable),ee=ne.find(R=>R.active),se=ne.find(R=>R.id===C),ae=[ee,se,...ne].filter(Boolean).map(R=>R.ref.current);xw(ae,p)}}H.current=!1}),onBlur:fe(n.onBlur,()=>D(!1))})})}),yw="RovingFocusGroupItem",bw=w.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:o=!1,tabStopId:s,children:c,...f}=n,h=_n(),d=s||h,p=xD(yw,t),v=p.currentTabStopId===d,y=gw(t),{onFocusableItemAdd:x,onFocusableItemRemove:A,currentTabStopId:C}=p;return w.useEffect(()=>{if(r)return x(),()=>A()},[r,x,A]),S.jsx(Wm.ItemSlot,{scope:t,id:d,focusable:r,active:o,children:S.jsx(Ce.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...f,ref:e,onMouseDown:fe(n.onMouseDown,M=>{r?p.onItemFocus(d):M.preventDefault()}),onFocus:fe(n.onFocus,()=>p.onItemFocus(d)),onKeyDown:fe(n.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){p.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const T=AD(M,p.orientation,p.dir);if(T!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let N=y().filter(j=>j.focusable).map(j=>j.ref.current);if(T==="last")N.reverse();else if(T==="prev"||T==="next"){T==="prev"&&N.reverse();const j=N.indexOf(M.currentTarget);N=p.loop?ED(N,j+1):N.slice(j+1)}setTimeout(()=>xw(N))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:C!=null}):c})})});bw.displayName=yw;var wD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CD(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function AD(n,e,t){const r=CD(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return wD[r]}function xw(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}function ED(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var Sw=vw,ww=bw,Xm=["Enter"," "],MD=["ArrowDown","PageUp","Home"],Cw=["ArrowUp","PageDown","End"],TD=[...MD,...Cw],kD={ltr:[...Xm,"ArrowRight"],rtl:[...Xm,"ArrowLeft"]},OD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},va="Menu",[ta,RD,DD]=Qp(va),[Cl,Aw]=bi(va,[DD,Bo,gf]),ya=Bo(),Ew=gf(),[Mw,Br]=Cl(va),[ND,ba]=Cl(va),Tw=n=>{const{__scopeMenu:e,open:t=!1,children:r,dir:o,onOpenChange:s,modal:c=!0}=n,f=ya(e),[h,d]=w.useState(null),p=w.useRef(!1),v=Et(s),y=da(o);return w.useEffect(()=>{const x=()=>{p.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>p.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),S.jsx(ug,{...f,children:S.jsx(Mw,{scope:e,open:t,onOpenChange:v,content:h,onContentChange:d,children:S.jsx(ND,{scope:e,onClose:w.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:p,dir:y,modal:c,children:r})})})};Tw.displayName=va;var _D="MenuAnchor",mg=w.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n,o=ya(t);return S.jsx(fg,{...o,...r,ref:e})});mg.displayName=_D;var pg="MenuPortal",[BD,kw]=Cl(pg,{forceMount:void 0}),Ow=n=>{const{__scopeMenu:e,forceMount:t,children:r,container:o}=n,s=Br(pg,e);return S.jsx(BD,{scope:e,forceMount:t,children:S.jsx(nn,{present:t||s.open,children:S.jsx(af,{asChild:!0,container:o,children:r})})})};Ow.displayName=pg;var Bn="MenuContent",[zD,gg]=Cl(Bn),Rw=w.forwardRef((n,e)=>{const t=kw(Bn,n.__scopeMenu),{forceMount:r=t.forceMount,...o}=n,s=Br(Bn,n.__scopeMenu),c=ba(Bn,n.__scopeMenu);return S.jsx(ta.Provider,{scope:n.__scopeMenu,children:S.jsx(nn,{present:r||s.open,children:S.jsx(ta.Slot,{scope:n.__scopeMenu,children:c.modal?S.jsx(LD,{...o,ref:e}):S.jsx(jD,{...o,ref:e})})})})}),LD=w.forwardRef((n,e)=>{const t=Br(Bn,n.__scopeMenu),r=w.useRef(null),o=Le(e,r);return w.useEffect(()=>{const s=r.current;if(s)return $p(s)},[]),S.jsx(vg,{...n,ref:o,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:fe(n.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),jD=w.forwardRef((n,e)=>{const t=Br(Bn,n.__scopeMenu);return S.jsx(vg,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),HD=hl("MenuContent.ScrollLock"),vg=w.forwardRef((n,e)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:v,onInteractOutside:y,onDismiss:x,disableOutsideScroll:A,...C}=n,M=Br(Bn,t),T=ba(Bn,t),D=ya(t),N=Ew(t),j=RD(t),[H,P]=w.useState(null),_=w.useRef(null),G=Le(e,_,M.onContentChange),Z=w.useRef(0),ie=w.useRef(""),ne=w.useRef(0),ee=w.useRef(null),se=w.useRef("right"),oe=w.useRef(0),ae=A?uf:w.Fragment,R=A?{as:HD,allowPinchZoom:!0}:void 0,z=F=>{const ue=ie.current+F,k=j().filter(J=>!J.disabled),Y=document.activeElement,te=k.find(J=>J.ref.current===Y)?.textValue,re=k.map(J=>J.textValue),me=QD(re,ue,te),ye=k.find(J=>J.textValue===me)?.ref.current;(function J(Ae){ie.current=Ae,window.clearTimeout(Z.current),Ae!==""&&(Z.current=window.setTimeout(()=>J(""),1e3))})(ue),ye&&setTimeout(()=>ye.focus())};w.useEffect(()=>()=>window.clearTimeout(Z.current),[]),Zp();const L=w.useCallback(F=>se.current===ee.current?.side&&$D(F,ee.current?.area),[]);return S.jsx(zD,{scope:t,searchRef:ie,onItemEnter:w.useCallback(F=>{L(F)&&F.preventDefault()},[L]),onItemLeave:w.useCallback(F=>{L(F)||(_.current?.focus(),P(null))},[L]),onTriggerLeave:w.useCallback(F=>{L(F)&&F.preventDefault()},[L]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:w.useCallback(F=>{ee.current=F},[]),children:S.jsx(ae,{...R,children:S.jsx(sf,{asChild:!0,trapped:o,onMountAutoFocus:fe(s,F=>{F.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:S.jsx(ma,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:v,onInteractOutside:y,onDismiss:x,children:S.jsx(Sw,{asChild:!0,...N,dir:T.dir,orientation:"vertical",loop:r,currentTabStopId:H,onCurrentTabStopIdChange:P,onEntryFocus:fe(h,F=>{T.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:S.jsx(hg,{role:"menu","aria-orientation":"vertical","data-state":Kw(M.open),"data-radix-menu-content":"",dir:T.dir,...D,...C,ref:G,style:{outline:"none",...C.style},onKeyDown:fe(C.onKeyDown,F=>{const k=F.target.closest("[data-radix-menu-content]")===F.currentTarget,Y=F.ctrlKey||F.altKey||F.metaKey,te=F.key.length===1;k&&(F.key==="Tab"&&F.preventDefault(),!Y&&te&&z(F.key));const re=_.current;if(F.target!==re||!TD.includes(F.key))return;F.preventDefault();const ye=j().filter(J=>!J.disabled).map(J=>J.ref.current);Cw.includes(F.key)&&ye.reverse(),WD(ye)}),onBlur:fe(n.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(Z.current),ie.current="")}),onPointerMove:fe(n.onPointerMove,na(F=>{const ue=F.target,k=oe.current!==F.clientX;if(F.currentTarget.contains(ue)&&k){const Y=F.clientX>oe.current?"right":"left";se.current=Y,oe.current=F.clientX}}))})})})})})})});Rw.displayName=Bn;var UD="MenuGroup",yg=w.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return S.jsx(Ce.div,{role:"group",...r,ref:e})});yg.displayName=UD;var PD="MenuLabel",Dw=w.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return S.jsx(Ce.div,{...r,ref:e})});Dw.displayName=PD;var Du="MenuItem",_x="menu.itemSelect",vf=w.forwardRef((n,e)=>{const{disabled:t=!1,onSelect:r,...o}=n,s=w.useRef(null),c=ba(Du,n.__scopeMenu),f=gg(Du,n.__scopeMenu),h=Le(e,s),d=w.useRef(!1),p=()=>{const v=s.current;if(!t&&v){const y=new CustomEvent(_x,{bubbles:!0,cancelable:!0});v.addEventListener(_x,x=>r?.(x),{once:!0}),bS(v,y),y.defaultPrevented?d.current=!1:c.onClose()}};return S.jsx(Nw,{...o,ref:h,disabled:t,onClick:fe(n.onClick,p),onPointerDown:v=>{n.onPointerDown?.(v),d.current=!0},onPointerUp:fe(n.onPointerUp,v=>{d.current||v.currentTarget?.click()}),onKeyDown:fe(n.onKeyDown,v=>{const y=f.searchRef.current!=="";t||y&&v.key===" "||Xm.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});vf.displayName=Du;var Nw=w.forwardRef((n,e)=>{const{__scopeMenu:t,disabled:r=!1,textValue:o,...s}=n,c=gg(Du,t),f=Ew(t),h=w.useRef(null),d=Le(e,h),[p,v]=w.useState(!1),[y,x]=w.useState("");return w.useEffect(()=>{const A=h.current;A&&x((A.textContent??"").trim())},[s.children]),S.jsx(ta.ItemSlot,{scope:t,disabled:r,textValue:o??y,children:S.jsx(ww,{asChild:!0,...f,focusable:!r,children:S.jsx(Ce.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:d,onPointerMove:fe(n.onPointerMove,na(A=>{r?c.onItemLeave(A):(c.onItemEnter(A),A.defaultPrevented||A.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:fe(n.onPointerLeave,na(A=>c.onItemLeave(A))),onFocus:fe(n.onFocus,()=>v(!0)),onBlur:fe(n.onBlur,()=>v(!1))})})})}),VD="MenuCheckboxItem",_w=w.forwardRef((n,e)=>{const{checked:t=!1,onCheckedChange:r,...o}=n;return S.jsx(Hw,{scope:n.__scopeMenu,checked:t,children:S.jsx(vf,{role:"menuitemcheckbox","aria-checked":Nu(t)?"mixed":t,...o,ref:e,"data-state":Sg(t),onSelect:fe(o.onSelect,()=>r?.(Nu(t)?!0:!t),{checkForDefaultPrevented:!1})})})});_w.displayName=VD;var Bw="MenuRadioGroup",[ID,GD]=Cl(Bw,{value:void 0,onValueChange:()=>{}}),zw=w.forwardRef((n,e)=>{const{value:t,onValueChange:r,...o}=n,s=Et(r);return S.jsx(ID,{scope:n.__scopeMenu,value:t,onValueChange:s,children:S.jsx(yg,{...o,ref:e})})});zw.displayName=Bw;var Lw="MenuRadioItem",jw=w.forwardRef((n,e)=>{const{value:t,...r}=n,o=GD(Lw,n.__scopeMenu),s=t===o.value;return S.jsx(Hw,{scope:n.__scopeMenu,checked:s,children:S.jsx(vf,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":Sg(s),onSelect:fe(r.onSelect,()=>o.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});jw.displayName=Lw;var bg="MenuItemIndicator",[Hw,qD]=Cl(bg,{checked:!1}),Uw=w.forwardRef((n,e)=>{const{__scopeMenu:t,forceMount:r,...o}=n,s=qD(bg,t);return S.jsx(nn,{present:r||Nu(s.checked)||s.checked===!0,children:S.jsx(Ce.span,{...o,ref:e,"data-state":Sg(s.checked)})})});Uw.displayName=bg;var YD="MenuSeparator",Pw=w.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n;return S.jsx(Ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});Pw.displayName=YD;var FD="MenuArrow",Vw=w.forwardRef((n,e)=>{const{__scopeMenu:t,...r}=n,o=ya(t);return S.jsx(dg,{...o,...r,ref:e})});Vw.displayName=FD;var xg="MenuSub",[KD,Iw]=Cl(xg),Gw=n=>{const{__scopeMenu:e,children:t,open:r=!1,onOpenChange:o}=n,s=Br(xg,e),c=ya(e),[f,h]=w.useState(null),[d,p]=w.useState(null),v=Et(o);return w.useEffect(()=>(s.open===!1&&v(!1),()=>v(!1)),[s.open,v]),S.jsx(ug,{...c,children:S.jsx(Mw,{scope:e,open:r,onOpenChange:v,content:d,onContentChange:p,children:S.jsx(KD,{scope:e,contentId:_n(),triggerId:_n(),trigger:f,onTriggerChange:h,children:t})})})};Gw.displayName=xg;var Vs="MenuSubTrigger",qw=w.forwardRef((n,e)=>{const t=Br(Vs,n.__scopeMenu),r=ba(Vs,n.__scopeMenu),o=Iw(Vs,n.__scopeMenu),s=gg(Vs,n.__scopeMenu),c=w.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=s,d={__scopeMenu:n.__scopeMenu},p=w.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return w.useEffect(()=>p,[p]),w.useEffect(()=>{const v=f.current;return()=>{window.clearTimeout(v),h(null)}},[f,h]),S.jsx(mg,{asChild:!0,...d,children:S.jsx(Nw,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":o.contentId,"data-state":Kw(t.open),...n,ref:of(e,o.onTriggerChange),onClick:v=>{n.onClick?.(v),!(n.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:fe(n.onPointerMove,na(v=>{s.onItemEnter(v),!v.defaultPrevented&&!n.disabled&&!t.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{t.onOpenChange(!0),p()},100))})),onPointerLeave:fe(n.onPointerLeave,na(v=>{p();const y=t.content?.getBoundingClientRect();if(y){const x=t.content?.dataset.side,A=x==="right",C=A?-5:5,M=y[A?"left":"right"],T=y[A?"right":"left"];s.onPointerGraceIntentChange({area:[{x:v.clientX+C,y:v.clientY},{x:M,y:y.top},{x:T,y:y.top},{x:T,y:y.bottom},{x:M,y:y.bottom}],side:x}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(v),v.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:fe(n.onKeyDown,v=>{const y=s.searchRef.current!=="";n.disabled||y&&v.key===" "||kD[r.dir].includes(v.key)&&(t.onOpenChange(!0),t.content?.focus(),v.preventDefault())})})})});qw.displayName=Vs;var Yw="MenuSubContent",Fw=w.forwardRef((n,e)=>{const t=kw(Bn,n.__scopeMenu),{forceMount:r=t.forceMount,...o}=n,s=Br(Bn,n.__scopeMenu),c=ba(Bn,n.__scopeMenu),f=Iw(Yw,n.__scopeMenu),h=w.useRef(null),d=Le(e,h);return S.jsx(ta.Provider,{scope:n.__scopeMenu,children:S.jsx(nn,{present:r||s.open,children:S.jsx(ta.Slot,{scope:n.__scopeMenu,children:S.jsx(vg,{id:f.contentId,"aria-labelledby":f.triggerId,...o,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{c.isUsingKeyboardRef.current&&h.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:fe(n.onFocusOutside,p=>{p.target!==f.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:fe(n.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:fe(n.onKeyDown,p=>{const v=p.currentTarget.contains(p.target),y=OD[c.dir].includes(p.key);v&&y&&(s.onOpenChange(!1),f.trigger?.focus(),p.preventDefault())})})})})})});Fw.displayName=Yw;function Kw(n){return n?"open":"closed"}function Nu(n){return n==="indeterminate"}function Sg(n){return Nu(n)?"indeterminate":n?"checked":"unchecked"}function WD(n){const e=document.activeElement;for(const t of n)if(t===e||(t.focus(),document.activeElement!==e))return}function XD(n,e){return n.map((t,r)=>n[(e+r)%n.length])}function QD(n,e,t){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let c=XD(n,Math.max(s,0));o.length===1&&(c=c.filter(d=>d!==t));const h=c.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return h!==t?h:void 0}function ZD(n,e){const{x:t,y:r}=n;let o=!1;for(let s=0,c=e.length-1;s<e.length;c=s++){const f=e[s],h=e[c],d=f.x,p=f.y,v=h.x,y=h.y;p>r!=y>r&&t<(v-d)*(r-p)/(y-p)+d&&(o=!o)}return o}function $D(n,e){if(!e)return!1;const t={x:n.clientX,y:n.clientY};return ZD(t,e)}function na(n){return e=>e.pointerType==="mouse"?n(e):void 0}var JD=Tw,eN=mg,tN=Ow,nN=Rw,iN=yg,rN=Dw,lN=vf,oN=_w,sN=zw,aN=jw,cN=Uw,uN=Pw,fN=Vw,hN=Gw,dN=qw,mN=Fw,yf="DropdownMenu",[pN]=bi(yf,[Aw]),Pt=Aw(),[gN,Ww]=pN(yf),Xw=n=>{const{__scopeDropdownMenu:e,children:t,dir:r,open:o,defaultOpen:s,onOpenChange:c,modal:f=!0}=n,h=Pt(e),d=w.useRef(null),[p,v]=dl({prop:o,defaultProp:s??!1,onChange:c,caller:yf});return S.jsx(gN,{scope:e,triggerId:_n(),triggerRef:d,contentId:_n(),open:p,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(y=>!y),[v]),modal:f,children:S.jsx(JD,{...h,open:p,onOpenChange:v,dir:r,modal:f,children:t})})};Xw.displayName=yf;var Qw="DropdownMenuTrigger",Zw=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,disabled:r=!1,...o}=n,s=Ww(Qw,t),c=Pt(t);return S.jsx(eN,{asChild:!0,...c,children:S.jsx(Ce.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:of(e,s.triggerRef),onPointerDown:fe(n.onPointerDown,f=>{!r&&f.button===0&&f.ctrlKey===!1&&(s.onOpenToggle(),s.open||f.preventDefault())}),onKeyDown:fe(n.onKeyDown,f=>{r||(["Enter"," "].includes(f.key)&&s.onOpenToggle(),f.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});Zw.displayName=Qw;var vN="DropdownMenuPortal",$w=n=>{const{__scopeDropdownMenu:e,...t}=n,r=Pt(e);return S.jsx(tN,{...r,...t})};$w.displayName=vN;var Jw="DropdownMenuContent",eC=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Ww(Jw,t),s=Pt(t),c=w.useRef(!1);return S.jsx(nN,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:e,onCloseAutoFocus:fe(n.onCloseAutoFocus,f=>{c.current||o.triggerRef.current?.focus(),c.current=!1,f.preventDefault()}),onInteractOutside:fe(n.onInteractOutside,f=>{const h=f.detail.originalEvent,d=h.button===0&&h.ctrlKey===!0,p=h.button===2||d;(!o.modal||p)&&(c.current=!0)}),style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eC.displayName=Jw;var yN="DropdownMenuGroup",bN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(iN,{...o,...r,ref:e})});bN.displayName=yN;var xN="DropdownMenuLabel",SN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(rN,{...o,...r,ref:e})});SN.displayName=xN;var wN="DropdownMenuItem",tC=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(lN,{...o,...r,ref:e})});tC.displayName=wN;var CN="DropdownMenuCheckboxItem",AN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(oN,{...o,...r,ref:e})});AN.displayName=CN;var EN="DropdownMenuRadioGroup",MN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(sN,{...o,...r,ref:e})});MN.displayName=EN;var TN="DropdownMenuRadioItem",kN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(aN,{...o,...r,ref:e})});kN.displayName=TN;var ON="DropdownMenuItemIndicator",RN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(cN,{...o,...r,ref:e})});RN.displayName=ON;var DN="DropdownMenuSeparator",NN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(uN,{...o,...r,ref:e})});NN.displayName=DN;var _N="DropdownMenuArrow",BN=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(fN,{...o,...r,ref:e})});BN.displayName=_N;var zN=n=>{const{__scopeDropdownMenu:e,children:t,open:r,onOpenChange:o,defaultOpen:s}=n,c=Pt(e),[f,h]=dl({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return S.jsx(hN,{...c,open:f,onOpenChange:h,children:t})},LN="DropdownMenuSubTrigger",nC=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(dN,{...o,...r,ref:e})});nC.displayName=LN;var jN="DropdownMenuSubContent",iC=w.forwardRef((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,o=Pt(t);return S.jsx(mN,{...o,...r,ref:e,style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iC.displayName=jN;var HN=Xw,UN=Zw,PN=$w,VN=eC,IN=tC,GN=zN,qN=nC,YN=iC;function Qm(n,[e,t]){return Math.min(t,Math.max(e,n))}function FN(n,e){return w.useReducer((t,r)=>e[t][r]??t,n)}var wg="ScrollArea",[rC]=bi(wg),[KN,Hn]=rC(wg),lC=w.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:o,scrollHideDelay:s=600,...c}=n,[f,h]=w.useState(null),[d,p]=w.useState(null),[v,y]=w.useState(null),[x,A]=w.useState(null),[C,M]=w.useState(null),[T,D]=w.useState(0),[N,j]=w.useState(0),[H,P]=w.useState(!1),[_,G]=w.useState(!1),Z=Le(e,ne=>h(ne)),ie=da(o);return S.jsx(KN,{scope:t,type:r,dir:ie,scrollHideDelay:s,scrollArea:f,viewport:d,onViewportChange:p,content:v,onContentChange:y,scrollbarX:x,onScrollbarXChange:A,scrollbarXEnabled:H,onScrollbarXEnabledChange:P,scrollbarY:C,onScrollbarYChange:M,scrollbarYEnabled:_,onScrollbarYEnabledChange:G,onCornerWidthChange:D,onCornerHeightChange:j,children:S.jsx(Ce.div,{dir:ie,...c,ref:Z,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":N+"px",...n.style}})})});lC.displayName=wg;var oC="ScrollAreaViewport",sC=w.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:o,...s}=n,c=Hn(oC,t),f=w.useRef(null),h=Le(e,f,c.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),S.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...s,ref:h,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...n.style},children:S.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});sC.displayName=oC;var Si="ScrollAreaScrollbar",aC=w.forwardRef((n,e)=>{const{forceMount:t,...r}=n,o=Hn(Si,n.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,f=n.orientation==="horizontal";return w.useEffect(()=>(f?s(!0):c(!0),()=>{f?s(!1):c(!1)}),[f,s,c]),o.type==="hover"?S.jsx(WN,{...r,ref:e,forceMount:t}):o.type==="scroll"?S.jsx(XN,{...r,ref:e,forceMount:t}):o.type==="auto"?S.jsx(cC,{...r,ref:e,forceMount:t}):o.type==="always"?S.jsx(Cg,{...r,ref:e}):null});aC.displayName=Si;var WN=w.forwardRef((n,e)=>{const{forceMount:t,...r}=n,o=Hn(Si,n.__scopeScrollArea),[s,c]=w.useState(!1);return w.useEffect(()=>{const f=o.scrollArea;let h=0;if(f){const d=()=>{window.clearTimeout(h),c(!0)},p=()=>{h=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return f.addEventListener("pointerenter",d),f.addEventListener("pointerleave",p),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",d),f.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),S.jsx(nn,{present:t||s,children:S.jsx(cC,{"data-state":s?"visible":"hidden",...r,ref:e})})}),XN=w.forwardRef((n,e)=>{const{forceMount:t,...r}=n,o=Hn(Si,n.__scopeScrollArea),s=n.orientation==="horizontal",c=xf(()=>h("SCROLL_END"),100),[f,h]=FN("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(f==="idle"){const d=window.setTimeout(()=>h("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[f,o.scrollHideDelay,h]),w.useEffect(()=>{const d=o.viewport,p=s?"scrollLeft":"scrollTop";if(d){let v=d[p];const y=()=>{const x=d[p];v!==x&&(h("SCROLL"),c()),v=x};return d.addEventListener("scroll",y),()=>d.removeEventListener("scroll",y)}},[o.viewport,s,h,c]),S.jsx(nn,{present:t||f!=="hidden",children:S.jsx(Cg,{"data-state":f==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:fe(n.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:fe(n.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),cC=w.forwardRef((n,e)=>{const t=Hn(Si,n.__scopeScrollArea),{forceMount:r,...o}=n,[s,c]=w.useState(!1),f=n.orientation==="horizontal",h=xf(()=>{if(t.viewport){const d=t.viewport.offsetWidth<t.viewport.scrollWidth,p=t.viewport.offsetHeight<t.viewport.scrollHeight;c(f?d:p)}},10);return Co(t.viewport,h),Co(t.content,h),S.jsx(nn,{present:r||s,children:S.jsx(Cg,{"data-state":s?"visible":"hidden",...o,ref:e})})}),Cg=w.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,o=Hn(Si,n.__scopeScrollArea),s=w.useRef(null),c=w.useRef(0),[f,h]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=mC(f.viewport,f.content),p={...r,sizes:f,onSizesChange:h,hasThumb:d>0&&d<1,onThumbChange:y=>s.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function v(y,x){return t_(y,c.current,f,x)}return t==="horizontal"?S.jsx(QN,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollLeft,x=Bx(y,f,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=v(y,o.dir))}}):t==="vertical"?S.jsx(ZN,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollTop,x=Bx(y,f);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=v(y))}}):null}),QN=w.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...o}=n,s=Hn(Si,n.__scopeScrollArea),[c,f]=w.useState(),h=w.useRef(null),d=Le(e,h,s.onScrollbarXChange);return w.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),S.jsx(fC,{"data-orientation":"horizontal",...o,ref:d,sizes:t,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":bf(t)+"px",...n.style},onThumbPointerDown:p=>n.onThumbPointerDown(p.x),onDragScroll:p=>n.onDragScroll(p.x),onWheelScroll:(p,v)=>{if(s.viewport){const y=s.viewport.scrollLeft+p.deltaX;n.onWheelScroll(y),gC(y,v)&&p.preventDefault()}},onResize:()=>{h.current&&s.viewport&&c&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:Bu(c.paddingLeft),paddingEnd:Bu(c.paddingRight)}})}})}),ZN=w.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...o}=n,s=Hn(Si,n.__scopeScrollArea),[c,f]=w.useState(),h=w.useRef(null),d=Le(e,h,s.onScrollbarYChange);return w.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),S.jsx(fC,{"data-orientation":"vertical",...o,ref:d,sizes:t,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":bf(t)+"px",...n.style},onThumbPointerDown:p=>n.onThumbPointerDown(p.y),onDragScroll:p=>n.onDragScroll(p.y),onWheelScroll:(p,v)=>{if(s.viewport){const y=s.viewport.scrollTop+p.deltaY;n.onWheelScroll(y),gC(y,v)&&p.preventDefault()}},onResize:()=>{h.current&&s.viewport&&c&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:Bu(c.paddingTop),paddingEnd:Bu(c.paddingBottom)}})}})}),[$N,uC]=rC(Si),fC=w.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:d,onWheelScroll:p,onResize:v,...y}=n,x=Hn(Si,t),[A,C]=w.useState(null),M=Le(e,Z=>C(Z)),T=w.useRef(null),D=w.useRef(""),N=x.viewport,j=r.content-r.viewport,H=Et(p),P=Et(h),_=xf(v,10);function G(Z){if(T.current){const ie=Z.clientX-T.current.left,ne=Z.clientY-T.current.top;d({x:ie,y:ne})}}return w.useEffect(()=>{const Z=ie=>{const ne=ie.target;A?.contains(ne)&&H(ie,j)};return document.addEventListener("wheel",Z,{passive:!1}),()=>document.removeEventListener("wheel",Z,{passive:!1})},[N,A,j,H]),w.useEffect(P,[r,P]),Co(A,_),Co(x.content,_),S.jsx($N,{scope:t,scrollbar:A,hasThumb:o,onThumbChange:Et(s),onThumbPointerUp:Et(c),onThumbPositionChange:P,onThumbPointerDown:Et(f),children:S.jsx(Ce.div,{...y,ref:M,style:{position:"absolute",...y.style},onPointerDown:fe(n.onPointerDown,Z=>{Z.button===0&&(Z.target.setPointerCapture(Z.pointerId),T.current=A.getBoundingClientRect(),D.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),G(Z))}),onPointerMove:fe(n.onPointerMove,G),onPointerUp:fe(n.onPointerUp,Z=>{const ie=Z.target;ie.hasPointerCapture(Z.pointerId)&&ie.releasePointerCapture(Z.pointerId),document.body.style.webkitUserSelect=D.current,x.viewport&&(x.viewport.style.scrollBehavior=""),T.current=null})})})}),_u="ScrollAreaThumb",hC=w.forwardRef((n,e)=>{const{forceMount:t,...r}=n,o=uC(_u,n.__scopeScrollArea);return S.jsx(nn,{present:t||o.hasThumb,children:S.jsx(JN,{ref:e,...r})})}),JN=w.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...o}=n,s=Hn(_u,t),c=uC(_u,t),{onThumbPositionChange:f}=c,h=Le(e,v=>c.onThumbChange(v)),d=w.useRef(void 0),p=xf(()=>{d.current&&(d.current(),d.current=void 0)},100);return w.useEffect(()=>{const v=s.viewport;if(v){const y=()=>{if(p(),!d.current){const x=n_(v,f);d.current=x,f()}};return f(),v.addEventListener("scroll",y),()=>v.removeEventListener("scroll",y)}},[s.viewport,p,f]),S.jsx(Ce.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:fe(n.onPointerDownCapture,v=>{const x=v.target.getBoundingClientRect(),A=v.clientX-x.left,C=v.clientY-x.top;c.onThumbPointerDown({x:A,y:C})}),onPointerUp:fe(n.onPointerUp,c.onThumbPointerUp)})});hC.displayName=_u;var Ag="ScrollAreaCorner",dC=w.forwardRef((n,e)=>{const t=Hn(Ag,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?S.jsx(e_,{...n,ref:e}):null});dC.displayName=Ag;var e_=w.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,o=Hn(Ag,t),[s,c]=w.useState(0),[f,h]=w.useState(0),d=!!(s&&f);return Co(o.scrollbarX,()=>{const p=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(p),h(p)}),Co(o.scrollbarY,()=>{const p=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(p),c(p)}),d?S.jsx(Ce.div,{...r,ref:e,style:{width:s,height:f,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Bu(n){return n?parseInt(n,10):0}function mC(n,e){const t=n/e;return isNaN(t)?0:t}function bf(n){const e=mC(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function t_(n,e,t,r="ltr"){const o=bf(t),s=o/2,c=e||s,f=o-c,h=t.scrollbar.paddingStart+c,d=t.scrollbar.size-t.scrollbar.paddingEnd-f,p=t.content-t.viewport,v=r==="ltr"?[0,p]:[p*-1,0];return pC([h,d],v)(n)}function Bx(n,e,t="ltr"){const r=bf(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-o,c=e.content-e.viewport,f=s-r,h=t==="ltr"?[0,c]:[c*-1,0],d=Qm(n,h);return pC([0,c],[0,f])(d)}function pC(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function gC(n,e){return n>0&&n<e}var n_=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function o(){const s={left:n.scrollLeft,top:n.scrollTop},c=t.left!==s.left,f=t.top!==s.top;(c||f)&&e(),t=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function xf(n,e){const t=Et(n),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Co(n,e){const t=Et(e);jt(()=>{let r=0;if(n){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return o.observe(n),()=>{window.cancelAnimationFrame(r),o.unobserve(n)}}},[n,t])}var i_=lC,r_=sC,l_=dC,o_=[" ","Enter","ArrowUp","ArrowDown"],s_=[" ","Enter"],gl="Select",[Sf,wf,a_]=Qp(gl),[zo]=bi(gl,[a_,Bo]),Cf=Bo(),[c_,zr]=zo(gl),[u_,f_]=zo(gl),vC=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:o,onOpenChange:s,value:c,defaultValue:f,onValueChange:h,dir:d,name:p,autoComplete:v,disabled:y,required:x,form:A}=n,C=Cf(e),[M,T]=w.useState(null),[D,N]=w.useState(null),[j,H]=w.useState(!1),P=da(d),[_,G]=dl({prop:r,defaultProp:o??!1,onChange:s,caller:gl}),[Z,ie]=dl({prop:c,defaultProp:f,onChange:h,caller:gl}),ne=w.useRef(null),ee=M?A||!!M.closest("form"):!0,[se,oe]=w.useState(new Set),ae=Array.from(se).map(R=>R.props.value).join(";");return S.jsx(ug,{...C,children:S.jsxs(c_,{required:x,scope:e,trigger:M,onTriggerChange:T,valueNode:D,onValueNodeChange:N,valueNodeHasChildren:j,onValueNodeHasChildrenChange:H,contentId:_n(),value:Z,onValueChange:ie,open:_,onOpenChange:G,dir:P,triggerPointerDownPosRef:ne,disabled:y,children:[S.jsx(Sf.Provider,{scope:e,children:S.jsx(u_,{scope:n.__scopeSelect,onNativeOptionAdd:w.useCallback(R=>{oe(z=>new Set(z).add(R))},[]),onNativeOptionRemove:w.useCallback(R=>{oe(z=>{const L=new Set(z);return L.delete(R),L})},[]),children:t})}),ee?S.jsxs(UC,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:v,value:Z,onChange:R=>ie(R.target.value),disabled:y,form:A,children:[Z===void 0?S.jsx("option",{value:""}):null,Array.from(se)]},ae):null]})})};vC.displayName=gl;var yC="SelectTrigger",bC=w.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...o}=n,s=Cf(t),c=zr(yC,t),f=c.disabled||r,h=Le(e,c.onTriggerChange),d=wf(t),p=w.useRef("touch"),[v,y,x]=VC(C=>{const M=d().filter(N=>!N.disabled),T=M.find(N=>N.value===c.value),D=IC(M,C,T);D!==void 0&&c.onValueChange(D.value)}),A=C=>{f||(c.onOpenChange(!0),x()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return S.jsx(fg,{asChild:!0,...s,children:S.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":PC(c.value)?"":void 0,...o,ref:h,onClick:fe(o.onClick,C=>{C.currentTarget.focus(),p.current!=="mouse"&&A(C)}),onPointerDown:fe(o.onPointerDown,C=>{p.current=C.pointerType;const M=C.target;M.hasPointerCapture(C.pointerId)&&M.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(A(C),C.preventDefault())}),onKeyDown:fe(o.onKeyDown,C=>{const M=v.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&y(C.key),!(M&&C.key===" ")&&o_.includes(C.key)&&(A(),C.preventDefault())})})})});bC.displayName=yC;var xC="SelectValue",SC=w.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:o,children:s,placeholder:c="",...f}=n,h=zr(xC,t),{onValueNodeHasChildrenChange:d}=h,p=s!==void 0,v=Le(e,h.onValueNodeChange);return jt(()=>{d(p)},[d,p]),S.jsx(Ce.span,{...f,ref:v,style:{pointerEvents:"none"},children:PC(h.value)?S.jsx(S.Fragment,{children:c}):s})});SC.displayName=xC;var h_="SelectIcon",wC=w.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...o}=n;return S.jsx(Ce.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});wC.displayName=h_;var d_="SelectPortal",CC=n=>S.jsx(af,{asChild:!0,...n});CC.displayName=d_;var vl="SelectContent",AC=w.forwardRef((n,e)=>{const t=zr(vl,n.__scopeSelect),[r,o]=w.useState();if(jt(()=>{o(new DocumentFragment)},[]),!t.open){const s=r;return s?ha.createPortal(S.jsx(EC,{scope:n.__scopeSelect,children:S.jsx(Sf.Slot,{scope:n.__scopeSelect,children:S.jsx("div",{children:n.children})})}),s):null}return S.jsx(MC,{...n,ref:e})});AC.displayName=vl;var Gn=10,[EC,Lr]=zo(vl),m_="SelectContentImpl",p_=hl("SelectContent.RemoveScroll"),MC=w.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:c,side:f,sideOffset:h,align:d,alignOffset:p,arrowPadding:v,collisionBoundary:y,collisionPadding:x,sticky:A,hideWhenDetached:C,avoidCollisions:M,...T}=n,D=zr(vl,t),[N,j]=w.useState(null),[H,P]=w.useState(null),_=Le(e,J=>j(J)),[G,Z]=w.useState(null),[ie,ne]=w.useState(null),ee=wf(t),[se,oe]=w.useState(!1),ae=w.useRef(!1);w.useEffect(()=>{if(N)return $p(N)},[N]),Zp();const R=w.useCallback(J=>{const[Ae,...Me]=ee().map(Ye=>Ye.ref.current),[Ne]=Me.slice(-1),He=document.activeElement;for(const Ye of J)if(Ye===He||(Ye?.scrollIntoView({block:"nearest"}),Ye===Ae&&H&&(H.scrollTop=0),Ye===Ne&&H&&(H.scrollTop=H.scrollHeight),Ye?.focus(),document.activeElement!==He))return},[ee,H]),z=w.useCallback(()=>R([G,N]),[R,G,N]);w.useEffect(()=>{se&&z()},[se,z]);const{onOpenChange:L,triggerPointerDownPosRef:F}=D;w.useEffect(()=>{if(N){let J={x:0,y:0};const Ae=Ne=>{J={x:Math.abs(Math.round(Ne.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(Ne.pageY)-(F.current?.y??0))}},Me=Ne=>{J.x<=10&&J.y<=10?Ne.preventDefault():N.contains(Ne.target)||L(!1),document.removeEventListener("pointermove",Ae),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",Ae),document.addEventListener("pointerup",Me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ae),document.removeEventListener("pointerup",Me,{capture:!0})}}},[N,L,F]),w.useEffect(()=>{const J=()=>L(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[L]);const[ue,k]=VC(J=>{const Ae=ee().filter(He=>!He.disabled),Me=Ae.find(He=>He.ref.current===document.activeElement),Ne=IC(Ae,J,Me);Ne&&setTimeout(()=>Ne.ref.current.focus())}),Y=w.useCallback((J,Ae,Me)=>{const Ne=!ae.current&&!Me;(D.value!==void 0&&D.value===Ae||Ne)&&(Z(J),Ne&&(ae.current=!0))},[D.value]),te=w.useCallback(()=>N?.focus(),[N]),re=w.useCallback((J,Ae,Me)=>{const Ne=!ae.current&&!Me;(D.value!==void 0&&D.value===Ae||Ne)&&ne(J)},[D.value]),me=r==="popper"?Zm:TC,ye=me===Zm?{side:f,sideOffset:h,align:d,alignOffset:p,arrowPadding:v,collisionBoundary:y,collisionPadding:x,sticky:A,hideWhenDetached:C,avoidCollisions:M}:{};return S.jsx(EC,{scope:t,content:N,viewport:H,onViewportChange:P,itemRefCallback:Y,selectedItem:G,onItemLeave:te,itemTextRefCallback:re,focusSelectedItem:z,selectedItemText:ie,position:r,isPositioned:se,searchRef:ue,children:S.jsx(uf,{as:p_,allowPinchZoom:!0,children:S.jsx(sf,{asChild:!0,trapped:D.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:fe(o,J=>{D.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:S.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>D.onOpenChange(!1),children:S.jsx(me,{role:"listbox",id:D.contentId,"data-state":D.open?"open":"closed",dir:D.dir,onContextMenu:J=>J.preventDefault(),...T,...ye,onPlaced:()=>oe(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:fe(T.onKeyDown,J=>{const Ae=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!Ae&&J.key.length===1&&k(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ne=ee().filter(He=>!He.disabled).map(He=>He.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const He=J.target,Ye=Ne.indexOf(He);Ne=Ne.slice(Ye+1)}setTimeout(()=>R(Ne)),J.preventDefault()}})})})})})})});MC.displayName=m_;var g_="SelectItemAlignedPosition",TC=w.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...o}=n,s=zr(vl,t),c=Lr(vl,t),[f,h]=w.useState(null),[d,p]=w.useState(null),v=Le(e,_=>p(_)),y=wf(t),x=w.useRef(!1),A=w.useRef(!0),{viewport:C,selectedItem:M,selectedItemText:T,focusSelectedItem:D}=c,N=w.useCallback(()=>{if(s.trigger&&s.valueNode&&f&&d&&C&&M&&T){const _=s.trigger.getBoundingClientRect(),G=d.getBoundingClientRect(),Z=s.valueNode.getBoundingClientRect(),ie=T.getBoundingClientRect();if(s.dir!=="rtl"){const He=ie.left-G.left,Ye=Z.left-He,It=_.left-Ye,Gt=_.width+It,Ur=Math.max(Gt,G.width),Pr=window.innerWidth-Gn,Uo=Qm(Ye,[Gn,Math.max(Gn,Pr-Ur)]);f.style.minWidth=Gt+"px",f.style.left=Uo+"px"}else{const He=G.right-ie.right,Ye=window.innerWidth-Z.right-He,It=window.innerWidth-_.right-Ye,Gt=_.width+It,Ur=Math.max(Gt,G.width),Pr=window.innerWidth-Gn,Uo=Qm(Ye,[Gn,Math.max(Gn,Pr-Ur)]);f.style.minWidth=Gt+"px",f.style.right=Uo+"px"}const ne=y(),ee=window.innerHeight-Gn*2,se=C.scrollHeight,oe=window.getComputedStyle(d),ae=parseInt(oe.borderTopWidth,10),R=parseInt(oe.paddingTop,10),z=parseInt(oe.borderBottomWidth,10),L=parseInt(oe.paddingBottom,10),F=ae+R+se+L+z,ue=Math.min(M.offsetHeight*5,F),k=window.getComputedStyle(C),Y=parseInt(k.paddingTop,10),te=parseInt(k.paddingBottom,10),re=_.top+_.height/2-Gn,me=ee-re,ye=M.offsetHeight/2,J=M.offsetTop+ye,Ae=ae+R+J,Me=F-Ae;if(Ae<=re){const He=ne.length>0&&M===ne[ne.length-1].ref.current;f.style.bottom="0px";const Ye=d.clientHeight-C.offsetTop-C.offsetHeight,It=Math.max(me,ye+(He?te:0)+Ye+z),Gt=Ae+It;f.style.height=Gt+"px"}else{const He=ne.length>0&&M===ne[0].ref.current;f.style.top="0px";const It=Math.max(re,ae+C.offsetTop+(He?Y:0)+ye)+Me;f.style.height=It+"px",C.scrollTop=Ae-re+C.offsetTop}f.style.margin=`${Gn}px 0`,f.style.minHeight=ue+"px",f.style.maxHeight=ee+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[y,s.trigger,s.valueNode,f,d,C,M,T,s.dir,r]);jt(()=>N(),[N]);const[j,H]=w.useState();jt(()=>{d&&H(window.getComputedStyle(d).zIndex)},[d]);const P=w.useCallback(_=>{_&&A.current===!0&&(N(),D?.(),A.current=!1)},[N,D]);return S.jsx(y_,{scope:t,contentWrapper:f,shouldExpandOnScrollRef:x,onScrollButtonChange:P,children:S.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:S.jsx(Ce.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});TC.displayName=g_;var v_="SelectPopperPosition",Zm=w.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:o=Gn,...s}=n,c=Cf(t);return S.jsx(hg,{...c,...s,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Zm.displayName=v_;var[y_,Eg]=zo(vl,{}),$m="SelectViewport",kC=w.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:r,...o}=n,s=Lr($m,t),c=Eg($m,t),f=Le(e,s.onViewportChange),h=w.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(Sf.Slot,{scope:t,children:S.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:fe(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:y}=c;if(y?.current&&v){const x=Math.abs(h.current-p.scrollTop);if(x>0){const A=window.innerHeight-Gn*2,C=parseFloat(v.style.minHeight),M=parseFloat(v.style.height),T=Math.max(C,M);if(T<A){const D=T+x,N=Math.min(A,D),j=D-N;v.style.height=N+"px",v.style.bottom==="0px"&&(p.scrollTop=j>0?j:0,v.style.justifyContent="flex-end")}}}h.current=p.scrollTop})})})]})});kC.displayName=$m;var OC="SelectGroup",[b_,x_]=zo(OC),S_=w.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,o=_n();return S.jsx(b_,{scope:t,id:o,children:S.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:e})})});S_.displayName=OC;var RC="SelectLabel",w_=w.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,o=x_(RC,t);return S.jsx(Ce.div,{id:o.id,...r,ref:e})});w_.displayName=RC;var zu="SelectItem",[C_,DC]=zo(zu),NC=w.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:o=!1,textValue:s,...c}=n,f=zr(zu,t),h=Lr(zu,t),d=f.value===r,[p,v]=w.useState(s??""),[y,x]=w.useState(!1),A=Le(e,D=>h.itemRefCallback?.(D,r,o)),C=_n(),M=w.useRef("touch"),T=()=>{o||(f.onValueChange(r),f.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(C_,{scope:t,value:r,disabled:o,textId:C,isSelected:d,onItemTextChange:w.useCallback(D=>{v(N=>N||(D?.textContent??"").trim())},[]),children:S.jsx(Sf.ItemSlot,{scope:t,value:r,disabled:o,textValue:p,children:S.jsx(Ce.div,{role:"option","aria-labelledby":C,"data-highlighted":y?"":void 0,"aria-selected":d&&y,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:A,onFocus:fe(c.onFocus,()=>x(!0)),onBlur:fe(c.onBlur,()=>x(!1)),onClick:fe(c.onClick,()=>{M.current!=="mouse"&&T()}),onPointerUp:fe(c.onPointerUp,()=>{M.current==="mouse"&&T()}),onPointerDown:fe(c.onPointerDown,D=>{M.current=D.pointerType}),onPointerMove:fe(c.onPointerMove,D=>{M.current=D.pointerType,o?h.onItemLeave?.():M.current==="mouse"&&D.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(c.onPointerLeave,D=>{D.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:fe(c.onKeyDown,D=>{h.searchRef?.current!==""&&D.key===" "||(s_.includes(D.key)&&T(),D.key===" "&&D.preventDefault())})})})})});NC.displayName=zu;var Is="SelectItemText",_C=w.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:o,...s}=n,c=zr(Is,t),f=Lr(Is,t),h=DC(Is,t),d=f_(Is,t),[p,v]=w.useState(null),y=Le(e,T=>v(T),h.onItemTextChange,T=>f.itemTextRefCallback?.(T,h.value,h.disabled)),x=p?.textContent,A=w.useMemo(()=>S.jsx("option",{value:h.value,disabled:h.disabled,children:x},h.value),[h.disabled,h.value,x]),{onNativeOptionAdd:C,onNativeOptionRemove:M}=d;return jt(()=>(C(A),()=>M(A)),[C,M,A]),S.jsxs(S.Fragment,{children:[S.jsx(Ce.span,{id:h.textId,...s,ref:y}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?ha.createPortal(s.children,c.valueNode):null]})});_C.displayName=Is;var BC="SelectItemIndicator",zC=w.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return DC(BC,t).isSelected?S.jsx(Ce.span,{"aria-hidden":!0,...r,ref:e}):null});zC.displayName=BC;var Jm="SelectScrollUpButton",LC=w.forwardRef((n,e)=>{const t=Lr(Jm,n.__scopeSelect),r=Eg(Jm,n.__scopeSelect),[o,s]=w.useState(!1),c=Le(e,r.onScrollButtonChange);return jt(()=>{if(t.viewport&&t.isPositioned){let f=function(){const d=h.scrollTop>0;s(d)};const h=t.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[t.viewport,t.isPositioned]),o?S.jsx(HC,{...n,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=t;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});LC.displayName=Jm;var ep="SelectScrollDownButton",jC=w.forwardRef((n,e)=>{const t=Lr(ep,n.__scopeSelect),r=Eg(ep,n.__scopeSelect),[o,s]=w.useState(!1),c=Le(e,r.onScrollButtonChange);return jt(()=>{if(t.viewport&&t.isPositioned){let f=function(){const d=h.scrollHeight-h.clientHeight,p=Math.ceil(h.scrollTop)<d;s(p)};const h=t.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[t.viewport,t.isPositioned]),o?S.jsx(HC,{...n,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=t;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});jC.displayName=ep;var HC=w.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:r,...o}=n,s=Lr("SelectScrollButton",t),c=w.useRef(null),f=wf(t),h=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>h(),[h]),jt(()=>{f().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),S.jsx(Ce.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:fe(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:fe(o.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:fe(o.onPointerLeave,()=>{h()})})}),A_="SelectSeparator",E_=w.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return S.jsx(Ce.div,{"aria-hidden":!0,...r,ref:e})});E_.displayName=A_;var tp="SelectArrow",M_=w.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,o=Cf(t),s=zr(tp,t),c=Lr(tp,t);return s.open&&c.position==="popper"?S.jsx(dg,{...o,...r,ref:e}):null});M_.displayName=tp;var T_="SelectBubbleInput",UC=w.forwardRef(({__scopeSelect:n,value:e,...t},r)=>{const o=w.useRef(null),s=Le(r,o),c=XO(e);return w.useEffect(()=>{const f=o.current;if(!f)return;const h=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==e&&p){const v=new Event("change",{bubbles:!0});p.call(f,e),f.dispatchEvent(v)}},[c,e]),S.jsx(Ce.select,{...t,style:{...xS,...t.style},ref:s,defaultValue:e})});UC.displayName=T_;function PC(n){return n===""||n===void 0}function VC(n){const e=Et(n),t=w.useRef(""),r=w.useRef(0),o=w.useCallback(c=>{const f=t.current+c;e(f),(function h(d){t.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(f)},[e]),s=w.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,o,s]}function IC(n,e,t){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let c=k_(n,Math.max(s,0));o.length===1&&(c=c.filter(d=>d!==t));const h=c.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return h!==t?h:void 0}function k_(n,e){return n.map((t,r)=>n[(e+r)%n.length])}var O_=vC,R_=bC,D_=SC,N_=wC,__=CC,B_=AC,z_=kC,L_=NC,j_=_C,H_=zC,U_=LC,P_=jC,V_="Separator",zx="horizontal",I_=["horizontal","vertical"],GC=w.forwardRef((n,e)=>{const{decorative:t,orientation:r=zx,...o}=n,s=G_(r)?r:zx,f=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return S.jsx(Ce.div,{"data-orientation":s,...f,...o,ref:e})});GC.displayName=V_;function G_(n){return I_.includes(n)}var q_=GC,Af="Tabs",[Y_]=bi(Af,[gf]),qC=gf(),[F_,Mg]=Y_(Af),YC=w.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,onValueChange:o,defaultValue:s,orientation:c="horizontal",dir:f,activationMode:h="automatic",...d}=n,p=da(f),[v,y]=dl({prop:r,onChange:o,defaultProp:s??"",caller:Af});return S.jsx(F_,{scope:t,baseId:_n(),value:v,onValueChange:y,orientation:c,dir:p,activationMode:h,children:S.jsx(Ce.div,{dir:p,"data-orientation":c,...d,ref:e})})});YC.displayName=Af;var FC="TabsList",KC=w.forwardRef((n,e)=>{const{__scopeTabs:t,loop:r=!0,...o}=n,s=Mg(FC,t),c=qC(t);return S.jsx(Sw,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:r,children:S.jsx(Ce.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:e})})});KC.displayName=FC;var WC="TabsTrigger",XC=w.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,disabled:o=!1,...s}=n,c=Mg(WC,t),f=qC(t),h=$C(c.baseId,r),d=JC(c.baseId,r),p=r===c.value;return S.jsx(ww,{asChild:!0,...f,focusable:!o,active:p,children:S.jsx(Ce.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:h,...s,ref:e,onMouseDown:fe(n.onMouseDown,v=>{!o&&v.button===0&&v.ctrlKey===!1?c.onValueChange(r):v.preventDefault()}),onKeyDown:fe(n.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&c.onValueChange(r)}),onFocus:fe(n.onFocus,()=>{const v=c.activationMode!=="manual";!p&&!o&&v&&c.onValueChange(r)})})})});XC.displayName=WC;var QC="TabsContent",ZC=w.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,forceMount:o,children:s,...c}=n,f=Mg(QC,t),h=$C(f.baseId,r),d=JC(f.baseId,r),p=r===f.value,v=w.useRef(p);return w.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),S.jsx(nn,{present:o||p,children:({present:y})=>S.jsx(Ce.div,{"data-state":p?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":h,hidden:!y,id:d,tabIndex:0,...c,ref:e,style:{...n.style,animationDuration:v.current?"0s":void 0},children:y&&s})})});ZC.displayName=QC;function $C(n,e){return`${n}-trigger-${e}`}function JC(n,e){return`${n}-content-${e}`}var K_=YC,W_=KC,X_=XC,Q_=ZC,[Ef]=bi("Tooltip",[Bo]),Tg=Bo(),eA="TooltipProvider",Z_=700,Lx="tooltip.open",[$_,tA]=Ef(eA),nA=n=>{const{__scopeTooltip:e,delayDuration:t=Z_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=n,c=w.useRef(!0),f=w.useRef(!1),h=w.useRef(0);return w.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),S.jsx($_,{scope:e,isOpenDelayedRef:c,delayDuration:t,onOpen:w.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(d=>{f.current=d},[]),disableHoverableContent:o,children:s})};nA.displayName=eA;var iA="Tooltip",[x8,Mf]=Ef(iA),np="TooltipTrigger",J_=w.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,o=Mf(np,t),s=tA(np,t),c=Tg(t),f=w.useRef(null),h=Le(e,f,o.onTriggerChange),d=w.useRef(!1),p=w.useRef(!1),v=w.useCallback(()=>d.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),S.jsx(fg,{asChild:!0,...c,children:S.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:h,onPointerMove:fe(n.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:fe(n.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:fe(n.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:fe(n.onFocus,()=>{d.current||o.onOpen()}),onBlur:fe(n.onBlur,o.onClose),onClick:fe(n.onClick,o.onClose)})})});J_.displayName=np;var e3="TooltipPortal",[S8,t3]=Ef(e3,{forceMount:void 0}),Ao="TooltipContent",n3=w.forwardRef((n,e)=>{const t=t3(Ao,n.__scopeTooltip),{forceMount:r=t.forceMount,side:o="top",...s}=n,c=Mf(Ao,n.__scopeTooltip);return S.jsx(nn,{present:r||c.open,children:c.disableHoverableContent?S.jsx(rA,{side:o,...s,ref:e}):S.jsx(i3,{side:o,...s,ref:e})})}),i3=w.forwardRef((n,e)=>{const t=Mf(Ao,n.__scopeTooltip),r=tA(Ao,n.__scopeTooltip),o=w.useRef(null),s=Le(e,o),[c,f]=w.useState(null),{trigger:h,onClose:d}=t,p=o.current,{onPointerInTransitChange:v}=r,y=w.useCallback(()=>{f(null),v(!1)},[v]),x=w.useCallback((A,C)=>{const M=A.currentTarget,T={x:A.clientX,y:A.clientY},D=a3(T,M.getBoundingClientRect()),N=c3(T,D),j=u3(C.getBoundingClientRect()),H=h3([...N,...j]);f(H),v(!0)},[v]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(h&&p){const A=M=>x(M,p),C=M=>x(M,h);return h.addEventListener("pointerleave",A),p.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",A),p.removeEventListener("pointerleave",C)}}},[h,p,x,y]),w.useEffect(()=>{if(c){const A=C=>{const M=C.target,T={x:C.clientX,y:C.clientY},D=h?.contains(M)||p?.contains(M),N=!f3(T,c);D?y():N&&(y(),d())};return document.addEventListener("pointermove",A),()=>document.removeEventListener("pointermove",A)}},[h,p,c,d,y]),S.jsx(rA,{...n,ref:s})}),[r3,l3]=Ef(iA,{isInside:!1}),o3=mk("TooltipContent"),rA=w.forwardRef((n,e)=>{const{__scopeTooltip:t,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...f}=n,h=Mf(Ao,t),d=Tg(t),{onClose:p}=h;return w.useEffect(()=>(document.addEventListener(Lx,p),()=>document.removeEventListener(Lx,p)),[p]),w.useEffect(()=>{if(h.trigger){const v=y=>{y.target?.contains(h.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[h.trigger,p]),S.jsx(ma,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:S.jsxs(hg,{"data-state":h.stateAttribute,...d,...f,ref:e,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(o3,{children:r}),S.jsx(r3,{scope:t,isInside:!0,children:S.jsx(xk,{id:h.contentId,role:"tooltip",children:o||r})})]})})});n3.displayName=Ao;var lA="TooltipArrow",s3=w.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,o=Tg(t);return l3(lA,t).isInside?null:S.jsx(dg,{...o,...r,ref:e})});s3.displayName=lA;function a3(n,e){const t=Math.abs(e.top-n.y),r=Math.abs(e.bottom-n.y),o=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,r,o,s)){case s:return"left";case o:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function c3(n,e,t=5){const r=[];switch(e){case"top":r.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":r.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":r.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":r.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return r}function u3(n){const{top:e,right:t,bottom:r,left:o}=n;return[{x:o,y:e},{x:t,y:e},{x:t,y:r},{x:o,y:r}]}function f3(n,e){const{x:t,y:r}=n;let o=!1;for(let s=0,c=e.length-1;s<e.length;c=s++){const f=e[s],h=e[c],d=f.x,p=f.y,v=h.x,y=h.y;p>r!=y>r&&t<(v-d)*(r-p)/(y-p)+d&&(o=!o)}return o}function h3(n){const e=n.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),d3(e)}function d3(n){if(n.length<=1)return n.slice();const e=[];for(let r=0;r<n.length;r++){const o=n[r];for(;e.length>=2;){const s=e[e.length-1],c=e[e.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))e.pop();else break}e.push(o)}e.pop();const t=[];for(let r=n.length-1;r>=0;r--){const o=n[r];for(;t.length>=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var m3=nA;function oA(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(e=0;e<o;e++)n[e]&&(t=oA(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function sA(){for(var n,e,t=0,r="",o=arguments.length;t<o;t++)(n=arguments[t])&&(e=oA(n))&&(r&&(r+=" "),r+=e);return r}const p3=(n,e)=>{const t=new Array(n.length+e.length);for(let r=0;r<n.length;r++)t[r]=n[r];for(let r=0;r<e.length;r++)t[n.length+r]=e[r];return t},g3=(n,e)=>({classGroupId:n,validator:e}),aA=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),Lu="-",jx=[],v3="arbitrary..",y3=n=>{const e=x3(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return b3(c);const f=c.split(Lu),h=f[0]===""&&f.length>1?1:0;return cA(f,h,e)},getConflictingClassGroupIds:(c,f)=>{if(f){const h=r[c],d=t[c];return h?d?p3(d,h):h:d||jx}return t[c]||jx}}},cA=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const o=n[e],s=t.nextPart.get(o);if(s){const d=cA(n,e+1,s);if(d)return d}const c=t.validators;if(c===null)return;const f=e===0?n.join(Lu):n.slice(e).join(Lu),h=c.length;for(let d=0;d<h;d++){const p=c[d];if(p.validator(f))return p.classGroupId}},b3=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),r=e.slice(0,t);return r?v3+r:void 0})(),x3=n=>{const{theme:e,classGroups:t}=n;return S3(t,e)},S3=(n,e)=>{const t=aA();for(const r in n){const o=n[r];kg(o,t,r,e)}return t},kg=(n,e,t,r)=>{const o=n.length;for(let s=0;s<o;s++){const c=n[s];w3(c,e,t,r)}},w3=(n,e,t,r)=>{if(typeof n=="string"){C3(n,e,t);return}if(typeof n=="function"){A3(n,e,t,r);return}E3(n,e,t,r)},C3=(n,e,t)=>{const r=n===""?e:uA(e,n);r.classGroupId=t},A3=(n,e,t,r)=>{if(M3(n)){kg(n(r),e,t,r);return}e.validators===null&&(e.validators=[]),e.validators.push(g3(t,n))},E3=(n,e,t,r)=>{const o=Object.entries(n),s=o.length;for(let c=0;c<s;c++){const[f,h]=o[c];kg(h,uA(e,f),t,r)}},uA=(n,e)=>{let t=n;const r=e.split(Lu),o=r.length;for(let s=0;s<o;s++){const c=r[s];let f=t.nextPart.get(c);f||(f=aA(),t.nextPart.set(c,f)),t=f}return t},M3=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,T3=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),r=Object.create(null);const o=(s,c)=>{t[s]=c,e++,e>n&&(e=0,r=t,t=Object.create(null))};return{get(s){let c=t[s];if(c!==void 0)return c;if((c=r[s])!==void 0)return o(s,c),c},set(s,c){s in t?t[s]=c:o(s,c)}}},ip="!",Hx=":",k3=[],Ux=(n,e,t,r,o)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:r,isExternal:o}),O3=n=>{const{prefix:e,experimentalParseClassName:t}=n;let r=o=>{const s=[];let c=0,f=0,h=0,d;const p=o.length;for(let C=0;C<p;C++){const M=o[C];if(c===0&&f===0){if(M===Hx){s.push(o.slice(h,C)),h=C+1;continue}if(M==="/"){d=C;continue}}M==="["?c++:M==="]"?c--:M==="("?f++:M===")"&&f--}const v=s.length===0?o:o.slice(h);let y=v,x=!1;v.endsWith(ip)?(y=v.slice(0,-1),x=!0):v.startsWith(ip)&&(y=v.slice(1),x=!0);const A=d&&d>h?d-h:void 0;return Ux(s,x,y,A)};if(e){const o=e+Hx,s=r;r=c=>c.startsWith(o)?s(c.slice(o.length)):Ux(k3,!1,c,void 0,!0)}if(t){const o=r;r=s=>t({className:s,parseClassName:o})}return r},R3=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,r)=>{e.set(t,1e6+r)}),t=>{const r=[];let o=[];for(let s=0;s<t.length;s++){const c=t[s],f=c[0]==="[",h=e.has(c);f||h?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(c)):o.push(c)}return o.length>0&&(o.sort(),r.push(...o)),r}},D3=n=>({cache:T3(n.cacheSize),parseClassName:O3(n),sortModifiers:R3(n),...y3(n)}),N3=/\s+/,_3=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=e,c=[],f=n.trim().split(N3);let h="";for(let d=f.length-1;d>=0;d-=1){const p=f[d],{isExternal:v,modifiers:y,hasImportantModifier:x,baseClassName:A,maybePostfixModifierPosition:C}=t(p);if(v){h=p+(h.length>0?" "+h:h);continue}let M=!!C,T=r(M?A.substring(0,C):A);if(!T){if(!M){h=p+(h.length>0?" "+h:h);continue}if(T=r(A),!T){h=p+(h.length>0?" "+h:h);continue}M=!1}const D=y.length===0?"":y.length===1?y[0]:s(y).join(":"),N=x?D+ip:D,j=N+T;if(c.indexOf(j)>-1)continue;c.push(j);const H=o(T,M);for(let P=0;P<H.length;++P){const _=H[P];c.push(N+_)}h=p+(h.length>0?" "+h:h)}return h},B3=(...n)=>{let e=0,t,r,o="";for(;e<n.length;)(t=n[e++])&&(r=fA(t))&&(o&&(o+=" "),o+=r);return o},fA=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=fA(n[r]))&&(t&&(t+=" "),t+=e);return t},z3=(n,...e)=>{let t,r,o,s;const c=h=>{const d=e.reduce((p,v)=>v(p),n());return t=D3(d),r=t.cache.get,o=t.cache.set,s=f,f(h)},f=h=>{const d=r(h);if(d)return d;const p=_3(h,t);return o(h,p),p};return s=c,(...h)=>s(B3(...h))},L3=[],xt=n=>{const e=t=>t[n]||L3;return e.isThemeGetter=!0,e},hA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j3=/^\d+\/\d+$/,H3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,U3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,V3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fo=n=>j3.test(n),Oe=n=>!!n&&!Number.isNaN(Number(n)),br=n=>!!n&&Number.isInteger(Number(n)),bm=n=>n.endsWith("%")&&Oe(n.slice(0,-1)),Pi=n=>H3.test(n),G3=()=>!0,q3=n=>U3.test(n)&&!P3.test(n),mA=()=>!1,Y3=n=>V3.test(n),F3=n=>I3.test(n),K3=n=>!pe(n)&&!ge(n),W3=n=>Lo(n,vA,mA),pe=n=>hA.test(n),ll=n=>Lo(n,yA,q3),xm=n=>Lo(n,J3,Oe),Px=n=>Lo(n,pA,mA),X3=n=>Lo(n,gA,F3),Xc=n=>Lo(n,bA,Y3),ge=n=>dA.test(n),Bs=n=>jo(n,yA),Q3=n=>jo(n,eB),Vx=n=>jo(n,pA),Z3=n=>jo(n,vA),$3=n=>jo(n,gA),Qc=n=>jo(n,bA,!0),Lo=(n,e,t)=>{const r=hA.exec(n);return r?r[1]?e(r[1]):t(r[2]):!1},jo=(n,e,t=!1)=>{const r=dA.exec(n);return r?r[1]?e(r[1]):t:!1},pA=n=>n==="position"||n==="percentage",gA=n=>n==="image"||n==="url",vA=n=>n==="length"||n==="size"||n==="bg-size",yA=n=>n==="length",J3=n=>n==="number",eB=n=>n==="family-name",bA=n=>n==="shadow",tB=()=>{const n=xt("color"),e=xt("font"),t=xt("text"),r=xt("font-weight"),o=xt("tracking"),s=xt("leading"),c=xt("breakpoint"),f=xt("container"),h=xt("spacing"),d=xt("radius"),p=xt("shadow"),v=xt("inset-shadow"),y=xt("text-shadow"),x=xt("drop-shadow"),A=xt("blur"),C=xt("perspective"),M=xt("aspect"),T=xt("ease"),D=xt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],H=()=>[...j(),ge,pe],P=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],G=()=>[ge,pe,h],Z=()=>[fo,"full","auto",...G()],ie=()=>[br,"none","subgrid",ge,pe],ne=()=>["auto",{span:["full",br,ge,pe]},br,ge,pe],ee=()=>[br,"auto",ge,pe],se=()=>["auto","min","max","fr",ge,pe],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...G()],z=()=>[fo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],L=()=>[n,ge,pe],F=()=>[...j(),Vx,Px,{position:[ge,pe]}],ue=()=>["no-repeat",{repeat:["","x","y","space","round"]}],k=()=>["auto","cover","contain",Z3,W3,{size:[ge,pe]}],Y=()=>[bm,Bs,ll],te=()=>["","none","full",d,ge,pe],re=()=>["",Oe,Bs,ll],me=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[Oe,bm,Vx,Px],Ae=()=>["","none",A,ge,pe],Me=()=>["none",Oe,ge,pe],Ne=()=>["none",Oe,ge,pe],He=()=>[Oe,ge,pe],Ye=()=>[fo,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pi],breakpoint:[Pi],color:[G3],container:[Pi],"drop-shadow":[Pi],ease:["in","out","in-out"],font:[K3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pi],shadow:[Pi],spacing:["px",Oe],text:[Pi],"text-shadow":[Pi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fo,pe,ge,M]}],container:["container"],columns:[{columns:[Oe,pe,ge,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:H()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{start:Z()}],end:[{end:Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[br,"auto",ge,pe]}],basis:[{basis:[fo,"full","auto",f,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,fo,"auto","initial","none",pe]}],grow:[{grow:["",Oe,ge,pe]}],shrink:[{shrink:["",Oe,ge,pe]}],order:[{order:[br,"first","last","none",ge,pe]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[f,"screen",...z()]}],"min-w":[{"min-w":[f,"screen","none",...z()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",t,Bs,ll]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ge,xm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bm,pe]}],"font-family":[{font:[Q3,pe,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ge,pe]}],"line-clamp":[{"line-clamp":[Oe,"none",ge,xm]}],leading:[{leading:[s,...G()]}],"list-image":[{"list-image":["none",ge,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ge,ll]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Oe,"auto",ge,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:k()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},br,ge,pe],radial:["",ge,pe],conic:[br,ge,pe]},$3,X3]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ge,pe]}],"outline-w":[{outline:["",Oe,Bs,ll]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,Qc,Xc]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",v,Qc,Xc]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Oe,ll]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,Qc,Xc]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Oe,ge,pe]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ge,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:k()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,pe]}],filter:[{filter:["","none",ge,pe]}],blur:[{blur:Ae()}],brightness:[{brightness:[Oe,ge,pe]}],contrast:[{contrast:[Oe,ge,pe]}],"drop-shadow":[{"drop-shadow":["","none",x,Qc,Xc]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Oe,ge,pe]}],"hue-rotate":[{"hue-rotate":[Oe,ge,pe]}],invert:[{invert:["",Oe,ge,pe]}],saturate:[{saturate:[Oe,ge,pe]}],sepia:[{sepia:["",Oe,ge,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,pe]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ge,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ge,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ge,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ge,pe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ge,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ge,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ge,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ge,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ge,pe]}],ease:[{ease:["linear","initial",T,ge,pe]}],delay:[{delay:[Oe,ge,pe]}],animate:[{animate:["none",D,ge,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ge,pe]}],"perspective-origin":[{"perspective-origin":H()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[ge,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:H()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ye()}],"translate-x":[{"translate-x":Ye()}],"translate-y":[{"translate-y":Ye()}],"translate-z":[{"translate-z":Ye()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,pe]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Oe,Bs,ll,xm]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nB=z3(tB);function et(...n){return nB(sA(n))}function iB({delayDuration:n=0,...e}){return S.jsx(m3,{"data-slot":"tooltip-provider",delayDuration:n,...e})}function Ix({direction:n,onDrag:e}){const t=w.useRef(!1),r=w.useRef(0),o=w.useCallback(h=>{t.current=!0,r.current=n==="horizontal"?h.clientX:h.clientY,h.target.setPointerCapture(h.pointerId)},[n]),s=w.useCallback(h=>{if(!t.current)return;const d=n==="horizontal"?h.clientX:h.clientY;e(d-r.current),r.current=d},[n,e]),c=w.useCallback(()=>{t.current=!1},[]),f=n==="horizontal";return S.jsx("div",{onPointerDown:o,onPointerMove:s,onPointerUp:c,className:`${f?"w-1.5 cursor-col-resize":"h-1.5 cursor-row-resize"} bg-border hover:bg-primary/20 transition-colors shrink-0 select-none`})}function rB({sidebar:n,editor:e,response:t}){const[r,o]=w.useState(260),[s,c]=w.useState(.55),f=w.useRef(null),h=w.useCallback(p=>{o(v=>Math.max(180,Math.min(600,v+p)))},[]),d=w.useCallback(p=>{if(!f.current)return;const v=f.current.clientHeight;c(y=>Math.max(.15,Math.min(.85,y+p/v)))},[]);return S.jsxs("div",{className:"h-screen w-screen flex flex-col overflow-hidden",children:[S.jsx("div",{className:"h-9 shrink-0 flex items-center px-3 border-b bg-muted/40",children:S.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"Hurler"})}),S.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[S.jsx("div",{style:{width:r},className:"shrink-0 overflow-hidden",children:n}),S.jsx(Ix,{direction:"horizontal",onDrag:h}),S.jsxs("div",{ref:f,className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[S.jsx("div",{style:{flex:s},className:"min-h-0 overflow-hidden",children:e}),S.jsx(Ix,{direction:"vertical",onDrag:d}),S.jsx("div",{style:{flex:1-s},className:"min-h-0 overflow-hidden",children:t})]})]})]})}const Gx=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,qx=sA,Og=(n,e)=>t=>{var r;if(e?.variants==null)return qx(n,t?.class,t?.className);const{variants:o,defaultVariants:s}=e,c=Object.keys(o).map(d=>{const p=t?.[d],v=s?.[d];if(p===null)return null;const y=Gx(p)||Gx(v);return o[d][y]}),f=t&&Object.entries(t).reduce((d,p)=>{let[v,y]=p;return y===void 0||(d[v]=y),d},{}),h=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:v,className:y,...x}=p;return Object.entries(x).every(A=>{let[C,M]=A;return Array.isArray(M)?M.includes({...s,...f}[C]):{...s,...f}[C]===M})?[...d,v,y]:d},[]);return qx(n,c,h,t?.class,t?.className)},lB=Og("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function vt({className:n,variant:e="default",size:t="default",asChild:r=!1,...o}){const s=r?vS:"button";return S.jsx(s,{"data-slot":"button","data-variant":e,"data-size":t,className:et(lB({variant:e,size:t,className:n})),...o})}function xA({className:n,children:e,...t}){return S.jsxs(i_,{"data-slot":"scroll-area",className:et("relative",n),...t,children:[S.jsx(r_,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:e}),S.jsx(oB,{}),S.jsx(l_,{})]})}function oB({className:n,orientation:e="vertical",...t}){return S.jsx(aC,{"data-slot":"scroll-area-scrollbar",orientation:e,className:et("flex touch-none p-px transition-colors select-none",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",n),...t,children:S.jsx(hC,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const SA=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim();const sB=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const aB=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());const Yx=n=>{const e=aB(n);return e.charAt(0).toUpperCase()+e.slice(1)};var cB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uB=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const fB=w.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:c,...f},h)=>w.createElement("svg",{ref:h,...cB,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:SA("lucide",o),...!s&&!uB(f)&&{"aria-hidden":"true"},...f},[...c.map(([d,p])=>w.createElement(d,p)),...Array.isArray(s)?s:[s]]));const Mt=(n,e)=>{const t=w.forwardRef(({className:r,...o},s)=>w.createElement(fB,{ref:s,iconNode:e,className:SA(`lucide-${sB(Yx(n))}`,`lucide-${n}`,r),...o}));return t.displayName=Yx(n),t};const hB=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dB=Mt("check",hB);const mB=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rg=Mt("chevron-down",mB);const pB=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wA=Mt("chevron-right",pB);const gB=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vB=Mt("chevron-up",gB);const yB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],bB=Mt("circle-check",yB);const xB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],SB=Mt("circle-x",xB);const wB=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Fx=Mt("ellipsis-vertical",wB);const CB=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],AB=Mt("file-text",CB);const EB=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],MB=Mt("folder-plus",EB);const TB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],CA=Mt("globe",TB);const kB=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],OB=Mt("loader-circle",kB);const RB=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],DB=Mt("pencil",RB);const NB=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],_B=Mt("play",NB);const BB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],rp=Mt("plus",BB);const zB=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],AA=Mt("save",zB);const LB=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jB=Mt("settings",LB);const HB=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ju=Mt("trash-2",HB);const UB=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],PB=Mt("x",UB);function EA({...n}){return S.jsx(O_,{"data-slot":"select",...n})}function MA({...n}){return S.jsx(D_,{"data-slot":"select-value",...n})}function TA({className:n,size:e="default",children:t,...r}){return S.jsxs(R_,{"data-slot":"select-trigger","data-size":e,className:et("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...r,children:[t,S.jsx(N_,{asChild:!0,children:S.jsx(Rg,{className:"size-4 opacity-50"})})]})}function kA({className:n,children:e,position:t="item-aligned",align:r="center",...o}){return S.jsx(__,{children:S.jsxs(B_,{"data-slot":"select-content",className:et("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,align:r,...o,children:[S.jsx(VB,{}),S.jsx(z_,{className:et("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),S.jsx(IB,{})]})})}function Hu({className:n,children:e,...t}){return S.jsxs(L_,{"data-slot":"select-item",className:et("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...t,children:[S.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:S.jsx(H_,{children:S.jsx(dB,{className:"size-4"})})}),S.jsx(j_,{children:e})]})}function VB({className:n,...e}){return S.jsx(U_,{"data-slot":"select-scroll-up-button",className:et("flex cursor-default items-center justify-center py-1",n),...e,children:S.jsx(vB,{className:"size-4"})})}function IB({className:n,...e}){return S.jsx(P_,{"data-slot":"select-scroll-down-button",className:et("flex cursor-default items-center justify-center py-1",n),...e,children:S.jsx(Rg,{className:"size-4"})})}function Uu({...n}){return S.jsx(GO,{"data-slot":"dialog",...n})}function GB({...n}){return S.jsx(qO,{"data-slot":"dialog-portal",...n})}function qB({className:n,...e}){return S.jsx(YO,{"data-slot":"dialog-overlay",className:et("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function Pu({className:n,children:e,showCloseButton:t=!0,...r}){return S.jsxs(GB,{"data-slot":"dialog-portal",children:[S.jsx(qB,{}),S.jsxs(FO,{"data-slot":"dialog-content",className:et("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",n),...r,children:[e,t&&S.jsxs(WS,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[S.jsx(PB,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Vu({className:n,...e}){return S.jsx("div",{"data-slot":"dialog-header",className:et("flex flex-col gap-2 text-center sm:text-left",n),...e})}function lp({className:n,showCloseButton:e=!1,children:t,...r}){return S.jsxs("div",{"data-slot":"dialog-footer",className:et("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...r,children:[t,e&&S.jsx(WS,{asChild:!0,children:S.jsx(vt,{variant:"outline",children:"Close"})})]})}function Iu({className:n,...e}){return S.jsx(KO,{"data-slot":"dialog-title",className:et("text-lg leading-none font-semibold",n),...e})}function YB({className:n,...e}){return S.jsx(WO,{"data-slot":"dialog-description",className:et("text-muted-foreground text-sm",n),...e})}function Ks({className:n,type:e,...t}){return S.jsx("input",{type:e,"data-slot":"input",className:et("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...t})}function FB({className:n,orientation:e="horizontal",decorative:t=!0,...r}){return S.jsx(q_,{"data-slot":"separator",decorative:t,orientation:e,className:et("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),...r})}function Kx({...n}){return S.jsx(HN,{"data-slot":"dropdown-menu",...n})}function Wx({...n}){return S.jsx(UN,{"data-slot":"dropdown-menu-trigger",...n})}function Xx({className:n,sideOffset:e=4,...t}){return S.jsx(PN,{children:S.jsx(VN,{"data-slot":"dropdown-menu-content",sideOffset:e,className:et("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),...t})})}function zs({className:n,inset:e,variant:t="default",...r}){return S.jsx(IN,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:et("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...r})}function KB({...n}){return S.jsx(GN,{"data-slot":"dropdown-menu-sub",...n})}function WB({className:n,inset:e,children:t,...r}){return S.jsxs(qN,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:et("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...r,children:[t,S.jsx(wA,{className:"ml-auto size-4"})]})}function XB({className:n,...e}){return S.jsx(YN,{"data-slot":"dropdown-menu-sub-content",className:et("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",n),...e})}function QB(){return Math.random().toString(36).slice(2,10)}function ZB({files:n,activeFile:e,onSelectFile:t,onCreateFile:r,onDeleteFile:o,metadata:s,onUpdateMetadata:c,environments:f,activeEnvironment:h,onSelectEnvironment:d,onOpenEnvEditor:p}){const[v,y]=w.useState(!1),[x,A]=w.useState(""),[C,M]=w.useState(new Set),[T,D]=w.useState(null),[N,j]=w.useState(""),H=w.useRef(null);w.useEffect(()=>{T&&H.current&&(H.current.focus(),H.current.select())},[T]);const P=()=>{x.trim()&&(r(x.trim()),A(""),y(!1))},_=z=>{M(L=>{const F=new Set(L);return F.has(z)?F.delete(z):F.add(z),F})},G=()=>{const z=QB(),L={...s,sections:[...s.sections,{id:z,name:"New Section"}]};c(L),D(z),j("New Section")},Z=z=>{const L=s.sections.find(F=>F.id===z);L&&(D(z),j(L.name))},ie=()=>{if(!T)return;const z=N.trim();if(!z){D(null);return}const L={...s,sections:s.sections.map(F=>F.id===T?{...F,name:z}:F)};c(L),D(null)},ne=z=>{const L={...s.fileGroups};for(const[ue,k]of Object.entries(L))k===z&&delete L[ue];const F={...s,sections:s.sections.filter(ue=>ue.id!==z),fileGroups:L};c(F)},ee=(z,L)=>{const F={...s.fileGroups};L?F[z]=L:delete F[z],c({...s,fileGroups:F})},se=new Map;for(const z of s.sections)se.set(z.id,[]);const oe=[];for(const z of n){const L=s.fileGroups[z];L&&se.has(L)?se.get(L).push(z):oe.push(z)}const ae=z=>S.jsxs("div",{className:`group flex items-center rounded-md px-2 py-1.5 text-sm cursor-pointer ${e===z?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,onClick:()=>t(z),children:[S.jsx(AB,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),S.jsx("span",{className:"truncate flex-1",children:z}),S.jsxs(Kx,{children:[S.jsx(Wx,{asChild:!0,children:S.jsx(vt,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100",onClick:L=>L.stopPropagation(),children:S.jsx(Fx,{className:"h-3 w-3"})})}),S.jsxs(Xx,{align:"end",children:[s.sections.length>0&&S.jsxs(KB,{children:[S.jsx(WB,{children:"Move to"}),S.jsxs(XB,{children:[s.sections.map(L=>S.jsx(zs,{onClick:F=>{F.stopPropagation(),ee(z,L.id)},disabled:s.fileGroups[z]===L.id,children:L.name},L.id)),S.jsx(zs,{onClick:L=>{L.stopPropagation(),ee(z,null)},disabled:!s.fileGroups[z],children:"Ungrouped"})]})]}),S.jsxs(zs,{className:"text-destructive",onClick:L=>{L.stopPropagation(),o(z)},children:[S.jsx(ju,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]},z),R=(z,L,F=!1)=>{const ue=C.has(z),k=T===z;return S.jsxs("div",{className:"group flex items-center gap-1 px-1 py-1 text-xs font-medium text-muted-foreground",children:[S.jsxs("button",{className:"flex items-center gap-1 flex-1 min-w-0 hover:text-foreground",onClick:()=>_(z),children:[ue?S.jsx(wA,{className:"h-3.5 w-3.5 shrink-0"}):S.jsx(Rg,{className:"h-3.5 w-3.5 shrink-0"}),k?S.jsx(Ks,{ref:H,className:"h-5 text-xs px-1 py-0",value:N,onChange:Y=>j(Y.target.value),onKeyDown:Y=>{Y.stopPropagation(),Y.key==="Enter"&&ie(),Y.key==="Escape"&&D(null)},onBlur:ie,onClick:Y=>Y.stopPropagation()}):S.jsx("span",{className:"truncate",onDoubleClick:Y=>{F||(Y.stopPropagation(),Z(z))},children:L})]}),!F&&!k&&S.jsxs(Kx,{children:[S.jsx(Wx,{asChild:!0,children:S.jsx(vt,{variant:"ghost",size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100",children:S.jsx(Fx,{className:"h-3 w-3"})})}),S.jsxs(Xx,{align:"end",children:[S.jsxs(zs,{onClick:()=>Z(z),children:[S.jsx(DB,{className:"mr-2 h-4 w-4"}),"Rename"]}),S.jsxs(zs,{className:"text-destructive",onClick:()=>ne(z),children:[S.jsx(ju,{className:"mr-2 h-4 w-4"}),"Delete section"]})]})]})]})};return S.jsxs("div",{className:"flex h-full w-full flex-col bg-muted/30",children:[S.jsxs("div",{className:"flex items-center justify-between border-b px-3 py-2",children:[S.jsx("span",{className:"text-sm font-semibold",children:"Requests"}),S.jsxs("div",{className:"flex items-center gap-0.5",children:[S.jsx(vt,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:G,title:"New section",children:S.jsx(MB,{className:"h-4 w-4"})}),S.jsx(vt,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>y(!0),title:"New request",children:S.jsx(rp,{className:"h-4 w-4"})})]})]}),S.jsx(xA,{className:"flex-1",children:S.jsxs("div",{className:"p-1",children:[s.sections.map(z=>{const L=se.get(z.id)??[],F=C.has(z.id);return S.jsxs("div",{children:[R(z.id,z.name),!F&&L.map(ue=>S.jsx("div",{className:"pl-3",children:ae(ue)},ue))]},z.id)}),(oe.length>0||s.sections.length>0)&&S.jsxs("div",{children:[s.sections.length>0&&R("__ungrouped__","Ungrouped",!0),!C.has("__ungrouped__")&&oe.map(z=>S.jsx("div",{className:s.sections.length>0?"pl-3":"",children:ae(z)},z))]}),n.length===0&&S.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground text-center",children:"No requests yet. Click + to create one."})]})}),S.jsx(FB,{}),S.jsxs("div",{className:"p-3 space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx(CA,{className:"h-3.5 w-3.5 text-muted-foreground"}),S.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Environment"})]}),S.jsxs("div",{className:"flex gap-1",children:[S.jsxs(EA,{value:h??"__none__",onValueChange:z=>d(z==="__none__"?null:z),children:[S.jsx(TA,{className:"h-8 text-xs flex-1",children:S.jsx(MA,{placeholder:"No environment"})}),S.jsxs(kA,{children:[S.jsx(Hu,{value:"__none__",children:"No environment"}),f.map(z=>S.jsx(Hu,{value:z,children:z},z))]})]}),S.jsx(vt,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:p,children:S.jsx(jB,{className:"h-3.5 w-3.5"})})]})]}),S.jsx(Uu,{open:v,onOpenChange:y,children:S.jsxs(Pu,{children:[S.jsx(Vu,{children:S.jsx(Iu,{children:"New Request"})}),S.jsx(Ks,{placeholder:"Request name",value:x,onChange:z=>A(z.target.value),onKeyDown:z=>z.key==="Enter"&&P(),autoFocus:!0}),S.jsxs(lp,{children:[S.jsx(vt,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),S.jsx(vt,{onClick:P,disabled:!x.trim(),children:"Create"})]})]})})]})}const $B=Og("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function ho({className:n,variant:e="default",asChild:t=!1,...r}){const o=t?vS:"span";return S.jsx(o,{"data-slot":"badge","data-variant":e,className:et($B({variant:e}),n),...r})}let op=[],OA=[];(()=>{let n="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,t=0;e<n.length;e++)(e%2?OA:op).push(t=t+n[e])})();function JB(n){if(n<768)return!1;for(let e=0,t=op.length;;){let r=e+t>>1;if(n<op[r])t=r;else if(n>=OA[r])e=r+1;else return!0;if(e==t)return!1}}function Qx(n){return n>=127462&&n<=127487}const Zx=8205;function ez(n,e,t=!0,r=!0){return(t?RA:tz)(n,e,r)}function RA(n,e,t){if(e==n.length)return e;e&&DA(n.charCodeAt(e))&&NA(n.charCodeAt(e-1))&&e--;let r=Sm(n,e);for(e+=$x(r);e<n.length;){let o=Sm(n,e);if(r==Zx||o==Zx||t&&JB(o))e+=$x(o),r=o;else if(Qx(o)){let s=0,c=e-2;for(;c>=0&&Qx(Sm(n,c));)s++,c-=2;if(s%2==0)break;e+=2}else break}return e}function tz(n,e,t){for(;e>0;){let r=RA(n,e-2,t);if(r<e)return r;e--}return 0}function Sm(n,e){let t=n.charCodeAt(e);if(!NA(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return DA(r)?(t-55296<<10)+(r-56320)+65536:t}function DA(n){return n>=56320&&n<57344}function NA(n){return n>=55296&&n<56320}function $x(n){return n<65536?1:2}class Ie{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,t,r){[e,t]=Eo(this,e,t);let o=[];return this.decompose(0,e,o,2),r.length&&r.decompose(0,r.length,o,3),this.decompose(t,this.length,o,1),si.from(o,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Eo(this,e,t);let r=[];return this.decompose(e,t,r,0),si.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),o=new Ws(this),s=new Ws(e);for(let c=t,f=t;;){if(o.next(c),s.next(c),c=0,o.lineBreak!=s.lineBreak||o.done!=s.done||o.value!=s.value)return!1;if(f+=o.value.length,o.done||f>=r)return!0}}iter(e=1){return new Ws(this,e)}iterRange(e,t=this.length){return new _A(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let o=this.line(e).from;r=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new BA(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]?Ie.empty:e.length<=32?new ut(e):si.from(ut.split(e,[]))}}class ut extends Ie{constructor(e,t=nz(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,o){for(let s=0;;s++){let c=this.text[s],f=o+c.length;if((t?r:f)>=e)return new iz(o,f,r,c);o=f+1,r++}}decompose(e,t,r,o){let s=e<=0&&t>=this.length?this:new ut(Jx(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(o&1){let c=r.pop(),f=yu(s.text,c.text.slice(),0,s.length);if(f.length<=32)r.push(new ut(f,c.length+s.length));else{let h=f.length>>1;r.push(new ut(f.slice(0,h)),new ut(f.slice(h)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof ut))return super.replace(e,t,r);[e,t]=Eo(this,e,t);let o=yu(this.text,yu(r.text,Jx(this.text,0,e)),t),s=this.length+r.length-(t-e);return o.length<=32?new ut(o,s):si.from(ut.split(o,[]),s)}sliceString(e,t=this.length,r=`
54
+ `){[e,t]=Eo(this,e,t);let o="";for(let s=0,c=0;s<=t&&c<this.text.length;c++){let f=this.text[c],h=s+f.length;s>e&&c&&(o+=r),e<h&&t>s&&(o+=f.slice(Math.max(0,e-s),t-s)),s=h+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],o=-1;for(let s of e)r.push(s),o+=s.length+1,r.length==32&&(t.push(new ut(r,o)),r=[],o=-1);return o>-1&&t.push(new ut(r,o)),t}}class si extends Ie{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,o){for(let s=0;;s++){let c=this.children[s],f=o+c.length,h=r+c.lines-1;if((t?h:f)>=e)return c.lineInner(e,t,r,o);o=f+1,r=h+1}}decompose(e,t,r,o){for(let s=0,c=0;c<=t&&s<this.children.length;s++){let f=this.children[s],h=c+f.length;if(e<=h&&t>=c){let d=o&((c<=e?1:0)|(h>=t?2:0));c>=e&&h<=t&&!d?r.push(f):f.decompose(e-c,t-c,r,d)}c=h+1}}replace(e,t,r){if([e,t]=Eo(this,e,t),r.lines<this.lines)for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],f=s+c.length;if(e>=s&&t<=f){let h=c.replace(e-s,t-s,r),d=this.lines-c.lines+h.lines;if(h.lines<d>>4&&h.lines>d>>6){let p=this.children.slice();return p[o]=h,new si(p,this.length-(t-e)+r.length)}return super.replace(s,f,h)}s=f+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
55
+ `){[e,t]=Eo(this,e,t);let o="";for(let s=0,c=0;s<this.children.length&&c<=t;s++){let f=this.children[s],h=c+f.length;c>e&&s&&(o+=r),e<h&&t>c&&(o+=f.sliceString(e-c,t-c,r)),c=h+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof si))return 0;let r=0,[o,s,c,f]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,s+=t){if(o==c||s==f)return r;let h=this.children[o],d=e.children[s];if(h!=d)return r+h.scanIdentical(d,t);r+=h.length+1}}static from(e,t=e.reduce((r,o)=>r+o.length+1,-1)){let r=0;for(let x of e)r+=x.lines;if(r<32){let x=[];for(let A of e)A.flatten(x);return new ut(x,t)}let o=Math.max(32,r>>5),s=o<<1,c=o>>1,f=[],h=0,d=-1,p=[];function v(x){let A;if(x.lines>s&&x instanceof si)for(let C of x.children)v(C);else x.lines>c&&(h>c||!h)?(y(),f.push(x)):x instanceof ut&&h&&(A=p[p.length-1])instanceof ut&&x.lines+A.lines<=32?(h+=x.lines,d+=x.length+1,p[p.length-1]=new ut(A.text.concat(x.text),A.length+1+x.length)):(h+x.lines>o&&y(),h+=x.lines,d+=x.length+1,p.push(x))}function y(){h!=0&&(f.push(p.length==1?p[0]:si.from(p,d)),d=-1,h=p.length=0)}for(let x of e)v(x);return y(),f.length==1?f[0]:new si(f,t)}}Ie.empty=new ut([""],0);function nz(n){let e=-1;for(let t of n)e+=t.length+1;return e}function yu(n,e,t=0,r=1e9){for(let o=0,s=0,c=!0;s<n.length&&o<=r;s++){let f=n[s],h=o+f.length;h>=t&&(h>r&&(f=f.slice(0,r-o)),o<t&&(f=f.slice(t-o)),c?(e[e.length-1]+=f,c=!1):e.push(f)),o=h+1}return e}function Jx(n,e,t){return yu(n,[""],e,t)}class Ws{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof ut?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,o=this.nodes[r],s=this.offsets[r],c=s>>1,f=o instanceof ut?o.text.length:o.children.length;if(c==(t>0?f:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
56
+ `,this;e--}else if(o instanceof ut){let h=o.text[c+(t<0?-1:0)];if(this.offsets[r]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=o.children[c+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof ut?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class _A{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Ws(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=r?o:t<0?o.slice(o.length-r):o.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 BA{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ie.prototype[Symbol.iterator]=function(){return this.iter()},Ws.prototype[Symbol.iterator]=_A.prototype[Symbol.iterator]=BA.prototype[Symbol.iterator]=function(){return this});class iz{constructor(e,t,r,o){this.from=e,this.to=t,this.number=r,this.text=o}get length(){return this.to-this.from}}function Eo(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Bt(n,e,t=!0,r=!0){return ez(n,e,t,r)}function rz(n){return n>=56320&&n<57344}function lz(n){return n>=55296&&n<56320}function oz(n,e){let t=n.charCodeAt(e);if(!lz(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return rz(r)?(t-55296<<10)+(r-56320)+65536:t}function sz(n){return n<65536?1:2}const sp=/\r\n?|\n/;var gn=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(gn||(gn={}));class pi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,o=0;t<this.sections.length;){let s=this.sections[t++],c=this.sections[t++];c<0?(e(r,o,s),o+=s):o+=c,r+=s}}iterChangedRanges(e,t=!1){ap(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?e.push(r,o):e.push(o,r)}return new pi(e)}composeDesc(e){return this.empty?e:e.empty?this:zA(this,e)}mapDesc(e,t=!1){return e.empty?this:cp(this,e,t)}mapPos(e,t=-1,r=gn.Simple){let o=0,s=0;for(let c=0;c<this.sections.length;){let f=this.sections[c++],h=this.sections[c++],d=o+f;if(h<0){if(d>e)return s+(e-o);s+=f}else{if(r!=gn.Simple&&d>=e&&(r==gn.TrackDel&&o<e&&d>e||r==gn.TrackBefore&&o<e||r==gn.TrackAfter&&d>e))return null;if(d>e||d==e&&t<0&&!f)return e==o||t<0?s:s+h;s+=h}o=d}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return s}touchesRange(e,t=e){for(let r=0,o=0;r<this.sections.length&&o<=t;){let s=this.sections[r++],c=this.sections[r++],f=o+s;if(c>=0&&o<=t&&f>=e)return o<e&&f>t?"cover":!0;o=f}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];e+=(e?" ":"")+r+(o>=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new pi(e)}static create(e){return new pi(e)}}class St extends pi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ap(this,(t,r,o,s,c)=>e=e.replace(o,o+(r-t),c),!1),e}mapDesc(e,t=!1){return cp(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let o=0,s=0;o<t.length;o+=2){let c=t[o],f=t[o+1];if(f>=0){t[o]=f,t[o+1]=c;let h=o>>1;for(;r.length<h;)r.push(Ie.empty);r.push(c?e.slice(s,s+c):Ie.empty)}s+=c}return new St(t,r)}compose(e){return this.empty?e:e.empty?this:zA(this,e,!0)}map(e,t=!1){return e.empty?this:cp(this,e,t,!0)}iterChanges(e,t=!1){ap(this,e,t)}get desc(){return pi.create(this.sections)}filter(e){let t=[],r=[],o=[],s=new ia(this);e:for(let c=0,f=0;;){let h=c==e.length?1e9:e[c++];for(;f<h||f==h&&s.len==0;){if(s.done)break e;let p=Math.min(s.len,h-f);Ut(o,p,-1);let v=s.ins==-1?-1:s.off==0?s.ins:0;Ut(t,p,v),v>0&&Er(r,t,s.text),s.forward(p),f+=p}let d=e[c++];for(;f<d;){if(s.done)break e;let p=Math.min(s.len,d-f);Ut(t,p,-1),Ut(o,p,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(p),f+=p}}return{changes:new St(t,r),filtered:pi.create(o)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],o=this.sections[t+1];o<0?e.push(r):o==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let o=[],s=[],c=0,f=null;function h(p=!1){if(!p&&!o.length)return;c<t&&Ut(o,t-c,-1);let v=new St(o,s);f=f?f.compose(v.map(f)):v,o=[],s=[],c=0}function d(p){if(Array.isArray(p))for(let v of p)d(v);else if(p instanceof St){if(p.length!=t)throw new RangeError(`Mismatched change set length (got ${p.length}, expected ${t})`);h(),f=f?f.compose(p.map(f)):p}else{let{from:v,to:y=v,insert:x}=p;if(v>y||v<0||y>t)throw new RangeError(`Invalid change range ${v} to ${y} (in doc of length ${t})`);let A=x?typeof x=="string"?Ie.of(x.split(r||sp)):x:Ie.empty,C=A.length;if(v==y&&C==0)return;v<c&&h(),v>c&&Ut(o,v-c,-1),Ut(o,y-v,C),Er(s,o,A),c=y}}return d(e),h(!f),f}static empty(e){return new St(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let o=0;o<e.length;o++){let s=e[o];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((c,f)=>f&&typeof c!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length<o;)r.push(Ie.empty);r[o]=Ie.of(s.slice(1)),t.push(s[0],r[o].length)}}}return new St(t,r)}static createSet(e,t){return new St(e,t)}}function Ut(n,e,t,r=!1){if(e==0&&t<=0)return;let o=n.length-2;o>=0&&t<=0&&t==n[o+1]?n[o]+=e:o>=0&&e==0&&n[o]==0?n[o+1]+=t:r?(n[o]+=e,n[o+1]+=t):n.push(e,t)}function Er(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(Ie.empty);n.push(t)}}function ap(n,e,t){let r=n.inserted;for(let o=0,s=0,c=0;c<n.sections.length;){let f=n.sections[c++],h=n.sections[c++];if(h<0)o+=f,s+=f;else{let d=o,p=s,v=Ie.empty;for(;d+=f,p+=h,h&&r&&(v=v.append(r[c-2>>1])),!(t||c==n.sections.length||n.sections[c+1]<0);)f=n.sections[c++],h=n.sections[c++];e(o,d,s,p,v),o=d,s=p}}}function cp(n,e,t,r=!1){let o=[],s=r?[]:null,c=new ia(n),f=new ia(e);for(let h=-1;;){if(c.done&&f.len||f.done&&c.len)throw new Error("Mismatched change set lengths");if(c.ins==-1&&f.ins==-1){let d=Math.min(c.len,f.len);Ut(o,d,-1),c.forward(d),f.forward(d)}else if(f.ins>=0&&(c.ins<0||h==c.i||c.off==0&&(f.len<c.len||f.len==c.len&&!t))){let d=f.len;for(Ut(o,f.ins,-1);d;){let p=Math.min(c.len,d);c.ins>=0&&h<c.i&&c.len<=p&&(Ut(o,0,c.ins),s&&Er(s,o,c.text),h=c.i),c.forward(p),d-=p}f.next()}else if(c.ins>=0){let d=0,p=c.len;for(;p;)if(f.ins==-1){let v=Math.min(p,f.len);d+=v,p-=v,f.forward(v)}else if(f.ins==0&&f.len<p)p-=f.len,f.next();else break;Ut(o,d,h<c.i?c.ins:0),s&&h<c.i&&Er(s,o,c.text),h=c.i,c.forward(c.len-p)}else{if(c.done&&f.done)return s?St.createSet(o,s):pi.create(o);throw new Error("Mismatched change set lengths")}}}function zA(n,e,t=!1){let r=[],o=t?[]:null,s=new ia(n),c=new ia(e);for(let f=!1;;){if(s.done&&c.done)return o?St.createSet(r,o):pi.create(r);if(s.ins==0)Ut(r,s.len,0,f),s.next();else if(c.len==0&&!c.done)Ut(r,0,c.ins,f),o&&Er(o,r,c.text),c.next();else{if(s.done||c.done)throw new Error("Mismatched change set lengths");{let h=Math.min(s.len2,c.len),d=r.length;if(s.ins==-1){let p=c.ins==-1?-1:c.off?0:c.ins;Ut(r,h,p,f),o&&p&&Er(o,r,c.text)}else c.ins==-1?(Ut(r,s.off?0:s.len,h,f),o&&Er(o,r,s.textBit(h))):(Ut(r,s.off?0:s.len,c.off?0:c.ins,f),o&&!c.off&&Er(o,r,c.text));f=(s.ins>h||c.ins>=0&&c.len>h)&&(f||r.length>d),s.forward2(h),c.forward(h)}}}}class ia{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,t=this.i-2>>1;return t>=e.length?Ie.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?Ie.empty:t[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 cl{constructor(e,t,r){this.from=e,this.to=t,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,t=-1){let r,o;return this.empty?r=o=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),r==this.from&&o==this.to?this:new cl(r,o,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return le.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return le.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!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 le.range(e.anchor,e.head)}static create(e,t,r){return new cl(e,t,r)}}class le{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:le.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!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],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new le([this.main],0)}addRange(e,t=!0){return le.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,le.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 le(e.ranges.map(t=>cl.fromJSON(t)),e.main)}static single(e,t=e){return new le([le.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,o=0;o<e.length;o++){let s=e[o];if(s.empty?s.from<=r:s.from<r)return le.normalized(e.slice(),t);r=s.to}return new le(e,t)}static cursor(e,t=0,r,o){return cl.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(o??16777215)<<6)}static range(e,t,r,o){let s=(r??16777215)<<6|(o==null?7:Math.min(6,o));return t<e?cl.create(t,e,48|s):cl.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let r=e[t];e.sort((o,s)=>o.from-s.from),t=e.indexOf(r);for(let o=1;o<e.length;o++){let s=e[o],c=e[o-1];if(s.empty?s.from<=c.to:s.from<c.to){let f=c.from,h=Math.max(s.to,c.to);o<=t&&t--,e.splice(--o,2,s.anchor>s.head?le.range(h,f):le.range(f,h))}}return new le(e,t)}}function LA(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Dg=0;class be{constructor(e,t,r,o,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=o,this.id=Dg++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new be(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Ng),!!e.static,e.enables)}of(e){return new bu([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new bu(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new bu(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Ng(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class bu{constructor(e,t,r,o){this.dependencies=e,this.facet=t,this.type=r,this.value=o,this.id=Dg++}dynamicSlot(e){var t;let r=this.value,o=this.facet.compareInput,s=this.id,c=e[s]>>1,f=this.type==2,h=!1,d=!1,p=[];for(let v of this.dependencies)v=="doc"?h=!0:v=="selection"?d=!0:(((t=e[v.id])!==null&&t!==void 0?t:1)&1)==0&&p.push(e[v.id]);return{create(v){return v.values[c]=r(v),1},update(v,y){if(h&&y.docChanged||d&&(y.docChanged||y.selection)||up(v,p)){let x=r(v);if(f?!e1(x,v.values[c],o):!o(x,v.values[c]))return v.values[c]=x,1}return 0},reconfigure:(v,y)=>{let x,A=y.config.address[s];if(A!=null){let C=qu(y,A);if(this.dependencies.every(M=>M instanceof be?y.facet(M)===v.facet(M):M instanceof Ki?y.field(M,!1)==v.field(M,!1):!0)||(f?e1(x=r(v),C,o):o(x=r(v),C)))return v.values[c]=C,0}else x=r(v);return v.values[c]=x,1}}}}function e1(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function up(n,e){let t=!1;for(let r of e)Xs(n,r)&1&&(t=!0);return t}function az(n,e,t){let r=t.map(h=>n[h.id]),o=t.map(h=>h.type),s=r.filter(h=>!(h&1)),c=n[e.id]>>1;function f(h){let d=[];for(let p=0;p<r.length;p++){let v=qu(h,r[p]);if(o[p]==2)for(let y of v)d.push(y);else d.push(v)}return e.combine(d)}return{create(h){for(let d of r)Xs(h,d);return h.values[c]=f(h),1},update(h,d){if(!up(h,s))return 0;let p=f(h);return e.compare(p,h.values[c])?0:(h.values[c]=p,1)},reconfigure(h,d){let p=up(h,r),v=d.config.facets[e.id],y=d.facet(e);if(v&&!p&&Ng(t,v))return h.values[c]=y,0;let x=f(h);return e.compare(x,y)?(h.values[c]=y,0):(h.values[c]=x,1)}}}const Zc=be.define({static:!0});class Ki{constructor(e,t,r,o,s){this.id=e,this.createF=t,this.updateF=r,this.compareF=o,this.spec=s,this.provides=void 0}static define(e){let t=new Ki(Dg++,e.create,e.update,e.compare||((r,o)=>r===o),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Zc).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,o)=>{let s=r.values[t],c=this.updateF(s,o);return this.compareF(s,c)?0:(r.values[t]=c,1)},reconfigure:(r,o)=>{let s=r.facet(Zc),c=o.facet(Zc),f;return(f=s.find(h=>h.field==this))&&f!=c.find(h=>h.field==this)?(r.values[t]=f.create(r),1):o.config.address[this.id]!=null?(r.values[t]=o.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Zc.of({field:this,create:e})]}get extension(){return this}}const al={lowest:4,low:3,default:2,high:1,highest:0};function Ls(n){return e=>new jA(e,n)}const Tf={highest:Ls(al.highest),high:Ls(al.high),default:Ls(al.default),low:Ls(al.low),lowest:Ls(al.lowest)};class jA{constructor(e,t){this.inner=e,this.prec=t}}class kf{of(e){return new fp(this,e)}reconfigure(e){return kf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class fp{constructor(e,t){this.compartment=e,this.inner=t}}class Gu{constructor(e,t,r,o,s,c){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=o,this.staticValues=s,this.facets=c,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let o=[],s=Object.create(null),c=new Map;for(let y of cz(e,t,c))y instanceof Ki?o.push(y):(s[y.facet.id]||(s[y.facet.id]=[])).push(y);let f=Object.create(null),h=[],d=[];for(let y of o)f[y.id]=d.length<<1,d.push(x=>y.slot(x));let p=r?.config.facets;for(let y in s){let x=s[y],A=x[0].facet,C=p&&p[y]||[];if(x.every(M=>M.type==0))if(f[A.id]=h.length<<1|1,Ng(C,x))h.push(r.facet(A));else{let M=A.combine(x.map(T=>T.value));h.push(r&&A.compare(M,r.facet(A))?r.facet(A):M)}else{for(let M of x)M.type==0?(f[M.id]=h.length<<1|1,h.push(M.value)):(f[M.id]=d.length<<1,d.push(T=>M.dynamicSlot(T)));f[A.id]=d.length<<1,d.push(M=>az(M,A,x))}}let v=d.map(y=>y(f));return new Gu(e,c,v,f,h,s)}}function cz(n,e,t){let r=[[],[],[],[],[]],o=new Map;function s(c,f){let h=o.get(c);if(h!=null){if(h<=f)return;let d=r[h].indexOf(c);d>-1&&r[h].splice(d,1),c instanceof fp&&t.delete(c.compartment)}if(o.set(c,f),Array.isArray(c))for(let d of c)s(d,f);else if(c instanceof fp){if(t.has(c.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(c.compartment)||c.inner;t.set(c.compartment,d),s(d,f)}else if(c instanceof jA)s(c.inner,c.prec);else if(c instanceof Ki)r[f].push(c),c.provides&&s(c.provides,f);else if(c instanceof bu)r[f].push(c),c.facet.extensions&&s(c.facet.extensions,al.default);else{let d=c.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${c}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,f)}}return s(n,al.default),r.reduce((c,f)=>c.concat(f))}function Xs(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let o=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|o}function qu(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const HA=be.define(),hp=be.define({combine:n=>n.some(e=>e),static:!0}),UA=be.define({combine:n=>n.length?n[0]:void 0,static:!0}),PA=be.define(),VA=be.define(),IA=be.define(),GA=be.define({combine:n=>n.length?n[0]:!1});class jr{constructor(e,t){this.type=e,this.value=t}static define(){return new uz}}class uz{of(e){return new jr(this,e)}}class fz{constructor(e){this.map=e}of(e){return new ht(this,e)}}class ht{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new ht(this.type,t)}is(e){return this.type==e}static define(e={}){return new fz(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let o of e){let s=o.map(t);s&&r.push(s)}return r}}ht.reconfigure=ht.define();ht.appendConfig=ht.define();class wt{constructor(e,t,r,o,s,c){this.startState=e,this.changes=t,this.selection=r,this.effects=o,this.annotations=s,this.scrollIntoView=c,this._doc=null,this._state=null,r&&LA(r,t.newLength),s.some(f=>f.type==wt.time)||(this.annotations=s.concat(wt.time.of(Date.now())))}static create(e,t,r,o,s,c){return new wt(e,t,r,o,s,c)}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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(wt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}wt.time=jr.define();wt.userEvent=jr.define();wt.addToHistory=jr.define();wt.remote=jr.define();function hz(n,e){let t=[];for(let r=0,o=0;;){let s,c;if(r<n.length&&(o==e.length||e[o]>=n[r]))s=n[r++],c=n[r++];else if(o<e.length)s=e[o++],c=e[o++];else return t;!t.length||t[t.length-1]<s?t.push(s,c):t[t.length-1]<c&&(t[t.length-1]=c)}}function qA(n,e,t){var r;let o,s,c;return t?(o=e.changes,s=St.empty(e.changes.length),c=n.changes.compose(e.changes)):(o=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),c=n.changes.compose(o)),{changes:c,selection:e.selection?e.selection.map(s):(r=n.selection)===null||r===void 0?void 0:r.map(o),effects:ht.mapEffects(n.effects,o).concat(ht.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function dp(n,e,t){let r=e.selection,o=yo(e.annotations);return e.userEvent&&(o=o.concat(wt.userEvent.of(e.userEvent))),{changes:e.changes instanceof St?e.changes:St.of(e.changes||[],t,n.facet(UA)),selection:r&&(r instanceof le?r:le.single(r.anchor,r.head)),effects:yo(e.effects),annotations:o,scrollIntoView:!!e.scrollIntoView}}function YA(n,e,t){let r=dp(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let c=!!e[s].sequential;r=qA(r,dp(n,e[s],c?r.changes.newLength:n.doc.length),c)}let o=wt.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return mz(t?dz(o):o)}function dz(n){let e=n.startState,t=!0;for(let o of e.facet(PA)){let s=o(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:hz(t,s))}if(t!==!0){let o,s;if(t===!1)s=n.changes.invertedDesc,o=St.empty(e.doc.length);else{let c=n.changes.filter(t);o=c.changes,s=c.filtered.mapDesc(c.changes).invertedDesc}n=wt.create(e,o,n.selection&&n.selection.map(s),ht.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let r=e.facet(VA);for(let o=r.length-1;o>=0;o--){let s=r[o](n);s instanceof wt?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof wt?n=s[0]:n=YA(e,yo(s),!1)}return n}function mz(n){let e=n.startState,t=e.facet(IA),r=n;for(let o=t.length-1;o>=0;o--){let s=t[o](n);s&&Object.keys(s).length&&(r=qA(r,dp(e,s,n.changes.newLength),!0))}return r==n?n:wt.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const pz=[];function yo(n){return n==null?pz:Array.isArray(n)?n:[n]}var Ii=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Ii||(Ii={}));const gz=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let mp;try{mp=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function vz(n){if(mp)return mp.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||gz.test(t)))return!0}return!1}function yz(n){return e=>{if(!/\S/.test(e))return Ii.Space;if(vz(e))return Ii.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Ii.Word;return Ii.Other}}class qe{constructor(e,t,r,o,s,c){this.config=e,this.doc=t,this.selection=r,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=s,c&&(c._state=this);for(let f=0;f<this.config.dynamicSlots.length;f++)Xs(this,f<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return Xs(this,r),qu(this,r)}update(...e){return YA(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:o}=t;for(let f of e.effects)f.is(kf.reconfigure)?(t&&(o=new Map,t.compartments.forEach((h,d)=>o.set(d,h)),t=null),o.set(f.value.compartment,f.value.extension)):f.is(ht.reconfigure)?(t=null,r=f.value):f.is(ht.appendConfig)&&(t=null,r=yo(r).concat(f.value));let s;t?s=e.startState.values.slice():(t=Gu.resolve(r,o,this),s=new qe(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(h,d)=>d.reconfigure(h,this),null).values);let c=e.startState.facet(hp)?e.newSelection:e.newSelection.asSingle();new qe(t,e.newDoc,c,s,(f,h)=>h.update(f,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:le.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),o=this.changes(r.changes),s=[r.range],c=yo(r.effects);for(let f=1;f<t.ranges.length;f++){let h=e(t.ranges[f]),d=this.changes(h.changes),p=d.map(o);for(let y=0;y<f;y++)s[y]=s[y].map(p);let v=o.mapDesc(d,!0);s.push(h.range.map(v)),o=o.compose(p),c=ht.mapEffects(c,p).concat(ht.mapEffects(yo(h.effects),v))}return{changes:o,selection:le.create(s,t.mainIndex),effects:c}}changes(e=[]){return e instanceof St?e:St.of(e,this.doc.length,this.facet(qe.lineSeparator))}toText(e){return Ie.of(e.split(this.facet(qe.lineSeparator)||sp))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Xs(this,t),qu(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let o=e[r];o instanceof Ki&&this.config.address[o.id]!=null&&(t[r]=o.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let o=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let c=r[s],f=e[s];o.push(c.init(h=>c.spec.fromJSON(f,h)))}}return qe.create({doc:e.doc,selection:le.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=Gu.resolve(e.extensions||[],new Map),r=e.doc instanceof Ie?e.doc:Ie.of((e.doc||"").split(t.staticFacet(qe.lineSeparator)||sp)),o=e.selection?e.selection instanceof le?e.selection:le.single(e.selection.anchor,e.selection.head):le.single(0);return LA(o,r.length),t.staticFacet(hp)||(o=o.asSingle()),new qe(t,r,o,t.dynamicSlots.map(()=>null),(s,c)=>c.create(s),null)}get tabSize(){return this.facet(qe.tabSize)}get lineBreak(){return this.facet(qe.lineSeparator)||`
57
+ `}get readOnly(){return this.facet(GA)}phrase(e,...t){for(let r of this.facet(qe.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,o)=>{if(o=="$")return"$";let s=+(o||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let o=[];for(let s of this.facet(HA))for(let c of s(this,t,r))Object.prototype.hasOwnProperty.call(c,e)&&o.push(c[e]);return o}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return yz(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:o}=this.doc.lineAt(e),s=this.charCategorizer(e),c=e-r,f=e-r;for(;c>0;){let h=Bt(t,c,!1);if(s(t.slice(h,c))!=Ii.Word)break;c=h}for(;f<o;){let h=Bt(t,f);if(s(t.slice(f,h))!=Ii.Word)break;f=h}return c==f?null:le.range(c+r,f+r)}}qe.allowMultipleSelections=hp;qe.tabSize=be.define({combine:n=>n.length?n[0]:4});qe.lineSeparator=UA;qe.readOnly=GA;qe.phrases=be.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(o=>n[o]==e[o])}});qe.languageData=HA;qe.changeFilter=PA;qe.transactionFilter=VA;qe.transactionExtender=IA;kf.reconfigure=ht.define();function Of(n,e,t={}){let r={};for(let o of n)for(let s of Object.keys(o)){let c=o[s],f=r[s];if(f===void 0)r[s]=c;else if(!(f===c||c===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](f,c);else throw new Error("Config merge conflict for field "+s)}for(let o in e)r[o]===void 0&&(r[o]=e[o]);return r}class yl{eq(e){return this==e}range(e,t=e){return pp.create(e,t,this)}}yl.prototype.startSide=yl.prototype.endSide=0;yl.prototype.point=!1;yl.prototype.mapMode=gn.TrackDel;function _g(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let pp=class FA{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new FA(e,t,r)}};function gp(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Bg{constructor(e,t,r,o){this.from=e,this.to=t,this.value=r,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,o=0){let s=r?this.to:this.from;for(let c=o,f=s.length;;){if(c==f)return c;let h=c+f>>1,d=s[h]-e||(r?this.value[h].endSide:this.value[h].startSide)-t;if(h==c)return d>=0?c:f;d>=0?f=h:c=h+1}}between(e,t,r,o){for(let s=this.findIndex(t,-1e9,!0),c=this.findIndex(r,1e9,!1,s);s<c;s++)if(o(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],o=[],s=[],c=-1,f=-1;for(let h=0;h<this.value.length;h++){let d=this.value[h],p=this.from[h]+e,v=this.to[h]+e,y,x;if(p==v){let A=t.mapPos(p,d.startSide,d.mapMode);if(A==null||(y=x=A,d.startSide!=d.endSide&&(x=t.mapPos(p,d.endSide),x<y)))continue}else if(y=t.mapPos(p,d.startSide),x=t.mapPos(v,d.endSide),y>x||y==x&&d.startSide>0&&d.endSide<=0)continue;(x-y||d.endSide-d.startSide)<0||(c<0&&(c=y),d.point&&(f=Math.max(f,x-y)),r.push(d),o.push(y-c),s.push(x-c))}return{mapped:r.length?new Bg(o,s,r,f):null,pos:c}}}class Ue{constructor(e,t,r,o){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=o}static create(e,t,r,o){return new Ue(e,t,r,o)}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 t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:o=0,filterTo:s=this.length}=e,c=e.filter;if(t.length==0&&!c)return this;if(r&&(t=t.slice().sort(gp)),this.isEmpty)return t.length?Ue.of(t):this;let f=new KA(this,null,-1).goto(0),h=0,d=[],p=new ra;for(;f.value||h<t.length;)if(h<t.length&&(f.from-t[h].from||f.startSide-t[h].value.startSide)>=0){let v=t[h++];p.addInner(v.from,v.to,v.value)||d.push(v)}else f.rangeIndex==1&&f.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(f.chunkIndex)<t[h].from)&&(!c||o>this.chunkEnd(f.chunkIndex)||s<this.chunkPos[f.chunkIndex])&&p.addChunk(this.chunkPos[f.chunkIndex],this.chunk[f.chunkIndex])?f.nextChunk():((!c||o>f.to||s<f.from||c(f.from,f.to,f.value))&&(p.addInner(f.from,f.to,f.value)||d.push(pp.create(f.from,f.to,f.value))),f.next());return p.finishInner(this.nextLayer.isEmpty&&!d.length?Ue.empty:this.nextLayer.update({add:d,filter:c,filterFrom:o,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],o=-1;for(let c=0;c<this.chunk.length;c++){let f=this.chunkPos[c],h=this.chunk[c],d=e.touchesRange(f,f+h.length);if(d===!1)o=Math.max(o,h.maxPoint),t.push(h),r.push(e.mapPos(f));else if(d===!0){let{mapped:p,pos:v}=h.map(f,e);p&&(o=Math.max(o,p.maxPoint),t.push(p),r.push(v))}}let s=this.nextLayer.map(e);return t.length==0?s:new Ue(r,t,s||Ue.empty,o)}between(e,t,r){if(!this.isEmpty){for(let o=0;o<this.chunk.length;o++){let s=this.chunkPos[o],c=this.chunk[o];if(t>=s&&e<=s+c.length&&c.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return la.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return la.from(e).goto(t)}static compare(e,t,r,o,s=-1){let c=e.filter(v=>v.maxPoint>0||!v.isEmpty&&v.maxPoint>=s),f=t.filter(v=>v.maxPoint>0||!v.isEmpty&&v.maxPoint>=s),h=t1(c,f,r),d=new js(c,h,s),p=new js(f,h,s);r.iterGaps((v,y,x)=>n1(d,v,p,y,x,o)),r.empty&&r.length==0&&n1(d,0,p,0,0,o)}static eq(e,t,r=0,o){o==null&&(o=999999999);let s=e.filter(p=>!p.isEmpty&&t.indexOf(p)<0),c=t.filter(p=>!p.isEmpty&&e.indexOf(p)<0);if(s.length!=c.length)return!1;if(!s.length)return!0;let f=t1(s,c),h=new js(s,f,0).goto(r),d=new js(c,f,0).goto(r);for(;;){if(h.to!=d.to||!vp(h.active,d.active)||h.point&&(!d.point||!_g(h.point,d.point)))return!1;if(h.to>o)return!0;h.next(),d.next()}}static spans(e,t,r,o,s=-1){let c=new js(e,null,s).goto(t),f=t,h=c.openStart;for(;;){let d=Math.min(c.to,r);if(c.point){let p=c.activeForPoint(c.to),v=c.pointFrom<t?p.length+1:c.point.startSide<0?p.length:Math.min(p.length,h);o.point(f,d,c.point,p,v,c.pointRank),h=Math.min(c.openEnd(d),p.length)}else d>f&&(o.span(f,d,c.active,h),h=c.openEnd(d));if(c.to>r)return h+(c.point&&c.to>r?1:0);f=c.to,c.next()}}static of(e,t=!1){let r=new ra;for(let o of e instanceof pp?[e]:t?bz(e):e)r.add(o.from,o.to,o.value);return r.finish()}static join(e){if(!e.length)return Ue.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let o=e[r];o!=Ue.empty;o=o.nextLayer)t=new Ue(o.chunkPos,o.chunk,t,Math.max(o.maxPoint,t.maxPoint));return t}}Ue.empty=new Ue([],[],null,-1);function bz(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(gp(e,r)>0)return n.slice().sort(gp);e=r}return n}Ue.empty.nextLayer=Ue.empty;class ra{finishChunk(e){this.chunks.push(new Bg(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,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new ra)).add(e,t,r)}addInner(e,t,r){let o=e-this.lastTo||r.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return o<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(Ue.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ue.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function t1(n,e,t){let r=new Map;for(let s of n)for(let c=0;c<s.chunk.length;c++)s.chunk[c].maxPoint<=0&&r.set(s.chunk[c],s.chunkPos[c]);let o=new Set;for(let s of e)for(let c=0;c<s.chunk.length;c++){let f=r.get(s.chunk[c]);f!=null&&(t?t.mapPos(f):f)==s.chunkPos[c]&&!t?.touchesRange(f,f+s.chunk[c].length)&&o.add(s.chunk[c])}return o}class KA{constructor(e,t,r,o=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=o}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let o=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(o)||this.layer.chunkEnd(this.chunkIndex)<e||o.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let o=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<o)&&this.setRangeIndex(o)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!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],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.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 la{constructor(e){this.heap=e}static from(e,t=null,r=-1){let o=[];for(let s=0;s<e.length;s++)for(let c=e[s];!c.isEmpty;c=c.nextLayer)c.maxPoint>=r&&o.push(new KA(c,t,r,s));return o.length==1?o[0]:new la(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)wm(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)wm(this.heap,r);(this.to-e||this.value.endSide-t)<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(),wm(this.heap,0)}}}function wm(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let o=n[r];if(r+1<n.length&&o.compare(n[r+1])>=0&&(o=n[r+1],r++),t.compare(o)<0)break;n[r]=t,n[e]=o,e=r}}class js{constructor(e,t,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=la.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){$c(this.active,e),$c(this.activeTo,e),$c(this.activeRank,e),this.minActive=i1(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:o,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||o-this.activeTo[t])>0;)t++;Jc(this.active,t,r),Jc(this.activeTo,t,o),Jc(this.activeRank,t,s),e&&Jc(e,t,this.cursor.from),this.minActive=i1(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),r&&$c(r,o)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.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 o=r.length-1;o>=0&&r[o]<e;o--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];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)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function n1(n,e,t,r,o,s){n.goto(e),t.goto(r);let c=r+o,f=r,h=r-e,d=!!s.boundChange;for(let p=!1;;){let v=n.to+h-t.to,y=v||n.endSide-t.endSide,x=y<0?n.to+h:t.to,A=Math.min(x,c);if(n.point||t.point?(n.point&&t.point&&_g(n.point,t.point)&&vp(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(f,A,n.point,t.point),p=!1):(p&&s.boundChange(f),A>f&&!vp(n.active,t.active)&&s.compareRange(f,A,n.active,t.active),d&&A<c&&(v||n.openEnd(x)!=t.openEnd(x))&&(p=!0)),x>c)break;f=x,y<=0&&n.next(),y>=0&&t.next()}}function vp(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!_g(n[t],e[t]))return!1;return!0}function $c(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function Jc(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function i1(n,e){let t=-1,r=1e9;for(let o=0;o<e.length;o++)(e[o]-r||n[o].endSide-n[t].endSide)<0&&(t=o,r=e[o]);return t}function Rf(n,e,t=n.length){let r=0;for(let o=0;o<t&&o<n.length;)n.charCodeAt(o)==9?(r+=e-r%e,o++):(r++,o=Bt(n,o));return r}function xz(n,e,t,r){for(let o=0,s=0;;){if(s>=e)return o;if(o==n.length)break;s+=n.charCodeAt(o)==9?t-s%t:1,o=Bt(n,o)}return n.length}const yp="ͼ",r1=typeof Symbol>"u"?"__"+yp:Symbol.for(yp),bp=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),l1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Rr{constructor(e,t){this.rules=[];let{finish:r}=t||{};function o(c){return/^@/.test(c)?[c]:c.split(/,\s*/)}function s(c,f,h,d){let p=[],v=/^@(\w+)\b/.exec(c[0]),y=v&&v[1]=="keyframes";if(v&&f==null)return h.push(c[0]+";");for(let x in f){let A=f[x];if(/&/.test(x))s(x.split(/,\s*/).map(C=>c.map(M=>C.replace(/&/,M))).reduce((C,M)=>C.concat(M)),A,h);else if(A&&typeof A=="object"){if(!v)throw new RangeError("The value of a property ("+x+") should be a primitive value.");s(o(x),A,p,y)}else A!=null&&p.push(x.replace(/_.*/,"").replace(/[A-Z]/g,C=>"-"+C.toLowerCase())+": "+A+";")}(p.length||y)&&h.push((r&&!v&&!d?c.map(r):c).join(", ")+" {"+p.join(" ")+"}")}for(let c in e)s(o(c),e[c],this.rules)}getRules(){return this.rules.join(`
58
+ `)}static newName(){let e=l1[r1]||1;return l1[r1]=e+1,yp+e.toString(36)}static mount(e,t,r){let o=e[bp],s=r&&r.nonce;o?s&&o.setNonce(s):o=new Sz(e,s),o.mount(Array.isArray(t)?t:[t],e)}}let o1=new Map;class Sz{constructor(e,t){let r=e.ownerDocument||e,o=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let s=o1.get(r);if(s)return e[bp]=s;this.sheet=new o.CSSStyleSheet,o1.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[bp]=this}mount(e,t){let r=this.sheet,o=0,s=0;for(let c=0;c<e.length;c++){let f=e[c],h=this.modules.indexOf(f);if(h<s&&h>-1&&(this.modules.splice(h,1),s--,h=-1),h==-1){if(this.modules.splice(s++,0,f),r)for(let d=0;d<f.rules.length;d++)r.insertRule(f.rules[d],o++)}else{for(;s<h;)o+=this.modules[s++].rules.length;o+=f.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let c="";for(let h=0;h<this.modules.length;h++)c+=this.modules[h].getRules()+`
59
+ `;this.styleTag.textContent=c;let f=t.head||t;this.styleTag.parentNode!=f&&f.insertBefore(this.styleTag,f.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Dr={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:"'"},oa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wz=typeof navigator<"u"&&/Mac/.test(navigator.platform),Cz=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _t=0;_t<10;_t++)Dr[48+_t]=Dr[96+_t]=String(_t);for(var _t=1;_t<=24;_t++)Dr[_t+111]="F"+_t;for(var _t=65;_t<=90;_t++)Dr[_t]=String.fromCharCode(_t+32),oa[_t]=String.fromCharCode(_t);for(var Cm in Dr)oa.hasOwnProperty(Cm)||(oa[Cm]=Dr[Cm]);function Az(n){var e=wz&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Cz&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?oa:Dr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}let Yt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},xp=typeof document<"u"?document:{documentElement:{style:{}}};const Sp=/Edge\/(\d+)/.exec(Yt.userAgent),WA=/MSIE \d/.test(Yt.userAgent),wp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yt.userAgent),Df=!!(WA||wp||Sp),s1=!Df&&/gecko\/(\d+)/i.test(Yt.userAgent),Am=!Df&&/Chrome\/(\d+)/.exec(Yt.userAgent),Ez="webkitFontSmoothing"in xp.documentElement.style,Cp=!Df&&/Apple Computer/.test(Yt.vendor),a1=Cp&&(/Mobile\/\w+/.test(Yt.userAgent)||Yt.maxTouchPoints>2);var he={mac:a1||/Mac/.test(Yt.platform),windows:/Win/.test(Yt.platform),linux:/Linux|X11/.test(Yt.platform),ie:Df,ie_version:WA?xp.documentMode||6:wp?+wp[1]:Sp?+Sp[1]:0,gecko:s1,gecko_version:s1?+(/Firefox\/(\d+)/.exec(Yt.userAgent)||[0,0])[1]:0,chrome:!!Am,chrome_version:Am?+Am[1]:0,ios:a1,android:/Android\b/.test(Yt.userAgent),webkit_version:Ez?+(/\bAppleWebKit\/(\d+)/.exec(Yt.userAgent)||[0,0])[1]:0,safari:Cp,safari_version:Cp?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Yt.userAgent)||[0,0])[1]:0,tabSize:xp.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function zg(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Yu=Object.create(null);function Lg(n,e,t){if(n==e)return!0;n||(n=Yu),e||(e=Yu);let r=Object.keys(n),o=Object.keys(e);if(r.length-0!=o.length-0)return!1;for(let s of r)if(s!=t&&(o.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function Mz(n,e){for(let t=n.attributes.length-1;t>=0;t--){let r=n.attributes[t].name;e[r]==null&&n.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?n.style.cssText=r:n.getAttribute(t)!=r&&n.setAttribute(t,r)}}function c1(n,e,t){let r=!1;if(e)for(let o in e)t&&o in t||(r=!0,o=="style"?n.style.cssText="":n.removeAttribute(o));if(t)for(let o in t)e&&e[o]==t[o]||(r=!0,o=="style"?n.style.cssText=t[o]:n.setAttribute(o,t[o]));return r}function Tz(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class Nf{eq(e){return!1}updateDOM(e,t){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,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Lt=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(Lt||(Lt={}));class lt extends yl{constructor(e,t,r,o){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=o}get heightRelevant(){return!1}static mark(e){return new xa(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new bl(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,o;if(e.isBlockGap)r=-5e8,o=4e8;else{let{start:s,end:c}=XA(e,t);r=(s?t?-3e8:-1:5e8)-1,o=(c?t?2e8:1:-6e8)+1}return new bl(e,r,o,t,e.widget||null,!0)}static line(e){return new Sa(e)}static set(e,t=!1){return Ue.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}lt.none=Ue.empty;class xa extends lt{constructor(e){let{start:t,end:r}=XA(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?zg(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Yu}eq(e){return this==e||e instanceof xa&&this.tagName==e.tagName&&Lg(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}xa.prototype.point=!1;class Sa extends lt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Sa&&this.spec.class==e.spec.class&&Lg(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Sa.prototype.mapMode=gn.TrackBefore;Sa.prototype.point=!0;class bl extends lt{constructor(e,t,r,o,s,c){super(t,r,s,e),this.block=o,this.isReplace=c,this.mapMode=o?t<=0?gn.TrackBefore:gn.TrackAfter:gn.TrackDel}get type(){return this.startSide!=this.endSide?Lt.WidgetRange:this.startSide<=0?Lt.WidgetBefore:Lt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bl&&kz(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}bl.prototype.point=!0;function XA(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function kz(n,e){return n==e||!!(n&&e&&n.compare(e))}function bo(n,e,t,r=0){let o=t.length-1;o>=0&&t[o]+r>=n?t[o]=Math.max(t[o],e):t.push(n,e)}class sa extends yl{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof sa&&this.tagName==e.tagName&&Lg(this.attributes,e.attributes)}static create(e){return new sa(e.tagName,e.attributes||Yu)}static set(e,t=!1){return Ue.of(e,t)}}sa.prototype.startSide=sa.prototype.endSide=-1;function Mo(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Ap(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Qs(n,e){if(!e.anchorNode)return!1;try{return Ap(n,e.anchorNode)}catch{return!1}}function xu(n){return n.nodeType==3?aa(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Zs(n,e,t,r){return t?u1(n,e,t,r,-1)||u1(n,e,t,r,1):!1}function Nr(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Fu(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function u1(n,e,t,r,o){for(;;){if(n==t&&e==r)return!0;if(e==(o<0?0:Fi(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=Nr(n)+(o<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=o<0?Fi(n):0}else return!1}}function Fi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ku(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Oz(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function QA(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function Rz(n,e,t,r,o,s,c,f){let h=n.ownerDocument,d=h.defaultView||window;for(let p=n,v=!1;p&&!v;)if(p.nodeType==1){let y,x=p==h.body,A=1,C=1;if(x)y=Oz(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(p).position)&&(v=!0),p.scrollHeight<=p.clientHeight&&p.scrollWidth<=p.clientWidth){p=p.assignedSlot||p.parentNode;continue}let D=p.getBoundingClientRect();({scaleX:A,scaleY:C}=QA(p,D)),y={left:D.left,right:D.left+p.clientWidth*A,top:D.top,bottom:D.top+p.clientHeight*C}}let M=0,T=0;if(o=="nearest")e.top<y.top?(T=e.top-(y.top+c),t>0&&e.bottom>y.bottom+T&&(T=e.bottom-y.bottom+c)):e.bottom>y.bottom&&(T=e.bottom-y.bottom+c,t<0&&e.top-T<y.top&&(T=e.top-(y.top+c)));else{let D=e.bottom-e.top,N=y.bottom-y.top;T=(o=="center"&&D<=N?e.top+D/2-N/2:o=="start"||o=="center"&&t<0?e.top-c:e.bottom-N+c)-y.top}if(r=="nearest"?e.left<y.left?(M=e.left-(y.left+s),t>0&&e.right>y.right+M&&(M=e.right-y.right+s)):e.right>y.right&&(M=e.right-y.right+s,t<0&&e.left<y.left+M&&(M=e.left-(y.left+s))):M=(r=="center"?e.left+(e.right-e.left)/2-(y.right-y.left)/2:r=="start"==f?e.left-s:e.right-(y.right-y.left)+s)-y.left,M||T)if(x)d.scrollBy(M,T);else{let D=0,N=0;if(T){let j=p.scrollTop;p.scrollTop+=T/C,N=(p.scrollTop-j)*C}if(M){let j=p.scrollLeft;p.scrollLeft+=M/A,D=(p.scrollLeft-j)*A}e={left:e.left-D,top:e.top-N,right:e.right-D,bottom:e.bottom-N},D&&Math.abs(D-M)<1&&(r="nearest"),N&&Math.abs(N-T)<1&&(o="nearest")}if(x)break;(e.top<y.top||e.bottom>y.bottom||e.left<y.left||e.right>y.right)&&(e={left:Math.max(e.left,y.left),right:Math.min(e.right,y.right),top:Math.max(e.top,y.top),bottom:Math.min(e.bottom,y.bottom)}),p=p.assignedSlot||p.parentNode}else if(p.nodeType==11)p=p.host;else break}function Dz(n){let e=n.ownerDocument,t,r;for(let o=n.parentNode;o&&!(o==e.body||t&&r);)if(o.nodeType==1)!r&&o.scrollHeight>o.clientHeight&&(r=o),!t&&o.scrollWidth>o.clientWidth&&(t=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:t,y:r}}class Nz{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:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?Fi(t):0),r,Math.min(e.focusOffset,r?Fi(r):0))}set(e,t,r,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=o}}let sl=null;he.safari&&he.safari_version>=26&&(sl=!1);function ZA(n){if(n.setActive)return n.setActive();if(sl)return n.focus(sl);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(sl==null?{get preventScroll(){return sl={preventScroll:!0},!0}}:void 0),!sl){sl=!1;for(let t=0;t<e.length;){let r=e[t++],o=e[t++],s=e[t++];r.scrollTop!=o&&(r.scrollTop=o),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let f1;function aa(n,e,t=e){let r=f1||(f1=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function xo(n,e,t,r){let o={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=r);let s=new KeyboardEvent("keydown",o);s.synthetic=!0,n.dispatchEvent(s);let c=new KeyboardEvent("keyup",o);return c.synthetic=!0,n.dispatchEvent(c),s.defaultPrevented||c.defaultPrevented}function _z(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function Bz(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,Fi(t));;)if(r){if(t.nodeType!=1)return!1;let o=t.childNodes[r-1];o.contentEditable=="false"?r--:(t=o,r=Fi(t))}else{if(t==n)return!0;r=Nr(t),t=t.parentNode}}function $A(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function JA(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Fi(t)}else if(t.parentNode&&!Fu(t))r=Nr(t),t=t.parentNode;else return null}}function e2(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!Fu(t))r=Nr(t)+1,t=t.parentNode;else return null}}class Yn{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new Yn(e.parentNode,Nr(e),t)}static after(e,t){return new Yn(e.parentNode,Nr(e)+1,t)}}var rt=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(rt||(rt={}));const xl=rt.LTR,jg=rt.RTL;function t2(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const zz=t2("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Lz=t2("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ep=Object.create(null),ni=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Ep[e]=t,Ep[t]=-e}function n2(n){return n<=247?zz[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?Lz[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const jz=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Gi{get dir(){return this.level%2?jg:xl}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,o){let s=-1;for(let c=0;c<e.length;c++){let f=e[c];if(f.from<=t&&f.to>=t){if(f.level==r)return c;(s<0||(o!=0?o<0?f.from<t:f.to>t:e[s].level>f.level))&&(s=c)}}if(s<0)throw new RangeError("Index out of range");return s}}function i2(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],o=e[t];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!i2(r.inner,o.inner))return!1}return!0}const $e=[];function Hz(n,e,t,r,o){for(let s=0;s<=r.length;s++){let c=s?r[s-1].to:e,f=s<r.length?r[s].from:t,h=s?256:o;for(let d=c,p=h,v=h;d<f;d++){let y=n2(n.charCodeAt(d));y==512?y=p:y==8&&v==4&&(y=16),$e[d]=y==4?2:y,y&7&&(v=y),p=y}for(let d=c,p=h,v=h;d<f;d++){let y=$e[d];if(y==128)d<f-1&&p==$e[d+1]&&p&24?y=$e[d]=p:$e[d]=256;else if(y==64){let x=d+1;for(;x<f&&$e[x]==64;)x++;let A=d&&p==8||x<t&&$e[x]==8?v==1?1:8:256;for(let C=d;C<x;C++)$e[C]=A;d=x-1}else y==8&&v==1&&($e[d]=1);p=y,y&7&&(v=y)}}}function Uz(n,e,t,r,o){let s=o==1?2:1;for(let c=0,f=0,h=0;c<=r.length;c++){let d=c?r[c-1].to:e,p=c<r.length?r[c].from:t;for(let v=d,y,x,A;v<p;v++)if(x=Ep[y=n.charCodeAt(v)])if(x<0){for(let C=f-3;C>=0;C-=3)if(ni[C+1]==-x){let M=ni[C+2],T=M&2?o:M&4?M&1?s:o:0;T&&($e[v]=$e[ni[C]]=T),f=C;break}}else{if(ni.length==189)break;ni[f++]=v,ni[f++]=y,ni[f++]=h}else if((A=$e[v])==2||A==1){let C=A==o;h=C?0:1;for(let M=f-3;M>=0;M-=3){let T=ni[M+2];if(T&2)break;if(C)ni[M+2]|=2;else{if(T&4)break;ni[M+2]|=4}}}}}function Pz(n,e,t,r){for(let o=0,s=r;o<=t.length;o++){let c=o?t[o-1].to:n,f=o<t.length?t[o].from:e;for(let h=c;h<f;){let d=$e[h];if(d==256){let p=h+1;for(;;)if(p==f){if(o==t.length)break;p=t[o++].to,f=o<t.length?t[o].from:e}else if($e[p]==256)p++;else break;let v=s==1,y=(p<e?$e[p]:r)==1,x=v==y?v?1:2:r;for(let A=p,C=o,M=C?t[C-1].to:n;A>h;)A==M&&(A=t[--C].from,M=C?t[C-1].to:n),$e[--A]=x;h=p}else s=d,h++}}}function Mp(n,e,t,r,o,s,c){let f=r%2?2:1;if(r%2==o%2)for(let h=e,d=0;h<t;){let p=!0,v=!1;if(d==s.length||h<s[d].from){let C=$e[h];C!=f&&(p=!1,v=C==16)}let y=!p&&f==1?[]:null,x=p?r:r+1,A=h;e:for(;;)if(d<s.length&&A==s[d].from){if(v)break e;let C=s[d];if(!p)for(let M=C.to,T=d+1;;){if(M==t)break e;if(T<s.length&&s[T].from==M)M=s[T++].to;else{if($e[M]==f)break e;break}}if(d++,y)y.push(C);else{C.from>h&&c.push(new Gi(h,C.from,x));let M=C.direction==xl!=!(x%2);Tp(n,M?r+1:r,o,C.inner,C.from,C.to,c),h=C.to}A=C.to}else{if(A==t||(p?$e[A]!=f:$e[A]==f))break;A++}y?Mp(n,h,A,r+1,o,y,c):h<A&&c.push(new Gi(h,A,x)),h=A}else for(let h=t,d=s.length;h>e;){let p=!0,v=!1;if(!d||h>s[d-1].to){let C=$e[h-1];C!=f&&(p=!1,v=C==16)}let y=!p&&f==1?[]:null,x=p?r:r+1,A=h;e:for(;;)if(d&&A==s[d-1].to){if(v)break e;let C=s[--d];if(!p)for(let M=C.from,T=d;;){if(M==e)break e;if(T&&s[T-1].to==M)M=s[--T].from;else{if($e[M-1]==f)break e;break}}if(y)y.push(C);else{C.to<h&&c.push(new Gi(C.to,h,x));let M=C.direction==xl!=!(x%2);Tp(n,M?r+1:r,o,C.inner,C.from,C.to,c),h=C.from}A=C.from}else{if(A==e||(p?$e[A-1]!=f:$e[A-1]==f))break;A--}y?Mp(n,A,h,r+1,o,y,c):A<h&&c.push(new Gi(A,h,x)),h=A}}function Tp(n,e,t,r,o,s,c){let f=e%2?2:1;Hz(n,o,s,r,f),Uz(n,o,s,r,f),Pz(o,s,r,f),Mp(n,o,s,e,t,r,c)}function Vz(n,e,t){if(!n)return[new Gi(0,0,e==jg?1:0)];if(e==xl&&!t.length&&!jz.test(n))return r2(n.length);if(t.length)for(;n.length>$e.length;)$e[$e.length]=256;let r=[],o=e==xl?0:1;return Tp(n,o,o,t,0,n.length,r),r}function r2(n){return[new Gi(0,n,0)]}let l2="";function Iz(n,e,t,r,o){var s;let c=r.head-n.from,f=Gi.find(e,c,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),h=e[f],d=h.side(o,t);if(c==d){let y=f+=o?1:-1;if(y<0||y>=e.length)return null;h=e[f=y],c=h.side(!o,t),d=h.side(o,t)}let p=Bt(n.text,c,h.forward(o,t));(p<h.from||p>h.to)&&(p=d),l2=n.text.slice(Math.min(c,p),Math.max(c,p));let v=f==(o?e.length-1:0)?null:e[f+(o?1:-1)];return v&&p==d&&v.level+(o?0:1)<h.level?le.cursor(v.side(!o,t)+n.from,v.forward(o,t)?1:-1,v.level):le.cursor(p+n.from,h.forward(o,t)?-1:1,h.level)}function Gz(n,e,t){for(let r=e;r<t;r++){let o=n2(n.charCodeAt(r));if(o==1)return xl;if(o==2||o==4)return jg}return xl}const o2=be.define(),s2=be.define(),a2=be.define(),c2=be.define(),kp=be.define(),u2=be.define(),f2=be.define(),Hg=be.define(),Ug=be.define(),h2=be.define({combine:n=>n.some(e=>e)}),d2=be.define({combine:n=>n.some(e=>e)}),m2=be.define();class So{constructor(e,t="nearest",r="nearest",o=5,s=5,c=!1){this.range=e,this.y=t,this.x=r,this.yMargin=o,this.xMargin=s,this.isSnapshot=c}map(e){return e.empty?this:new So(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 So(le.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const eu=ht.define({map:(n,e)=>n.map(e)}),p2=ht.define();function ui(n,e,t){let r=n.facet(c2);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Vi=be.define({combine:n=>n.length?n[0]:!0});let qz=0;const mo=be.define({combine(n){return n.filter((e,t)=>{for(let r=0;r<t;r++)if(n[r].plugin==e.plugin)return!1;return!0})}});class vi{constructor(e,t,r,o,s){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=o,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(mo.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(mo.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:r,eventObservers:o,provide:s,decorations:c}=t||{};return new vi(qz++,e,r,o,f=>{let h=[];return c&&h.push(_f.of(d=>{let p=d.plugin(f);return p?c(p):lt.none})),s&&h.push(s(f)),h})}static fromClass(e,t){return vi.define((r,o)=>new e(r,o),t)}}class Em{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 t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(ui(t.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(t){ui(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){ui(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const g2=be.define(),Pg=be.define(),_f=be.define(),v2=be.define(),Vg=be.define(),wa=be.define(),y2=be.define();function h1(n,e){let t=n.state.facet(y2);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(n):s),o=[];return Ue.spans(r,e.from,e.to,{point(){},span(s,c,f,h){let d=s-e.from,p=c-e.from,v=o;for(let y=f.length-1;y>=0;y--,h--){let x=f[y].spec.bidiIsolate,A;if(x==null&&(x=Gz(e.text,d,p)),h>0&&v.length&&(A=v[v.length-1]).to==d&&A.direction==x)A.to=p,v=A.inner;else{let C={from:d,to:p,direction:x,inner:[]};v.push(C),v=C.inner}}}}),o}const b2=be.define();function x2(n){let e=0,t=0,r=0,o=0;for(let s of n.state.facet(b2)){let c=s(n);c&&(c.left!=null&&(e=Math.max(e,c.left)),c.right!=null&&(t=Math.max(t,c.right)),c.top!=null&&(r=Math.max(r,c.top)),c.bottom!=null&&(o=Math.max(o,c.bottom)))}return{left:e,right:t,top:r,bottom:o}}const Gs=be.define();class Dn{constructor(e,t,r,o){this.fromA=e,this.toA=t,this.fromB=r,this.toB=o}join(e){return new Dn(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 t=e.length,r=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>r.toA)){if(o.toA<r.fromA)break;r=r.join(o),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let o=0,s=0,c=0;;){let f=o<e.length?e[o].fromB:1e9,h=s<t.length?t[s]:1e9,d=Math.min(f,h);if(d==1e9)break;let p=d+c,v=d,y=p;for(;;)if(s<t.length&&t[s]<=v){let x=t[s+1];s+=2,v=Math.max(v,x);for(let A=o;A<e.length&&e[A].fromB<=v;A++)c=e[A].toA-e[A].toB;y=Math.max(y,x+c)}else if(o<e.length&&e[o].fromB<=v){let x=e[o++];v=Math.max(v,x.toB),y=Math.max(y,x.toA),c=x.toA-x.toB}else break;r.push(new Dn(p,y,d,v))}return r}}class Wu{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=St.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let o=[];this.changes.iterChangedRanges((s,c,f,h)=>o.push(new Dn(s,c,f,h))),this.changedRanges=o}static create(e,t,r){return new Wu(e,t,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 Yz=[];class yt{constructor(e,t,r=0){this.dom=e,this.length=t,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Yz}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 t=this.domAttrs;t&&Mz(this.dom,t)}}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,t=this.posAtStart){let r=t;for(let o of this.children){if(o==e)return r;r+=o.length+o.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let r=Nr(this.dom),o=this.length?e>0:t>0;return new Yn(this.parent.dom,r+(o?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 zf)return e;return null}static get(e){return e.cmTile}}class Bf extends yt{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 t=this.dom,r=null,o,s=e?.node==t?e:null,c=0;for(let f of this.children){if(f.sync(e),c+=f.length+f.breakAfter,o=r?r.nextSibling:t.firstChild,s&&o!=f.dom&&(s.written=!0),f.dom.parentNode==t)for(;o&&o!=f.dom;)o=d1(o);else t.insertBefore(f.dom,o);r=f.dom}for(o=r?r.nextSibling:t.firstChild,s&&o&&(s.written=!0);o;)o=d1(o);this.length=c}}function d1(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class zf extends Bf{constructor(e,t){super(t),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 t=yt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],r=this,o=0,s=0;;)if(o==r.children.length){if(!t.length)return;r=r.parent,r.breakAfter&&s++,o=t.pop()}else{let c=r.children[o++];if(c instanceof Tr)t.push(o),r=c,o=0;else{let f=s+c.length,h=e(c,s);if(h!==void 0)return h;s=f+c.breakAfter}}}resolveBlock(e,t){let r,o=-1,s,c=-1;if(this.blockTiles((f,h)=>{let d=h+f.length;if(e>=h&&e<=d){if(f.isWidget()&&t>=-1&&t<=1){if(f.flags&32)return!0;f.flags&16&&(r=void 0)}(h<e||e==d&&(t<-1?f.length:f.covers(1)))&&(!r||!f.isWidget()&&r.isWidget())&&(r=f,o=e-h),(d>e||e==h&&(t>1?f.length:f.covers(-1)))&&(!s||!f.isWidget()&&s.isWidget())&&(s=f,c=e-h)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&t<0||!s?{tile:r,offset:o}:{tile:s,offset:c}}}class Tr extends Bf{constructor(e,t){super(e),this.wrapper=t}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,t){let r=new Tr(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class To extends Bf{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,r){let o=new To(t||document.createElement("div"),e);return(!t||!r)&&(o.flags|=4),o}get domAttrs(){return this.attrs}resolveInline(e,t,r){let o=null,s=-1,c=null,f=-1;function h(p,v){for(let y=0,x=0;y<p.children.length&&x<=v;y++){let A=p.children[y],C=x+A.length;C>=v&&(A.isComposite()?h(A,v-x):(!c||c.isHidden&&(t>0||r&&Kz(c,A)))&&(C>v||A.flags&32)?(c=A,f=v-x):(x<v||A.flags&16&&!A.isHidden)&&(o=A,s=v-x)),x=C}}h(this,e);let d=(t<0?o:c)||o||c;return d?{tile:d,offset:d==o?s:f}:null}coordsIn(e,t){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t):Fz(this)}domIn(e,t){let r=this.resolveInline(e,t);if(r){let{tile:o,offset:s}=r;if(this.dom.contains(o.dom))return o.isText()?new Yn(o.dom,Math.min(o.dom.nodeValue.length,s)):o.domPosFor(s,o.flags&16?1:o.flags&32?-1:t);let c=r.tile.parent,f=!1;for(let h of c.children){if(f)return new Yn(h.dom,0);h==r.tile&&(f=!0)}}return new Yn(this.dom,0)}}function Fz(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=xu(e);return t[t.length-1]||null}function Kz(n,e){let t=n.coordsIn(0,1),r=e.coordsIn(0,1);return t&&r&&r.top<t.bottom}class en extends Bf{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let r=new en(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class ul extends yt{constructor(e,t){super(e,t.length),this.text=t}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,t){let r=this.dom.nodeValue.length;e>r&&(e=r);let o=e,s=e,c=0;e==0&&t<0||e==r&&t>=0?he.chrome||he.gecko||(e?(o--,c=1):s<r&&(s++,c=-1)):t<0?o--:s<r&&s++;let f=aa(this.dom,o,s).getClientRects();if(!f.length)return null;let h=f[(c?c<0:t>=0)?0:f.length-1];return he.safari&&!c&&h.width==0&&(h=Array.prototype.find.call(f,d=>d.width)||h),c?Ku(h,c<0):h||null}static of(e,t){let r=new ul(t||document.createTextNode(e),e);return t||(r.flags|=2),r}}class Sl extends yt{constructor(e,t,r,o){super(e,t,o),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,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,r){let o=this.widget.coordsAt(this.dom,e,t);if(o)return o;if(r)return Ku(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),c=null;if(!s.length)return null;let f=this.flags&16?!0:this.flags&32?!1:e>0;for(let h=f?s.length-1:0;c=s[h],!(e>0?h==0:h==s.length-1||c.top<c.bottom);h+=f?-1:1);return Ku(c,!f)}}get overrideDOMText(){if(!this.length)return Ie.empty;let{root:e}=this;if(!e)return Ie.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,r,o,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new Sl(s,r,e,o)}}class Xu extends yt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Ie.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Wz{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,r){let{tile:o,index:s,beforeBreak:c,parents:f}=this;for(;e||t>0;)if(o.isComposite())if(c){if(!e)break;r&&r.break(),e--,c=!1}else if(s==o.children.length){if(!e&&!f.length)break;r&&r.leave(o),c=!!o.breakAfter,{tile:o,index:s}=f.pop(),s++}else{let h=o.children[s],d=h.breakAfter;(t>0?h.length<=e:h.length<e)&&(!r||r.skip(h,0,h.length)!==!1||!h.isComposite)?(c=!!d,s++,e-=h.length):(f.push({tile:o,index:s}),o=h,s=0,r&&h.isComposite()&&r.enter(h))}else if(s==o.length)c=!!o.breakAfter,{tile:o,index:s}=f.pop(),s++;else if(e){let h=Math.min(e,o.length-s);r&&r.skip(o,s,s+h),e-=h,s+=h}else break;return this.tile=o,this.index=s,this.beforeBreak=c,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Xz{constructor(e,t,r,o){this.from=e,this.to=t,this.wrapper=r,this.rank=o}}class Qz{constructor(e,t,r){this.cache=e,this.root=t,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,r,o){var s;this.flushBuffer();let c=this.ensureMarks(t,r),f=c.lastChild;if(f&&f.isText()&&!(f.flags&8)&&f.length+e.length<512){this.cache.reused.set(f,2);let h=c.children[c.children.length-1]=new ul(f.dom,f.text+e);h.parent=c}else c.append(o||ul.of(e,(s=this.cache.find(ul))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let r=this.curLine;r.dom!=t.line.dom&&(r.setDOM(this.cache.reused.has(t.line)?Mm(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let o=r;for(let f=t.marks.length-1;f>=0;f--){let h=t.marks[f],d=o.lastChild;if(d instanceof en&&d.mark.eq(h.mark))d.dom!=h.dom&&d.setDOM(Mm(h.dom)),o=d;else{if(this.cache.reused.get(h)){let v=yt.get(h.dom);v&&v.setDOM(Mm(h.dom))}let p=en.of(h.mark,h.dom);o.append(p),o=p}this.cache.reused.set(h,2)}let s=yt.get(e.text);s&&this.cache.reused.set(s,2);let c=new ul(e.text,e.text.nodeValue);c.flags|=8,o.append(c)}addInlineWidget(e,t,r){let o=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);o||this.flushBuffer();let s=this.ensureMarks(t,r);!o&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,r){this.flushBuffer(),this.ensureMarks(t,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 t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var r;e||(e=S2);let o=To.start(e,t||((r=this.cache.find(To))===null||r===void 0?void 0:r.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=o)}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,t){var r;let o=this.curLine;for(let s=e.length-1;s>=0;s--){let c=e[s],f;if(t>0&&(f=o.lastChild)&&f instanceof en&&f.mark.eq(c))o=f,t--;else{let h=en.of(c,(r=this.cache.find(en,d=>d.mark.eq(c)))===null||r===void 0?void 0:r.dom);o.append(h),o=h,t=0}}return o}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!m1(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(he.ios&&m1(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Tm,0,32)||new Sl(Tm.toDOM(),0,Tm,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 t=new Xz(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-t.rank||this.wrappers[r-1].to-t.to)<0;)r--;this.wrappers.splice(r,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let r of this.wrappers){let o=t.lastChild;if(r.from<this.pos&&o instanceof Tr&&o.wrapper.eq(r.wrapper))t=o;else{let s=Tr.of(r.wrapper,(e=this.cache.find(Tr,c=>c.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),r=this.cache.find(Xu,void 0,1);return r&&(r.flags=t),r||new Xu(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Zz{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:o,lineBreak:s,done:c}=this.cursor.next(this.skipCount);if(this.skipCount=0,c)throw new Error("Ran out of text content when drawing inline views");this.text=o;let f=this.textOff=Math.min(e,o.length);return s?null:o.slice(0,f)}let t=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,t);return this.textOff=t,r}}const Qu=[Sl,To,ul,en,Xu,Tr,zf];for(let n=0;n<Qu.length;n++)Qu[n].bucket=n;class $z{constructor(e){this.view=e,this.buckets=Qu.map(()=>[]),this.index=Qu.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,r=this.buckets[t];r.length<6?r.push(e):r[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,r=2){let o=e.bucket,s=this.buckets[o],c=this.index[o];for(let f=s.length-1;f>=0;f--){let h=(f+c)%s.length,d=s[h];if((!t||t(d))&&!this.reused.has(d))return s.splice(h,1),h<c&&this.index[o]--,this.reused.set(d,r),d}return null}findWidget(e,t,r){let o=this.buckets[0];if(o.length)for(let s=0,c=0;;s++){if(s==o.length){if(c)return null;c=1,s=0}let f=o[s];if(!this.reused.has(f)&&(c==0?f.widget.compare(e):f.widget.constructor==e.constructor&&e.updateDOM(f.dom,this.view)))return o.splice(s,1),s<this.index[0]&&this.index[0]--,f.widget==e&&f.length==t&&(f.flags&497)==r?(this.reused.set(f,1),f):(this.reused.set(f,2),new Sl(f.dom,t,e,f.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Jz{constructor(e,t,r,o,s){this.view=e,this.decorations=o,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new $z(e),this.text=new Zz(e.state.doc),this.builder=new Qz(this.cache,new zf(e,e.contentDOM),Ue.iter(r)),this.cache.reused.set(t,2),this.old=new Wz(t),this.reuseWalker={skip:(c,f,h)=>{if(this.cache.add(c),c.isComposite())return!1},enter:c=>this.cache.add(c),leave:()=>{},break:()=>{}}}run(e,t){let r=t&&this.getCompositionContext(t.text);for(let o=0,s=0,c=0;;){let f=c<e.length?e[c++]:null,h=f?f.fromA:this.old.root.length;if(h>o){let d=h-o;this.preserve(d,!c,!f),o=h,s+=d}if(!f)break;t&&f.fromA<=t.range.fromA&&f.toA>=t.range.toA?(this.forward(f.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,r),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,f.toA),this.emit(t.range.toB,f.toB)):(this.forward(f.fromA,f.toA),this.emit(s,f.toB)),s=f.toB,o=f.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,r){let o=nL(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(c,f,h)=>{if(c.isWidget())if(this.openWidget)this.builder.continueWidget(h-f);else{let d=h>0||f<c.length?Sl.of(c.widget,this.view,h-f,c.flags&496,this.cache.maybeReuse(c)):this.cache.reuse(c);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,o,s),s=o.length)}else if(c.isText())this.builder.ensureLine(null),!f&&h==c.length?this.builder.addText(c.text,o,s,this.cache.reuse(c)):(this.cache.add(c),this.builder.addText(c.text.slice(f,h),o,s)),s=o.length;else if(c.isLine())c.flags&=-2,this.cache.reused.set(c,1),this.builder.addLine(c);else if(c instanceof Xu)this.cache.add(c);else if(c instanceof en)this.builder.ensureLine(null),this.builder.addMark(c,o,s),this.cache.reused.set(c,1),s=o.length;else return!1;this.openWidget=!1},enter:c=>{c.isLine()?this.builder.addLineStart(c.attrs,this.cache.maybeReuse(c)):(this.cache.add(c),c instanceof en&&o.unshift(c.mark)),this.openWidget=!1},leave:c=>{c.isLine()?o.length&&(o.length=s=0):c instanceof en&&(o.shift(),s=Math.min(s,o.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let r=null,o=this.builder,s=0,c=Ue.spans(this.decorations,e,t,{point:(f,h,d,p,v,y)=>{if(d instanceof bl){if(this.disallowBlockEffectsFor[y]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(h>this.view.state.doc.lineAt(f).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=p.length,v>p.length)o.continueWidget(h-f);else{let x=d.widget||(d.block?ko.block:ko.inline),A=eL(d),C=this.cache.findWidget(x,h-f,A)||Sl.of(x,this.view,h-f,A);d.block?(d.startSide>0&&o.addLineStartIfNotCovered(r),o.addBlockWidget(C)):(o.ensureLine(r),o.addInlineWidget(C,p,v))}r=null}else r=tL(r,d);h>f&&this.text.skip(h-f)},span:(f,h,d,p)=>{for(let v=f;v<h;){let y=this.text.next(Math.min(512,h-v));y==null?(o.addLineStartIfNotCovered(r),o.addBreak(),v++):(o.ensureLine(r),o.addText(y,d,v==f?p:d.length),v+=y.length),r=null}}});o.addLineStartIfNotCovered(r),this.openWidget=c>s,this.openMarks=c}forward(e,t,r=1){t-e<=10?this.old.advance(t-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let t=[],r=null;for(let o=e.parentNode;;o=o.parentNode){let s=yt.get(o);if(o==this.view.contentDOM)break;s instanceof en?t.push(s):s?.isLine()?r=s:o.nodeName=="DIV"&&!r&&o!=this.view.contentDOM?r=new To(o,S2):t.push(en.of(new xa({tagName:o.nodeName.toLowerCase(),attributes:Tz(o)}),o))}return{line:r,marks:t}}}function m1(n,e){let t=r=>{for(let o of r.children)if((e?o.isText():o.length)||t(o))return!0;return!1};return t(n)}function eL(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const S2={class:"cm-line"};function tL(n,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(n||(n={class:"cm-line"}),t&&zg(t,n),r&&(n.class+=" "+r)),n}function nL(n){let e=[];for(let t=n.parents.length;t>1;t--){let r=t==n.parents.length?n.tile:n.parents[t].tile;r instanceof en&&e.push(r.mark)}return e}function Mm(n){let e=yt.get(n);return e&&e.setDOM(n.cloneNode()),n}class ko extends Nf{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}}ko.inline=new ko("span");ko.block=new ko("div");const Tm=new class extends Nf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class p1{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=lt.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 zf(e,e.contentDOM),this.updateInner([new Dn(0,0,0,e.state.doc.length)],null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:p,toA:v})=>v<this.minWidthFrom||p>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 o=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?o=this.domChanged.newSel.head:!fL(e.changes,this.hasComposition)&&!e.selectionSet&&(o=e.state.selection.main.head));let s=o>-1?rL(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){let{from:p,to:v}=this.hasComposition;r=new Dn(p,v,e.changes.mapPos(p,-1),e.changes.mapPos(v,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(he.ie||he.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let c=this.decorations,f=this.blockWrappers;this.updateDeco();let h=sL(c,this.decorations,e.changes);h.length&&(r=Dn.extendWithRanges(r,h));let d=cL(f,this.blockWrappers,e.changes);return d.length&&(r=Dn.extendWithRanges(r,d)),s&&!r.some(p=>p.fromA<=s.range.fromA&&p.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(t||e.length){let c=this.tile,f=new Jz(this.view,c,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=f.run(e,t),Op(c,f.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 s=he.chrome||he.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof km&&o.push(s.dom);r.updateGaps(o)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(p2)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,o=this.view.root.activeElement,s=o==r,c=!s&&!(this.view.state.facet(Vi)||r.tabIndex>-1)&&Qs(r,this.view.observer.selectionRange)&&!(o&&r.contains(o));if(!(s||t||c))return;let f=this.forceSelection;this.forceSelection=!1;let h=this.view.state.selection.main,d,p;if(h.empty?p=d=this.inlineDOMNearPos(h.anchor,h.assoc||1):(p=this.inlineDOMNearPos(h.head,h.head==h.from?1:-1),d=this.inlineDOMNearPos(h.anchor,h.anchor==h.from?1:-1)),he.gecko&&h.empty&&!this.hasComposition&&iL(d)){let y=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(y,d.node.childNodes[d.offset]||null)),d=p=new Yn(y,0),f=!0}let v=this.view.observer.selectionRange;(f||!v.focusNode||(!Zs(d.node,d.offset,v.anchorNode,v.anchorOffset)||!Zs(p.node,p.offset,v.focusNode,v.focusOffset))&&!this.suppressWidgetCursorChange(v,h))&&(this.view.observer.ignore(()=>{he.android&&he.chrome&&r.contains(v.focusNode)&&uL(v.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let y=Mo(this.view.root);if(y)if(h.empty){if(he.gecko){let x=lL(d.node,d.offset);if(x&&x!=3){let A=(x==1?JA:e2)(d.node,d.offset);A&&(d=new Yn(A.node,A.offset))}}y.collapse(d.node,d.offset),h.bidiLevel!=null&&y.caretBidiLevel!==void 0&&(y.caretBidiLevel=h.bidiLevel)}else if(y.extend){y.collapse(d.node,d.offset);try{y.extend(p.node,p.offset)}catch{}}else{let x=document.createRange();h.anchor>h.head&&([d,p]=[p,d]),x.setEnd(p.node,p.offset),x.setStart(d.node,d.offset),y.removeAllRanges(),y.addRange(x)}c&&this.view.root.activeElement==r&&(r.blur(),o&&o.focus())}),this.view.observer.setSelectionRange(d,p)),this.impreciseAnchor=d.precise?null:new Yn(v.anchorNode,v.anchorOffset),this.impreciseHead=p.precise?null:new Yn(v.focusNode,v.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Zs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=Mo(e.root),{anchorNode:o,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let c=this.lineAt(t.head,t.assoc);if(!c)return;let f=c.posAtStart;if(t.head==f||t.head==f+c.length)return;let h=this.coordsAt(t.head,-1),d=this.coordsAt(t.head,1);if(!h||!d||h.bottom>d.top)return;let p=this.domAtPos(t.head+t.assoc,t.assoc);r.collapse(p.node,p.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let v=e.observer.selectionRange;e.docView.posFromDOM(v.anchorNode,v.anchorOffset)!=t.from&&r.collapse(o,s)}posFromDOM(e,t){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let o=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[t];else{let c=Fi(e)==0?0:t==0?-1:1;for(;;){let f=e.parentNode;if(f==r.dom)break;c==0&&f.firstChild!=f.lastChild&&(e==f.firstChild?c=-1:c=1),e=f}c<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return o;for(;s&&!yt.get(s);)s=s.nextSibling;if(!s)return o+r.length;for(let c=0,f=o;;c++){let h=r.children[c];if(h.dom==s)return f;f+=h.length+h.breakAfter}}else return r.isText()?e==r.dom?o+t:o+(t?r.length:0):o}domAtPos(e,t){let{tile:r,offset:o}=this.tile.resolveBlock(e,t);return r.isWidget()?r.domPosFor(e,t):r.domIn(o,t)}inlineDOMNearPos(e,t){let r,o=-1,s=!1,c,f=-1,h=!1;return this.tile.blockTiles((d,p)=>{if(d.isWidget()){if(d.flags&32&&p>=e)return!0;d.flags&16&&(s=!0)}else{let v=p+d.length;if(p<=e&&(r=d,o=e-p,s=v<e),v>=e&&!c&&(c=d,f=e-p,h=p>e),p>e&&c)return!0}}),!r&&!c?this.domAtPos(e,t):(s&&c?r=null:h&&r&&(c=null),r&&t<0||!c?r.domIn(o,t):c.domIn(f,t))}coordsAt(e,t){let{tile:r,offset:o}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof km?null:r.coordsInWidget(o,t,!0):r.coordsIn(o,t)}lineAt(e,t){let{tile:r}=this.tile.resolveBlock(e,t);return r.isLine()?r:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function o(s,c){if(s.isComposite())for(let f of s.children){if(f.length>=c){let h=o(f,c);if(h)return h}if(c-=f.length,c<0)break}else if(s.isText()&&c<s.length){let f=Bt(s.text,c);if(f==c)return null;let h=aa(s.dom,c,f).getClientRects();for(let d=0;d<h.length;d++){let p=h[d];if(d==h.length-1||p.top<p.bottom&&p.left<p.right)return p}}return null}return o(t,r)}measureVisibleLineHeights(e){let t=[],{from:r,to:o}=e,s=this.view.contentDOM.clientWidth,c=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,f=-1,h=this.view.textDirection==rt.LTR,d=0,p=(v,y,x)=>{for(let A=0;A<v.children.length&&!(y>o);A++){let C=v.children[A],M=y+C.length,T=C.dom.getBoundingClientRect(),{height:D}=T;if(x&&!A&&(d+=T.top-x.top),C instanceof Tr)M>r&&p(C,y,T);else if(y>=r&&(d>0&&t.push(-d),t.push(D+d),d=0,c)){let N=C.dom.lastChild,j=N?xu(N):[];if(j.length){let H=j[j.length-1],P=h?H.right-T.left:T.right-H.left;P>f&&(f=P,this.minWidth=s,this.minWidthFrom=y,this.minWidthTo=M)}}x&&A==v.children.length-1&&(d+=x.bottom-T.bottom),y=M+C.breakAfter}};return p(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?rt.RTL:rt.LTR}measureTextSize(){let e=this.tile.blockTiles(c=>{if(c.isLine()&&c.children.length&&c.length<=20){let f=0,h;for(let d of c.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let p=xu(d.dom);if(p.length!=1)return;f+=p[0].width,h=p[0].height}if(f)return{lineHeight:c.dom.getBoundingClientRect().height,charWidth:f/c.length,textHeight:h}}});if(e)return e;let t=document.createElement("div"),r,o,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let c=xu(t.firstChild)[0];r=t.getBoundingClientRect().height,o=c&&c.width?c.width/27:7,s=c&&c.height?c.height:r,t.remove()}),{lineHeight:r,charWidth:o,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,o=0;;o++){let s=o==t.viewports.length?null:t.viewports[o],c=s?s.from-1:this.view.state.doc.length;if(c>r){let f=(t.lineBlockAt(c).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(lt.replace({widget:new km(f),block:!0,inclusive:!0,isBlockGap:!0}).range(r,c))}if(!s)break;r=s.to+1}return lt.set(e)}updateDeco(){let e=1,t=this.view.state.facet(_f).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,o=this.view.state.facet(Vg).map((s,c)=>{let f=typeof s=="function";return f&&(r=!0),f?s(this.view):s});for(o.length&&(this.dynamicDecorationMap[e++]=r,t.push(Ue.join(o))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(v2).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(m2))try{if(d(this.view,e.range,e))return!0}catch(p){ui(this.view.state,p,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),o;if(!r)return;!t.empty&&(o=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,o.left),top:Math.min(r.top,o.top),right:Math.max(r.right,o.right),bottom:Math.max(r.bottom,o.bottom)});let s=x2(this.view),c={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:f,offsetHeight:h}=this.view.scrollDOM;Rz(this.view.scrollDOM,c,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,f),-f),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==rt.LTR)}lineHasWidget(e){let t=r=>r.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Op(this.tile)}}function Op(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let r of n.children)Op(r,e)}}function iL(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function w2(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=JA(t.focusNode,t.focusOffset),o=e2(t.focusNode,t.focusOffset),s=r||o;if(o&&r&&o.node!=r.node){let f=yt.get(o.node);if(!f||f.isText()&&f.text!=o.node.nodeValue)s=o;else if(n.docView.lastCompositionAfterCursor){let h=yt.get(r.node);!h||h.isText()&&h.text!=r.node.nodeValue||(s=o)}}if(n.docView.lastCompositionAfterCursor=s!=r,!s)return null;let c=e-s.offset;return{from:c,to:c+s.node.nodeValue.length,node:s.node}}function rL(n,e,t){let r=w2(n,t);if(!r)return null;let{node:o,from:s,to:c}=r,f=o.nodeValue;if(/[\n\r]/.test(f)||n.state.doc.sliceString(r.from,r.to)!=f)return null;let h=e.invertedDesc;return{range:new Dn(h.mapPos(s),h.mapPos(c),s,c),text:o}}function lL(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let oL=class{constructor(){this.changes=[]}compareRange(e,t){bo(e,t,this.changes)}comparePoint(e,t){bo(e,t,this.changes)}boundChange(e){bo(e,e,this.changes)}};function sL(n,e,t){let r=new oL;return Ue.compare(n,e,t,r),r.changes}class aL{constructor(){this.changes=[]}compareRange(e,t){bo(e,t,this.changes)}comparePoint(){}boundChange(e){bo(e,e,this.changes)}}function cL(n,e,t){let r=new aL;return Ue.compare(n,e,t,r),r.changes}function uL(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function fL(n,e){let t=!1;return e&&n.iterChangedRanges((r,o)=>{r<e.to&&o>e.from&&(t=!0)}),t}class km extends Nf{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 hL(n,e,t=1){let r=n.charCategorizer(e),o=n.doc.lineAt(e),s=e-o.from;if(o.length==0)return le.cursor(e);s==0?t=1:s==o.length&&(t=-1);let c=s,f=s;t<0?c=Bt(o.text,s,!1):f=Bt(o.text,s);let h=r(o.text.slice(c,f));for(;c>0;){let d=Bt(o.text,c,!1);if(r(o.text.slice(d,c))!=h)break;c=d}for(;f<o.length;){let d=Bt(o.text,f);if(r(o.text.slice(f,d))!=h)break;f=d}return le.range(c+o.from,f+o.from)}function dL(n,e,t,r,o){let s=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let f=n.viewState.heightOracle.textHeight,h=Math.floor((o-t.top-(n.defaultLineHeight-f)*.5)/f);s+=h*n.viewState.heightOracle.lineLength}let c=n.state.sliceDoc(t.from,t.to);return t.from+xz(c,s,n.state.tabSize)}function Rp(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let o;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!o||s.type==Lt.Text&&(o.type!=s.type||(t<0?s.from<e:s.to>e)))&&(o=s)}}return o||r}return r}function mL(n,e,t,r){let o=Rp(n,e.head,e.assoc||-1),s=!r||o.type!=Lt.Text||!(n.lineWrapping||o.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head);if(s){let c=n.dom.getBoundingClientRect(),f=n.textDirectionAt(o.from),h=n.posAtCoords({x:t==(f==rt.LTR)?c.right-1:c.left+1,y:(s.top+s.bottom)/2});if(h!=null)return le.cursor(h,t?-1:1)}return le.cursor(t?o.to:o.from,t?-1:1)}function g1(n,e,t,r){let o=n.state.doc.lineAt(e.head),s=n.bidiSpans(o),c=n.textDirectionAt(o.from);for(let f=e,h=null;;){let d=Iz(o,s,c,f,t),p=l2;if(!d){if(o.number==(t?n.state.doc.lines:1))return f;p=`
60
+ `,o=n.state.doc.line(o.number+(t?1:-1)),s=n.bidiSpans(o),d=n.visualLineSide(o,!t)}if(h){if(!h(p))return f}else{if(!r)return d;h=r(p)}f=d}}function pL(n,e,t){let r=n.state.charCategorizer(e),o=r(t);return s=>{let c=r(s);return o==Ii.Space&&(o=c),o==c}}function gL(n,e,t,r){let o=e.head,s=t?1:-1;if(o==(t?n.state.doc.length:0))return le.cursor(o,e.assoc);let c=e.goalColumn,f,h=n.contentDOM.getBoundingClientRect(),d=n.coordsAtPos(o,(e.empty?e.assoc:0)||(t?1:-1)),p=n.documentTop;if(d)c==null&&(c=d.left-h.left),f=s<0?d.top:d.bottom;else{let A=n.viewState.lineBlockAt(o);c==null&&(c=Math.min(h.right-h.left,n.defaultCharacterWidth*(o-A.from))),f=(s<0?A.top:A.bottom)+p}let v=h.left+c,y=r??n.viewState.heightOracle.textHeight>>1,x=Dp(n,{x:v,y:f+y*s},!1,s);return le.cursor(x.pos,x.assoc,void 0,c)}function $s(n,e,t){for(;;){let r=0;for(let o of n)o.between(e-1,e+1,(s,c,f)=>{if(e>s&&e<c){let h=r||t||(e-s<c-e?-1:1);e=h<0?s:c,r=h}});if(!r)return e}}function C2(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let o=e.ranges[r],s=null;if(o.empty){let c=$s(n,o.from,0);c!=o.from&&(s=le.cursor(c,-1))}else{let c=$s(n,o.from,-1),f=$s(n,o.to,1);(c!=o.from||f!=o.to)&&(s=le.range(o.from==o.anchor?c:f,o.from==o.head?c:f))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?le.create(t,e.mainIndex):e}function Om(n,e,t){let r=$s(n.state.facet(wa).map(o=>o(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:le.cursor(r,r<t.from?1:-1)}class ai{constructor(e,t){this.pos=e,this.assoc=t}}function Dp(n,e,t,r){let o=n.contentDOM.getBoundingClientRect(),s=o.top+n.viewState.paddingTop,{x:c,y:f}=e,h=f-s,d;for(;;){if(h<0)return new ai(0,1);if(h>n.viewState.docHeight)return new ai(n.state.doc.length,-1);if(d=n.elementAtHeight(h),r==null)break;if(d.type==Lt.Text){if(r<0?d.to<n.viewport.from:d.from>n.viewport.to)break;let y=n.docView.coordsAt(r<0?d.from:d.to,r>0?-1:1);if(y&&(r<0?y.top<=h+s:y.bottom>=h+s))break}let v=n.viewState.heightOracle.textHeight/2;h=r>0?d.bottom+v:d.top-v}if(n.viewport.from>=d.to||n.viewport.to<=d.from){if(t)return null;if(d.type==Lt.Text){let v=dL(n,o,d,c,f);return new ai(v,v==d.from?1:-1)}}if(d.type!=Lt.Text)return h<(d.top+d.bottom)/2?new ai(d.from,1):new ai(d.to,-1);let p=n.docView.lineAt(d.from,2);return(!p||p.length!=d.length)&&(p=n.docView.lineAt(d.from,-2)),A2(n,p,d.from,c,f)}function A2(n,e,t,r,o){let s=-1,c=null,f=1e9,h=1e9,d=o,p=o,v=(y,x)=>{for(let A=0;A<y.length;A++){let C=y[A];if(C.top==C.bottom)continue;let M=C.left>r?C.left-r:C.right<r?r-C.right:0,T=C.top>o?C.top-o:C.bottom<o?o-C.bottom:0;C.top<=p&&C.bottom>=d&&(d=Math.min(C.top,d),p=Math.max(C.bottom,p),T=0),(s<0||(T-h||M-f)<0)&&(s>=0&&h&&f<M&&c.top<=p-2&&c.bottom>=d+2?h=0:(s=x,f=M,h=T,c=C))}};if(e.isText()){for(let x=0;x<e.length;){let A=Bt(e.text,x);if(v(aa(e.dom,x,A).getClientRects(),x),!f&&!h)break;x=A}return r>(c.left+c.right)/2==(v1(n,s+t)==rt.LTR)?new ai(t+Bt(e.text,s),-1):new ai(t+s,1)}else{if(!e.length)return new ai(t,1);for(let C=0;C<e.children.length;C++){let M=e.children[C];if(M.flags&48)continue;let T=(M.dom.nodeType==1?M.dom:aa(M.dom,0,M.length)).getClientRects();if(v(T,C),!f&&!h)break}let y=e.children[s],x=e.posBefore(y,t);return y.isComposite()||y.isText()?A2(n,y,x,Math.max(c.left,Math.min(c.right,r)),o):r>(c.left+c.right)/2==(v1(n,s+t)==rt.LTR)?new ai(x+y.length,-1):new ai(x,1)}}function v1(n,e){let t=n.state.doc.lineAt(e);return n.bidiSpans(t)[Gi.find(n.bidiSpans(t),e-t.from,-1,1)].dir}const qs="￿";class vL{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(qe.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qs}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let o=e;;){this.findPointBefore(r,o);let s=this.text.length;this.readNode(o);let c=yt.get(o),f=o.nextSibling;if(f==t){c?.breakAfter&&!f&&r!=this.view.contentDOM&&this.lineBreak();break}let h=yt.get(f);(c&&h?c.breakAfter:(c?c.breakAfter:Fu(o))||Fu(f)&&(o.nodeName!="BR"||c?.isWidget())&&this.text.length>s)&&!bL(f,t)&&this.lineBreak(),o=f}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,c=1,f;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),c=this.lineSeparator.length):(f=o.exec(t))&&(s=f.index,c=f[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),c>1)for(let h of this.points)h.node==e&&h.pos>this.text.length&&(h.pos-=c-1);r=s+c}}readNode(e){let t=yt.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let o=r.iter();!o.next().done;)o.lineBreak?this.lineBreak():this.append(o.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,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(yL(e,r.node,r.offset)?t:0))}}function yL(n,e,t){for(;;){if(!e||t<Fi(e))return!1;if(e==n)return!0;t=Nr(e)+1,e=e.parentNode}}function bL(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let r=yt.get(n);if(!r?.isWidget())return!1;r&&(t||(t=[])).push(r)}if(t)for(let r of t){let o=r.overrideDOMText;if(o?.length)return!1}return!0}class y1{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class xL{constructor(e,t,r,o){this.typeOver=o,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:c}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=E2(e.docView.tile,t,r,0))){let f=s||c?[]:wL(e),h=new vL(f,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=CL(f,this.bounds.from)}else{let f=e.observer.selectionRange,h=s&&s.node==f.focusNode&&s.offset==f.focusOffset||!Ap(e.contentDOM,f.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),d=c&&c.node==f.anchorNode&&c.offset==f.anchorOffset||!Ap(e.contentDOM,f.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),p=e.viewport;if((he.ios||he.chrome)&&e.state.selection.main.empty&&h!=d&&(p.from>0||p.to<e.state.doc.length)){let v=Math.min(h,d),y=Math.max(h,d),x=p.from-v,A=p.to-y;(x==0||x==1||v==0)&&(A==0||A==-1||y==e.state.doc.length)&&(h=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(le.range(d,h)):this.newSel=le.single(d,h)}}}function E2(n,e,t,r){if(n.isComposite()){let o=-1,s=-1,c=-1,f=-1;for(let h=0,d=r,p=r;h<n.children.length;h++){let v=n.children[h],y=d+v.length;if(d<e&&y>t)return E2(v,e,t,d);if(y>=e&&o==-1&&(o=h,s=d),d>t&&v.dom.parentNode==n.dom){c=h,f=p;break}p=y,d=y+v.breakAfter}return{from:s,to:f<0?r+n.length:f,startDOM:(o?n.children[o-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:c<n.children.length&&c>=0?n.children[c].dom:null}}else return n.isText()?{from:r,to:r+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function M2(n,e){let t,{newSel:r}=e,o=n.state.selection.main,s=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:c,to:f}=e.bounds,h=o.from,d=null;(s===8||he.android&&e.text.length<f-c)&&(h=o.to,d="end");let p=T2(n.state.doc.sliceString(c,f,qs),e.text,h-c,d);p&&(he.chrome&&s==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==qs+qs&&p.toB--,t={from:c+p.from,to:c+p.toA,insert:Ie.of(e.text.slice(p.from,p.toB).split(qs))})}else r&&(!n.hasFocus&&n.state.facet(Vi)||Zu(r,o))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!o.empty&&r&&r.main.empty?t={from:o.from,to:o.to,insert:n.state.doc.slice(o.from,o.to)}:(he.mac||he.android)&&t&&t.from==t.to&&t.from==o.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=le.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:Ie.of([t.insert.toString().replace("."," ")])}):t&&t.from>=o.from&&t.to<=o.to&&(t.from!=o.from||t.to!=o.to)&&o.to-o.from-(t.to-t.from)<=4?t={from:o.from,to:o.to,insert:n.state.doc.slice(o.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,o.to))}:n.state.doc.lineAt(o.from).to<o.to&&n.docView.lineHasWidget(o.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:o.from,to:o.to,insert:n.state.toText(n.inputState.insertingText)}:he.chrome&&t&&t.from==t.to&&t.from==o.head&&t.insert.toString()==`
61
+ `&&n.lineWrapping&&(r&&(r=le.single(r.main.anchor-1,r.main.head-1)),t={from:o.from,to:o.to,insert:Ie.of([" "])}),t)return Ig(n,t,r,s);if(r&&!Zu(r,o)){let c=!1,f="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(c=!0),f=n.inputState.lastSelectionOrigin,f=="select.pointer"&&(r=C2(n.state.facet(wa).map(h=>h(n)),r))),n.dispatch({selection:r,scrollIntoView:c,userEvent:f}),!0}else return!1}function Ig(n,e,t,r=-1){if(he.ios&&n.inputState.flushIOSKey(e))return!0;let o=n.state.selection.main;if(he.android&&(e.to==o.to&&(e.from==o.from||e.from==o.from-1&&n.state.sliceDoc(e.from,o.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&xo(n.contentDOM,"Enter",13)||(e.from==o.from-1&&e.to==o.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>o.head)&&xo(n.contentDOM,"Backspace",8)||e.from==o.from&&e.to==o.to+1&&e.insert.length==0&&xo(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let c,f=()=>c||(c=SL(n,e,t));return n.state.facet(u2).some(h=>h(n,e.from,e.to,s,f))||n.dispatch(f()),!0}function SL(n,e,t){let r,o=n.state,s=o.selection.main,c=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let h=e.from<s.from?-1:1,d=h<0?s.from:s.to,p=$s(o.facet(wa).map(v=>v(n)),d,h);e.from==p&&(c=p)}if(c>-1)r={changes:e,selection:le.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let h=s.from<e.from?o.sliceDoc(s.from,e.from):"",d=s.to>e.to?o.sliceDoc(e.to,s.to):"";r=o.replaceSelection(n.state.toText(h+e.insert.sliceString(0,void 0,n.state.lineBreak)+d))}else{let h=o.changes(e),d=t&&t.main.to<=h.newLength?t.main:void 0;if(o.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let p=n.state.sliceDoc(e.from,e.to),v,y=t&&w2(n,t.main.head);if(y){let A=e.insert.length-(e.to-e.from);v={from:y.from,to:y.to-A}}else v=n.state.doc.lineAt(s.head);let x=s.to-e.to;r=o.changeByRange(A=>{if(A.from==s.from&&A.to==s.to)return{changes:h,range:d||A.map(h)};let C=A.to-x,M=C-p.length;if(n.state.sliceDoc(M,C)!=p||C>=v.from&&M<=v.to)return{range:A};let T=o.changes({from:M,to:C,insert:e.insert}),D=A.to-s.to;return{changes:T,range:d?le.range(Math.max(0,d.anchor+D),Math.max(0,d.head+D)):A.map(T)}})}else r={changes:h,selection:d&&o.selection.replaceRange(d)}}let f="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,f+=".compose",n.inputState.compositionFirstChange&&(f+=".start",n.inputState.compositionFirstChange=!1)),o.update(r,{userEvent:f,scrollIntoView:!0})}function T2(n,e,t,r){let o=Math.min(n.length,e.length),s=0;for(;s<o&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==o&&n.length==e.length)return null;let c=n.length,f=e.length;for(;c>0&&f>0&&n.charCodeAt(c-1)==e.charCodeAt(f-1);)c--,f--;if(r=="end"){let h=Math.max(0,s-Math.min(c,f));t-=c+h-s}if(c<s&&n.length<e.length){let h=t<=s&&t>=c?s-t:0;s-=h,f=s+(f-c),c=s}else if(f<s){let h=t<=s&&t>=f?s-t:0;s-=h,c=s+(c-f),f=s}return{from:s,toA:c,toB:f}}function wL(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:o,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new y1(t,r)),(o!=t||s!=r)&&e.push(new y1(o,s))),e}function CL(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?le.single(t+e,r+e):null}function Zu(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class AL{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=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,he.safari&&e.contentDOM.addEventListener("input",()=>null),he.gecko&&UL(e.contentDOM.ownerDocument)}handleEvent(e){!NL(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,t){let r=this.handlers[e];if(r){for(let o of r.observers)o(this.view,t);for(let o of r.handlers){if(t.defaultPrevented)break;if(o(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=EL(e),r=this.handlers,o=this.view.contentDOM;for(let s in t)if(s!="scroll"){let c=!t[s].handlers.length,f=r[s];f&&c!=!f.handlers.length&&(o.removeEventListener(s,this.handleEvent),f=null),f||o.addEventListener(s,this.handleEvent,{passive:c})}for(let s in r)s!="scroll"&&!t[s]&&o.removeEventListener(s,this.handleEvent);this.handlers=t}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&&O2.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),he.android&&he.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return he.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=k2.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||ML.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,xo(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:he.safari&&!he.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 b1(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(o){ui(t.state,o)}}}function EL(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let o=r.spec,s=o&&o.plugin.domEventHandlers,c=o&&o.plugin.domEventObservers;if(s)for(let f in s){let h=s[f];h&&t(f).handlers.push(b1(r.value,h))}if(c)for(let f in c){let h=c[f];h&&t(f).observers.push(b1(r.value,h))}}for(let r in Wn)t(r).handlers.push(Wn[r]);for(let r in Ln)t(r).observers.push(Ln[r]);return e}const k2=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ML="dthko",O2=[16,17,18,20,91,92,224,225],tu=6;function nu(n){return Math.max(0,n)*.7+8}function TL(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class kL{constructor(e,t,r,o){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Dz(e.contentDOM),this.atoms=e.state.facet(wa).map(c=>c(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(qe.allowMultipleSelections)&&OL(e,t),this.dragging=DL(e,t)&&N2(t)==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&&TL(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,o=0,s=0,c=this.view.win.innerWidth,f=this.view.win.innerHeight;this.scrollParents.x&&({left:o,right:c}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:f}=this.scrollParents.y.getBoundingClientRect());let h=x2(this.view);e.clientX-h.left<=o+tu?t=-nu(o-e.clientX):e.clientX+h.right>=c-tu&&(t=nu(e.clientX-c)),e.clientY-h.top<=s+tu?r=-nu(s-e.clientY):e.clientY+h.bottom>=f-tu&&(r=nu(e.clientY-f)),this.setScrollSpeed(t,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,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,r=C2(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function OL(n,e){let t=n.state.facet(o2);return t.length?t[0](e):he.mac?e.metaKey:e.ctrlKey}function RL(n,e){let t=n.state.facet(s2);return t.length?t[0](e):he.mac?!e.altKey:!e.ctrlKey}function DL(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=Mo(n.root);if(!r||r.rangeCount==0)return!0;let o=r.getRangeAt(0).getClientRects();for(let s=0;s<o.length;s++){let c=o[s];if(c.left<=e.clientX&&c.right>=e.clientX&&c.top<=e.clientY&&c.bottom>=e.clientY)return!0}return!1}function NL(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=yt.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Wn=Object.create(null),Ln=Object.create(null),R2=he.ie&&he.ie_version<15||he.ios&&he.webkit_version<604;function _L(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),D2(n,t.value)},50)}function Lf(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function D2(n,e){e=Lf(n.state,Hg,e);let{state:t}=n,r,o=1,s=t.toText(e),c=s.lines==t.selection.ranges.length;if(Np!=null&&t.selection.ranges.every(h=>h.empty)&&Np==s.toString()){let h=-1;r=t.changeByRange(d=>{let p=t.doc.lineAt(d.from);if(p.from==h)return{range:d};h=p.from;let v=t.toText((c?s.line(o++).text:e)+t.lineBreak);return{changes:{from:p.from,insert:v},range:le.cursor(d.from+v.length)}})}else c?r=t.changeByRange(h=>{let d=s.line(o++);return{changes:{from:h.from,to:h.to,insert:d.text},range:le.cursor(h.from+d.length)}}):r=t.replaceSelection(s);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Ln.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Wn.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Ln.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Ln.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Wn.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(a2))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=zL(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new kL(n,e,t,r)),r&&n.observer.ignore(()=>{ZA(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let o=n.inputState.mouseSelection;if(o)return o.start(e),o.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function x1(n,e,t,r){if(r==1)return le.cursor(e,t);if(r==2)return hL(n.state,e,t);{let o=n.docView.lineAt(e,t),s=n.state.doc.lineAt(o?o.posAtEnd:e),c=o?o.posAtStart:s.from,f=o?o.posAtEnd:s.to;return f<n.state.doc.length&&f==s.to&&f++,le.range(c,f)}}const BL=he.ie&&he.ie_version<=11;let S1=null,w1=0,C1=0;function N2(n){if(!BL)return n.detail;let e=S1,t=C1;return S1=n,C1=Date.now(),w1=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(w1+1)%3:1}function zL(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=N2(e),o=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),o=o.map(s.changes))},get(s,c,f){let h=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),d,p=x1(n,h.pos,h.assoc,r);if(t.pos!=h.pos&&!c){let v=x1(n,t.pos,t.assoc,r),y=Math.min(v.from,p.from),x=Math.max(v.to,p.to);p=y<p.from?le.range(y,x):le.range(x,y)}return c?o.replaceRange(o.main.extend(p.from,p.to)):f&&r==1&&o.ranges.length>1&&(d=LL(o,h.pos))?d:f?o.addRange(p):le.create([p])}}}function LL(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:o}=n.ranges[t];if(r<=e&&o>=e)return le.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Wn.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let o=n.docView.tile.nearest(e.target);if(o&&o.isWidget()){let s=o.posAtStart,c=s+o.length;(s>=t.to||c<=t.from)&&(t=le.range(s,c))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Lf(n.state,Ug,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Wn.dragend=n=>(n.inputState.draggedContent=null,!1);function A1(n,e,t,r){if(t=Lf(n.state,Hg,t),!t)return;let o=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,c=r&&s&&RL(n,e)?{from:s.from,to:s.to}:null,f={from:o,insert:t},h=n.state.changes(c?[c,f]:f);n.focus(),n.dispatch({changes:h,selection:{anchor:h.mapPos(o,-1),head:h.mapPos(o,1)},userEvent:c?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Wn.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),o=0,s=()=>{++o==t.length&&A1(n,e,r.filter(c=>c!=null).join(n.state.lineBreak),!1)};for(let c=0;c<t.length;c++){let f=new FileReader;f.onerror=s,f.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(f.result)||(r[c]=f.result),s()},f.readAsText(t[c])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return A1(n,e,r,!0),!0}return!1};Wn.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=R2?null:e.clipboardData;return t?(D2(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(_L(n),!1)};function jL(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.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(),n.focus()},50)}function HL(n){let e=[],t=[],r=!1;for(let o of n.selection.ranges)o.empty||(e.push(n.sliceDoc(o.from,o.to)),t.push(o));if(!e.length){let o=-1;for(let{from:s}of n.selection.ranges){let c=n.doc.lineAt(s);c.number>o&&(e.push(c.text),t.push({from:c.from,to:Math.min(n.doc.length,c.to+1)})),o=c.number}r=!0}return{text:Lf(n,Ug,e.join(n.lineBreak)),ranges:t,linewise:r}}let Np=null;Wn.copy=Wn.cut=(n,e)=>{let t=Mo(n.root);if(t&&!Qs(n.contentDOM,t))return!1;let{text:r,ranges:o,linewise:s}=HL(n.state);if(!r&&!s)return!1;Np=s?r:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let c=R2?null:e.clipboardData;return c?(c.clearData(),c.setData("text/plain",r),!0):(jL(n,r),!1)};const _2=jr.define();function B2(n,e){let t=[];for(let r of n.facet(f2)){let o=r(n,e);o&&t.push(o)}return t.length?n.update({effects:t,annotations:_2.of(!0)}):null}function z2(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=B2(n.state,e);t?n.dispatch(t):n.update([])}},10)}Ln.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),z2(n)};Ln.blur=n=>{n.observer.clearSelectionRange(),z2(n)};Ln.compositionstart=Ln.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};Ln.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,he.chrome&&he.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Ln.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Wn.beforeinput=(n,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),c=e.getTargetRanges();if(s&&c.length){let f=c[0],h=n.posAtDOM(f.startContainer,f.startOffset),d=n.posAtDOM(f.endContainer,f.endOffset);return Ig(n,{from:h,to:d,insert:n.state.toText(s)},null),!0}}let o;if(he.chrome&&he.android&&(o=k2.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(o.key,o.keyCode),o.key=="Backspace"||o.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var c;(((c=window.visualViewport)===null||c===void 0?void 0:c.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return he.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),he.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Ln.compositionend(n,e),20),!1};const E1=new Set;function UL(n){E1.has(n)||(E1.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const M1=["pre-wrap","normal","pre-line","break-spaces"];let Oo=!1;function T1(){Oo=!1}class PL{constructor(e){this.lineWrapping=e,this.doc=Ie.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-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 M1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let o=e[r];o<0?r++:this.heightSamples[Math.floor(o*10)]||(t=!0,this.heightSamples[Math.floor(o*10)]=!0)}return t}refresh(e,t,r,o,s,c){let f=M1.indexOf(e)>-1,h=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=f||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=f,this.lineHeight=t,this.charWidth=r,this.textHeight=o,this.lineLength=s,h){this.heightSamples={};for(let d=0;d<c.length;d++){let p=c[d];p<0?d++:this.heightSamples[Math.floor(p*10)]=!0}}return h}}class VL{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class qn{constructor(e,t,r,o,s){this.from=e,this.length=t,this.top=r,this.height=o,this._content=s}get type(){return typeof this._content=="number"?Lt.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 bl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new qn(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Je=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Je||(Je={}));const Su=.001;class Ft{constructor(e,t,r=2){this.length=e,this.height=t,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)>Su&&(Oo=!0),this.height=e)}replace(e,t,r){return Ft.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,o){let s=this,c=r.doc;for(let f=o.length-1;f>=0;f--){let{fromA:h,toA:d,fromB:p,toB:v}=o[f],y=s.lineAt(h,Je.ByPosNoHeight,r.setDoc(t),0,0),x=y.to>=d?y:s.lineAt(d,Je.ByPosNoHeight,r,0,0);for(v+=x.to-d,d=x.to;f>0&&y.from<=o[f-1].toA;)h=o[f-1].fromA,p=o[f-1].fromB,f--,h<y.from&&(y=s.lineAt(h,Je.ByPosNoHeight,r,0,0));p+=y.from-h,h=y.from;let A=Gg.build(r.setDoc(c),e,p,v);s=$u(s,s.replace(h,d,A))}return s.updateHeight(r,0)}static empty(){return new mn(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,o=0,s=0;for(;;)if(t==r)if(o>s*2){let f=e[t-1];f.break?e.splice(--t,1,f.left,null,f.right):e.splice(--t,1,f.left,f.right),r+=1+f.break,o-=f.size}else if(s>o*2){let f=e[r];f.break?e.splice(r,1,f.left,null,f.right):e.splice(r,1,f.left,f.right),r+=2+f.break,s-=f.size}else break;else if(o<s){let f=e[t++];f&&(o+=f.size)}else{let f=e[--r];f&&(s+=f.size)}let c=0;return e[t-1]==null?(c=1,t--):e[t]==null&&(c=1,r++),new GL(Ft.of(e.slice(0,t)),c,Ft.of(e.slice(r)))}}function $u(n,e){return n==e?n:(n.constructor!=e.constructor&&(Oo=!0),e)}Ft.prototype.size=1;const IL=lt.replace({});class L2 extends Ft{constructor(e,t,r){super(e,t),this.deco=r,this.spaceAbove=0}mainBlock(e,t){return new qn(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,r,o){return this.spaceAbove&&e<r+this.spaceAbove?new qn(o,0,r,this.spaceAbove,IL):this.mainBlock(r,o)}lineAt(e,t,r,o,s){let c=this.mainBlock(o,s);return this.spaceAbove?this.blockAt(0,r,o,s).join(c):c}forEachLine(e,t,r,o,s,c){e<=s+this.length&&t>=s&&c(this.lineAt(0,Je.ByPos,r,o,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,r=!1,o){return o&&o.from<=t&&o.more&&this.setMeasuredHeight(o),this.outdated=!1,this}toString(){return`block(${this.length})`}}class mn extends L2{constructor(e,t,r){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,t){return new qn(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,r){let o=r[0];return r.length==1&&(o instanceof mn||o instanceof Nt&&o.flags&4)&&Math.abs(this.length-o.length)<10?(o instanceof Nt?o=new mn(o.length,this.height,this.spaceAbove):o.height=this.height,this.outdated||(o.outdated=!1),o):Ft.of(r)}updateHeight(e,t=0,r=!1,o){return o&&o.from<=t&&o.more?this.setMeasuredHeight(o):(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 Nt extends Ft{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,o=e.doc.lineAt(t+this.length).number,s=o-r+1,c,f=0;if(e.lineWrapping){let h=Math.min(this.height,e.lineHeight*s);c=h/s,this.length>s+1&&(f=(this.height-h)/(this.length-s-1))}else c=this.height/s;return{firstLine:r,lastLine:o,perLine:c,perChar:f}}blockAt(e,t,r,o){let{firstLine:s,lastLine:c,perLine:f,perChar:h}=this.heightMetrics(t,o);if(t.lineWrapping){let d=o+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),p=t.doc.lineAt(d),v=f+p.length*h,y=Math.max(r,e-v/2);return new qn(p.from,p.length,y,v,0)}else{let d=Math.max(0,Math.min(c-s,Math.floor((e-r)/f))),{from:p,length:v}=t.doc.line(s+d);return new qn(p,v,r+f*d,f,0)}}lineAt(e,t,r,o,s){if(t==Je.ByHeight)return this.blockAt(e,r,o,s);if(t==Je.ByPosNoHeight){let{from:x,to:A}=r.doc.lineAt(e);return new qn(x,A-x,0,0,0)}let{firstLine:c,perLine:f,perChar:h}=this.heightMetrics(r,s),d=r.doc.lineAt(e),p=f+d.length*h,v=d.number-c,y=o+f*v+h*(d.from-s-v);return new qn(d.from,d.length,Math.max(o,Math.min(y,o+this.height-p)),p,0)}forEachLine(e,t,r,o,s,c){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:f,perLine:h,perChar:d}=this.heightMetrics(r,s);for(let p=e,v=o;p<=t;){let y=r.doc.lineAt(p);if(p==e){let A=y.number-f;v+=h*A+d*(e-s-A)}let x=h+d*y.length;c(new qn(y.from,y.length,v,x,0)),v+=x,p=y.to+1}}replace(e,t,r){let o=this.length-t;if(o>0){let s=r[r.length-1];s instanceof Nt?r[r.length-1]=new Nt(s.length+o):r.push(null,new Nt(o-1))}if(e>0){let s=r[0];s instanceof Nt?r[0]=new Nt(e+s.length):r.unshift(new Nt(e-1),null)}return Ft.of(r)}decomposeLeft(e,t){t.push(new Nt(e-1),null)}decomposeRight(e,t){t.push(null,new Nt(this.length-e-1))}updateHeight(e,t=0,r=!1,o){let s=t+this.length;if(o&&o.from<=t+this.length&&o.more){let c=[],f=Math.max(t,o.from),h=-1;for(o.from>t&&c.push(new Nt(o.from-t-1).updateHeight(e,t));f<=s&&o.more;){let p=e.doc.lineAt(f).length;c.length&&c.push(null);let v=o.heights[o.index++],y=0;v<0&&(y=-v,v=o.heights[o.index++]),h==-1?h=v:Math.abs(v-h)>=Su&&(h=-2);let x=new mn(p,v,y);x.outdated=!1,c.push(x),f+=p+1}f<=s&&c.push(null,new Nt(s-f).updateHeight(e,f));let d=Ft.of(c);return(h<0||Math.abs(d.height-this.height)>=Su||Math.abs(h-this.heightMetrics(e,t).perLine)>=Su)&&(Oo=!0),$u(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class GL extends Ft{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(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,t,r,o){let s=r+this.left.height;return e<s?this.left.blockAt(e,t,r,o):this.right.blockAt(e,t,s,o+this.left.length+this.break)}lineAt(e,t,r,o,s){let c=o+this.left.height,f=s+this.left.length+this.break,h=t==Je.ByHeight?e<c:e<f,d=h?this.left.lineAt(e,t,r,o,s):this.right.lineAt(e,t,r,c,f);if(this.break||(h?d.to<f:d.from>f))return d;let p=t==Je.ByPosNoHeight?Je.ByPosNoHeight:Je.ByPos;return h?d.join(this.right.lineAt(f,p,r,c,f)):this.left.lineAt(f,p,r,o,s).join(d)}forEachLine(e,t,r,o,s,c){let f=o+this.left.height,h=s+this.left.length+this.break;if(this.break)e<h&&this.left.forEachLine(e,t,r,o,s,c),t>=h&&this.right.forEachLine(e,t,r,f,h,c);else{let d=this.lineAt(h,Je.ByPos,r,o,s);e<d.from&&this.left.forEachLine(e,d.from-1,r,o,s,c),d.to>=e&&d.from<=t&&c(d),t>d.to&&this.right.forEachLine(d.to+1,t,r,f,h,c)}}replace(e,t,r){let o=this.left.length+this.break;if(t<o)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,r));let s=[];e>0&&this.decomposeLeft(e,s);let c=s.length;for(let f of r)s.push(f);if(e>0&&k1(s,c-1),t<this.length){let f=s.length;this.decomposeRight(t,s),k1(s,f)}return Ft.of(s)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,o=r+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<o&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Ft.of(this.break?[e,null,t]:[e,t]):(this.left=$u(this.left,e),this.right=$u(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,o){let{left:s,right:c}=this,f=t+s.length+this.break,h=null;return o&&o.from<=t+s.length&&o.more?h=s=s.updateHeight(e,t,r,o):s.updateHeight(e,t,r),o&&o.from<=f+c.length&&o.more?h=c=c.updateHeight(e,f,r,o):c.updateHeight(e,f,r),h?this.balanced(s,c):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function k1(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof Nt&&(r=n[e+1])instanceof Nt&&n.splice(e-1,3,new Nt(t.length+1+r.length))}const qL=5;class Gg{constructor(e,t){this.pos=e,this.oracle=t,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,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),o=this.nodes[this.nodes.length-1];o instanceof mn?o.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new mn(r-this.pos,-1,0)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let o=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;o<0&&(o=this.oracle.lineHeight);let c=t-e;r.block?this.addBlock(new L2(c,o,r)):(c||s||o>=qL)&&this.addLineDeco(o,s,c)}else t>e&&this.span(e,t);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:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,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 mn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new Nt(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof mn)return e;let t=new mn(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let o=this.ensureLine();o.length+=r,o.collapsed+=r,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof mn)&&!this.isCovered?this.nodes.push(new mn(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let o of this.nodes)o instanceof mn&&o.updateHeight(this.oracle,r),r+=o?o.length:1;return this.nodes}static build(e,t,r,o){let s=new Gg(r,e);return Ue.spans(t,r,o,s,0),s.finish(r)}}function YL(n,e,t){let r=new FL;return Ue.compare(n,e,t,r,0),r.changes}class FL{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,o){(e<t||r&&r.heightRelevant||o&&o.heightRelevant)&&bo(e,t,this.changes,5)}}function KL(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,o=r.defaultView||window,s=Math.max(0,t.left),c=Math.min(o.innerWidth,t.right),f=Math.max(0,t.top),h=Math.min(o.innerHeight,t.bottom);for(let d=n.parentNode;d&&d!=r.body;)if(d.nodeType==1){let p=d,v=window.getComputedStyle(p);if((p.scrollHeight>p.clientHeight||p.scrollWidth>p.clientWidth)&&v.overflow!="visible"){let y=p.getBoundingClientRect();s=Math.max(s,y.left),c=Math.min(c,y.right),f=Math.max(f,y.top),h=Math.min(d==n.parentNode?o.innerHeight:h,y.bottom)}d=v.position=="absolute"||v.position=="fixed"?p.offsetParent:p.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-t.left,right:Math.max(s,c)-t.left,top:f-(t.top+e),bottom:Math.max(f,h)-(t.top+e)}}function WL(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function XL(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Rm{constructor(e,t,r,o){this.from=e,this.to=t,this.size=r,this.displaySize=o}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],s=t[r];if(o.from!=s.from||o.to!=s.to||o.size!=s.size)return!1}return!0}draw(e,t){return lt.replace({widget:new QL(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class QL extends Nf{constructor(e,t){super(),this.size=e,this.vertical=t}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 O1{constructor(e){this.state=e,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.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=R1,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=rt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Pg).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new PL(t),this.stateDeco=D1(e),this.heightMap=Ft.empty().applyChanges(this.stateDeco,Ie.empty,this.heightOracle.setDoc(e.doc),[new Dn(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=lt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let o=r?t.head:t.anchor;if(!e.some(({from:s,to:c})=>o>=s&&o<=c)){let{from:s,to:c}=this.lineBlockAt(o);e.push(new iu(s,c))}}return this.viewports=e.sort((r,o)=>r.from-o.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?R1:new qg(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(Ys(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=D1(this.state);let o=e.changedRanges,s=Dn.extendWithRanges(o,YL(r,this.stateDeco,e?e.changes:St.empty(this.state.doc.length))),c=this.heightMap.height,f=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);T1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=c||Oo)&&(e.flags|=2),f?(this.scrollAnchorPos=e.changes.mapPos(f.from,-1),this.scrollAnchorHeight=f.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=c);let h=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<h.from||t.range.head>h.to)||!this.viewportIsAppropriate(h))&&(h=this.getViewport(0,t));let d=h.from!=this.viewport.from||h.to!=this.viewport.to;this.viewport=h,e.flags|=this.updateForViewport(),(d||!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),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(d2)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),o=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?rt.RTL:rt.LTR;let c=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent,f=t.getBoundingClientRect(),h=c||this.mustMeasureContent||this.contentDOMHeight!=f.height;this.contentDOMHeight=f.height,this.mustMeasureContent=!1;let d=0,p=0;if(f.width&&f.height){let{scaleX:j,scaleY:H}=QA(t,f);(j>.005&&Math.abs(this.scaleX-j)>.005||H>.005&&Math.abs(this.scaleY-H)>.005)&&(this.scaleX=j,this.scaleY=H,d|=16,c=h=!0)}let v=(parseInt(r.paddingTop)||0)*this.scaleY,y=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=v||this.paddingBottom!=y)&&(this.paddingTop=v,this.paddingBottom=y,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(h=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=$A(e.scrollDOM);let A=(this.printing?XL:KL)(t,this.paddingTop),C=A.top-this.pixelViewport.top,M=A.bottom-this.pixelViewport.bottom;this.pixelViewport=A;let T=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(T!=this.inView&&(this.inView=T,T&&(h=!0)),!this.inView&&!this.scrollTarget&&!WL(e.dom))return 0;let D=f.width;if((this.contentDOMWidth!=D||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=f.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),h){let j=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(j)&&(c=!0),c||o.lineWrapping&&Math.abs(D-this.contentDOMWidth)>o.charWidth){let{lineHeight:H,charWidth:P,textHeight:_}=e.docView.measureTextSize();c=H>0&&o.refresh(s,H,P,_,Math.max(5,D/P),j),c&&(e.docView.minWidth=0,d|=16)}C>0&&M>0?p=Math.max(C,M):C<0&&M<0&&(p=Math.min(C,M)),T1();for(let H of this.viewports){let P=H.from==this.viewport.from?j:e.docView.measureVisibleLineHeights(H);this.heightMap=(c?Ft.empty().applyChanges(this.stateDeco,Ie.empty,this.heightOracle,[new Dn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,c,new VL(H.from,P))}Oo&&(d|=2)}let N=!this.viewportIsAppropriate(this.viewport,p)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return N&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(p,this.scrollTarget),d|=this.updateForViewport()),(d&2||N)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(c?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,s=this.heightOracle,{visibleTop:c,visibleBottom:f}=this,h=new iu(o.lineAt(c-r*1e3,Je.ByHeight,s,0,0).from,o.lineAt(f+(1-r)*1e3,Je.ByHeight,s,0,0).to);if(t){let{head:d}=t.range;if(d<h.from||d>h.to){let p=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),v=o.lineAt(d,Je.ByPos,s,0,0),y;t.y=="center"?y=(v.top+v.bottom)/2-p/2:t.y=="start"||t.y=="nearest"&&d<h.from?y=v.top:y=v.bottom-p,h=new iu(o.lineAt(y-1e3/2,Je.ByHeight,s,0,0).from,o.lineAt(y+p+1e3/2,Je.ByHeight,s,0,0).to)}}return h}mapViewport(e,t){let r=t.mapPos(e.from,-1),o=t.mapPos(e.to,1);return new iu(this.heightMap.lineAt(r,Je.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(o,Je.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:o}=this.heightMap.lineAt(e,Je.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,Je.ByPos,this.heightOracle,0,0),{visibleTop:c,visibleBottom:f}=this;return(e==0||o<=c-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||s>=f+Math.max(10,Math.min(r,250)))&&o>c-2*1e3&&s<f+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let o of e)t.touchesRange(o.from,o.to)||r.push(new Rm(t.mapPos(o.from),t.mapPos(o.to),o.size,o.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,o=r?1e4:2e3,s=o>>1,c=o<<1;if(this.defaultTextDirection!=rt.LTR&&!r)return[];let f=[],h=(p,v,y,x)=>{if(v-p<s)return;let A=this.state.selection.main,C=[A.from];A.empty||C.push(A.to);for(let T of C)if(T>p&&T<v){h(p,T-10,y,x),h(T+10,v,y,x);return}let M=$L(e,T=>T.from>=y.from&&T.to<=y.to&&Math.abs(T.from-p)<s&&Math.abs(T.to-v)<s&&!C.some(D=>T.from<D&&T.to>D));if(!M){if(v<y.to&&t&&r&&t.visibleRanges.some(N=>N.from<=v&&N.to>=v)){let N=t.moveToLineBoundary(le.cursor(v),!1,!0).head;N>p&&(v=N)}let T=this.gapSize(y,p,v,x),D=r||T<2e6?T:2e6;M=new Rm(p,v,T,D)}f.push(M)},d=p=>{if(p.length<c||p.type!=Lt.Text)return;let v=ZL(p.from,p.to,this.stateDeco);if(v.total<c)return;let y=this.scrollTarget?this.scrollTarget.range.head:null,x,A;if(r){let C=o/this.heightOracle.lineLength*this.heightOracle.lineHeight,M,T;if(y!=null){let D=lu(v,y),N=((this.visibleBottom-this.visibleTop)/2+C)/p.height;M=D-N,T=D+N}else M=(this.visibleTop-p.top-C)/p.height,T=(this.visibleBottom-p.top+C)/p.height;x=ru(v,M),A=ru(v,T)}else{let C=v.total*this.heightOracle.charWidth,M=o*this.heightOracle.charWidth,T=0;if(C>2e6)for(let P of e)P.from>=p.from&&P.from<p.to&&P.size!=P.displaySize&&P.from*this.heightOracle.charWidth+T<this.pixelViewport.left&&(T=P.size-P.displaySize);let D=this.pixelViewport.left+T,N=this.pixelViewport.right+T,j,H;if(y!=null){let P=lu(v,y),_=((N-D)/2+M)/C;j=P-_,H=P+_}else j=(D-M)/C,H=(N+M)/C;x=ru(v,j),A=ru(v,H)}x>p.from&&h(p.from,x,p,v),A<p.to&&h(A,p.to,p,v)};for(let p of this.viewportLines)Array.isArray(p.type)?p.type.forEach(d):d(p);return f}gapSize(e,t,r,o){let s=lu(o,r)-lu(o,t);return this.heightOracle.lineWrapping?e.height*s:o.total*this.heightOracle.charWidth*s}updateLineGaps(e){Rm.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=lt.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];Ue.spans(t,this.viewport.from,this.viewport.to,{span(s,c){r.push({from:s,to:c})},point(){}},20);let o=0;if(r.length!=this.visibleRanges.length)o=12;else for(let s=0;s<r.length&&!(o&8);s++){let c=this.visibleRanges[s],f=r[s];(c.from!=f.from||c.to!=f.to)&&(o|=4,e&&e.mapPos(c.from,-1)==f.from&&e.mapPos(c.to,1)==f.to||(o|=8))}return this.visibleRanges=r,o}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ys(this.heightMap.lineAt(e,Je.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(t=>t.top<=e&&t.bottom>=e)||Ys(this.heightMap.lineAt(this.scaler.fromDOM(e),Je.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ys(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 iu{constructor(e,t){this.from=e,this.to=t}}function ZL(n,e,t){let r=[],o=n,s=0;return Ue.spans(t,n,e,{span(){},point(c,f){c>o&&(r.push({from:o,to:c}),s+=c-o),o=f}},20),o<e&&(r.push({from:o,to:e}),s+=e-o),{total:s,ranges:r}}function ru({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let o=0;;o++){let{from:s,to:c}=e[o],f=c-s;if(r<=f)return s+r;r-=f}}function lu(n,e){let t=0;for(let{from:r,to:o}of n.ranges){if(e<=o){t+=e-r;break}t+=o-r}return t/n.total}function $L(n,e){for(let t of n)if(e(t))return t}const R1={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function D1(n){let e=n.facet(_f).filter(r=>typeof r!="function"),t=n.facet(Vg).filter(r=>typeof r!="function");return t.length&&e.push(Ue.join(t)),e}class qg{constructor(e,t,r){let o=0,s=0,c=0;this.viewports=r.map(({from:f,to:h})=>{let d=t.lineAt(f,Je.ByPos,e,0,0).top,p=t.lineAt(h,Je.ByPos,e,0,0).bottom;return o+=p-d,{from:f,to:h,top:d,bottom:p,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(t.height-o);for(let f of this.viewports)f.domTop=c+(f.top-s)*this.scale,c=f.domBottom=f.domTop+(f.bottom-f.top),s=f.bottom}toDOM(e){for(let t=0,r=0,o=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return o+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,o=s.domBottom}}fromDOM(e){for(let t=0,r=0,o=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return r+(e-o)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,o=s.domBottom}}eq(e){return e instanceof qg?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function Ys(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new qn(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(o=>Ys(o,e)):n._content)}const ou=be.define({combine:n=>n.join(" ")}),_p=be.define({combine:n=>n.indexOf(!0)>-1}),Bp=Rr.newName(),j2=Rr.newName(),H2=Rr.newName(),U2={"&light":"."+j2,"&dark":"."+H2};function zp(n,e,t){return new Rr(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,o=>{if(o=="&")return n;if(!t||!t[o])throw new RangeError(`Unsupported selector: ${o}`);return t[o]}):n+" "+r}})}const JL=zp("."+Bp,{"&":{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-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"}},U2),e4={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Dm=he.ie&&he.ie_version<=11;class t4{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Nz,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(t=>{for(let r of t)this.queue.push(r);(he.ie&&he.ie_version<=11||he.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&he.android&&e.constructor.EDIT_CONTEXT!==!1&&!(he.chrome&&he.chrome_version<126)&&(this.editContext=new i4(e),e.state.facet(Vi)&&(e.contentDOM.editContext=this.editContext.editContext)),Dm&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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 t;((t=this.view.docView)===null||t===void 0?void 0:t.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(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.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(t=>{t.length>0&&t[t.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((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,o=this.selectionRange;if(r.state.facet(Vi)?r.root.activeElement!=this.dom:!Qs(this.dom,o))return;let s=o.anchorNode&&r.docView.tile.nearest(o.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(he.ie&&he.ie_version<=11||he.android&&he.chrome)&&!r.state.selection.main.empty&&o.focusNode&&Zs(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Mo(e.root);if(!t)return!1;let r=he.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&n4(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let o=Qs(this.dom,r);return o&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Bz(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),o&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)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,e4),Dm&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Dm&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let o=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&xo(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(o)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,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 t=-1,r=-1,o=!1;for(let s of e){let c=this.readMutation(s);c&&(c.typeOver&&(o=!0),t==-1?{from:t,to:r}=c:(t=Math.min(c.from,t),r=Math.max(c.to,r)))}return{from:t,to:r,typeOver:o}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),o=this.selectionChanged&&Qs(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new xL(this.view,e,t,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,o=M2(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!Zu(this.view.state.selection,t.newSel.main))&&this.view.update([]),o}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let r=N1(t,e.previousSibling||e.target.previousSibling,-1),o=N1(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.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(Vi)!=e.state.facet(Vi)&&(e.view.contentDOM.editContext=e.state.facet(Vi)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let o of this.scrollTargets)o.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 N1(n,e,t){for(;e;){let r=yt.get(e);if(r&&r.parent==n)return r;let o=e.parentNode;e=o!=n.dom?o:t>0?e.nextSibling:e.previousSibling}return null}function _1(n,e){let t=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,c=n.docView.domAtPos(n.state.selection.main.anchor,1);return Zs(c.node,c.offset,o,s)&&([t,r,o,s]=[o,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:o,focusOffset:s}}function n4(n,e){if(e.getComposedRanges){let o=e.getComposedRanges(n.root)[0];if(o)return _1(n,o)}let t=null;function r(o){o.preventDefault(),o.stopImmediatePropagation(),t=o.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?_1(n,t):null}class i4{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=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 o=e.state.selection.main,{anchor:s,head:c}=o,f=this.toEditorPos(r.updateRangeStart),h=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:f,drifted:!1});let d=h-f>r.text.length;f==this.from&&s<this.from?f=s:h==this.to&&s>this.to&&(h=s);let p=T2(e.state.sliceDoc(f,h),r.text,(d?o.from:o.to)-f,d?"end":null);if(!p){let y=le.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Zu(y,o)||e.dispatch({selection:y,userEvent:"select"});return}let v={from:p.from+f,to:p.toA+f,insert:Ie.of(r.text.slice(p.from,p.toB).split(`
62
+ `))};if((he.mac||he.android)&&v.from==c-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(v={from:f,to:h,insert:Ie.of([r.text.replace("."," ")])}),this.pendingContextChange=v,!e.state.readOnly){let y=this.to-this.from+(v.to-v.from+v.insert.length);Ig(e,v,le.single(this.toEditorPos(r.selectionStart,y),this.toEditorPos(r.selectionEnd,y)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),v.from<v.to&&!v.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let o=[],s=null;for(let c=this.toEditorPos(r.rangeStart),f=this.toEditorPos(r.rangeEnd);c<f;c++){let h=e.coordsForChar(c);s=h&&new DOMRect(h.left,h.top,h.right-h.left,h.bottom-h.top)||s||new DOMRect,o.push(s)}t.updateCharacterBounds(r.rangeStart,o)},this.handlers.textformatupdate=r=>{let o=[];for(let s of r.getTextFormats()){let c=s.underlineStyle,f=s.underlineThickness;if(!/none/i.test(c)&&!/none/i.test(f)){let h=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(h<d){let p=`text-decoration: underline ${/^[a-z]/.test(c)?c+" ":c=="Dashed"?"dashed ":c=="Squiggle"?"wavy ":""}${/thin/i.test(f)?1:2}px`;o.push(lt.mark({attributes:{style:p}}).range(h,d))}}}e.dispatch({effects:p2.of(lt.set(o))})},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)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let o=Mo(r.root);o&&o.rangeCount&&this.editContext.updateSelectionBounds(o.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,o=this.pendingContextChange;return e.changes.iterChanges((s,c,f,h,d)=>{if(r)return;let p=d.length-(c-s);if(o&&c>=o.to)if(o.from==s&&o.to==c&&o.insert.eq(d)){o=this.pendingContextChange=null,t+=p,this.to+=p;return}else o=null,this.revertPending(e.state);if(s+=t,c+=t,c<=this.from)this.from+=p,this.to+=p;else if(s<this.to){if(s<this.from||c>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(c),d.toString()),this.to+=p}t+=p}),o&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(o=>!o.isUserEvent("input.type")&&o.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||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+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 t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),o=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=o)&&this.editContext.updateSelection(r,o)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class we{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 t;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&&(o=>o.forEach(s=>r(s,this)))||(o=>this.update(o)),this.dispatch=this.dispatch.bind(this),this._root=e.root||_z(e.parent)||document,this.viewState=new O1(e.state||qe.create(e)),e.scrollTo&&e.scrollTo.is(eu)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(mo).map(o=>new Em(o));for(let o of this.plugins)o.update(this);this.observer=new t4(this),this.inputState=new AL(this),this.inputState.ensureHandlers(this.plugins),this.docView=new p1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof wt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,o,s=this.state;for(let y of e){if(y.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=y.state}if(this.destroyed){this.viewState.state=s;return}let c=this.hasFocus,f=0,h=null;e.some(y=>y.annotation(_2))?(this.inputState.notifiedFocused=c,f=1):c!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=c,h=B2(s,c),h||(f=1));let d=this.observer.delayedAndroidKey,p=null;if(d?(this.observer.clearDelayedAndroidKey(),p=this.observer.readChange(),(p&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(p=null)):this.observer.clear(),s.facet(qe.phrases)!=this.state.facet(qe.phrases))return this.setState(s);o=Wu.create(this,s,e),o.flags|=f;let v=this.viewState.scrollTarget;try{this.updateState=2;for(let y of e){if(v&&(v=v.map(y.changes)),y.scrollIntoView){let{main:x}=y.state.selection;v=new So(x.empty?x:le.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of y.effects)x.is(eu)&&(v=x.value.clip(this.state))}this.viewState.update(o,v),this.bidiCache=Ju.update(this.bidiCache,o.changes),o.empty||(this.updatePlugins(o),this.inputState.update(o)),t=this.docView.update(o),this.state.facet(Gs)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(y=>y.isUserEvent("select.pointer")))}finally{this.updateState=0}if(o.startState.facet(ou)!=o.state.facet(ou)&&(this.viewState.mustMeasureContent=!0),(t||r||v||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!o.empty)for(let y of this.state.facet(kp))try{y(o)}catch(x){ui(this.state,x,"update listener")}(h||p)&&Promise.resolve().then(()=>{h&&this.state==h.startState&&this.dispatch(h),p&&!M2(this,p)&&d.force&&xo(this.contentDOM,d.key,d.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 t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new O1(e),this.plugins=e.facet(mo).map(r=>new Em(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new p1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(mo),r=e.state.facet(mo);if(t!=r){let o=[];for(let s of r){let c=t.indexOf(s);if(c<0)o.push(new Em(s));else{let f=this.plugins[c];f.mustUpdate=e,o.push(f)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o<this.plugins.length;o++)this.plugins[o].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){ui(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 t=null,r=this.scrollDOM,o=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:c}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(c=-1),this.viewState.scrollAnchorHeight=-1;try{for(let f=0;;f++){if(c<0)if($A(r))s=-1,c=this.viewState.heightMap.height;else{let x=this.viewState.scrollAnchorAt(o);s=x.from,c=x.top}this.updateState=1;let h=this.viewState.measure(this);if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(f>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];h&4||([this.measureRequests,d]=[d,this.measureRequests]);let p=d.map(x=>{try{return x.read(this)}catch(A){return ui(this.state,A),B1}}),v=Wu.create(this,this.state,[]),y=!1;v.flags|=h,t?t.flags|=h:t=v,this.updateState=2,v.empty||(this.updatePlugins(v),this.inputState.update(v),this.updateAttrs(),y=this.docView.update(v),y&&this.docViewUpdate());for(let x=0;x<d.length;x++)if(p[x]!=B1)try{let A=d[x];A.write&&A.write(p[x],this)}catch(A){ui(this.state,A)}if(y&&this.docView.updateSelection(!0),!v.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,c=-1;continue}else{let A=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-c;if(A>1||A<-1){o=o+A,r.scrollTop=o/this.scaleY,c=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let f of this.state.facet(kp))f(t)}get themeClasses(){return Bp+" "+(this.state.facet(_p)?H2:j2)+" "+this.state.facet(ou)}updateAttrs(){let e=z1(this,g2,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Vi)?"true":"false",class:"cm-content",style:`${he.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),z1(this,Pg,t);let r=this.observer.ignore(()=>{let o=c1(this.contentDOM,this.contentAttrs,t),s=c1(this.dom,this.editorAttrs,e);return o||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let o of r.effects)if(o.is(we.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=o.value}}mountStyles(){this.styleModules=this.state.facet(Gs);let e=this.state.facet(we.cspNonce);Rr.mount(this.root,this.styleModules.concat(JL).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 t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.plugin==e)||null),t&&t.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,t,r){return Om(this,e,g1(this,e,t,r))}moveByGroup(e,t){return Om(this,e,g1(this,e,t,r=>pL(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),o=this.textDirectionAt(e.from),s=r[t?r.length-1:0];return le.cursor(s.side(t,o)+e.from,s.forward(!t,o)?1:-1)}moveToLineBoundary(e,t,r=!0){return mL(this,e,t,r)}moveVertically(e,t,r){return Om(this,e,gL(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=Dp(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Dp(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let o=this.state.doc.lineAt(e),s=this.bidiSpans(o),c=s[Gi.find(s,e-o.from,-1,t)];return Ku(r,c.dir==rt.LTR==t>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(h2)||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>r4)return r2(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||i2(s.isolates,r=h1(this,e))))return s.order;r||(r=h1(this,e));let o=Vz(e.text,t,r);return this.bidiCache.push(new Ju(e.from,e.to,t,r,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||he.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ZA(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,t={}){return eu.of(new So(typeof e=="number"?le.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return eu.of(new So(le.cursor(r.from),"start","start",r.top-e,t,!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 vi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return vi.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=Rr.newName(),o=[ou.of(r),Gs.of(zp(`.${r}`,e))];return t&&t.dark&&o.push(_p.of(!0)),o}static baseTheme(e){return Tf.lowest(Gs.of(zp("."+Bp,e,U2)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),o=r&&yt.get(r)||yt.get(e);return((t=o?.root)===null||t===void 0?void 0:t.view)||null}}we.styleModule=Gs;we.inputHandler=u2;we.clipboardInputFilter=Hg;we.clipboardOutputFilter=Ug;we.scrollHandler=m2;we.focusChangeEffect=f2;we.perLineTextDirection=h2;we.exceptionSink=c2;we.updateListener=kp;we.editable=Vi;we.mouseSelectionStyle=a2;we.dragMovesSelection=s2;we.clickAddsSelectionRange=o2;we.decorations=_f;we.blockWrappers=v2;we.outerDecorations=Vg;we.atomicRanges=wa;we.bidiIsolatedRanges=y2;we.scrollMargins=b2;we.darkTheme=_p;we.cspNonce=be.define({combine:n=>n.length?n[0]:""});we.contentAttributes=Pg;we.editorAttributes=g2;we.lineWrapping=we.contentAttributes.of({class:"cm-lineWrapping"});we.announce=ht.define();const r4=4096,B1={};class Ju{constructor(e,t,r,o,s,c){this.from=e,this.to=t,this.dir=r,this.isolates=o,this.fresh=s,this.order=c}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],o=e.length?e[e.length-1].dir:rt.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let c=e[s];c.dir==o&&!t.touchesRange(c.from,c.to)&&r.push(new Ju(t.mapPos(c.from,1),t.mapPos(c.to,-1),c.dir,c.isolates,!1,c.order))}return r}}function z1(n,e,t){for(let r=n.state.facet(e),o=r.length-1;o>=0;o--){let s=r[o],c=typeof s=="function"?s(n):s;c&&zg(c,t)}return t}const l4=he.mac?"mac":he.windows?"win":he.linux?"linux":"key";function o4(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let o,s,c,f;for(let h=0;h<t.length-1;++h){const d=t[h];if(/^(cmd|meta|m)$/i.test(d))f=!0;else if(/^a(lt)?$/i.test(d))o=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))c=!0;else if(/^mod$/i.test(d))e=="mac"?f=!0:s=!0;else throw new Error("Unrecognized modifier name: "+d)}return o&&(r="Alt-"+r),s&&(r="Ctrl-"+r),f&&(r="Meta-"+r),c&&(r="Shift-"+r),r}function su(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const s4=Tf.default(we.domEventHandlers({keydown(n,e){return f4(a4(e.state),n,e,"editor")}})),P2=be.define({enables:s4}),L1=new WeakMap;function a4(n){let e=n.facet(P2),t=L1.get(e);return t||L1.set(e,t=u4(e.reduce((r,o)=>r.concat(o),[]))),t}let Ar=null;const c4=4e3;function u4(n,e=l4){let t=Object.create(null),r=Object.create(null),o=(c,f)=>{let h=r[c];if(h==null)r[c]=f;else if(h!=f)throw new Error("Key binding "+c+" is used both as a regular binding and as a multi-stroke prefix")},s=(c,f,h,d,p)=>{var v,y;let x=t[c]||(t[c]=Object.create(null)),A=f.split(/ (?!$)/).map(T=>o4(T,e));for(let T=1;T<A.length;T++){let D=A.slice(0,T).join(" ");o(D,!0),x[D]||(x[D]={preventDefault:!0,stopPropagation:!1,run:[N=>{let j=Ar={view:N,prefix:D,scope:c};return setTimeout(()=>{Ar==j&&(Ar=null)},c4),!0}]})}let C=A.join(" ");o(C,!1);let M=x[C]||(x[C]={preventDefault:!1,stopPropagation:!1,run:((y=(v=x._any)===null||v===void 0?void 0:v.run)===null||y===void 0?void 0:y.slice())||[]});h&&M.run.push(h),d&&(M.preventDefault=!0),p&&(M.stopPropagation=!0)};for(let c of n){let f=c.scope?c.scope.split(" "):["editor"];if(c.any)for(let d of f){let p=t[d]||(t[d]=Object.create(null));p._any||(p._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:v}=c;for(let y in p)p[y].run.push(x=>v(x,Lp))}let h=c[e]||c.key;if(h)for(let d of f)s(d,h,c.run,c.preventDefault,c.stopPropagation),c.shift&&s(d,"Shift-"+h,c.shift,c.preventDefault,c.stopPropagation)}return t}let Lp=null;function f4(n,e,t,r){Lp=e;let o=Az(e),s=oz(o,0),c=sz(s)==o.length&&o!=" ",f="",h=!1,d=!1,p=!1;Ar&&Ar.view==t&&Ar.scope==r&&(f=Ar.prefix+" ",O2.indexOf(e.keyCode)<0&&(d=!0,Ar=null));let v=new Set,y=M=>{if(M){for(let T of M.run)if(!v.has(T)&&(v.add(T),T(t)))return M.stopPropagation&&(p=!0),!0;M.preventDefault&&(M.stopPropagation&&(p=!0),d=!0)}return!1},x=n[r],A,C;return x&&(y(x[f+su(o,e,!c)])?h=!0:c&&(e.altKey||e.metaKey||e.ctrlKey)&&!(he.windows&&e.ctrlKey&&e.altKey)&&!(he.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(A=Dr[e.keyCode])&&A!=o?(y(x[f+su(A,e,!0)])||e.shiftKey&&(C=oa[e.keyCode])!=o&&C!=A&&y(x[f+su(C,e,!1)]))&&(h=!0):c&&e.shiftKey&&y(x[f+su(o,e,!0)])&&(h=!0),!h&&y(x._any)&&(h=!0)),d&&(h=!0),h&&p&&e.stopPropagation(),Lp=null,h}class Ca{constructor(e,t,r,o,s){this.className=e,this.left=t,this.top=r,this.width=o,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let o=e.coordsAtPos(r.head,r.assoc||1);if(!o)return[];let s=V2(e);return[new Ca(t,o.left-s.left,o.top-s.top,null,o.bottom-o.top)]}else return h4(e,t,r)}}function V2(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==rt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function j1(n,e,t,r){let o=n.coordsAtPos(e,t*2);if(!o)return r;let s=n.dom.getBoundingClientRect(),c=(o.top+o.bottom)/2,f=n.posAtCoords({x:s.left+1,y:c}),h=n.posAtCoords({x:s.right-1,y:c});return f==null||h==null?r:{from:Math.max(r.from,Math.min(f,h)),to:Math.min(r.to,Math.max(f,h))}}function h4(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),o=Math.min(t.to,n.viewport.to),s=n.textDirection==rt.LTR,c=n.contentDOM,f=c.getBoundingClientRect(),h=V2(n),d=c.querySelector(".cm-line"),p=d&&window.getComputedStyle(d),v=f.left+(p?parseInt(p.paddingLeft)+Math.min(0,parseInt(p.textIndent)):0),y=f.right-(p?parseInt(p.paddingRight):0),x=Rp(n,r,1),A=Rp(n,o,-1),C=x.type==Lt.Text?x:null,M=A.type==Lt.Text?A:null;if(C&&(n.lineWrapping||x.widgetLineBreaks)&&(C=j1(n,r,1,C)),M&&(n.lineWrapping||A.widgetLineBreaks)&&(M=j1(n,o,-1,M)),C&&M&&C.from==M.from&&C.to==M.to)return D(N(t.from,t.to,C));{let H=C?N(t.from,null,C):j(x,!1),P=M?N(null,t.to,M):j(A,!0),_=[];return(C||x).to<(M||A).from-(C&&M?1:0)||x.widgetLineBreaks>1&&H.bottom+n.defaultLineHeight/2<P.top?_.push(T(v,H.bottom,y,P.top)):H.bottom<P.top&&n.elementAtHeight((H.bottom+P.top)/2).type==Lt.Text&&(H.bottom=P.top=(H.bottom+P.top)/2),D(H).concat(_).concat(D(P))}function T(H,P,_,G){return new Ca(e,H-h.left,P-h.top,Math.max(0,_-H),G-P)}function D({top:H,bottom:P,horizontal:_}){let G=[];for(let Z=0;Z<_.length;Z+=2)G.push(T(_[Z],H,_[Z+1],P));return G}function N(H,P,_){let G=1e9,Z=-1e9,ie=[];function ne(oe,ae,R,z,L){let F=n.coordsAtPos(oe,oe==_.to?-2:2),ue=n.coordsAtPos(R,R==_.from?2:-2);!F||!ue||(G=Math.min(F.top,ue.top,G),Z=Math.max(F.bottom,ue.bottom,Z),L==rt.LTR?ie.push(s&&ae?v:F.left,s&&z?y:ue.right):ie.push(!s&&z?v:ue.left,!s&&ae?y:F.right))}let ee=H??_.from,se=P??_.to;for(let oe of n.visibleRanges)if(oe.to>ee&&oe.from<se)for(let ae=Math.max(oe.from,ee),R=Math.min(oe.to,se);;){let z=n.state.doc.lineAt(ae);for(let L of n.bidiSpans(z)){let F=L.from+z.from,ue=L.to+z.from;if(F>=R)break;ue>ae&&ne(Math.max(F,ae),H==null&&F<=ee,Math.min(ue,R),P==null&&ue>=se,L.dir)}if(ae=z.to+1,ae>=R)break}return ie.length==0&&ne(ee,H==null,se,P==null,n.textDirection),{top:G,bottom:Z,horizontal:ie}}function j(H,P){let _=f.top+(P?H.top:H.bottom);return{top:_,bottom:_,horizontal:[]}}}function d4(n,e){return n.constructor==e.constructor&&n.eq(e)}class m4{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(wu)!=e.state.facet(wu)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(wu);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!d4(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[r].constructor&&o.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(o.draw(),t);for(;t;){let o=t.nextSibling;t.remove(),t=o}this.drawn=e,he.safari&&he.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const wu=be.define();function I2(n){return[vi.define(e=>new m4(e,n)),wu.of(n)]}const ca=be.define({combine(n){return Of(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function p4(n={}){return[ca.of(n),g4,v4,y4,d2.of(!0)]}function G2(n){return n.startState.facet(ca)!=n.state.facet(ca)}const g4=I2({above:!0,markers(n){let{state:e}=n,t=e.facet(ca),r=[];for(let o of e.selection.ranges){let s=o==e.selection.main;if(o.empty||t.drawRangeCursor){let c=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",f=o.empty?o:le.cursor(o.head,o.head>o.anchor?-1:1);for(let h of Ca.forRange(n,c,f))r.push(h)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=G2(n);return t&&H1(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){H1(e.state,n)},class:"cm-cursorLayer"});function H1(n,e){e.style.animationDuration=n.facet(ca).cursorBlinkRate+"ms"}const v4=I2({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Ca.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||G2(n)},class:"cm-selectionLayer"}),y4=Tf.highest(we.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function b4(){return S4}const x4=lt.line({class:"cm-activeLine"}),S4=vi.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let o=n.lineBlockAt(r.head);o.from>e&&(t.push(x4.range(o.from)),e=o.from)}return lt.set(t)}},{decorations:n=>n.decorations});class wl extends yl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}wl.prototype.elementClass="";wl.prototype.toDOM=void 0;wl.prototype.mapMode=gn.TrackBefore;wl.prototype.startSide=wl.prototype.endSide=-1;wl.prototype.point=!0;const Nm=be.define(),w4=be.define(),Cu=be.define(),U1=be.define({combine:n=>n.some(e=>e)});function C4(n){return[A4]}const A4=vi.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.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=n.state.facet(Cu).map(e=>new V1(n,e)),this.fixed=!n.state.facet(U1);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),n.scrollDOM.insertBefore(this.dom,n.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(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(n.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(U1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=Ue.iter(this.view.state.facet(Nm),this.view.viewport.from),r=[],o=this.gutters.map(s=>new E4(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let c=!0;for(let f of s.type)if(f.type==Lt.Text&&c){jp(t,r,f.from);for(let h of o)h.line(this.view,f,r);c=!1}else if(f.widget)for(let h of o)h.widget(this.view,f)}else if(s.type==Lt.Text){jp(t,r,s.from);for(let c of o)c.line(this.view,s,r)}else if(s.widget)for(let c of o)c.widget(this.view,s);for(let s of o)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(Cu),t=n.state.facet(Cu),r=n.docChanged||n.heightChanged||n.viewportChanged||!Ue.eq(n.startState.facet(Nm),n.state.facet(Nm),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let o of this.gutters)o.update(n)&&(r=!0);else{r=!0;let o=[];for(let s of t){let c=e.indexOf(s);c<0?o.push(new V1(this.view,s)):(this.gutters[c].update(n),o.push(this.gutters[c]))}for(let s of this.gutters)s.dom.remove(),o.indexOf(s)<0&&s.destroy();for(let s of o)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=o}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>we.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,o=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==rt.LTR?{left:r,right:o}:{right:r,left:o}})});function P1(n){return Array.isArray(n)?n:[n]}function jp(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class E4{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Ue.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:o}=this,s=(t.top-this.height)/e.scaleY,c=t.height/e.scaleY;if(this.i==o.elements.length){let f=new q2(e,c,s,r);o.elements.push(f),o.dom.appendChild(f.dom)}else o.elements[this.i].update(e,c,s,r);this.height=t.bottom,this.i++}line(e,t,r){let o=[];jp(this.cursor,o,t.from),r.length&&(o=o.concat(r));let s=this.gutter.config.lineMarker(e,t,o);s&&o.unshift(s);let c=this.gutter;o.length==0&&!c.config.renderEmptyElements||this.addElement(e,t,o)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),o=r?[r]:null;for(let s of e.state.facet(w4)){let c=s(e,t.widget,t);c&&(o||(o=[])).push(c)}o&&this.addElement(e,t,o)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class V1{constructor(e,t){this.view=e,this.config=t,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 t.domEventHandlers)this.dom.addEventListener(r,o=>{let s=o.target,c;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let h=s.getBoundingClientRect();c=(h.top+h.bottom)/2}else c=o.clientY;let f=e.lineBlockAtHeight(c-e.documentTop);t.domEventHandlers[r](e,f,o)&&o.preventDefault()});this.markers=P1(t.markers(e)),t.initialSpacer&&(this.spacer=new q2(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=P1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let o=this.config.updateSpacer(this.spacer.markers[0],e);o!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[o])}let r=e.view.viewport;return!Ue.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class q2{constructor(e,t,r,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,o)}update(e,t,r,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),M4(this.markers,o)||this.setMarkers(e,o)}setMarkers(e,t){let r="cm-gutterElement",o=this.dom.firstChild;for(let s=0,c=0;;){let f=c,h=s<t.length?t[s++]:null,d=!1;if(h){let p=h.elementClass;p&&(r+=" "+p);for(let v=c;v<this.markers.length;v++)if(this.markers[v].compare(h)){f=v,d=!0;break}}else f=this.markers.length;for(;c<f;){let p=this.markers[c++];if(p.toDOM){p.destroy(o);let v=o.nextSibling;o.remove(),o=v}}if(!h)break;h.toDOM&&(d?o=o.nextSibling:this.dom.insertBefore(h.toDOM(e),o)),d&&c++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function M4(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const T4=be.define(),k4=be.define(),po=be.define({combine(n){return Of(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let o in t){let s=r[o],c=t[o];r[o]=s?(f,h,d)=>s(f,h,d)||c(f,h,d):c}return r}})}});class _m extends wl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Bm(n,e){return n.state.facet(po).formatNumber(e,n.state)}const O4=Cu.compute([po],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(T4)},lineMarker(e,t,r){return r.some(o=>o.toDOM)?null:new _m(Bm(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let o of e.state.facet(k4)){let s=o(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(po)!=e.state.facet(po),initialSpacer(e){return new _m(Bm(e,I1(e.state.doc.lines)))},updateSpacer(e,t){let r=Bm(t.view,I1(t.view.state.doc.lines));return r==e.number?e:new _m(r)},domEventHandlers:n.facet(po).domEventHandlers,side:"before"}));function R4(n={}){return[po.of(n),C4(),O4]}function I1(n){let e=9;for(;e<n;)e=e*10+9;return e}const D4=1024;let N4=0;class zm{constructor(e,t){this.from=e,this.to=t}}class je{constructor(e={}){this.id=N4++,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=jn.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}je.closedBy=new je({deserialize:n=>n.split(" ")});je.openedBy=new je({deserialize:n=>n.split(" ")});je.group=new je({deserialize:n=>n.split(" ")});je.isolate=new je({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});je.contextHash=new je({perNode:!0});je.lookAhead=new je({perNode:!0});je.mounted=new je({perNode:!0});class Js{constructor(e,t,r,o=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=o}static get(e){return e&&e.props&&e.props[je.mounted.id]}}const _4=Object.create(null);class jn{constructor(e,t,r,o=0){this.name=e,this.props=t,this.id=r,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):_4,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new jn(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(o)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return o}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 t=this.prop(je.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let o of r.split(" "))t[o]=e[r];return r=>{for(let o=r.prop(je.group),s=-1;s<(o?o.length:0);s++){let c=t[s<0?r.name:o[s]];if(c)return c}}}}jn.none=new jn("",Object.create(null),0,8);const au=new WeakMap,G1=new WeakMap;var ft;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(ft||(ft={}));class zt{constructor(e,t,r,o,s){if(this.type=e,this.children=t,this.positions=r,this.length=o,this.props=null,s&&s.length){this.props=Object.create(null);for(let[c,f]of s)this.props[typeof c=="number"?c:c.id]=f}}toString(){let e=Js.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let o=r.toString();o&&(t&&(t+=","),t+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Up(this.topNode,e)}cursorAt(e,t=0,r=0){let o=au.get(this)||this.topNode,s=new Up(o);return s.moveTo(e,t),au.set(this,s._tree),s}get topNode(){return new zn(this,0,0,null)}resolve(e,t=0){let r=ua(au.get(this)||this.topNode,e,t,!1);return au.set(this,r),r}resolveInner(e,t=0){let r=ua(G1.get(this)||this.topNode,e,t,!0);return G1.set(this,r),r}resolveStack(e,t=0){return L4(this,e,t)}iterate(e){let{enter:t,leave:r,from:o=0,to:s=this.length}=e,c=e.mode||0,f=(c&ft.IncludeAnonymous)>0;for(let h=this.cursor(c|ft.IncludeAnonymous);;){let d=!1;if(h.from<=s&&h.to>=o&&(!f&&h.type.isAnonymous||t(h)!==!1)){if(h.firstChild())continue;d=!0}for(;d&&r&&(f||!h.type.isAnonymous)&&r(h),!h.nextSibling();){if(!h.parent())return;d=!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 t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Kg(jn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,o)=>new zt(this.type,t,r,o,this.propValues),e.makeTree||((t,r,o)=>new zt(jn.none,t,r,o)))}static build(e){return j4(e)}}zt.empty=new zt(jn.none,[],[],0);class Yg{constructor(e,t){this.buffer=e,this.index=t}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 Yg(this.buffer,this.index)}}class _r{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return jn.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],o=this.set.types[t],s=o.name;if(/\W/.test(s)&&!o.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let c=[];for(;e<r;)c.push(this.childString(e)),e=this.buffer[e+3];return s+"("+c.join(",")+")"}findChild(e,t,r,o,s){let{buffer:c}=this,f=-1;for(let h=e;h!=t&&!(Y2(s,o,c[h+1],c[h+2])&&(f=h,r>0));h=c[h+3]);return f}slice(e,t,r){let o=this.buffer,s=new Uint16Array(t-e),c=0;for(let f=e,h=0;f<t;){s[h++]=o[f++],s[h++]=o[f++]-r;let d=s[h++]=o[f++]-r;s[h++]=o[f++]-e,c=Math.max(c,d)}return new _r(s,c,this.set)}}function Y2(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function ua(n,e,t,r){for(var o;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let c=!r&&n instanceof zn&&n.index<0?null:n.parent;if(!c)return n;n=c}let s=r?0:ft.IgnoreOverlays;if(r)for(let c=n,f=c.parent;f;c=f,f=c.parent)c instanceof zn&&c.index<0&&((o=f.enter(e,t,s))===null||o===void 0?void 0:o.from)!=c.from&&(n=f);for(;;){let c=n.enter(e,t,s);if(!c)return n;n=c}}class F2{cursor(e=0){return new Up(this,e)}getChild(e,t=null,r=null){let o=q1(this,e,t,r);return o.length?o[0]:null}getChildren(e,t=null,r=null){return q1(this,e,t,r)}resolve(e,t=0){return ua(this,e,t,!1)}resolveInner(e,t=0){return ua(this,e,t,!0)}matchContext(e){return Hp(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let o=t.lastChild;if(!o||o.to!=t.to)break;o.type.isError&&o.from==o.to?(r=t,t=o.prevSibling):t=o}return r}get node(){return this}get next(){return this.parent}}class zn extends F2{constructor(e,t,r,o){super(),this._tree=e,this.from=t,this.index=r,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,o,s=0){for(let c=this;;){for(let{children:f,positions:h}=c._tree,d=t>0?f.length:-1;e!=d;e+=t){let p=f[e],v=h[e]+c.from,y;if(!(!(s&ft.EnterBracketed&&p instanceof zt&&(y=Js.get(p))&&!y.overlay&&y.bracketed&&r>=v&&r<=v+p.length)&&!Y2(o,r,v,v+p.length))){if(p instanceof _r){if(s&ft.ExcludeBuffers)continue;let x=p.findChild(0,p.buffer.length,t,r-v,o);if(x>-1)return new Mr(new B4(c,p,e,v),null,x)}else if(s&ft.IncludeAnonymous||!p.type.isAnonymous||Fg(p)){let x;if(!(s&ft.IgnoreMounts)&&(x=Js.get(p))&&!x.overlay)return new zn(x.tree,v,e,c);let A=new zn(p,v,e,c);return s&ft.IncludeAnonymous||!A.type.isAnonymous?A:A.nextChild(t<0?p.children.length-1:0,t,r,o,s)}}}if(s&ft.IncludeAnonymous||!c.type.isAnonymous||(c.index>=0?e=c.index+t:e=t<0?-1:c._parent._tree.children.length,c=c._parent,!c))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,t,r=0){let o;if(!(r&ft.IgnoreOverlays)&&(o=Js.get(this._tree))&&o.overlay){let s=e-this.from,c=r&ft.EnterBracketed&&o.bracketed;for(let{from:f,to:h}of o.overlay)if((t>0||c?f<=s:f<s)&&(t<0||c?h>=s:h>s))return new zn(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,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 q1(n,e,t,r){let o=n.cursor(),s=[];if(!o.firstChild())return s;if(t!=null){for(let c=!1;!c;)if(c=o.type.is(t),!o.nextSibling())return s}for(;;){if(r!=null&&o.type.is(r))return s;if(o.type.is(e)&&s.push(o.node),!o.nextSibling())return r==null?s:[]}}function Hp(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class B4{constructor(e,t,r,o){this.parent=e,this.buffer=t,this.index=r,this.start=o}}class Mr extends F2{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,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:o}=this.context,s=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new Mr(this.context,this,s)}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,t,r=0){if(r&ft.ExcludeBuffers)return null;let{buffer:o}=this.context,s=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Mr(this.context,this,s)}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,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Mr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Mr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,o=this.index+4,s=r.buffer[this.index+3];if(s>o){let c=r.buffer[this.index+1];e.push(r.slice(o,s,c)),t.push(0)}return new zt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function K2(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let c=n[s];(c.from>t.from||c.to<t.to)&&(t=c,e=s)}let r=t instanceof zn&&t.index<0?null:t.parent,o=n.slice();return r?o[e]=r:o.splice(e,1),new z4(o,t)}class z4{constructor(e,t){this.heads=e,this.node=t}get next(){return K2(this.heads)}}function L4(n,e,t){let r=n.resolveInner(e,t),o=null;for(let s=r instanceof zn?r:r.context.parent;s;s=s.parent)if(s.index<0){let c=s.parent;(o||(o=[r])).push(c.resolve(e,t)),s=c}else{let c=Js.get(s.tree);if(c&&c.overlay&&c.overlay[0].from<=e&&c.overlay[c.overlay.length-1].to>=e){let f=new zn(c.tree,c.overlay[0].from+s.from,-1,s);(o||(o=[r])).push(ua(f,e,t,!1))}}return o?K2(o):r}class Up{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~ft.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,t){this.index=e;let{start:r,buffer:o}=this.buffer;return this.type=t||o.set.types[o.buffer[e]],this.from=r+o.buffer[e+1],this.to=r+o.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,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:o}=this.buffer,s=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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,t,r=this.mode){return this.buffer?r&ft.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ft.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ft.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:t}=this.buffer,r=this.stack.length-1;if(e<0){let o=r<0?0:this.stack[r]+4;if(this.index!=o)return this.yieldBuf(t.findChild(o,this.index,-1,0,4))}else{let o=t.buffer[this.index+3];if(o<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(o)}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 t,r,{buffer:o}=this;if(o){if(e>0){if(this.index<o.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(o.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=o)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,c=e<0?-1:r._tree.children.length;s!=c;s+=e){let f=r._tree.children[s];if(this.mode&ft.IncludeAnonymous||f instanceof _r||!f.type.isAnonymous||Fg(f))return!1}return!0}move(e,t){if(t&&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,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let o=this.index,s=this.stack.length;s>=0;){for(let c=e;c;c=c._parent)if(c.index==o){if(o==this.index)return c;t=c,r=s+1;break e}o=this.stack[--s]}for(let o=r;o<this.stack.length;o++)t=new Mr(this.buffer,t,this.stack[o]);return this.bufferNode=new Mr(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let o=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&t&&t(this),o=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,o=!0}}}matchContext(e){if(!this.buffer)return Hp(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let o=e.length-1,s=this.stack.length-1;o>=0;s--){if(s<0)return Hp(this._tree,e,o);let c=r[t.buffer[this.stack[s]]];if(!c.isAnonymous){if(e[o]&&e[o]!=c.name)return!1;o--}}return!0}}function Fg(n){return n.children.some(e=>e instanceof _r||!e.type.isAnonymous||Fg(e))}function j4(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:o=D4,reused:s=[],minRepeatType:c=r.types.length}=n,f=Array.isArray(t)?new Yg(t,t.length):t,h=r.types,d=0,p=0;function v(H,P,_,G,Z,ie){let{id:ne,start:ee,end:se,size:oe}=f,ae=p,R=d;if(oe<0)if(f.next(),oe==-1){let k=s[ne];_.push(k),G.push(ee-H);return}else if(oe==-3){d=ne;return}else if(oe==-4){p=ne;return}else throw new RangeError(`Unrecognized record size: ${oe}`);let z=h[ne],L,F,ue=ee-H;if(se-ee<=o&&(F=M(f.pos-P,Z))){let k=new Uint16Array(F.size-F.skip),Y=f.pos-F.size,te=k.length;for(;f.pos>Y;)te=T(F.start,k,te);L=new _r(k,se-F.start,r),ue=F.start-H}else{let k=f.pos-oe;f.next();let Y=[],te=[],re=ne>=c?ne:-1,me=0,ye=se;for(;f.pos>k;)re>=0&&f.id==re&&f.size>=0?(f.end<=ye-o&&(A(Y,te,ee,me,f.end,ye,re,ae,R),me=Y.length,ye=f.end),f.next()):ie>2500?y(ee,k,Y,te):v(ee,k,Y,te,re,ie+1);if(re>=0&&me>0&&me<Y.length&&A(Y,te,ee,me,ee,ye,re,ae,R),Y.reverse(),te.reverse(),re>-1&&me>0){let J=x(z,R);L=Kg(z,Y,te,0,Y.length,0,se-ee,J,J)}else L=C(z,Y,te,se-ee,ae-se,R)}_.push(L),G.push(ue)}function y(H,P,_,G){let Z=[],ie=0,ne=-1;for(;f.pos>P;){let{id:ee,start:se,end:oe,size:ae}=f;if(ae>4)f.next();else{if(ne>-1&&se<ne)break;ne<0&&(ne=oe-o),Z.push(ee,se,oe),ie++,f.next()}}if(ie){let ee=new Uint16Array(ie*4),se=Z[Z.length-2];for(let oe=Z.length-3,ae=0;oe>=0;oe-=3)ee[ae++]=Z[oe],ee[ae++]=Z[oe+1]-se,ee[ae++]=Z[oe+2]-se,ee[ae++]=ae;_.push(new _r(ee,Z[2]-se,r)),G.push(se-H)}}function x(H,P){return(_,G,Z)=>{let ie=0,ne=_.length-1,ee,se;if(ne>=0&&(ee=_[ne])instanceof zt){if(!ne&&ee.type==H&&ee.length==Z)return ee;(se=ee.prop(je.lookAhead))&&(ie=G[ne]+ee.length+se)}return C(H,_,G,Z,ie,P)}}function A(H,P,_,G,Z,ie,ne,ee,se){let oe=[],ae=[];for(;H.length>G;)oe.push(H.pop()),ae.push(P.pop()+_-Z);H.push(C(r.types[ne],oe,ae,ie-Z,ee-ie,se)),P.push(Z-_)}function C(H,P,_,G,Z,ie,ne){if(ie){let ee=[je.contextHash,ie];ne=ne?[ee].concat(ne):[ee]}if(Z>25){let ee=[je.lookAhead,Z];ne=ne?[ee].concat(ne):[ee]}return new zt(H,P,_,G,ne)}function M(H,P){let _=f.fork(),G=0,Z=0,ie=0,ne=_.end-o,ee={size:0,start:0,skip:0};e:for(let se=_.pos-H;_.pos>se;){let oe=_.size;if(_.id==P&&oe>=0){ee.size=G,ee.start=Z,ee.skip=ie,ie+=4,G+=4,_.next();continue}let ae=_.pos-oe;if(oe<0||ae<se||_.start<ne)break;let R=_.id>=c?4:0,z=_.start;for(_.next();_.pos>ae;){if(_.size<0)if(_.size==-3||_.size==-4)R+=4;else break e;else _.id>=c&&(R+=4);_.next()}Z=z,G+=oe,ie+=R}return(P<0||G==H)&&(ee.size=G,ee.start=Z,ee.skip=ie),ee.size>4?ee:void 0}function T(H,P,_){let{id:G,start:Z,end:ie,size:ne}=f;if(f.next(),ne>=0&&G<c){let ee=_;if(ne>4){let se=f.pos-(ne-4);for(;f.pos>se;)_=T(H,P,_)}P[--_]=ee,P[--_]=ie-H,P[--_]=Z-H,P[--_]=G}else ne==-3?d=G:ne==-4&&(p=G);return _}let D=[],N=[];for(;f.pos>0;)v(n.start||0,n.bufferStart||0,D,N,-1,0);let j=(e=n.length)!==null&&e!==void 0?e:D.length?N[0]+D[0].length:0;return new zt(h[n.topID],D.reverse(),N.reverse(),j)}const Y1=new WeakMap;function Au(n,e){if(!n.isAnonymous||e instanceof _r||e.type!=n)return 1;let t=Y1.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof zt)){t=1;break}t+=Au(n,r)}Y1.set(e,t)}return t}function Kg(n,e,t,r,o,s,c,f,h){let d=0;for(let A=r;A<o;A++)d+=Au(n,e[A]);let p=Math.ceil(d*1.5/8),v=[],y=[];function x(A,C,M,T,D){for(let N=M;N<T;){let j=N,H=C[N],P=Au(n,A[N]);for(N++;N<T;N++){let _=Au(n,A[N]);if(P+_>=p)break;P+=_}if(N==j+1){if(P>p){let _=A[j];x(_.children,_.positions,0,_.children.length,C[j]+D);continue}v.push(A[j])}else{let _=C[N-1]+A[N-1].length-H;v.push(Kg(n,A,C,j,N,H,_,null,h))}y.push(H+D-s)}}return x(e,t,r,o,0),(f||h)(v,y,c)}class fl{constructor(e,t,r,o,s=!1,c=!1){this.from=e,this.to=t,this.tree=r,this.offset=o,this.open=(s?1:0)|(c?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let o=[new fl(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&o.push(s);return o}static applyChanges(e,t,r=128){if(!t.length)return e;let o=[],s=1,c=e.length?e[0]:null;for(let f=0,h=0,d=0;;f++){let p=f<t.length?t[f]:null,v=p?p.fromA:1e9;if(v-h>=r)for(;c&&c.from<v;){let y=c;if(h>=y.from||v<=y.to||d){let x=Math.max(y.from,h)-d,A=Math.min(y.to,v)-d;y=x>=A?null:new fl(x,A,y.tree,y.offset+d,f>0,!!p)}if(y&&o.push(y),c.to>v)break;c=s<e.length?e[s++]:null}if(!p)break;h=p.toA,d=p.toA-p.toB}return o}}class H4{startParse(e,t,r){return typeof e=="string"&&(e=new U4(e)),r=r?r.length?r.map(o=>new zm(o.from,o.to)):[new zm(0,0)]:[new zm(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let o=this.startParse(e,t,r);for(;;){let s=o.advance();if(s)return s}}}class U4{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new je({perNode:!0});let P4=0;class Rn{constructor(e,t,r,o){this.name=e,this.set=t,this.base=r,this.modified=o,this.id=P4++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof Rn&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let o=new Rn(r,[],null,[]);if(o.set.push(o),t)for(let s of t.set)o.set.push(s);return o}static defineModifier(e){let t=new ef(e);return r=>r.modified.indexOf(t)>-1?r:ef.get(r.base||r,r.modified.concat(t).sort((o,s)=>o.id-s.id))}}let V4=0;class ef{constructor(e){this.name=e,this.instances=[],this.id=V4++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(f=>f.base==e&&I4(t,f.modified));if(r)return r;let o=[],s=new Rn(e.name,o,e,t);for(let f of t)f.instances.push(s);let c=G4(t);for(let f of e.set)if(!f.modified.length)for(let h of c)o.push(ef.get(f,h));return s}}function I4(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function G4(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,o=e.length;r<o;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function q4(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let o of t.split(" "))if(o){let s=[],c=2,f=o;for(let v=0;;){if(f=="..."&&v>0&&v+3==o.length){c=1;break}let y=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(f);if(!y)throw new RangeError("Invalid path: "+o);if(s.push(y[0]=="*"?"":y[0][0]=='"'?JSON.parse(y[0]):y[0]),v+=y[0].length,v==o.length)break;let x=o[v++];if(v==o.length&&x=="!"){c=0;break}if(x!="/")throw new RangeError("Invalid path: "+o);f=o.slice(v)}let h=s.length-1,d=s[h];if(!d)throw new RangeError("Invalid path: "+o);let p=new fa(r,c,h>0?s.slice(0,h):null);e[d]=p.sort(e[d])}}return W2.add(e)}const W2=new je({combine(n,e){let t,r,o;for(;n||e;){if(!n||e&&n.depth>=e.depth?(o=e,e=e.next):(o=n,n=n.next),t&&t.mode==o.mode&&!o.context&&!t.context)continue;let s=new fa(o.tags,o.mode,o.context);t?t.next=s:r=s,t=s}return r}});class fa{constructor(e,t,r,o){this.tags=e,this.mode=t,this.context=r,this.next=o}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}}fa.empty=new fa([],2,null);function X2(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let c of s.tag)t[c.id]=s.class;let{scope:r,all:o=null}=e||{};return{style:s=>{let c=o;for(let f of s)for(let h of f.set){let d=t[h.id];if(d){c=c?c+" "+d:d;break}}return c},scope:r}}function Y4(n,e){let t=null;for(let r of n){let o=r.style(e);o&&(t=t?t+" "+o:o)}return t}function F4(n,e,t,r=0,o=n.length){let s=new K4(r,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),r,o,"",s.highlighters),s.flush(o)}class K4{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,o,s){let{type:c,from:f,to:h}=e;if(f>=r||h<=t)return;c.isTop&&(s=this.highlighters.filter(x=>!x.scope||x.scope(c)));let d=o,p=W4(e)||fa.empty,v=Y4(s,p.tags);if(v&&(d&&(d+=" "),d+=v,p.mode==1&&(o+=(o?" ":"")+v)),this.startSpan(Math.max(t,f),d),p.opaque)return;let y=e.tree&&e.tree.prop(je.mounted);if(y&&y.overlay){let x=e.node.enter(y.overlay[0].from+f,1),A=this.highlighters.filter(M=>!M.scope||M.scope(y.tree.type)),C=e.firstChild();for(let M=0,T=f;;M++){let D=M<y.overlay.length?y.overlay[M]:null,N=D?D.from+f:h,j=Math.max(t,T),H=Math.min(r,N);if(j<H&&C)for(;e.from<H&&(this.highlightRange(e,j,H,o,s),this.startSpan(Math.min(H,e.to),d),!(e.to>=N||!e.nextSibling())););if(!D||N>r)break;T=D.to+f,T>t&&(this.highlightRange(x.cursor(),Math.max(t,D.from+f),Math.min(r,T),"",A),this.startSpan(Math.min(r,T),d))}C&&e.parent()}else if(e.firstChild()){y&&(o="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,o,s),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function W4(n){let e=n.type.prop(W2);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const ce=Rn.define,cu=ce(),wr=ce(),F1=ce(wr),K1=ce(wr),Cr=ce(),uu=ce(Cr),Lm=ce(Cr),li=ce(),ol=ce(li),ii=ce(),ri=ce(),Pp=ce(),Hs=ce(Pp),fu=ce(),X={comment:cu,lineComment:ce(cu),blockComment:ce(cu),docComment:ce(cu),name:wr,variableName:ce(wr),typeName:F1,tagName:ce(F1),propertyName:K1,attributeName:ce(K1),className:ce(wr),labelName:ce(wr),namespace:ce(wr),macroName:ce(wr),literal:Cr,string:uu,docString:ce(uu),character:ce(uu),attributeValue:ce(uu),number:Lm,integer:ce(Lm),float:ce(Lm),bool:ce(Cr),regexp:ce(Cr),escape:ce(Cr),color:ce(Cr),url:ce(Cr),keyword:ii,self:ce(ii),null:ce(ii),atom:ce(ii),unit:ce(ii),modifier:ce(ii),operatorKeyword:ce(ii),controlKeyword:ce(ii),definitionKeyword:ce(ii),moduleKeyword:ce(ii),operator:ri,derefOperator:ce(ri),arithmeticOperator:ce(ri),logicOperator:ce(ri),bitwiseOperator:ce(ri),compareOperator:ce(ri),updateOperator:ce(ri),definitionOperator:ce(ri),typeOperator:ce(ri),controlOperator:ce(ri),punctuation:Pp,separator:ce(Pp),bracket:Hs,angleBracket:ce(Hs),squareBracket:ce(Hs),paren:ce(Hs),brace:ce(Hs),content:li,heading:ol,heading1:ce(ol),heading2:ce(ol),heading3:ce(ol),heading4:ce(ol),heading5:ce(ol),heading6:ce(ol),contentSeparator:ce(li),list:ce(li),quote:ce(li),emphasis:ce(li),strong:ce(li),link:ce(li),monospace:ce(li),strikethrough:ce(li),inserted:ce(),deleted:ce(),changed:ce(),invalid:ce(),meta:fu,documentMeta:ce(fu),annotation:ce(fu),processingInstruction:ce(fu),definition:Rn.defineModifier("definition"),constant:Rn.defineModifier("constant"),function:Rn.defineModifier("function"),standard:Rn.defineModifier("standard"),local:Rn.defineModifier("local"),special:Rn.defineModifier("special")};for(let n in X){let e=X[n];e instanceof Rn&&(e.name=n)}X2([{tag:X.link,class:"tok-link"},{tag:X.heading,class:"tok-heading"},{tag:X.emphasis,class:"tok-emphasis"},{tag:X.strong,class:"tok-strong"},{tag:X.keyword,class:"tok-keyword"},{tag:X.atom,class:"tok-atom"},{tag:X.bool,class:"tok-bool"},{tag:X.url,class:"tok-url"},{tag:X.labelName,class:"tok-labelName"},{tag:X.inserted,class:"tok-inserted"},{tag:X.deleted,class:"tok-deleted"},{tag:X.literal,class:"tok-literal"},{tag:X.string,class:"tok-string"},{tag:X.number,class:"tok-number"},{tag:[X.regexp,X.escape,X.special(X.string)],class:"tok-string2"},{tag:X.variableName,class:"tok-variableName"},{tag:X.local(X.variableName),class:"tok-variableName tok-local"},{tag:X.definition(X.variableName),class:"tok-variableName tok-definition"},{tag:X.special(X.variableName),class:"tok-variableName2"},{tag:X.definition(X.propertyName),class:"tok-propertyName tok-definition"},{tag:X.typeName,class:"tok-typeName"},{tag:X.namespace,class:"tok-namespace"},{tag:X.className,class:"tok-className"},{tag:X.macroName,class:"tok-macroName"},{tag:X.propertyName,class:"tok-propertyName"},{tag:X.operator,class:"tok-operator"},{tag:X.comment,class:"tok-comment"},{tag:X.meta,class:"tok-meta"},{tag:X.invalid,class:"tok-invalid"},{tag:X.punctuation,class:"tok-punctuation"}]);var jm;const Fs=new je,X4=new je;class fi{constructor(e,t,r=[],o=""){this.data=e,this.name=o,qe.prototype.hasOwnProperty("tree")||Object.defineProperty(qe.prototype,"tree",{get(){return yi(this)}}),this.parser=t,this.extension=[Do.of(this),qe.languageData.of((s,c,f)=>{let h=W1(s,c,f),d=h.type.prop(Fs);if(!d)return[];let p=s.facet(d),v=h.type.prop(X4);if(v){let y=h.resolve(c-h.from,f);for(let x of v)if(x.test(y,s)){let A=s.facet(x.facet);return x.type=="replace"?A:A.concat(p)}}return p})].concat(r)}isActiveAt(e,t,r=-1){return W1(e,t,r).type.prop(Fs)==this.data}findRegions(e){let t=e.facet(Do);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],o=(s,c)=>{if(s.prop(Fs)==this.data){r.push({from:c,to:c+s.length});return}let f=s.prop(je.mounted);if(f){if(f.tree.prop(Fs)==this.data){if(f.overlay)for(let h of f.overlay)r.push({from:h.from+c,to:h.to+c});else r.push({from:c,to:c+s.length});return}else if(f.overlay){let h=r.length;if(o(f.tree,f.overlay[0].from+c),r.length>h)return}}for(let h=0;h<s.children.length;h++){let d=s.children[h];d instanceof zt&&o(d,s.positions[h]+c)}};return o(yi(e),0),r}get allowsNesting(){return!0}}fi.setState=ht.define();function W1(n,e,t){let r=n.facet(Do),o=yi(n).topNode;if(!r||r.allowsNesting)for(let s=o;s;s=s.enter(e,t,ft.ExcludeBuffers|ft.EnterBracketed))s.type.isTop&&(o=s);return o}function yi(n){let e=n.field(fi.state,!1);return e?e.tree:zt.empty}class Q4{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,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let Us=null;class tf{constructor(e,t,r=[],o,s,c,f,h){this.parser=e,this.state=t,this.fragments=r,this.tree=o,this.treeLen=s,this.viewport=c,this.skipped=f,this.scheduleOn=h,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new tf(e,t,[],zt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Q4(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=zt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let o=Date.now()+e;e=()=>Date.now()>o}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let o=this.parse.advance();if(o)if(this.fragments=this.withoutTempSkipped(fl.addTree(o,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=o,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(fl.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Us;Us=this;try{return e()}finally{Us=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=X1(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:o,treeLen:s,viewport:c,skipped:f}=this;if(this.takeTree(),!e.empty){let h=[];if(e.iterChangedRanges((d,p,v,y)=>h.push({fromA:d,toA:p,fromB:v,toB:y})),r=fl.applyChanges(r,h),o=zt.empty,s=0,c={from:e.mapPos(c.from,-1),to:e.mapPos(c.to,1)},this.skipped.length){f=[];for(let d of this.skipped){let p=e.mapPos(d.from,1),v=e.mapPos(d.to,-1);p<v&&f.push({from:p,to:v})}}}return new tf(this.parser,t,r,o,s,c,f,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:o,to:s}=this.skipped[r];o<e.to&&s>e.from&&(this.fragments=X1(this.fragments,o,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends H4{createParse(t,r,o){let s=o[0].from,c=o[o.length-1].to;return{parsedPos:s,advance(){let h=Us;if(h){for(let d of o)h.tempSkipped.push(d);e&&(h.scheduleOn=h.scheduleOn?Promise.all([h.scheduleOn,e]):e)}return this.parsedPos=c,new zt(jn.none,[],[],c-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Us}}function X1(n,e,t){return fl.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ro{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=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),t.viewport.to);return t.work(20,r)||t.takeTree(),new Ro(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=tf.create(e.facet(Do).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new Ro(r)}}fi.state=Ki.define({create:Ro.init,update(n,e){for(let t of e.effects)if(t.is(fi.setState))return t.value;return e.startState.facet(Do)!=e.state.facet(Do)?Ro.init(e.state):n.apply(e)}});let Q2=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Q2=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Hm=typeof navigator<"u"&&(!((jm=navigator.scheduling)===null||jm===void 0)&&jm.isInputPending)?()=>navigator.scheduling.isInputPending():null,Z4=vi.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 t=this.view.state.field(fi.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(fi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Q2(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:o}}=this.view,s=r.field(fi.state);if(s.tree==s.context.tree&&s.context.isDone(o+1e5))return;let c=Date.now()+Math.min(this.chunkBudget,100,e&&!Hm?Math.max(25,e.timeRemaining()-5):1e9),f=s.context.treeLen<o&&r.doc.length>o+1e3,h=s.context.work(()=>Hm&&Hm()||Date.now()>c,o+(f?0:1e5));this.chunkBudget-=Date.now()-t,(h||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:fi.setState.of(new Ro(s.context))})),this.chunkBudget>0&&!(h&&!f)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ui(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Do=be.define({combine(n){return n.length?n[0]:null},enables:n=>[fi.state,Z4,we.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]}),$4=be.define(),Wg=be.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function nf(n){let e=n.facet(Wg);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function rf(n,e){let t="",r=n.tabSize,o=n.facet(Wg)[0];if(o==" "){for(;e>=r;)t+=" ",e-=r;o=" "}for(let s=0;s<e;s++)t+=o;return t}function Z2(n,e){n instanceof qe&&(n=new jf(n));for(let r of n.state.facet($4)){let o=r(n,e);if(o!==void 0)return o}let t=yi(n.state);return t.length>=e?ej(n,t,e):null}class jf{constructor(e,t={}){this.state=e,this.options=t,this.unit=nf(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:s}=this.options;return o!=null&&o>=r.from&&o<=r.to?s&&o==e?{text:"",from:e}:(t<0?o<e:o<=e)?{text:r.text.slice(o-r.from),from:o}:{text:r.text.slice(0,o-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:o}=this.lineAt(e,t);return r.slice(e-o,Math.min(r.length,e+100-o))}column(e,t=1){let{text:r,from:o}=this.lineAt(e,t),s=this.countColumn(r,e-o),c=this.options.overrideIndentation?this.options.overrideIndentation(o):-1;return c>-1&&(s+=c-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return Rf(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:o}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let c=s(o);if(c>-1)return c}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const J4=new je;function ej(n,e,t){let r=e.resolveStack(t),o=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(o!=r.node){let s=[];for(let c=o;c&&!(c.from<r.node.from||c.to>r.node.to||c.from==r.node.from&&c.type==r.node.type);c=c.parent)s.push(c);for(let c=s.length-1;c>=0;c--)r={node:s[c],next:r}}return $2(r,n,t)}function $2(n,e,t){for(let r=n;r;r=r.next){let o=nj(r.node);if(o)return o(Xg.create(e,t,r))}return 0}function tj(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function nj(n){let e=n.type.prop(J4);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(je.closedBy))){let o=n.lastChild,s=o&&r.indexOf(o.name)>-1;return c=>oj(c,!0,1,void 0,s&&!tj(c)?o.from:void 0)}return n.parent==null?ij:null}function ij(){return 0}class Xg extends jf{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Xg(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(rj(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return $2(this.context.next,this.base,this.pos)}}function rj(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function lj(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let o=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),c=o==null||o<=s.from?s.to:Math.min(s.to,o);for(let f=t.to;;){let h=e.childAfter(f);if(!h||h==r)return null;if(!h.type.isSkipped){if(h.from>=c)return null;let d=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+d}}f=h.to}}function oj(n,e,t,r,o){let s=n.textAfter,c=s.match(/^\s*/)[0].length,f=r&&s.slice(c,c+r.length)==r||o==n.pos+c,h=lj(n);return h?f?n.column(h.from):n.column(h.to):n.baseIndent+(f?0:n.unit*t)}class Aa{constructor(e,t){this.specs=e;let r;function o(f){let h=Rr.newName();return(r||(r=Object.create(null)))["."+h]=f,h}const s=typeof t.all=="string"?t.all:t.all?o(t.all):void 0,c=t.scope;this.scope=c instanceof fi?f=>f.prop(Fs)==c.data:c?f=>f==c:void 0,this.style=X2(e.map(f=>({tag:f.tag,class:f.class||o(Object.assign({},f,{tag:null}))})),{all:s}).style,this.module=r?new Rr(r):null,this.themeType=t.themeType}static define(e,t){return new Aa(e,t||{})}}const Vp=be.define(),sj=be.define({combine(n){return n.length?[n[0]]:null}});function Um(n){let e=n.facet(Vp);return e.length?e:n.facet(sj)}function J2(n,e){let t=[cj],r;return n instanceof Aa&&(n.module&&t.push(we.styleModule.of(n.module)),r=n.themeType),r?t.push(Vp.computeN([we.darkTheme],o=>o.facet(we.darkTheme)==(r=="dark")?[n]:[])):t.push(Vp.of(n)),t}class aj{constructor(e){this.markCache=Object.create(null),this.tree=yi(e.state),this.decorations=this.buildDeco(e,Um(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=yi(e.state),r=Um(e.state),o=r!=Um(e.startState),{viewport:s}=e.view,c=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!o&&t.type==this.tree.type&&c>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=c):(t!=this.tree||e.viewportChanged||o)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return lt.none;let r=new ra;for(let{from:o,to:s}of e.visibleRanges)F4(this.tree,t,(c,f,h)=>{r.add(c,f,this.markCache[h]||(this.markCache[h]=lt.mark({class:h})))},o,s);return r.finish()}}const cj=Tf.high(vi.fromClass(aj,{decorations:n=>n.decorations})),uj=Aa.define([{tag:X.meta,color:"#404740"},{tag:X.link,textDecoration:"underline"},{tag:X.heading,textDecoration:"underline",fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.strong,fontWeight:"bold"},{tag:X.strikethrough,textDecoration:"line-through"},{tag:X.keyword,color:"#708"},{tag:[X.atom,X.bool,X.url,X.contentSeparator,X.labelName],color:"#219"},{tag:[X.literal,X.inserted],color:"#164"},{tag:[X.string,X.deleted],color:"#a11"},{tag:[X.regexp,X.escape,X.special(X.string)],color:"#e40"},{tag:X.definition(X.variableName),color:"#00f"},{tag:X.local(X.variableName),color:"#30a"},{tag:[X.typeName,X.namespace],color:"#085"},{tag:X.className,color:"#167"},{tag:[X.special(X.variableName),X.macroName],color:"#256"},{tag:X.definition(X.propertyName),color:"#00c"},{tag:X.comment,color:"#940"},{tag:X.invalid,color:"#f00"}]),fj=we.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),eE=1e4,tE="()[]{}",nE=be.define({combine(n){return Of(n,{afterCursor:!0,brackets:tE,maxScanDistance:eE,renderMatch:mj})}}),hj=lt.mark({class:"cm-matchingBracket"}),dj=lt.mark({class:"cm-nonmatchingBracket"});function mj(n){let e=[],t=n.matched?hj:dj;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const pj=Ki.define({create(){return lt.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(nE);for(let o of e.state.selection.ranges){if(!o.empty)continue;let s=hi(e.state,o.head,-1,r)||o.head>0&&hi(e.state,o.head-1,1,r)||r.afterCursor&&(hi(e.state,o.head,1,r)||o.head<e.state.doc.length&&hi(e.state,o.head+1,-1,r));s&&(t=t.concat(r.renderMatch(s,e.state)))}return lt.set(t,!0)},provide:n=>we.decorations.from(n)}),gj=[pj,fj];function vj(n={}){return[nE.of(n),gj]}const yj=new je;function Ip(n,e,t){let r=n.prop(e<0?je.openedBy:je.closedBy);if(r)return r;if(n.name.length==1){let o=t.indexOf(n.name);if(o>-1&&o%2==(e<0?1:0))return[t[o+e]]}return null}function Gp(n){let e=n.type.prop(yj);return e?e(n.node):n}function hi(n,e,t,r={}){let o=r.maxScanDistance||eE,s=r.brackets||tE,c=yi(n),f=c.resolveInner(e,t);for(let h=f;h;h=h.parent){let d=Ip(h.type,t,s);if(d&&h.from<h.to){let p=Gp(h);if(p&&(t>0?e>=p.from&&e<p.to:e>p.from&&e<=p.to))return bj(n,e,t,h,p,d,s)}}return xj(n,e,t,c,f.type,o,s)}function bj(n,e,t,r,o,s,c){let f=r.parent,h={from:o.from,to:o.to},d=0,p=f?.cursor();if(p&&(t<0?p.childBefore(r.from):p.childAfter(r.to)))do if(t<0?p.to<=r.from:p.from>=r.to){if(d==0&&s.indexOf(p.type.name)>-1&&p.from<p.to){let v=Gp(p);return{start:h,end:v?{from:v.from,to:v.to}:void 0,matched:!0}}else if(Ip(p.type,t,c))d++;else if(Ip(p.type,-t,c)){if(d==0){let v=Gp(p);return{start:h,end:v&&v.from<v.to?{from:v.from,to:v.to}:void 0,matched:!1}}d--}}while(t<0?p.prevSibling():p.nextSibling());return{start:h,matched:!1}}function xj(n,e,t,r,o,s,c){let f=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),h=c.indexOf(f);if(h<0||h%2==0!=t>0)return null;let d={from:t<0?e-1:e,to:t>0?e+1:e},p=n.doc.iterRange(e,t>0?n.doc.length:0),v=0;for(let y=0;!p.next().done&&y<=s;){let x=p.value;t<0&&(y+=x.length);let A=e+y*t;for(let C=t>0?0:x.length-1,M=t>0?x.length:-1;C!=M;C+=t){let T=c.indexOf(x[C]);if(!(T<0||r.resolveInner(A+C,1).type!=o))if(T%2==0==t>0)v++;else{if(v==1)return{start:d,end:{from:A+C,to:A+C+1},matched:T>>1==h>>1};v--}}t>0&&(y+=x.length)}return p.done?{start:d,matched:!1}:null}const Sj=Object.create(null),Q1=[jn.none],Z1=[],$1=Object.create(null),wj=Object.create(null);for(let[n,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"]])wj[n]=Cj(Sj,e);function Pm(n,e){Z1.indexOf(n)>-1||(Z1.push(n),console.warn(e))}function Cj(n,e){let t=[];for(let f of e.split(" ")){let h=[];for(let d of f.split(".")){let p=n[d]||X[d];p?typeof p=="function"?h.length?h=h.map(p):Pm(d,`Modifier ${d} used at start of tag`):h.length?Pm(d,`Tag ${d} used as modifier`):h=Array.isArray(p)?p:[p]:Pm(d,`Unknown highlighting tag ${d}`)}for(let d of h)t.push(d)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),o=r+" "+t.map(f=>f.id),s=$1[o];if(s)return s.id;let c=$1[o]=jn.define({id:Q1.length,name:r,props:[q4({[r]:t})]});return Q1.push(c),c.id}rt.RTL,rt.LTR;const Aj=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=Zg(n.state,t.from);return r.line?Ej(n):r.block?Tj(n):!1};function Qg(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let o=n(e,t);return o?(r(t.update(o)),!0):!1}}const Ej=Qg(Rj,0),Mj=Qg(iE,0),Tj=Qg((n,e)=>iE(n,e,Oj(e)),0);function Zg(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Ps=50;function kj(n,{open:e,close:t},r,o){let s=n.sliceDoc(r-Ps,r),c=n.sliceDoc(o,o+Ps),f=/\s*$/.exec(s)[0].length,h=/^\s*/.exec(c)[0].length,d=s.length-f;if(s.slice(d-e.length,d)==e&&c.slice(h,h+t.length)==t)return{open:{pos:r-f,margin:f&&1},close:{pos:o+h,margin:h&&1}};let p,v;o-r<=2*Ps?p=v=n.sliceDoc(r,o):(p=n.sliceDoc(r,r+Ps),v=n.sliceDoc(o-Ps,o));let y=/^\s*/.exec(p)[0].length,x=/\s*$/.exec(v)[0].length,A=v.length-x-t.length;return p.slice(y,y+e.length)==e&&v.slice(A,A+t.length)==t?{open:{pos:r+y+e.length,margin:/\s/.test(p.charAt(y+e.length))?1:0},close:{pos:o-x-t.length,margin:/\s/.test(v.charAt(A-1))?1:0}}:null}function Oj(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),o=t.to<=r.to?r:n.doc.lineAt(t.to);o.from>r.from&&o.from==t.to&&(o=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=o.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return e}function iE(n,e,t=e.selection.ranges){let r=t.map(s=>Zg(e,s.from).block);if(!r.every(s=>s))return null;let o=t.map((s,c)=>kj(e,r[c],s.from,s.to));if(n!=2&&!o.every(s=>s))return{changes:e.changes(t.map((s,c)=>o[c]?[]:[{from:s.from,insert:r[c].open+" "},{from:s.to,insert:" "+r[c].close}]))};if(n!=1&&o.some(s=>s)){let s=[];for(let c=0,f;c<o.length;c++)if(f=o[c]){let h=r[c],{open:d,close:p}=f;s.push({from:d.pos-h.open.length,to:d.pos+d.margin},{from:p.pos-p.margin,to:p.pos+h.close.length})}return{changes:s}}return null}function Rj(n,e,t=e.selection.ranges){let r=[],o=-1;e:for(let{from:s,to:c}of t){let f=r.length,h=1e9,d;for(let p=s;p<=c;){let v=e.doc.lineAt(p);if(d==null&&(d=Zg(e,v.from).line,!d))continue e;if(v.from>o&&(s==c||c>v.from)){o=v.from;let y=/^\s*/.exec(v.text)[0].length,x=y==v.length,A=v.text.slice(y,y+d.length)==d?y:-1;y<v.text.length&&y<h&&(h=y),r.push({line:v,comment:A,token:d,indent:y,empty:x,single:!1})}p=v.to+1}if(h<1e9)for(let p=f;p<r.length;p++)r[p].indent<r[p].line.text.length&&(r[p].indent=h);r.length==f+1&&(r[f].single=!0)}if(n!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:f,token:h,indent:d,empty:p,single:v}of r)(v||!p)&&s.push({from:f.from+d,insert:h+" "});let c=e.changes(s);return{changes:c,selection:e.selection.map(c,1)}}else if(n!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:c,comment:f,token:h}of r)if(f>=0){let d=c.from+f,p=d+h.length;c.text[p-c.from]==" "&&p++,s.push({from:d,to:p})}return{changes:s}}return null}const qp=jr.define(),Dj=jr.define(),Nj=be.define(),rE=be.define({combine(n){return Of(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,o)=>e(r,o)||t(r,o)})}}),lE=Ki.define({create(){return di.empty},update(n,e){let t=e.state.facet(rE),r=e.annotation(qp);if(r){let h=tn.fromTransaction(e,r.selection),d=r.side,p=d==0?n.undone:n.done;return h?p=lf(p,p.length,t.minDepth,h):p=aE(p,e.startState.selection),new di(d==0?r.rest:p,d==0?p:r.rest)}let o=e.annotation(Dj);if((o=="full"||o=="before")&&(n=n.isolate()),e.annotation(wt.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=tn.fromTransaction(e),c=e.annotation(wt.time),f=e.annotation(wt.userEvent);return s?n=n.addChanges(s,c,f,t,e):e.selection&&(n=n.addSelection(e.startState.selection,c,f,t.newGroupDelay)),(o=="full"||o=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new di(n.done.map(tn.fromJSON),n.undone.map(tn.fromJSON))}});function _j(n={}){return[lE,rE.of(n),we.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?oE:e.inputType=="historyRedo"?Yp:null;return r?(e.preventDefault(),r(t)):!1}})]}function Hf(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let o=t.field(lE,!1);if(!o)return!1;let s=o.pop(n,t,e);return s?(r(s),!0):!1}}const oE=Hf(0,!1),Yp=Hf(1,!1),Bj=Hf(0,!0),zj=Hf(1,!0);class tn{constructor(e,t,r,o,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=o,this.selectionsAfter=s}setSelAfter(e){return new tn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(e){return new tn(e.changes&&St.fromJSON(e.changes),[],e.mapped&&pi.fromJSON(e.mapped),e.startSelection&&le.fromJSON(e.startSelection),e.selectionsAfter.map(le.fromJSON))}static fromTransaction(e,t){let r=Nn;for(let o of e.startState.facet(Nj)){let s=o(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new tn(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Nn)}static selection(e){return new tn(void 0,Nn,void 0,void 0,e)}}function lf(n,e,t,r){let o=e+1>t+20?e-t-1:0,s=n.slice(o,e);return s.push(r),s}function Lj(n,e){let t=[],r=!1;return n.iterChangedRanges((o,s)=>t.push(o,s)),e.iterChangedRanges((o,s,c,f)=>{for(let h=0;h<t.length;){let d=t[h++],p=t[h++];f>=d&&c<=p&&(r=!0)}}),r}function jj(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function sE(n,e){return n.length?e.length?n.concat(e):n:e}const Nn=[],Hj=200;function aE(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Hj));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),lf(n,n.length-1,1e9,t.setSelAfter(r)))}else return[tn.selection([e])]}function Uj(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Vm(n,e){if(!n.length)return n;let t=n.length,r=Nn;for(;t;){let o=Pj(n[t-1],e,r);if(o.changes&&!o.changes.empty||o.effects.length){let s=n.slice(0,t);return s[t-1]=o,s}else e=o.mapped,t--,r=o.selectionsAfter}return r.length?[tn.selection(r)]:Nn}function Pj(n,e,t){let r=sE(n.selectionsAfter.length?n.selectionsAfter.map(f=>f.map(e)):Nn,t);if(!n.changes)return tn.selection(r);let o=n.changes.map(e),s=e.mapDesc(n.changes,!0),c=n.mapped?n.mapped.composeDesc(s):s;return new tn(o,ht.mapEffects(n.effects,e),c,n.startSelection.map(s),r)}const Vj=/^(input\.type|delete)($|\.)/;class di{constructor(e,t,r=0,o=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=o}isolate(){return this.prevTime?new di(this.done,this.undone):this}addChanges(e,t,r,o,s){let c=this.done,f=c[c.length-1];return f&&f.changes&&!f.changes.empty&&e.changes&&(!r||Vj.test(r))&&(!f.selectionsAfter.length&&t-this.prevTime<o.newGroupDelay&&o.joinToEvent(s,Lj(f.changes,e.changes))||r=="input.type.compose")?c=lf(c,c.length-1,o.minDepth,new tn(e.changes.compose(f.changes),sE(ht.mapEffects(e.effects,f.changes),f.effects),f.mapped,f.startSelection,Nn)):c=lf(c,c.length,o.minDepth,e),new di(c,Nn,t,r)}addSelection(e,t,r,o){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Nn;return s.length>0&&t-this.prevTime<o&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&jj(s[s.length-1],e)?this:new di(aE(this.done,e),this.undone,t,r)}addMapping(e){return new di(Vm(this.done,e),Vm(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let o=e==0?this.done:this.undone;if(o.length==0)return null;let s=o[o.length-1],c=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(r&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:qp.of({side:e,rest:Uj(o),selection:c}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let f=o.length==1?Nn:o.slice(0,o.length-1);return s.mapped&&(f=Vm(f,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:qp.of({side:e,rest:f,selection:c}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}di.empty=new di(Nn,Nn);const Ij=[{key:"Mod-z",run:oE,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Yp,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Yp,preventDefault:!0},{key:"Mod-u",run:Bj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:zj,preventDefault:!0}];function Ho(n,e){return le.create(n.ranges.map(e),n.mainIndex)}function Qn(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Zn({state:n,dispatch:e},t){let r=Ho(n.selection,t);return r.eq(n.selection,!0)?!1:(e(Qn(n,r)),!0)}function Uf(n,e){return le.cursor(e?n.to:n.from)}function cE(n,e){return Zn(n,t=>t.empty?n.moveByChar(t,e):Uf(t,e))}function Vt(n){return n.textDirectionAt(n.state.selection.main.head)==rt.LTR}const uE=n=>cE(n,!Vt(n)),fE=n=>cE(n,Vt(n));function hE(n,e){return Zn(n,t=>t.empty?n.moveByGroup(t,e):Uf(t,e))}const Gj=n=>hE(n,!Vt(n)),qj=n=>hE(n,Vt(n));function Yj(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Pf(n,e,t){let r=yi(n).resolveInner(e.head),o=t?je.closedBy:je.openedBy;for(let h=e.head;;){let d=t?r.childAfter(h):r.childBefore(h);if(!d)break;Yj(n,d,o)?r=d:h=t?d.to:d.from}let s=r.type.prop(o),c,f;return s&&(c=t?hi(n,r.from,1):hi(n,r.to,-1))&&c.matched?f=t?c.end.to:c.end.from:f=t?r.to:r.from,le.cursor(f,t?-1:1)}const Fj=n=>Zn(n,e=>Pf(n.state,e,!Vt(n))),Kj=n=>Zn(n,e=>Pf(n.state,e,Vt(n)));function dE(n,e){return Zn(n,t=>{if(!t.empty)return Uf(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const mE=n=>dE(n,!1),pE=n=>dE(n,!0);function gE(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,o;if(e){for(let s of n.state.facet(we.scrollMargins)){let c=s(n);c?.top&&(t=Math.max(c?.top,t)),c?.bottom&&(r=Math.max(c?.bottom,r))}o=n.scrollDOM.clientHeight-t-r}else o=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,o-5)}}function vE(n,e){let t=gE(n),{state:r}=n,o=Ho(r.selection,c=>c.empty?n.moveVertically(c,e,t.height):Uf(c,e));if(o.eq(r.selection))return!1;let s;if(t.selfScroll){let c=n.coordsAtPos(r.selection.main.head),f=n.scrollDOM.getBoundingClientRect(),h=f.top+t.marginTop,d=f.bottom-t.marginBottom;c&&c.top>h&&c.bottom<d&&(s=we.scrollIntoView(o.main.head,{y:"start",yMargin:c.top-h}))}return n.dispatch(Qn(r,o),{effects:s}),!0}const J1=n=>vE(n,!1),Fp=n=>vE(n,!0);function Hr(n,e,t){let r=n.lineBlockAt(e.head),o=n.moveToLineBoundary(e,t);if(o.head==e.head&&o.head!=(t?r.to:r.from)&&(o=n.moveToLineBoundary(e,t,!1)),!t&&o.head==r.from&&r.length){let s=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(o=le.cursor(r.from+s))}return o}const Wj=n=>Zn(n,e=>Hr(n,e,!0)),Xj=n=>Zn(n,e=>Hr(n,e,!1)),Qj=n=>Zn(n,e=>Hr(n,e,!Vt(n))),Zj=n=>Zn(n,e=>Hr(n,e,Vt(n))),$j=n=>Zn(n,e=>le.cursor(n.lineBlockAt(e.head).from,1)),Jj=n=>Zn(n,e=>le.cursor(n.lineBlockAt(e.head).to,-1));function e5(n,e,t){let r=!1,o=Ho(n.selection,s=>{let c=hi(n,s.head,-1)||hi(n,s.head,1)||s.head>0&&hi(n,s.head-1,1)||s.head<n.doc.length&&hi(n,s.head+1,-1);if(!c||!c.end)return s;r=!0;let f=c.start.from==s.head?c.end.to:c.end.from;return le.cursor(f)});return r?(e(Qn(n,o)),!0):!1}const t5=({state:n,dispatch:e})=>e5(n,e);function Un(n,e){let t=Ho(n.state.selection,r=>{let o=e(r);return le.range(r.anchor,o.head,o.goalColumn,o.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Qn(n.state,t)),!0)}function yE(n,e){return Un(n,t=>n.moveByChar(t,e))}const bE=n=>yE(n,!Vt(n)),xE=n=>yE(n,Vt(n));function SE(n,e){return Un(n,t=>n.moveByGroup(t,e))}const n5=n=>SE(n,!Vt(n)),i5=n=>SE(n,Vt(n)),r5=n=>Un(n,e=>Pf(n.state,e,!Vt(n))),l5=n=>Un(n,e=>Pf(n.state,e,Vt(n)));function wE(n,e){return Un(n,t=>n.moveVertically(t,e))}const CE=n=>wE(n,!1),AE=n=>wE(n,!0);function EE(n,e){return Un(n,t=>n.moveVertically(t,e,gE(n).height))}const eS=n=>EE(n,!1),tS=n=>EE(n,!0),o5=n=>Un(n,e=>Hr(n,e,!0)),s5=n=>Un(n,e=>Hr(n,e,!1)),a5=n=>Un(n,e=>Hr(n,e,!Vt(n))),c5=n=>Un(n,e=>Hr(n,e,Vt(n))),u5=n=>Un(n,e=>le.cursor(n.lineBlockAt(e.head).from)),f5=n=>Un(n,e=>le.cursor(n.lineBlockAt(e.head).to)),nS=({state:n,dispatch:e})=>(e(Qn(n,{anchor:0})),!0),iS=({state:n,dispatch:e})=>(e(Qn(n,{anchor:n.doc.length})),!0),rS=({state:n,dispatch:e})=>(e(Qn(n,{anchor:n.selection.main.anchor,head:0})),!0),lS=({state:n,dispatch:e})=>(e(Qn(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),h5=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),d5=({state:n,dispatch:e})=>{let t=Vf(n).map(({from:r,to:o})=>le.range(r,Math.min(o+1,n.doc.length)));return e(n.update({selection:le.create(t),userEvent:"select"})),!0},m5=({state:n,dispatch:e})=>{let t=Ho(n.selection,r=>{let o=yi(n),s=o.resolveStack(r.from,1);if(r.empty){let c=o.resolveStack(r.from,-1);c.node.from>=s.node.from&&c.node.to<=s.node.to&&(s=c)}for(let c=s;c;c=c.next){let{node:f}=c;if((f.from<r.from&&f.to>=r.to||f.to>r.to&&f.from<=r.from)&&c.next)return le.range(f.to,f.from)}return r});return t.eq(n.selection)?!1:(e(Qn(n,t)),!0)};function ME(n,e){let{state:t}=n,r=t.selection,o=t.selection.ranges.slice();for(let s of t.selection.ranges){let c=t.doc.lineAt(s.head);if(e?c.to<n.state.doc.length:c.from>0)for(let f=s;;){let h=n.moveVertically(f,e);if(h.head<c.from||h.head>c.to){o.some(d=>d.head==h.head)||o.push(h);break}else{if(h.head==f.head)break;f=h}}}return o.length==r.ranges.length?!1:(n.dispatch(Qn(t,le.create(o,o.length-1))),!0)}const p5=n=>ME(n,!1),g5=n=>ME(n,!0),v5=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=le.create([t.main]):t.main.empty||(r=le.create([le.cursor(t.main.head)])),r?(e(Qn(n,r)),!0):!1};function Ea(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,o=r.changeByRange(s=>{let{from:c,to:f}=s;if(c==f){let h=e(s);h<c?(t="delete.backward",h=hu(n,h,!1)):h>c&&(t="delete.forward",h=hu(n,h,!0)),c=Math.min(c,h),f=Math.max(f,h)}else c=hu(n,c,!1),f=hu(n,f,!0);return c==f?{range:s}:{changes:{from:c,to:f},range:le.cursor(c,c<s.head?-1:1)}});return o.changes.empty?!1:(n.dispatch(r.update(o,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?we.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function hu(n,e,t){if(n instanceof we)for(let r of n.state.facet(we.atomicRanges).map(o=>o(n)))r.between(e,e,(o,s)=>{o<e&&s>e&&(e=t?s:o)});return e}const TE=(n,e,t)=>Ea(n,r=>{let o=r.from,{state:s}=n,c=s.doc.lineAt(o),f,h;if(t&&!e&&o>c.from&&o<c.from+200&&!/[^ \t]/.test(f=c.text.slice(0,o-c.from))){if(f[f.length-1]==" ")return o-1;let d=Rf(f,s.tabSize),p=d%nf(s)||nf(s);for(let v=0;v<p&&f[f.length-1-v]==" ";v++)o--;h=o}else h=Bt(c.text,o-c.from,e,e)+c.from,h==o&&c.number!=(e?s.doc.lines:1)?h+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(c.text.slice(h-c.from,o-c.from))&&(h=Bt(c.text,h-c.from,!1,!1)+c.from);return h}),Kp=n=>TE(n,!1,!0),kE=n=>TE(n,!0,!1),OE=(n,e)=>Ea(n,t=>{let r=t.head,{state:o}=n,s=o.doc.lineAt(r),c=o.charCategorizer(r);for(let f=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?o.doc.lines:1)&&(r+=e?1:-1);break}let h=Bt(s.text,r-s.from,e)+s.from,d=s.text.slice(Math.min(r,h)-s.from,Math.max(r,h)-s.from),p=c(d);if(f!=null&&p!=f)break;(d!=" "||r!=t.head)&&(f=p),r=h}return r}),RE=n=>OE(n,!1),y5=n=>OE(n,!0),b5=n=>Ea(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),x5=n=>Ea(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),S5=n=>Ea(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),w5=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ie.of(["",""])},range:le.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},C5=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let o=r.from,s=n.doc.lineAt(o),c=o==s.from?o-1:Bt(s.text,o-s.from,!1)+s.from,f=o==s.to?o+1:Bt(s.text,o-s.from,!0)+s.from;return{changes:{from:c,to:f,insert:n.doc.slice(o,f).append(n.doc.slice(c,o))},range:le.cursor(f)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Vf(n){let e=[],t=-1;for(let r of n.selection.ranges){let o=n.doc.lineAt(r.from),s=n.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=n.doc.lineAt(r.to-1)),t>=o.number){let c=e[e.length-1];c.to=s.to,c.ranges.push(r)}else e.push({from:o.from,to:s.to,ranges:[r]});t=s.number+1}return e}function DE(n,e,t){if(n.readOnly)return!1;let r=[],o=[];for(let s of Vf(n)){if(t?s.to==n.doc.length:s.from==0)continue;let c=n.doc.lineAt(t?s.to+1:s.from-1),f=c.length+1;if(t){r.push({from:s.to,to:c.to},{from:s.from,insert:c.text+n.lineBreak});for(let h of s.ranges)o.push(le.range(Math.min(n.doc.length,h.anchor+f),Math.min(n.doc.length,h.head+f)))}else{r.push({from:c.from,to:s.from},{from:s.to,insert:n.lineBreak+c.text});for(let h of s.ranges)o.push(le.range(h.anchor-f,h.head-f))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:le.create(o,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const A5=({state:n,dispatch:e})=>DE(n,e,!1),E5=({state:n,dispatch:e})=>DE(n,e,!0);function NE(n,e,t){if(n.readOnly)return!1;let r=[];for(let s of Vf(n))t?r.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):r.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let o=n.changes(r);return e(n.update({changes:o,selection:n.selection.map(o,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const M5=({state:n,dispatch:e})=>NE(n,e,!1),T5=({state:n,dispatch:e})=>NE(n,e,!0),k5=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Vf(e).map(({from:o,to:s})=>(o>0?o--:s<e.doc.length&&s++,{from:o,to:s}))),r=Ho(e.selection,o=>{let s;if(n.lineWrapping){let c=n.lineBlockAt(o.head),f=n.coordsAtPos(o.head,o.assoc||1);f&&(s=c.bottom+n.documentTop-f.bottom+n.defaultLineHeight/2)}return n.moveVertically(o,!0,s)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function O5(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=yi(n).resolveInner(e),r=t.childBefore(e),o=t.childAfter(e),s;return r&&o&&r.to<=e&&o.from>=e&&(s=r.type.prop(je.closedBy))&&s.indexOf(o.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(o.from).from&&!/\S/.test(n.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}const oS=_E(!1),R5=_E(!0);function _E(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(o=>{let{from:s,to:c}=o,f=e.doc.lineAt(s),h=!n&&s==c&&O5(e,s);n&&(s=c=(c<=f.to?f:e.doc.lineAt(c)).to);let d=new jf(e,{simulateBreak:s,simulateDoubleBreak:!!h}),p=Z2(d,s);for(p==null&&(p=Rf(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));c<f.to&&/\s/.test(f.text[c-f.from]);)c++;h?{from:s,to:c}=h:s>f.from&&s<f.from+100&&!/\S/.test(f.text.slice(0,s))&&(s=f.from);let v=["",rf(e,p)];return h&&v.push(rf(e,d.lineIndent(f.from,-1))),{changes:{from:s,to:c,insert:Ie.of(v)},range:le.cursor(s+1+v[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function $g(n,e){let t=-1;return n.changeByRange(r=>{let o=[];for(let c=r.from;c<=r.to;){let f=n.doc.lineAt(c);f.number>t&&(r.empty||r.to>f.from)&&(e(f,o,r),t=f.number),c=f.to+1}let s=n.changes(o);return{changes:o,range:le.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const D5=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new jf(n,{overrideIndentation:s=>{let c=t[s];return c??-1}}),o=$g(n,(s,c,f)=>{let h=Z2(r,s.from);if(h==null)return;/\S/.test(s.text)||(h=0);let d=/^\s*/.exec(s.text)[0],p=rf(n,h);(d!=p||f.from<s.from+d.length)&&(t[s.from]=h,c.push({from:s.from,to:s.from+d.length,insert:p}))});return o.changes.empty||e(n.update(o,{userEvent:"indent"})),!0},N5=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update($g(n,(t,r)=>{r.push({from:t.from,insert:n.facet(Wg)})}),{userEvent:"input.indent"})),!0),_5=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update($g(n,(t,r)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let s=Rf(o,n.tabSize),c=0,f=rf(n,Math.max(0,s-nf(n)));for(;c<o.length&&c<f.length&&o.charCodeAt(c)==f.charCodeAt(c);)c++;r.push({from:t.from+c,to:t.from+o.length,insert:f.slice(c)})}),{userEvent:"delete.dedent"})),!0),B5=n=>(n.setTabFocusMode(),!0),z5=[{key:"Ctrl-b",run:uE,shift:bE,preventDefault:!0},{key:"Ctrl-f",run:fE,shift:xE},{key:"Ctrl-p",run:mE,shift:CE},{key:"Ctrl-n",run:pE,shift:AE},{key:"Ctrl-a",run:$j,shift:u5},{key:"Ctrl-e",run:Jj,shift:f5},{key:"Ctrl-d",run:kE},{key:"Ctrl-h",run:Kp},{key:"Ctrl-k",run:b5},{key:"Ctrl-Alt-h",run:RE},{key:"Ctrl-o",run:w5},{key:"Ctrl-t",run:C5},{key:"Ctrl-v",run:Fp}],L5=[{key:"ArrowLeft",run:uE,shift:bE,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Gj,shift:n5,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Qj,shift:a5,preventDefault:!0},{key:"ArrowRight",run:fE,shift:xE,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:qj,shift:i5,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Zj,shift:c5,preventDefault:!0},{key:"ArrowUp",run:mE,shift:CE,preventDefault:!0},{mac:"Cmd-ArrowUp",run:nS,shift:rS},{mac:"Ctrl-ArrowUp",run:J1,shift:eS},{key:"ArrowDown",run:pE,shift:AE,preventDefault:!0},{mac:"Cmd-ArrowDown",run:iS,shift:lS},{mac:"Ctrl-ArrowDown",run:Fp,shift:tS},{key:"PageUp",run:J1,shift:eS},{key:"PageDown",run:Fp,shift:tS},{key:"Home",run:Xj,shift:s5,preventDefault:!0},{key:"Mod-Home",run:nS,shift:rS},{key:"End",run:Wj,shift:o5,preventDefault:!0},{key:"Mod-End",run:iS,shift:lS},{key:"Enter",run:oS,shift:oS},{key:"Mod-a",run:h5},{key:"Backspace",run:Kp,shift:Kp,preventDefault:!0},{key:"Delete",run:kE,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:RE,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:y5,preventDefault:!0},{mac:"Mod-Backspace",run:x5,preventDefault:!0},{mac:"Mod-Delete",run:S5,preventDefault:!0}].concat(z5.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),j5=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Fj,shift:r5},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Kj,shift:l5},{key:"Alt-ArrowUp",run:A5},{key:"Shift-Alt-ArrowUp",run:M5},{key:"Alt-ArrowDown",run:E5},{key:"Shift-Alt-ArrowDown",run:T5},{key:"Mod-Alt-ArrowUp",run:p5},{key:"Mod-Alt-ArrowDown",run:g5},{key:"Escape",run:v5},{key:"Mod-Enter",run:R5},{key:"Alt-l",mac:"Ctrl-l",run:d5},{key:"Mod-i",run:m5,preventDefault:!0},{key:"Mod-[",run:_5},{key:"Mod-]",run:N5},{key:"Mod-Alt-\\",run:D5},{key:"Shift-Mod-k",run:k5},{key:"Shift-Mod-\\",run:t5},{key:"Mod-/",run:Aj},{key:"Alt-A",run:Mj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:B5}].concat(L5),H5="#e5c07b",sS="#e06c75",U5="#56b6c2",P5="#ffffff",Eu="#abb2bf",Wp="#7d8799",V5="#61afef",I5="#98c379",aS="#d19a66",G5="#c678dd",q5="#21252b",cS="#2c313a",uS="#282c34",Im="#353a42",Y5="#3E4451",fS="#528bff",F5=we.theme({"&":{color:Eu,backgroundColor:uS},".cm-content":{caretColor:fS},".cm-cursor, .cm-dropCursor":{borderLeftColor:fS},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Y5},".cm-panels":{backgroundColor:q5,color:Eu},".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:uS,color:Wp,border:"none"},".cm-activeLineGutter":{backgroundColor:cS},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Im},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Im,borderBottomColor:Im},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:cS,color:Eu}}},{dark:!0}),K5=Aa.define([{tag:X.keyword,color:G5},{tag:[X.name,X.deleted,X.character,X.propertyName,X.macroName],color:sS},{tag:[X.function(X.variableName),X.labelName],color:V5},{tag:[X.color,X.constant(X.name),X.standard(X.name)],color:aS},{tag:[X.definition(X.name),X.separator],color:Eu},{tag:[X.typeName,X.className,X.number,X.changed,X.annotation,X.modifier,X.self,X.namespace],color:H5},{tag:[X.operator,X.operatorKeyword,X.url,X.escape,X.regexp,X.link,X.special(X.string)],color:U5},{tag:[X.meta,X.comment],color:Wp},{tag:X.strong,fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.strikethrough,textDecoration:"line-through"},{tag:X.link,color:Wp,textDecoration:"underline"},{tag:X.heading,fontWeight:"bold",color:sS},{tag:[X.atom,X.bool,X.special(X.variableName)],color:aS},{tag:[X.processingInstruction,X.string,X.inserted],color:I5},{tag:X.invalid,color:P5}]),W5=[F5,J2(K5)];function X5({fileName:n,content:e,onChange:t,onRun:r,onSave:o,isRunning:s,isDirty:c,environment:f}){const h=w.useRef(null),d=w.useRef(null),p=w.useRef(t),v=w.useRef(r),y=w.useRef(o),x=w.useRef(e);return p.current=t,v.current=r,y.current=o,x.current=e,w.useEffect(()=>{if(!n||!h.current){d.current&&(d.current.destroy(),d.current=null);return}d.current&&(d.current.destroy(),d.current=null);const A=qe.create({doc:x.current,extensions:[R4(),_j(),p4(),b4(),vj(),J2(uj),W5,P2.of([...j5,...Ij,{key:"Mod-Enter",run:()=>(v.current(),!0)},{key:"Mod-s",run:()=>(y.current(),!0)}]),we.updateListener.of(C=>{C.docChanged&&p.current(C.state.doc.toString())}),we.theme({"&":{height:"100%",fontSize:"13px"},".cm-scroller":{overflow:"auto"},".cm-content":{fontFamily:"'JetBrains Mono', 'Fira Code', monospace"},".cm-gutters":{fontFamily:"'JetBrains Mono', 'Fira Code', monospace"}})]});return d.current=new we({state:A,parent:h.current}),()=>{d.current?.destroy(),d.current=null}},[n]),w.useEffect(()=>{const A=d.current;if(!A)return;const C=A.state.doc.toString();C!==e&&A.dispatch({changes:{from:0,to:C.length,insert:e}})},[e]),S.jsx("div",{className:"flex h-full flex-col",children:n?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2",children:[S.jsxs("span",{className:"text-sm font-medium truncate flex-1",children:[n,".hurl"]}),c&&S.jsx(ho,{variant:"outline",className:"text-xs",children:"modified"}),f&&S.jsx(ho,{variant:"secondary",className:"text-xs",children:f}),S.jsxs(vt,{variant:"outline",size:"sm",onClick:o,disabled:!c,children:[S.jsx(AA,{className:"mr-1 h-3.5 w-3.5"}),"Save"]}),S.jsxs(vt,{size:"sm",onClick:r,disabled:s,children:[s?S.jsx(OB,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):S.jsx(_B,{className:"mr-1 h-3.5 w-3.5"}),"Run"]})]}),S.jsx("div",{className:"relative flex-1",children:S.jsx("div",{ref:h,className:"absolute inset-0"})})]}):S.jsx("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:S.jsx("p",{className:"text-sm",children:"Select or create a request to get started"})})})}function Q5({className:n,orientation:e="horizontal",...t}){return S.jsx(K_,{"data-slot":"tabs","data-orientation":e,orientation:e,className:et("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",n),...t})}const Z5=Og("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function $5({className:n,variant:e="default",...t}){return S.jsx(W_,{"data-slot":"tabs-list","data-variant":e,className:et(Z5({variant:e}),n),...t})}function du({className:n,...e}){return S.jsx(X_,{"data-slot":"tabs-trigger",className:et("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",n),...e})}function mu({className:n,...e}){return S.jsx(Q_,{"data-slot":"tabs-content",className:et("flex-1 outline-none",n),...e})}function J5(n){return n>=200&&n<300?"bg-green-500/15 text-green-700 border-green-500/30":n>=300&&n<400?"bg-yellow-500/15 text-yellow-700 border-yellow-500/30":n>=400&&n<500?"bg-orange-500/15 text-orange-700 border-orange-500/30":"bg-red-500/15 text-red-700 border-red-500/30"}function e8(n){const e=n.split(`
63
+ `),t=[];let r=!1;for(const o of e){if(o.startsWith("* Response body:")){r=!0;continue}if(r){if(o==="*"||o.startsWith("* Timings:"))break;t.push(o.startsWith("* ")?o.slice(2):o)}}return t.join(`
64
+ `)}function t8(n){const e=n.json,t=e8(n.stderr);if(!e?.entries?.length)return{status:0,headers:[],body:t||n.stderr,asserts:[]};const r=e.entries[e.entries.length-1],o=r.calls??[],c=o[o.length-1]?.response,f=r.asserts??[];return{status:c?.status??0,headers:c?.headers??[],body:t,asserts:f}}function n8(n,e){const t=e[n.line-1]?.trim();return t||`Line ${n.line}`}function i8(n){const e=n.match(/actual:\s+(.+)/),t=n.match(/expected:\s+(.+)/);return e&&t?{actual:e[1].trim(),expected:t[1].trim()}:null}function r8({result:n,isRunning:e,hurlSource:t}){if(e)return S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{className:"text-sm",children:"Running request..."})]})});if(!n)return S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:S.jsx("p",{className:"text-sm",children:"Run a request to see the response"})});const{status:r,headers:o,body:s,asserts:c}=t8(n),f=t.split(`
65
+ `),h=c.filter(y=>!(f[y.line-1]?.trim()??"").startsWith("HTTP")),d=h.filter(y=>y.success).length,p=h.filter(y=>!y.success).length;let v=typeof s=="string"?s:JSON.stringify(s,null,2);if(typeof s=="string")try{const y=JSON.parse(s);v=JSON.stringify(y,null,2)}catch{}return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Response"}),r>0&&S.jsx(ho,{variant:"outline",className:J5(r),children:r}),!n.success&&S.jsx(ho,{variant:"outline",className:"bg-red-500/15 text-red-700 border-red-500/30",children:"Error"}),S.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[n.duration,"ms"]})]}),S.jsxs(Q5,{defaultValue:"body",className:"flex-1 flex flex-col min-h-0",children:[S.jsxs($5,{className:"mx-3 mt-1 w-fit shrink-0",children:[S.jsx(du,{value:"body",children:"Body"}),S.jsxs(du,{value:"headers",children:["Headers",o.length>0&&` (${o.length})`]}),h.length>0&&S.jsxs(du,{value:"asserts",children:["Asserts",p>0?S.jsxs(ho,{variant:"outline",className:"ml-1.5 bg-red-500/15 text-red-700 border-red-500/30 text-[10px] px-1.5 py-0",children:[p," failed"]}):S.jsxs(ho,{variant:"outline",className:"ml-1.5 bg-green-500/15 text-green-700 border-green-500/30 text-[10px] px-1.5 py-0",children:[d," passed"]})]}),S.jsx(du,{value:"verbose",children:"Verbose"})]}),S.jsx(mu,{value:"body",className:"relative flex-1 m-0",children:S.jsx("div",{className:"absolute inset-0 overflow-auto",children:S.jsx("pre",{className:"p-3 text-xs font-mono whitespace-pre-wrap break-all",children:v||"(empty body)"})})}),S.jsx(mu,{value:"headers",className:"relative flex-1 m-0",children:S.jsx("div",{className:"absolute inset-0 overflow-auto",children:S.jsxs("div",{className:"p-3 space-y-1",children:[o.map((y,x)=>S.jsxs("div",{className:"flex gap-2 text-xs font-mono",children:[S.jsxs("span",{className:"font-semibold text-muted-foreground min-w-[150px]",children:[y.name,":"]}),S.jsx("span",{className:"break-all",children:y.value})]},x)),o.length===0&&S.jsx("p",{className:"text-xs text-muted-foreground",children:"No headers"})]})})}),h.length>0&&S.jsx(mu,{value:"asserts",className:"relative flex-1 m-0",children:S.jsx("div",{className:"absolute inset-0 overflow-auto",children:S.jsx("div",{className:"p-3 space-y-1",children:h.map((y,x)=>{const A=n8(y,f),C=y.message?i8(y.message):null;return S.jsxs("div",{className:`flex items-start gap-2 rounded-md px-2.5 py-2 text-xs font-mono ${y.success?"bg-green-500/5 text-green-800":"bg-red-500/5 text-red-800"}`,children:[y.success?S.jsx(bB,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-green-600"}):S.jsx(SB,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-red-600"}),S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"break-all",children:A}),C&&S.jsxs("div",{className:"mt-1 text-[11px] text-muted-foreground space-y-0.5",children:[S.jsxs("div",{children:["actual: ",S.jsx("span",{className:"text-red-700",children:C.actual})]}),S.jsxs("div",{children:["expected: ",S.jsx("span",{className:"text-green-700",children:C.expected})]})]})]})]},x)})})})}),S.jsx(mu,{value:"verbose",className:"relative flex-1 m-0",children:S.jsx("div",{className:"absolute inset-0 overflow-auto",children:S.jsx("pre",{className:"p-3 text-xs font-mono whitespace-pre-wrap break-all",children:n.stderr||"(no verbose output)"})})})]})]})}const yn="/api";async function bn(n,e){const t=await fetch(n,{...e,headers:{"Content-Type":"application/json",...e?.headers}});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r.error??`HTTP ${t.status}`)}return t.json()}const l8=()=>bn(`${yn}/files`),o8=(n,e)=>bn(`${yn}/files`,{method:"POST",body:JSON.stringify({name:n,content:e})}),s8=n=>bn(`${yn}/files/${n}`),hS=(n,e)=>bn(`${yn}/files/${n}`,{method:"PUT",body:JSON.stringify({content:e})}),a8=n=>bn(`${yn}/files/${n}`,{method:"DELETE"}),c8=()=>bn(`${yn}/environments`),u8=(n,e)=>bn(`${yn}/environments`,{method:"POST",body:JSON.stringify({name:n,variables:e})}),f8=n=>bn(`${yn}/environments/${n}`),h8=(n,e)=>bn(`${yn}/environments/${n}`,{method:"PUT",body:JSON.stringify({variables:e})}),d8=n=>bn(`${yn}/environments/${n}`,{method:"DELETE"}),m8=()=>bn(`${yn}/metadata`),dS=n=>bn(`${yn}/metadata`,{method:"PUT",body:JSON.stringify(n)}),p8=(n,e)=>bn(`${yn}/run`,{method:"POST",body:JSON.stringify({file:n,environment:e})});function g8({open:n,onClose:e,environments:t,onRefresh:r}){const[o,s]=w.useState(null),[c,f]=w.useState([]),[h,d]=w.useState(!1),[p,v]=w.useState(""),[y,x]=w.useState(!1);w.useEffect(()=>{o?f8(o).then(j=>{f(Object.entries(j.variables).map(([H,P])=>({key:H,value:P}))),x(!1)}):(f([]),x(!1))},[o]),w.useEffect(()=>{n&&t.length>0&&!o&&s(t[0])},[n,t,o]);const A=()=>{f([...c,{key:"",value:""}]),x(!0)},C=j=>{f(c.filter((H,P)=>P!==j)),x(!0)},M=(j,H,P)=>{const _=[...c];_[j]={..._[j],[H]:P},f(_),x(!0)},T=async()=>{if(!o)return;const j={};for(const H of c)H.key.trim()&&(j[H.key.trim()]=H.value);await h8(o,j),x(!1)},D=async()=>{p.trim()&&(await u8(p.trim()),v(""),d(!1),r(),s(p.trim().replace(/[^a-zA-Z0-9_-]/g,"_")))},N=async()=>{o&&(await d8(o),s(null),r())};return S.jsxs(S.Fragment,{children:[S.jsx(Uu,{open:n,onOpenChange:j=>!j&&e(),children:S.jsxs(Pu,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[S.jsx(Vu,{children:S.jsx(Iu,{children:"Manage Environments"})}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs(EA,{value:o??"__none__",onValueChange:j=>s(j==="__none__"?null:j),children:[S.jsx(TA,{className:"flex-1",children:S.jsx(MA,{placeholder:"Select environment"})}),S.jsxs(kA,{children:[S.jsx(Hu,{value:"__none__",children:"Select environment..."}),t.map(j=>S.jsx(Hu,{value:j,children:j},j))]})]}),S.jsx(vt,{variant:"outline",size:"icon",onClick:()=>d(!0),children:S.jsx(rp,{className:"h-4 w-4"})}),o&&S.jsx(vt,{variant:"destructive",size:"icon",onClick:N,children:S.jsx(ju,{className:"h-4 w-4"})})]}),o&&S.jsx(xA,{className:"flex-1 max-h-[400px]",children:S.jsxs("div",{className:"space-y-2 pr-4",children:[S.jsxs("div",{className:"grid grid-cols-[1fr_1fr_40px] gap-2 text-xs font-medium text-muted-foreground px-1",children:[S.jsx("span",{children:"Key"}),S.jsx("span",{children:"Value"}),S.jsx("span",{})]}),c.map((j,H)=>S.jsxs("div",{className:"grid grid-cols-[1fr_1fr_40px] gap-2",children:[S.jsx(Ks,{placeholder:"key",value:j.key,onChange:P=>M(H,"key",P.target.value),className:"h-8 text-sm font-mono"}),S.jsx(Ks,{placeholder:"value",value:j.value,onChange:P=>M(H,"value",P.target.value),className:"h-8 text-sm font-mono"}),S.jsx(vt,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>C(H),children:S.jsx(ju,{className:"h-3.5 w-3.5 text-muted-foreground"})})]},H)),S.jsxs(vt,{variant:"outline",size:"sm",onClick:A,className:"w-full",children:[S.jsx(rp,{className:"mr-1 h-3.5 w-3.5"}),"Add Variable"]})]})}),S.jsxs(lp,{children:[S.jsx(vt,{variant:"outline",onClick:e,children:"Close"}),o&&S.jsxs(vt,{onClick:T,disabled:!y,children:[S.jsx(AA,{className:"mr-1 h-3.5 w-3.5"}),"Save"]})]})]})}),S.jsx(Uu,{open:h,onOpenChange:d,children:S.jsxs(Pu,{children:[S.jsx(Vu,{children:S.jsx(Iu,{children:"New Environment"})}),S.jsx(Ks,{placeholder:"Environment name",value:p,onChange:j=>v(j.target.value),onKeyDown:j=>j.key==="Enter"&&D(),autoFocus:!0}),S.jsxs(lp,{children:[S.jsx(vt,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),S.jsx(vt,{onClick:D,disabled:!p.trim(),children:"Create"})]})]})})]})}function v8({open:n,environments:e,onSelect:t,onSkip:r}){return S.jsx(Uu,{open:n,children:S.jsxs(Pu,{className:"sm:max-w-md",onPointerDownOutside:o=>o.preventDefault(),children:[S.jsxs(Vu,{children:[S.jsx(Iu,{children:"Select an Environment"}),S.jsx(YB,{children:"Choose an environment to use for variable substitution in your requests."})]}),S.jsxs("div",{className:"space-y-2 py-2",children:[e.map(o=>S.jsxs(vt,{variant:"outline",className:"w-full justify-start gap-2 h-10",onClick:()=>t(o),children:[S.jsx(CA,{className:"h-4 w-4 text-muted-foreground"}),o]},o)),e.length===0&&S.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No environments found. You can create one later from the sidebar."})]}),S.jsx(vt,{variant:"ghost",className:"w-full text-muted-foreground",onClick:r,children:"Skip for now"})]})})}function y8(){const[n,e]=w.useState([]),[t,r]=w.useState([]),[o,s]=w.useState(null),[c,f]=w.useState(null),[h,d]=w.useState(""),[p,v]=w.useState(""),[y,x]=w.useState(!1),[A,C]=w.useState(null),[M,T]=w.useState({sections:[],fileGroups:{}}),[D,N]=w.useState(!1),[j,H]=w.useState(!0),P=w.useCallback(async()=>{const R=await l8();e(R)},[]),_=w.useCallback(async()=>{const R=await c8();r(R)},[]),G=w.useCallback(async()=>{const R=await m8();T(R)},[]);w.useEffect(()=>{P(),_(),G()},[P,_,G]);const Z=w.useCallback(async R=>{T(R),await dS(R)},[]),ie=w.useCallback(async R=>{const z=await s8(R);s(R),d(z.content),v(z.content),C(null)},[]),ne=w.useCallback(async R=>{await o8(R,`GET https://httpbin.org/get
66
+ HTTP 200
67
+ `),await P(),ie(R.replace(/[^a-zA-Z0-9_-]/g,"_"))},[P,ie]),ee=w.useCallback(async R=>{if(await a8(R),o===R&&(s(null),d(""),v(""),C(null)),M.fileGroups[R]){const{[R]:z,...L}=M.fileGroups,F={...M,fileGroups:L};T(F),await dS(F)}await P()},[o,P,M]),se=w.useCallback(async()=>{o&&(await hS(o,h),v(h))},[o,h]),oe=w.useCallback(async()=>{if(o){h!==p&&(await hS(o,h),v(h)),x(!0),C(null);try{const R=await p8(o,c??void 0);C(R)}catch(R){C({success:!1,duration:0,json:null,stdout:"",stderr:R instanceof Error?R.message:"Unknown error"})}finally{x(!1)}}},[o,c,h,p]),ae=h!==p;return S.jsxs(iB,{children:[S.jsx(rB,{sidebar:S.jsx(ZB,{files:n,activeFile:o,onSelectFile:ie,onCreateFile:ne,onDeleteFile:ee,metadata:M,onUpdateMetadata:Z,environments:t,activeEnvironment:c,onSelectEnvironment:f,onOpenEnvEditor:()=>N(!0)}),editor:S.jsx(X5,{fileName:o,content:h,onChange:d,onRun:oe,onSave:se,isRunning:y,isDirty:ae,environment:c}),response:S.jsx(r8,{result:A,isRunning:y,hurlSource:p})}),S.jsx(g8,{open:D,onClose:()=>N(!1),environments:t,onRefresh:_}),S.jsx(v8,{open:j&&t.length>0,environments:t,onSelect:R=>{f(R),H(!1)},onSkip:()=>H(!1)})]})}fk.createRoot(document.getElementById("root")).render(S.jsx(w.StrictMode,{children:S.jsx(y8,{})}));